/* LLM Security Digest — editorial research interface */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1eb;
  --surface-3: #e6eae2;
  --ink: #17201a;
  --ink-2: #4f5b53;
  --muted: #869088;
  --line: #dce1da;
  --line-strong: #c7cec5;
  --accent: #ff5c35;
  --accent-soft: #fff0ea;
  --inverse-bg: #17201a;
  --inverse-ink: #ffffff;
  --green: #27352c;
  --green-soft: #edf0ed;
  --shadow: 0 20px 60px rgba(23, 32, 26, .07);
  --header-h: 72px;
  --max-w: 1320px;
  --sidebar-w: 272px;
  --radius: 18px;
  --sans: "JetBrains Mono Variable", "LXGW WenKai Screen", "PingFang SC", monospace;
  --mono: "JetBrains Mono Variable", "LXGW WenKai Screen", "SFMono-Regular", monospace;
}

[data-theme="dark"] {
  --bg: #101411;
  --surface: #171d19;
  --surface-2: #1d251f;
  --surface-3: #253029;
  --ink: #f1f3ef;
  --ink-2: #b5beb7;
  --muted: #7e8a81;
  --line: #2c352f;
  --line-strong: #3c4940;
  --accent-soft: #38231c;
  --inverse-bg: #f1f3ef;
  --inverse-ink: #101411;
  --green: #8dd0b1;
  --green-soft: #193328;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { color: var(--ink); background: rgba(242, 201, 76, .58); }
.muted { color: var(--muted); }

.reading-progress { position: fixed; z-index: 300; inset: 0 0 auto; height: 2px; pointer-events: none; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--accent); }

/* Header */
.site-header { position: sticky; z-index: 200; top: 0; height: var(--header-h); border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px) saturate(1.3); }
.header-inner { width: min(var(--max-w), calc(100% - 48px)); height: 100%; margin: auto; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--inverse-ink); background: var(--inverse-bg); border-radius: 50%; font-size: 16px; font-weight: 700; transform: rotate(-8deg); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { margin-top: 4px; color: var(--muted); font: 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.primary-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.primary-nav a { padding: 9px 13px; border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.primary-nav a:hover, .primary-nav a.active { color: var(--ink); background: var(--surface-2); }
.primary-nav .nav-github { margin-left: 4px; color: var(--inverse-ink); background: var(--inverse-bg); }
.primary-nav .nav-github:hover { color: #fff; background: var(--accent); }
.theme-toggle, .nav-toggle { border: 0; color: var(--ink); background: transparent; cursor: pointer; }
.theme-toggle { width: 38px; height: 38px; margin-left: 10px; border: 1px solid var(--line); border-radius: 50%; }
.theme-toggle:hover { border-color: var(--ink); }
.nav-toggle { display: none; }

/* Shared */
.eyebrow { color: var(--ink-2); font: 600 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 30px; min-height: 50px; padding: 0 22px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 600; font-size: 14px; transition: .2s ease; }
.button:hover { transform: translateY(-2px); border-color: var(--ink); }
.button.primary { color: var(--inverse-ink); border-color: var(--inverse-bg); background: var(--inverse-bg); }
.button.primary:hover { border-color: var(--accent); background: var(--accent); }
.button.ghost { background: transparent; }
.text-link { flex-shrink: 0; padding-bottom: 4px; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 600; }
.text-link span { margin-left: 12px; }

/* Home */
.home-main { width: min(var(--max-w), calc(100% - 48px)); margin: auto; }
.home-hero { padding: 56px 4vw 48px; border-bottom: 1px solid var(--line); }
.index-hero { min-height: 0; display: grid; grid-template-columns: .8fr 1.2fr; align-items: end; gap: 8vw; }
.index-intro h1 { margin: 13px 0 12px; font-size: clamp(46px, 5.2vw, 68px); line-height: 1; letter-spacing: -.055em; font-weight: 600; }
.index-intro p { margin: 0; color: var(--ink-2); font-size: 15px; }
.today-entry { min-height: 170px; padding: 27px 30px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; column-gap: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: border-color .18s, transform .18s; }
.today-entry:hover { border-color: var(--ink); transform: translateY(-3px); }
.today-label { color: var(--muted); font: 10px/1 var(--mono); letter-spacing: .12em; }
.today-label i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); }
.today-date { align-self: center; font-size: clamp(25px, 2.6vw, 36px); font-weight: 600; letter-spacing: -.04em; }
.today-meta { align-self: end; color: var(--ink-2); font-size: 13px; }
.today-meta strong { color: var(--ink); font-size: 20px; }
.today-meta small { display: block; margin-top: 2px; color: var(--muted); }
.today-action { grid-column: 2; grid-row: 1 / -1; min-width: 145px; padding-left: 26px; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; border-left: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.today-action b { font-size: 30px; font-weight: 400; transition: transform .18s; }
.today-entry:hover .today-action b { color: var(--accent); transform: translateX(4px); }
.hero-copy h1, .digest-hero h1, .archive-hero h1 { margin: 22px 0 22px; font-size: clamp(44px, 5vw, 64px); line-height: 1.02; letter-spacing: -.055em; font-weight: 600; }
.hero-copy h1 em, .digest-hero h1 em, .archive-hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p { max-width: 650px; margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 37px; }
.hero-index { position: relative; min-height: 405px; padding: 36px; overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 50% 50% 24px 24px; box-shadow: var(--shadow); }
.index-label { font: 11px/1 var(--mono); letter-spacing: .16em; }
.index-number { position: relative; z-index: 1; margin-top: 72px; font-size: clamp(76px, 8vw, 118px); font-weight: 500; line-height: .8; letter-spacing: -.08em; }
.hero-index > p { position: relative; z-index: 1; margin: 17px 0 28px; color: var(--muted); font: 12px/1 var(--mono); letter-spacing: .1em; }
.index-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.index-grid span { color: var(--muted); font-size: 11px; }
.index-grid strong { display: block; color: var(--ink); font-size: 20px; font-weight: 500; }
.index-orbit { position: absolute; width: 300px; height: 300px; top: -95px; right: -86px; border: 1px solid var(--line); border-radius: 50%; }
.index-orbit i { position: absolute; border: 1px solid var(--line); border-radius: 50%; inset: 34px; }
.index-orbit i:nth-child(2) { inset: 68px; }
.index-orbit i:nth-child(3) { inset: 105px; background: var(--surface-2); border: 1px solid var(--line); }

.home-section { padding: 72px 4vw; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 43px; }
.section-heading > div { position: relative; }
.section-heading .eyebrow { margin: 0 0 10px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -.045em; }
.section-index { position: absolute; left: -42px; top: 2px; color: var(--accent); font: 12px/1 var(--mono); }
.section-desc { max-width: 390px; margin: 0; color: var(--ink-2); font-size: 14px; }
.latest-layout { display: grid; grid-template-columns: 285px 1fr; gap: 20px; }
.latest-date-card { min-height: 420px; padding: 30px; display: flex; flex-direction: column; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s ease; }
.latest-date-card:hover { transform: translateY(-4px); }
.date-month { color: var(--accent); font: 11px/1 var(--mono); letter-spacing: .12em; }
.latest-date-card > strong { margin-top: 54px; font-size: 86px; line-height: .86; letter-spacing: -.07em; font-weight: 500; }
.date-year { margin-top: 18px; color: var(--muted); font-size: 12px; }
.date-cta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 600; }
.paper-preview-list { border-top: 1px solid var(--line-strong); }
.paper-preview { min-height: 105px; padding: 20px 14px; display: grid; grid-template-columns: 44px 1fr 32px; gap: 17px; align-items: start; border-bottom: 1px solid var(--line); transition: background .18s ease; }
.paper-preview:hover { background: var(--surface); }
.preview-num { padding-top: 4px; color: var(--accent); font: 12px/1 var(--mono); }
.preview-copy { display: flex; flex-direction: column; }
.preview-topic { margin-bottom: 4px; color: var(--muted); font: 10px/1.4 var(--mono); text-transform: uppercase; }
.preview-copy strong { font-size: 15px; line-height: 1.4; }
.preview-copy small { margin-top: 7px; color: var(--ink-2); line-height: 1.55; }
.preview-arrow { color: var(--muted); transition: transform .18s; }
.paper-preview:hover .preview-arrow { color: var(--accent); transform: translate(3px, -3px); }

.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.note-card { min-height: 265px; padding: 28px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: .2s ease; }
.note-card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: var(--shadow); }
.note-type { color: var(--accent); font: 10px/1 var(--mono); letter-spacing: .12em; }
.note-card h3 { margin: 25px 0 14px; font-size: 19px; line-height: 1.42; letter-spacing: -.025em; }
.note-card p { margin: 0; color: var(--muted); font-size: 13px; }
.note-read { display: flex; justify-content: space-between; margin-top: auto; padding-top: 17px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.topic-band { margin: 0 4vw 104px; padding: 54px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.topic-band h2 { margin: 15px 0 0; font-size: 38px; line-height: 1.15; letter-spacing: -.045em; }
.topic-band .eyebrow { color: var(--muted); }
.topic-list { display: grid; grid-template-columns: repeat(2, 1fr); align-content: center; }
.topic-list span { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* Two-column reading layout */
.two-col { width: min(var(--max-w), calc(100% - 48px)); margin: 0 auto; padding: 42px 0 84px; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: clamp(36px, 5vw, 68px); align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 46px); overflow-y: auto; scrollbar-width: thin; }
.sidebar-toc { display: flex; flex-direction: column; gap: 14px; }
.sidebar-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.sidebar-section:first-child { padding-top: 0; }
.sidebar-title { margin-bottom: 12px; color: var(--muted); font: 600 10px/1 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.back-link { display: inline-flex; margin-bottom: 17px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.back-link:hover, .link-ext:hover { color: var(--accent); }
.sidebar-date { display: grid; grid-template-columns: 66px 1fr; gap: 13px; }
.sidebar-date .back-link { grid-column: 1 / -1; }
.sidebar-date-day { font-size: 49px; line-height: .9; font-weight: 500; letter-spacing: -.06em; }
.sidebar-date-copy { display: flex; flex-direction: column; justify-content: center; }
.sidebar-date-copy strong { font-size: 12px; }
.sidebar-date-copy span { color: var(--muted); font-size: 11px; }
.sidebar-cat-list, .sidebar-paper-list, .sidebar-toc-list { padding: 0; margin: 0; list-style: none; }
.sidebar-cat-list a, .sidebar-paper-list a, .sidebar-toc-list a { display: block; padding: 7px 9px; border-radius: 8px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.sidebar-cat-list a:hover, .sidebar-paper-list a:hover, .sidebar-toc-list a:hover { color: var(--ink); background: var(--surface-2); }
.sidebar-cat-list .muted { float: right; font-size: 10px; }
.sidebar-paper-list .num { display: inline-block; min-width: 26px; color: var(--muted); font: 10px/1 var(--mono); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: var(--surface); font-size: 10px; }

/* Daily paper */
.digest-hero { padding: 16px 0 40px; border-bottom: 1px solid var(--line); }
.digest-hero h1 { margin: 20px 0 16px; font-size: clamp(44px, 5vw, 62px); }
.digest-hero .lead { max-width: 700px; margin: 0; color: var(--ink-2); font-size: 16px; }
.quick-stats { display: flex; gap: 0; margin-top: 38px; }
.quick-stats .stat { min-width: 130px; padding-right: 34px; margin-right: 34px; border-right: 1px solid var(--line); }
.quick-stats .stat:last-child { border: 0; }
.stat strong, .stat small { display: block; }
.stat strong { font-size: 20px; letter-spacing: -.02em; }
.stat small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.digest-toolbar { position: sticky; z-index: 20; top: var(--header-h); display: flex; align-items: center; gap: 18px; padding: 14px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(15px); }
.paper-search { flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.paper-search input { width: 100%; height: 42px; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 13px; }
.paper-search input::placeholder { color: var(--muted); }
.view-note { flex-shrink: 0; color: var(--muted); font-size: 11px; }
.view-note strong { color: var(--ink); }
.cat-section { margin-top: 48px; }
.cat-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line-strong); }
.cat-heading > div { min-width: 0; }
.cat-heading h2 { margin: 6px 0 0; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.cat-kicker { color: var(--accent); font: 10px/1 var(--mono); letter-spacing: .12em; }
.cat-count { color: var(--muted); font: 32px/1 var(--mono); }
.paper-card { margin-bottom: 16px; padding: 24px 26px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scroll-margin-top: calc(var(--header-h) + 70px); transition: border-color .18s, box-shadow .18s; }
.paper-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-head { display: grid; grid-template-columns: 39px minmax(0, 1fr); gap: 16px; align-items: start; }
.paper-num { width: 39px; height: 39px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--line); border-radius: 50%; font: 13px/1 var(--mono); }
.paper-heading { min-width: 0; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.venue-chip { padding: 4px 8px; color: var(--green); background: var(--green-soft); border-radius: 5px; font-size: 14px; font-weight: 600; }
.paper-kind { color: var(--muted); font: 13px/1.2 var(--mono); text-transform: uppercase; }
.paper-title { margin: 0; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.38; letter-spacing: -.025em; }
.authors { display: block; margin-top: 9px; color: var(--ink-2); font-size: 15px; line-height: 1.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body { padding: 20px 0 0 55px; }
.content-label { display: block; margin-bottom: 8px; color: var(--accent); font: 10px/1 var(--mono); letter-spacing: .1em; }
.paper-insights { margin-top: 18px; border-top: 1px solid var(--line); }
.paper-detail { border-bottom: 1px solid var(--line); }
.paper-detail summary { padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink); cursor: pointer; font-size: 16px; font-weight: 600; list-style: none; }
.paper-detail summary::-webkit-details-marker { display: none; }
.paper-detail summary > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.paper-detail summary::after { content: "+"; color: var(--muted); font: 16px/1 var(--mono); }
.paper-detail[open] summary::after { content: "−"; color: var(--accent); }
.paper-detail[open] .details-hint { color: var(--accent); }
.paper-detail .details-hint { order: 2; margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.paper-detail p { margin: 0 0 18px; padding: 16px 18px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; font-size: 16px; line-height: 1.78; overflow-wrap: anywhere; white-space: pre-wrap; }
.figure-trigger { width: 100%; margin: 0 0 17px; padding: 12px 14px; display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); text-align: left; cursor: zoom-in; }
.figure-trigger:hover { border-color: var(--line-strong); background: var(--surface-3); }
.figure-trigger > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.figure-trigger b { font-size: 14px; font-weight: 600; }
.figure-trigger small { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.figure-trigger > strong { color: var(--muted); font-size: 14px; font-weight: 400; }
.figure-schematic { height: 40px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.figure-schematic i { width: 9px; height: 9px; border: 1px solid var(--ink-2); border-radius: 2px; }
.figure-schematic i:nth-child(2) { position: relative; width: 13px; height: 13px; background: var(--surface-2); }
.figure-schematic i:nth-child(2)::before, .figure-schematic i:nth-child(2)::after { content: ""; position: absolute; top: 5px; width: 5px; border-top: 1px solid var(--muted); }
.figure-schematic i:nth-child(2)::before { right: 100%; }
.figure-schematic i:nth-child(2)::after { left: 100%; }
.figure-viewer { position: fixed; z-index: 500; inset: 0; padding: 5vh 5vw; display: none; place-items: center; background: rgba(10, 14, 11, .78); backdrop-filter: blur(8px); }
.figure-viewer.is-open { display: grid; }
.figure-viewer-frame { position: relative; width: min(1180px, 100%); max-height: 90vh; padding: 16px; display: grid; place-items: center; border-radius: 14px; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.figure-viewer img { max-width: 100%; max-height: calc(90vh - 32px); object-fit: contain; }
.figure-viewer-close { position: absolute; z-index: 1; top: 8px; right: 8px; width: 36px; height: 36px; border: 1px solid #d9ddd7; border-radius: 50%; color: #17201a; background: rgba(255, 255, 255, .94); cursor: pointer; }
.abs-zh { margin-top: 17px; border-top: 1px solid var(--line); }
.abs-en { border-top: 1px solid var(--line); }
.abs-zh summary, .abs-en summary { padding: 15px 0; display: flex; justify-content: space-between; color: var(--ink); cursor: pointer; font-size: 16px; list-style: none; }
.abs-zh summary::-webkit-details-marker, .abs-en summary::-webkit-details-marker { display: none; }
.details-hint { color: var(--muted); }
.abs-zh[open] .details-hint, .abs-en[open] .details-hint { color: var(--accent); }
.abs-zh p { margin: 0 0 19px; padding: 18px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; font-size: 16px; line-height: 1.78; }
.abs-en blockquote { margin: 0 0 20px; padding: 18px; color: var(--ink-2); background: var(--surface-2); border-left: 2px solid var(--line-strong); border-radius: 0 10px 10px 0; font-size: 16px; line-height: 1.75; }
.card-actions { margin: 20px -26px 0; padding: 13px 26px; display: flex; gap: 22px; justify-content: flex-end; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.paper-action { color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.paper-action:hover { color: var(--accent); }
.paper-action.primary { color: var(--ink); }
.paper-action span { margin-left: 6px; }
.paper-card.is-hidden, .cat-section.is-empty { display: none; }

/* Archive */
.archive-main { width: min(1080px, calc(100% - 48px)); margin: auto; padding: 64px 0 96px; }
.archive-hero { display: grid; grid-template-columns: 1fr 360px; align-items: end; gap: 60px; padding-bottom: 65px; border-bottom: 1px solid var(--line-strong); }
.archive-hero .eyebrow { grid-column: 1 / -1; }
.archive-hero h1 { margin: 0; font-size: clamp(46px, 5vw, 64px); }
.archive-hero p { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.archive-toolbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.archive-toolbar label { display: flex; align-items: center; gap: 9px; width: 260px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.archive-toolbar input { width: 100%; height: 38px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.archive-row { min-height: 88px; display: grid; grid-template-columns: 50px 1.4fr .7fr 1fr 30px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); transition: background .18s; }
.archive-row:hover { background: var(--surface); }
.archive-index { color: var(--accent); font: 11px/1 var(--mono); }
.archive-date { display: flex; flex-direction: column; }
.archive-date strong { font-size: 20px; letter-spacing: -.02em; }
.archive-date small { color: var(--muted); font-size: 10px; }
.archive-meta { color: var(--muted); font-size: 12px; }
.archive-meta b { color: var(--ink); font-size: 18px; }
.archive-tags { display: flex; gap: 6px; }
.archive-tags i { padding: 4px 8px; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; font-size: 11px; font-style: normal; }
.archive-arrow { color: var(--muted); }
.archive-row:hover .archive-arrow { color: var(--accent); }
.archive-row.is-hidden { display: none; }

/* Long-form note */
.note-page .two-col { max-width: 1220px; grid-template-columns: 235px minmax(0, 800px); justify-content: center; }
.note-hero { padding: 23px 0 50px; border-bottom: 1px solid var(--line); }
.venue-badge { display: inline-block; margin-top: 22px; padding: 6px 10px; color: var(--green); background: var(--green-soft); border-radius: 6px; font-size: 11px; font-weight: 600; }
.paper-title-h1 { margin: 15px 0 18px; font-size: clamp(34px, 4vw, 46px); line-height: 1.18; letter-spacing: -.04em; }
.paper-authors { margin: 0; color: var(--ink-2); font-size: 13px; }
.paper-arxiv { margin: 13px 0 0; color: var(--accent); font-size: 12px; font-weight: 600; }
.note-content { padding-top: 18px; color: var(--ink-2); font-size: 16px; line-height: 1.82; }
.note-content h1, .note-content h2, .note-content h3, .note-content h4 { color: var(--ink); line-height: 1.25; letter-spacing: -.025em; }
.note-content h1 { font-size: 34px; }
.note-content h2 { margin: 52px 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 26px; scroll-margin-top: calc(var(--header-h) + 20px); }
.note-content h3 { margin: 39px 0 14px; font-size: 20px; }
.note-content h4 { margin-top: 28px; font-size: 16px; }
.note-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.note-content blockquote { margin: 24px 0; padding: 18px 22px; color: var(--ink-2); background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.note-content code { padding: .16em .42em; color: var(--accent); background: var(--surface-2); border-radius: 4px; font-family: var(--mono); font-size: .88em; }
.note-content pre { padding: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.note-content pre code { padding: 0; color: var(--ink); background: none; }
.note-content img { display: block; margin: 28px auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.note-content table { width: 100%; margin: 26px 0; border-collapse: collapse; overflow: hidden; font-size: 12px; }
.note-content th, .note-content td { padding: 11px 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.note-content th { color: var(--ink); background: var(--surface-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-inner { width: min(var(--max-w), calc(100% - 48px)); min-height: 180px; margin: auto; padding: 38px 4vw; display: grid; grid-template-columns: 1.6fr .7fr 1fr .7fr; gap: 38px; }
.footer-col { color: var(--ink-2); font-size: 12px; }
.footer-col strong { display: block; margin-bottom: 13px; color: var(--ink); font-size: 11px; }
.footer-col p { margin: 0; }
.footer-col p a { display: block; margin: 4px 0; }
.footer-brand { display: block; margin-bottom: 13px; color: var(--ink); font-size: 17px; font-weight: 700; }
.footer-meta { display: flex; flex-direction: column; justify-content: space-between; text-align: right; }
.footer-meta span { color: var(--accent); font: 10px/1 var(--mono); text-transform: uppercase; }
.footer-stats { width: min(var(--max-w), calc(100% - 48px)); margin: -12px auto 0; padding: 18px 4vw 24px; display: flex; justify-content: flex-end; gap: 20px; color: var(--ink-2); border-top: 1px dashed var(--line); font: 12px/1.4 var(--mono); }
.footer-stats span { white-space: nowrap; }
.footer-stats strong { margin-left: 4px; color: var(--ink); font-weight: 600; }

@media (max-width: 980px) {
  .primary-nav { position: fixed; top: var(--header-h); left: 16px; right: 16px; padding: 14px; display: none; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .primary-nav.is-open { display: flex; }
  .nav-toggle { width: 40px; height: 40px; margin-left: auto; display: grid; place-content: center; gap: 5px; }
  .nav-toggle span { width: 20px; height: 1px; display: block; background: var(--ink); }
  .theme-toggle { margin-left: 2px; }
  .index-hero { grid-template-columns: 1fr; align-items: stretch; }
  .hero-index { min-height: 330px; border-radius: var(--radius); }
  .index-number { margin-top: 55px; }
  .two-col { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
  .sidebar-paper-section { display: none; }
  .sidebar-toc { display: grid; grid-template-columns: 1fr 1fr; }
  .notes-grid { grid-template-columns: repeat(2, 1fr); }
  .archive-hero { grid-template-columns: 1fr; }
  .archive-row { grid-template-columns: 42px 1fr .5fr 30px; }
  .archive-tags { display: none; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-meta { text-align: left; gap: 20px; }
}

@media (max-width: 700px) {
  :root { --header-h: 64px; }
  .header-inner, .home-main, .two-col, .archive-main, .footer-inner { width: min(100% - 28px, var(--max-w)); }
  .brand-sub { display: none; }
  .home-hero { min-height: auto; padding: 52px 0 44px; }
  .index-intro h1 { font-size: 44px; }
  .today-entry { min-height: 150px; padding: 22px; grid-template-columns: 1fr auto; }
  .today-action { min-width: auto; }
  .hero-copy h1, .digest-hero h1, .archive-hero h1 { font-size: 40px; }
  .hero-copy > p { font-size: 15px; }
  .hero-index { min-height: 300px; padding: 28px; }
  .index-number { font-size: 88px; }
  .home-section { padding: 56px 0; }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 30px; }
  .section-index { position: static; display: block; margin-bottom: 14px; }
  .latest-layout { grid-template-columns: 1fr; }
  .latest-date-card { min-height: 300px; }
  .latest-date-card > strong { margin-top: 40px; }
  .paper-preview { padding-inline: 4px; grid-template-columns: 30px 1fr 22px; gap: 10px; }
  .preview-copy small { display: none; }
  .notes-grid { grid-template-columns: 1fr; }
  .topic-band { margin: 0 0 70px; padding: 35px 25px; grid-template-columns: 1fr; gap: 40px; }
  .topic-list { grid-template-columns: 1fr; }
  .two-col { padding: 35px 0 75px; gap: 30px; }
  .sidebar-toc { grid-template-columns: 1fr; }
  .sidebar-cat-list { display: flex; flex-wrap: wrap; gap: 5px; }
  .digest-hero { padding-top: 12px; }
  .quick-stats { overflow-x: auto; }
  .quick-stats .stat { min-width: 104px; padding-right: 18px; margin-right: 18px; }
  .digest-toolbar { top: var(--header-h); }
  .view-note { display: none; }
  .cat-section { margin-top: 42px; }
  .paper-card { padding: 22px 18px 0; }
  .card-head { grid-template-columns: 32px minmax(0, 1fr); gap: 11px; }
  .paper-num { width: 32px; height: 32px; }
  .paper-title { font-size: 18px; }
  .card-body { padding-left: 0; }
  .figure-trigger { grid-template-columns: 48px 1fr auto; gap: 10px; }
  .figure-trigger small { white-space: normal; }
  .figure-viewer { padding: 12px; }
  .figure-viewer-frame { padding: 8px; max-height: calc(100vh - 24px); }
  .figure-viewer img { max-height: calc(100vh - 40px); }
  .card-actions { margin-inline: -18px; padding-inline: 18px; justify-content: space-between; }
  .archive-main { padding: 58px 0 80px; }
  .archive-hero { gap: 22px; padding-bottom: 40px; }
  .archive-toolbar label { width: 190px; }
  .archive-row { grid-template-columns: 28px 1fr 28px; gap: 10px; }
  .archive-meta { display: none; }
  .note-page .two-col { display: block; }
  .note-page .sidebar { margin-bottom: 30px; }
  .note-content { font-size: 15px; }
  .note-content h2 { font-size: 24px; }
  .note-content table { display: block; overflow-x: auto; }
  .footer-inner { grid-template-columns: 1fr; min-height: auto; padding: 40px 0; }
  .footer-stats { width: min(100% - 28px, var(--max-w)); margin-top: -12px; padding: 18px 0 24px; justify-content: flex-start; gap: 16px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
