*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-border: #e5e7eb;
  --color-accent: #f59e0b;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 960px;
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-logo:hover { text-decoration: none; color: var(--color-primary); }

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav { display: flex; gap: 0.25rem; align-items: center; }

.site-nav a {
  color: var(--color-text-muted);
  font-size: 0.925rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--color-text);
  background: var(--color-bg-alt);
  text-decoration: none;
}

/* Main */
main { flex: 1; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-primary); }

/* Hamburger menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
}

@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .header-inner { padding: 0 1.25rem; }
}

@media (max-width: 640px) {
  .menu-toggle { display: block; }

  .header-right { gap: 0.5rem; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.25rem;
  }

  .site-nav.open { display: flex; }

  .site-nav a { width: 100%; }
}

/* ===== ArticleCard ===== */
.article-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-image-link { display: block; overflow: hidden; }
.card-image { width: 100%; height: 200px; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .card-image { transform: scale(1.03); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.625rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tag { display: inline-block; padding: 0.2rem 0.6rem; background: #eff6ff; color: #1d4ed8; border-radius: 99px; font-size: 0.75rem; font-weight: 500; text-decoration: none; transition: background 0.15s; }
.tag:hover { background: #dbeafe; text-decoration: none; }
.card-title { font-size: 1.1rem; font-weight: 600; line-height: 1.4; margin: 0; }
.card-title a { color: #1a1a1a; text-decoration: none; }
.card-title a:hover { color: #1d4ed8; }
.card-description { color: #6b7280; font-size: 0.9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: #9ca3af; flex-wrap: wrap; margin-top: auto; padding-top: 0.5rem; border-top: 1px solid #f3f4f6; }
.meta-sep { opacity: 0.5; }

/* ===== LanguageSwitcher ===== */
.lang-switcher { display: flex; align-items: center; gap: 0.25rem; font-size: 0.8rem; font-weight: 500; letter-spacing: 0.04em; }
.lang-sep { color: var(--color-border, #e5e7eb); user-select: none; }
.lang-item { padding: 0.2rem 0.35rem; border-radius: 4px; text-decoration: none; color: var(--color-text-muted, #6b7280); transition: color 0.15s, background 0.15s; }
.lang-item:hover { color: var(--color-text, #1a1a1a); background: var(--color-bg-alt, #f8f9fa); text-decoration: none; }
.lang-current { color: var(--color-primary, #1d4ed8); font-weight: 700; cursor: default; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; padding: 2rem 0; }
.page-numbers { display: flex; align-items: center; gap: 0.25rem; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding: 0 0.75rem; border-radius: 6px; font-size: 0.9rem; color: #374151; border: 1px solid #e5e7eb; background: #fff; text-decoration: none; transition: all 0.15s; }
.page-link:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; text-decoration: none; }
.page-current { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 600; cursor: default; }
.page-current:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.page-ellipsis { padding: 0 0.25rem; color: #9ca3af; }
.page-prev, .page-next { padding: 0 1rem; }
