:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-body: #1e293b;
  --muted: #475569;
  --subtle: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --max-w: 800px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--muted);
  padding: 6px 2px;
}

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

.main-content {
  padding-top: 36px;
  padding-bottom: 72px;
  min-height: calc(100vh - 140px);
}

/* Home */
.hero {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 2.8vw, 2.05rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hero-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 68ch;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  background: var(--bg);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.article-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.card-cover {
  display: block;
  background: var(--surface);
}

.card-cover img {
  width: 100%;
  height: 100%;
  min-height: 148px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--subtle);
  margin-bottom: 6px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.card-title a {
  color: var(--text);
}

.card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.page-link {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-weight: 500;
}

.page-link.disabled {
  color: #94a3b8;
  border-color: var(--surface-alt);
  background: var(--surface);
}

/* Article */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--subtle);
  margin-bottom: 22px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-current {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.article-container {
  color: var(--text-body);
}

.article-header {
  margin-bottom: 28px;
}

.article-header h1 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 3.6vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--subtle);
  margin-bottom: 22px;
}

.meta-dot {
  color: var(--border-strong);
}

.article-summary {
  margin: 0;
  padding: 18px 22px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0;
  color: var(--text-body);
  font-size: 1.04rem;
  line-height: 1.72;
}

.article-cover,
.article-figure {
  margin: 28px 0;
}

.article-cover img,
.article-figure img {
  width: 100%;
  border-radius: 0;
  border: 1px solid var(--border);
}

.article-cover img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--subtle);
  text-align: center;
}

/* Key Takeaways */
.takeaways {
  margin: 28px 0;
  padding: 20px 24px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 0;
}

.takeaways h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}

.takeaways ul {
  margin: 0;
  padding-left: 20px;
}

.takeaways li {
  margin-bottom: 8px;
  line-height: 1.68;
}

.takeaways li:last-child {
  margin-bottom: 0;
}

/* TOC */
.toc {
  margin: 28px 0 36px;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
}

.toc-title {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin: 6px 0;
  font-size: 0.96rem;
  line-height: 1.5;
}

.toc a {
  color: var(--text-body);
}

.toc a:hover {
  color: var(--accent);
}

/* Article Body */
.article-body {
  font-size: 1.04rem;
  line-height: 1.8;
}

.article-section {
  margin-top: 44px;
}

.article-section:first-child {
  margin-top: 12px;
}

.article-section h2 {
  font-size: 1.55rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.article-section h3 {
  font-size: 1.22rem;
  line-height: 1.35;
  color: var(--text);
  margin: 28px 0 12px;
  scroll-margin-top: 80px;
}

.article-section h4 {
  font-size: 1.06rem;
  color: var(--text);
  margin: 22px 0 10px;
  scroll-margin-top: 80px;
}

.article-section p {
  margin: 0 0 18px;
}

.content-list {
  margin: 0 0 22px;
  padding-left: 24px;
}

.content-list li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.content-list li::marker {
  color: var(--accent);
}

/* Tables */
.table-wrap {
  margin: 26px 0;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.6;
  text-align: left;
}

table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}

th,
td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

table tr > *:first-child {
  border-left: none;
}

table tr > *:last-child {
  border-right: none;
}

tbody tr:nth-child(even) {
  background: #fcfdff;
}

tbody tr:hover {
  background: var(--surface);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* FAQ (Flat List) */
.faq-section {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.faq-section h2 {
  margin: 0 0 20px;
  font-size: 1.55rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}

.faq-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-item {
  padding-left: 4px;
}

.faq-item::marker {
  color: var(--accent);
  font-weight: 600;
}

.faq-question {
  margin: 0 0 6px;
  font-size: 1.06rem;
  line-height: 1.5;
  color: var(--text);
}

.faq-question strong {
  font-weight: 700;
}

.faq-answer {
  margin: 0;
  font-size: 1rem;
  line-height: 1.72;
  color: var(--muted);
  font-weight: 400;
}

/* Sources & References */
.sources-section {
  margin-top: 44px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  scroll-margin-top: 80px;
}

.sources-section h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.sources-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 24px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.source-item {
  word-break: break-word;
  color: var(--subtle);
}

.source-item a {
  color: var(--accent);
}

.source-site {
  color: var(--subtle);
  font-size: 0.85rem;
}

.article-back {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 500;
}

/* 404 */
.not-found {
  text-align: center;
  padding: 72px 0;
}

.btn-home {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 0;
  background: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

.btn-home:hover {
  background: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 26px 0;
  color: var(--subtle);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .main-content {
    padding-top: 24px;
    padding-bottom: 52px;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .card-cover img {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .card-body {
    padding: 16px 18px;
  }

  .article-summary,
  .takeaways,
  .toc,
  .sources-section {
    padding: 16px 18px;
  }

  .article-body {
    font-size: 1rem;
  }

  .sources-list {
    grid-template-columns: 1fr;
  }
}
