/* ===== Variables ===== */
:root {
  --color-primary: #007AFF;
  --color-primary-bg: rgba(0, 122, 255, 0.1);
  --color-text: #1a1a2e;
  --color-text-secondary: rgba(0, 0, 0, 0.6);
  --color-text-muted: rgba(0, 0, 0, 0.5);
  --color-text-light: rgba(0, 0, 0, 0.3);
  --color-bg-header: #f8f9fa;
  --color-bg-footer: rgba(248, 249, 250, 0.95);
  --color-bg-footer-bottom: rgba(0, 0, 0, 0.03);
  --color-border: rgba(0, 0, 0, 0.06);
  --color-border-divider: rgba(0, 0, 0, 0.15);
  --color-card-bg: #fff;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-xl: 8px;
  --max-width: 800px;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-bg-header);
  border-bottom: 1px solid var(--color-border);
}

.site-header nav {
  display: flex;
  align-items: center;
  height: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 32px;
  padding: 0 1em;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo-img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xl);
}

.site-logo-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.menu {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.menu li {
  display: block;
}

.menu a {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: none;
  transition: color 0.2s, background 0.2s;
}

.menu a:hover {
  color: var(--color-text);
}

.menu a.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-bg-footer);
  border-top: 1px solid var(--color-border);
}

.footer-brand {
  padding: 16px 1em;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.footer-brand-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logo-img {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
}

.footer-brand-text {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.footer-brand-sep {
  font-size: 12px;
  color: var(--color-text-light);
}

.footer-brand-desc {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
}

.footer-brand-domain {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
}

.footer-tools {
  padding: 16px 1em;
  border-bottom: 1px solid var(--color-border);
}

.footer-tools-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-tool-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-tool-label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.footer-tool-group a {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-tool-group a:hover {
  color: var(--color-primary);
}

.footer-divider {
  width: 1px;
  height: 14px;
  background: var(--color-border-divider);
}

.footer-bottom {
  padding: 16px 1em;
  background: var(--color-bg-footer-bottom);
  text-align: center;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--color-text-secondary);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-bottom a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--color-text);
}

/* ===== Page Background Decoration ===== */
.page-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.page-bg .circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
}

main {
  position: relative;
}

main > *:not(.page-bg) {
  position: relative;
  z-index: 1;
}

/* ===== Category Header ===== */
.category-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 2em;
}

.category-image {
  flex-shrink: 0;
}

.category-image img {
  width: 210px;
  height: 135px;
  border-radius: var(--radius-lg);
  display: block;
}

.category-info {
  flex: 1;
  min-width: 0;
}

.category-info h1 {
  margin: 0 0 8px;
  font-size: 1.25em;
}

.category-desc {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}

/* ===== Tool Cards (Category Page) ===== */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 1.5em;
}

.tool-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--color-border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
  border-color: rgba(0, 122, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.tool-card h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.tool-card h3 a:hover {
  color: var(--color-primary);
}

.tool-card p {
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 0 0 10px;
}

.tool-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}


/* ===== Article List ===== */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-list .date {
  color: rgba(0, 0, 0, 0.4);
  font-size: 13px;
  flex-shrink: 0;
}

.article-list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
}

.article-list a:hover {
  color: var(--color-primary);
}

/* ===== Article Single ===== */
.article-header {
  margin-bottom: 2em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  margin-bottom: 0.75em;
  font-size: 1.5em;
  max-width: 100%;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 13px;
}

.article-meta-icon {
  width: 13px;
  height: 13px;
}

.article-meta-item.article-tag {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.article-desc {
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  margin-top: 1em;
  line-height: 1.6;
}

article {
  line-height: 1.8;
}

article h2 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-size: 1.25em;
}

article h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-size: 1.1em;
}

article p {
  margin-bottom: 1em;
}

article ul, article ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

article li {
  margin-bottom: 0.5em;
}

article a {
  color: var(--color-primary);
}

article img {
  border-radius: var(--radius-lg);
  margin: 1.5em 0;
}

article blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1em;
  margin: 1.5em 0;
  color: rgba(0, 0, 0, 0.6);
}

article pre {
  border-radius: var(--radius-lg);
  margin: 1.5em 0;
}

article code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* ===== Article Footer Tags ===== */
.article-footer {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.article-tags-label {
  color: rgba(0, 0, 0, 0.5);
  font-size: 13px;
  flex-shrink: 0;
}

.article-tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-tag-link {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.article-tag-link:hover {
  background: var(--color-primary);
  color: white;
}

/* ===== General Overrides ===== */
html {
  height: 100%;
}

body {
  background: #f5f5f5;
  color: var(--color-text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  padding: 0;
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2em 1em;
  width: 100%;
}

hr {
  border-style: solid;
  color: var(--color-border);
  border-width: 1px 0 0;
}

h1 {
  color: var(--color-text);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .site-header nav {
    gap: 16px;
  }

  .menu {
    gap: 8px;
  }

  .menu a {
    padding: 4px 8px;
    font-size: 12px;
  }

  .footer-tools-inner {
    gap: 12px;
  }

  .category-header {
    gap: 12px;
  }

  .category-image img {
    width: 140px;
    height: 90px;
  }

  .footer-divider {
    display: none;
  }
}

/* ===== Language Switcher ===== */
.lang-switcher {
  position: relative;
  margin-left: auto;
}

.lang-toggle {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}

.lang-code {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  padding: 4px 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  list-style: none;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown li {
  display: block;
}

.lang-dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.lang-dropdown a:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.lang-dropdown a.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
  font-weight: 500;
}

/* ===== Pagination ===== */
.pagination {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid var(--color-border);
}

.pagination-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  flex-wrap: wrap;
}

.pagination-item {
  display: block;
}

.pagination-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.pagination-link:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.pagination-link.pagination-current {
  background: var(--color-primary);
  color: white;
  font-weight: 500;
}

.pagination-prev,
.pagination-next {
  padding: 0 14px;
}

.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: rgba(0, 0, 0, 0.3);
}

.pagination-info {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 600px) {
  .pagination-link {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .pagination-prev,
  .pagination-next {
    padding: 0 10px;
  }
}
