/* ============================================================
 * ai-news — Toss-inspired light theme
 *  - Rounded everything, soft shadows, gentle hover lift
 *  - Article reading view is the priority: large body type,
 *    generous line-height, narrow column for comfort
 * ============================================================ */

/* Smooth cross-document page transitions (Chrome 126+, Safari 18+).
 * Falls back to a normal navigation in browsers without support. */
@view-transition { navigation: auto; }

/* Default root crossfade slowed down a little for a soft "water-flow" feel. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

/* Active highlights persist across pages and slide between positions.
 * Each named element pair animates from the previous page's geometry
 * to the new page's geometry, so swapping the active source/tab/chip
 * looks like the same pill smoothly moving. */
.src-list a.active     { view-transition-name: vt-active-source; }
.top-nav a.active      { view-transition-name: vt-active-top-nav; }
.chip.active           { view-transition-name: vt-active-chip; }
.pager .page-num.current { view-transition-name: vt-active-page; }
.lang-tabs .tab.active { view-transition-name: vt-active-lang; }

::view-transition-old(vt-active-source),
::view-transition-new(vt-active-source),
::view-transition-old(vt-active-top-nav),
::view-transition-new(vt-active-top-nav),
::view-transition-old(vt-active-chip),
::view-transition-new(vt-active-chip),
::view-transition-old(vt-active-page),
::view-transition-new(vt-active-page),
::view-transition-old(vt-active-lang),
::view-transition-new(vt-active-lang) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

:root {
  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-hover: #fbfcfe;

  /* Text */
  --text: #191f28;
  --text-strong: #0b1015;
  --text-dim: #4e5968;
  --muted: #8b95a1;
  --muted-soft: #b0b8c1;

  /* Lines */
  --border: #eef0f3;
  --border-strong: #e1e5ea;

  /* Brand & status */
  --accent: #3182f6;
  --accent-hover: #2272ea;
  --accent-soft: #eaf2ff;
  --official: #00c896;
  --official-soft: #e3faf2;
  --community: #ff9a3c;
  --community-soft: #fff2e3;
  --error: #f04438;
  --error-soft: #fff2f1;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 22, 36, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 22, 36, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 22, 36, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 22, 36, 0.08);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 280ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard",
               "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02";
}
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  font-weight: 800; font-size: 20px; letter-spacing: -0.03em;
  color: var(--text-strong);
}
.brand:hover { color: var(--accent); text-decoration: none; }
.brand-dot { color: var(--accent); margin: 0 1px; }

.search { flex: 1; display: flex; gap: 8px; max-width: 520px; }
.search input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r-pill);
  padding: 10px 16px; font-size: 14px;
  transition: all var(--t-base) var(--ease);
}
.search input::placeholder { color: var(--muted-soft); }
.search input:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.search button {
  background: var(--text-strong); color: white; border: 0;
  font-weight: 600; padding: 10px 18px; border-radius: var(--r-pill);
  cursor: pointer; transition: all var(--t-fast) var(--ease);
  font-size: 14px;
}
.search button:hover { background: #000; transform: translateY(-1px); }
.search button:active { transform: translateY(0); }

.top-nav {
  display: flex; gap: 2px; position: relative;
}
.top-nav a {
  position: relative; z-index: 1;
  color: var(--text-dim); padding: 8px 14px;
  border-radius: var(--r-pill); font-size: 14px; font-weight: 500;
  transition: color var(--t-base) var(--ease);
}
.top-nav a:hover { color: var(--text-strong); text-decoration: none; }
.top-nav a.active {
  color: var(--text-strong); font-weight: 600;
}
.top-nav .nav-indicator {
  position: absolute; left: 0; top: 0;
  background: var(--bg);
  border-radius: var(--r-pill);
  pointer-events: none; z-index: 0;
  opacity: 0;
  transform: translateX(0); width: 0; height: 100%;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
              width    320ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity  200ms var(--ease);
}
.top-nav .nav-indicator.armed { opacity: 1; }

/* ---------- Layout ---------- */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 28px 24px;
  display: grid; grid-template-columns: 260px 1fr; gap: 32px;
}
.layout.wide { grid-template-columns: 1fr; max-width: 880px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

/* ---------- Sidebar ---------- */
.sidebox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.sidebox h3 {
  margin: 0 0 14px; font-size: 13px; color: var(--muted);
  font-weight: 600; letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebox h3 .count { color: var(--muted-soft); font-size: 12px; font-weight: 500; }

.src-list {
  list-style: none; padding: 0; margin: 0;
  position: relative;
}
.src-list li { margin: 0; }
.src-list a {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--r-sm); color: var(--text);
  font-size: 14px; gap: 8px; font-weight: 500;
  transition: color var(--t-base) var(--ease);
}
.src-list a:hover { color: var(--text-strong); text-decoration: none; }
.src-list a.active { color: var(--accent-hover); font-weight: 600; }

/* Sliding hover/active indicator (positioned by JS) */
.hover-indicator {
  position: absolute; left: 0; right: 0; top: 0;
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  pointer-events: none; z-index: 0;
  opacity: 0;
  transform: translateY(0); height: 0;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
              height   320ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity  200ms var(--ease);
}
.hover-indicator.armed { opacity: 1; }
.hover-indicator.hovering { background: var(--bg); }
.src-name {
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.src-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.src-list a.active .src-n { color: var(--accent); }
.src-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  display: inline-block;
}
.src-dot.official { background: var(--official); }
.src-dot.community { background: var(--community); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag, .tag-mini {
  display: inline-flex; gap: 5px; align-items: baseline;
  background: var(--bg); border: 1px solid transparent;
  color: var(--text-dim); border-radius: var(--r-pill);
  padding: 4px 12px; font-size: 12.5px; font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.tag em { color: var(--muted-soft); font-style: normal; font-size: 11px; font-weight: 600; }
.tag:hover, .tag-mini:hover {
  background: var(--accent-soft); color: var(--accent-hover); text-decoration: none;
}
.tag.active {
  background: var(--accent); color: white; border-color: var(--accent);
}
.tag.active em { color: rgba(255,255,255,0.7); }

/* ---------- Content header ---------- */
.head-row {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 22px; gap: 16px;
  flex-wrap: wrap;
}
.head-row h1 {
  margin: 0 0 4px; font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text-strong);
}
.head-row .muted { font-size: 13px; }
.muted { color: var(--muted); }
.dot { color: var(--muted-soft); }

.head-controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.chips { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: var(--r-pill); border: 1px solid var(--border); }
.chip {
  display: inline-block; padding: 6px 14px;
  background: transparent; color: var(--text-dim);
  border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { background: var(--bg); text-decoration: none; color: var(--text-strong); }
.chip.active {
  background: var(--text-strong); color: white; font-weight: 600;
}

.per-page { display: flex; align-items: center; }
.per-page label {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.per-page select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 6px 10px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.per-page select:hover { border-color: var(--border-strong); }

/* ---------- Article cards (grid layout, consistent 16:9 thumbs) ---------- */
.article-list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  align-items: stretch;
}
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* Thumbnail: every card shows a 16:9 image area so cropping looks
 * intentional instead of arbitrary. Tall / wide source images are
 * centered, with the gradient placeholder when nothing is available. */
.thumb-wrap {
  display: block; width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg) 0%, #eef0f3 100%);
  overflow: hidden;
  position: relative;
}
.thumb {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  transition: transform var(--t-slow) var(--ease);
}
.article-card:hover .thumb { transform: scale(1.04); }

.card-body {
  padding: 16px 18px 18px;
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.card-body > .card-tags { margin-top: auto; }

/* No-image cards stay compact but visually balanced with image cards */
.article-card:not(:has(.thumb-wrap)) .card-body { padding-top: 18px; }
.meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.meta .src {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-weight: 500;
}
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill);
  margin-left: 2px; font-weight: 600; letter-spacing: -0.01em;
}
.badge.ko { background: var(--official-soft); color: var(--official); }
.badge.ko-light { background: var(--accent-soft); color: var(--accent); }
.card-title {
  margin: 0 0 6px; font-size: 16px; line-height: 1.4;
  font-weight: 700; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: var(--text-strong); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-en {
  margin: 0 0 6px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-summary {
  margin: 4px 0 10px; font-size: 13px; color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto;
  padding-top: 8px;
}

/* ---------- Pagination ---------- */
.pager {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  margin: 32px 0; flex-wrap: wrap;
}
.pager .page-btn, .pager .page-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim);
  border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all var(--t-fast) var(--ease);
}
.pager a:hover {
  background: var(--bg); border-color: var(--border-strong);
  color: var(--text-strong); text-decoration: none;
  transform: translateY(-1px);
}
.pager .page-num.current {
  background: var(--text-strong); color: white;
  border-color: var(--text-strong);
}
.pager .page-btn { color: var(--muted); }

/* ============================================================
 * Article reading view — Notion/Confluence-inspired
 *  - Surface is the page itself (no border, soft white)
 *  - 720px column, generous top/bottom padding for "page" feel
 *  - Notion text color (#37352f), tight heading rhythm
 *  - Inline code in coral on warm gray, code block in warm gray
 *  - Sticky TOC on the right when there are enough headings
 * ============================================================ */

/* Notion-ish palette overrides scoped to the article surface */
.article {
  --n-text: #37352f;
  --n-text-soft: rgba(55, 53, 47, 0.65);
  --n-text-muted: rgba(55, 53, 47, 0.45);
  --n-line: rgba(55, 53, 47, 0.12);
  --n-line-strong: rgba(55, 53, 47, 0.2);
  --n-code-bg: rgba(135, 131, 120, 0.15);
  --n-code-block-bg: #f7f6f3;
  --n-code-fg: #eb5757;
  --n-callout-bg: #f7f6f3;
  --n-accent: var(--accent);

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 56px 64px 80px;
  box-shadow: var(--shadow-sm);
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  color: var(--n-text);
}
@media (max-width: 720px) {
  .article { padding: 32px 22px 56px; border-radius: var(--r-md); }
}

.article .meta {
  font-size: 13px; margin-bottom: 16px; gap: 10px;
  color: var(--n-text-muted);
}
.article .meta .src a { color: var(--n-text-soft); }
.article .meta .origin-link { color: var(--n-text-muted); }
.article .meta .dot { color: var(--n-text-muted); }

.article-title {
  font-size: 40px; line-height: 1.2; margin: 4px 0 2px;
  font-weight: 800; letter-spacing: -0.03em;
  color: var(--n-text);
}
.article-en {
  color: var(--n-text-muted); margin: 4px 0 28px;
  font-size: 15px; font-weight: 500;
}
.hero {
  max-width: 100%; border-radius: 6px; margin: 12px 0 28px;
  display: block;
}

.lang-tabs-wrap {
  margin: 32px 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--n-line);
}
.lang-tabs {
  display: inline-flex; gap: 2px; align-items: center;
  padding: 3px;
  background: var(--n-callout-bg); border-radius: var(--r-pill);
  width: fit-content;
}
.lang-tabs .tab {
  background: transparent; color: var(--n-text-soft); border: 0;
  padding: 7px 16px; border-radius: var(--r-pill);
  cursor: pointer; font-size: 13.5px; font-weight: 600;
  transition: all var(--t-fast) var(--ease);
}
.lang-tabs .tab:hover { color: var(--n-text); }
.lang-tabs .tab.active {
  background: white; color: var(--n-text);
  box-shadow: 0 1px 2px rgba(15, 22, 36, 0.06);
}
.lang-tabs .not-translated { font-size: 14px; color: var(--n-text-muted); padding: 8px 4px; }
.btn-translate {
  margin-left: 12px; background: var(--accent); color: white;
  border: 0; padding: 9px 18px; border-radius: var(--r-pill);
  cursor: pointer; font-weight: 700; font-size: 13.5px;
  transition: all var(--t-fast) var(--ease);
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.25);
}
.btn-translate:hover {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(49, 130, 246, 0.35);
}
.btn-translate:active { transform: translateY(0); }

.article-body {
  font-size: 16.5px; line-height: 1.7;
  color: var(--n-text);
  word-break: keep-all; overflow-wrap: break-word;
}
.article-body.pane { display: none; }
.article-body.pane.active { display: block; }
.article-body > *:first-child { margin-top: 0; }
.article-body p {
  margin: 0 0 14px;
}
.article-body img {
  max-width: 100%; height: auto; border-radius: 6px;
  margin: 18px 0; display: block;
}

/* Headings: tight bottom margin (Notion-style), generous top margin */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  color: var(--n-text); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.3;
  scroll-margin-top: 80px;
  position: relative;
}
.article-body h1 { font-size: 30px; margin: 36px 0 6px; }
.article-body h2 { font-size: 24px; margin: 30px 0 6px; }
.article-body h3 { font-size: 19px; margin: 24px 0 4px; }
.article-body h4 { font-size: 16px; margin: 20px 0 4px; }
.article-body h1:first-child,
.article-body h2:first-child,
.article-body h3:first-child { margin-top: 0; }

/* Anchor link revealed on heading hover */
.article-body h1 > .h-anchor,
.article-body h2 > .h-anchor,
.article-body h3 > .h-anchor,
.article-body h4 > .h-anchor {
  position: absolute; left: -28px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--n-text-muted);
  opacity: 0; text-decoration: none; font-size: 18px;
  transition: opacity 150ms var(--ease), color 150ms var(--ease);
  border-bottom: 0 !important;
}
.article-body h1:hover > .h-anchor,
.article-body h2:hover > .h-anchor,
.article-body h3:hover > .h-anchor,
.article-body h4:hover > .h-anchor { opacity: 1; }
.article-body h1 > .h-anchor:hover,
.article-body h2 > .h-anchor:hover,
.article-body h3 > .h-anchor:hover,
.article-body h4 > .h-anchor:hover { color: var(--n-text); }

/* Lists */
.article-body ul, .article-body ol {
  padding-left: 1.6em; margin: 6px 0 14px;
}
.article-body li {
  margin: 4px 0; padding-left: 4px;
}
.article-body ul > li::marker { color: var(--n-text-soft); }
.article-body ol > li::marker { color: var(--n-text-soft); font-weight: 500; }
.article-body li > ul, .article-body li > ol { margin: 4px 0; }

/* Inline code: Notion-style coral on warm gray */
.article-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--n-code-bg);
  color: var(--n-code-fg);
  padding: 0.16em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Code block: warm gray, no chrome */
.article-body pre {
  background: var(--n-code-block-bg);
  color: var(--n-text);
  border: 0;
  padding: 16px 18px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.article-body pre code {
  background: none; color: inherit; padding: 0; font-size: inherit;
}

/* Blockquote / quotes — restrained Notion style */
.article-body blockquote {
  border-left: 3px solid var(--n-text);
  margin: 16px 0;
  padding: 4px 0 4px 16px;
  color: var(--n-text-soft);
  background: transparent;
  border-radius: 0;
  font-style: normal;
  font-size: inherit;
}

/* Links: subtle underline like Notion */
.article-body a {
  color: inherit;
  border-bottom: 1px solid var(--n-line-strong);
  transition: border-color 150ms var(--ease);
  text-decoration: none;
}
.article-body a:hover {
  border-bottom-color: var(--n-text);
  color: var(--n-text);
}

/* Tables: Confluence-style restrained borders */
.article-body table {
  border-collapse: collapse; margin: 18px 0; width: 100%;
  font-size: 14.5px;
}
.article-body th, .article-body td {
  border: 1px solid var(--n-line); padding: 10px 14px; text-align: left;
  vertical-align: top;
}
.article-body th {
  background: var(--n-callout-bg); font-weight: 600; color: var(--n-text);
}
.article-body tr:nth-child(even) td { background: rgba(247, 246, 243, 0.4); }

/* Horizontal rule */
.article-body hr {
  border: 0; border-top: 1px solid var(--n-line);
  margin: 24px 0;
}

/* ---------- Sticky TOC (Notion-style, right-aligned) ---------- */
.layout.wide.has-toc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 40px;
  max-width: 1120px;
  align-items: flex-start;
}
.layout.wide.has-toc .toc-rail {
  position: sticky; top: 90px;
  align-self: flex-start;
  padding-top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.toc {
  font-size: 12.5px; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--border);
}
.toc-title {
  font-size: 11.5px; font-weight: 600; color: var(--muted-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 2px 0; }
.toc a {
  display: block; padding: 4px 8px;
  color: var(--text-dim); text-decoration: none;
  border-radius: var(--r-xs); font-weight: 500;
  transition: all 150ms var(--ease);
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -2px;
}
.toc a:hover { color: var(--text-strong); background: var(--bg); }
.toc a.active {
  color: var(--accent-hover); font-weight: 600;
  border-left-color: var(--accent);
}
.toc .toc-l2 { padding-left: 20px; font-size: 12px; }
.toc .toc-l3 { padding-left: 32px; font-size: 11.5px; }
@media (max-width: 1000px) {
  .layout.wide.has-toc { grid-template-columns: 1fr; max-width: 880px; }
  .layout.wide.has-toc .toc-rail { display: none; }
}

.error {
  color: var(--error); font-size: 13px; margin-top: 16px;
  background: var(--error-soft); padding: 10px 14px; border-radius: var(--r-sm);
}

/* Sidebar meta list */
.meta-list { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.meta-list li {
  display: flex; gap: 10px; margin-bottom: 8px; align-items: baseline;
}
.meta-list .k {
  color: var(--muted); min-width: 56px; font-size: 12.5px; font-weight: 500;
}

/* ---------- Detail page extras ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  padding: 8px 14px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.back-link:hover {
  background: var(--bg); color: var(--text-strong);
  transform: translateX(-2px); text-decoration: none;
}

.lang-tabs-wrap {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 24px 0 16px;
}
.lang-tabs-wrap .lang-tabs { margin: 0; }

.article .meta .src a {
  color: var(--text-dim); font-weight: 500;
}
.article .meta .src a:hover { color: var(--accent); text-decoration: none; }
.article .meta .origin-link {
  color: var(--muted); font-weight: 500;
}
.article .meta .origin-link:hover { color: var(--accent); text-decoration: none; }

.article-tags-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* Related glass-section under the article */
.related-section {
  max-width: 760px; margin: 28px auto 0;
}
.section-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text-strong);
  margin: 0 0 14px; padding-left: 4px;
}
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--t-fast) var(--ease);
}
.related-item:hover {
  border-color: var(--border-strong); box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.related-reason {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent);
  background: var(--accent-soft); padding: 3px 8px; border-radius: var(--r-pill);
  flex-shrink: 0;
}
.related-link {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  color: var(--text-strong); font-weight: 500; overflow: hidden;
}
.related-link:hover { color: var(--accent); text-decoration: none; }
.related-title {
  font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.related-meta { font-size: 12px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  max-width: 1280px; margin: 0 auto; padding: 24px 24px 48px;
  color: var(--muted-soft); font-size: 12.5px; text-align: center;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.article-card, .pager, .head-row { animation: fadeUp var(--t-slow) var(--ease) both; }
.article { animation: fadeUp var(--t-slow) var(--ease) both; }
.article-card:nth-child(1) { animation-delay: 20ms; }
.article-card:nth-child(2) { animation-delay: 40ms; }
.article-card:nth-child(3) { animation-delay: 60ms; }
.article-card:nth-child(4) { animation-delay: 80ms; }
.article-card:nth-child(5) { animation-delay: 100ms; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
