/* =====================================================================
   Daily-AI · styles.css
   Design system: light, Linear/Vercel — near-white surfaces, thin 1px
   rules, restrained indigo accent, mono numerics, airy 4-based spacing.
   ===================================================================== */

/* ── Design tokens (verbatim from the frontend-pro plan's Global Constraints) ── */
:root {
  --bg:             #ffffff;
  --surface:        #fbfbfc;
  --hover:          #f6f7f9;
  --border:         #ececf0;
  --border-strong:  #e1e1e8;
  --ink:            #14141b;
  --ink-2:          #3a3a46;
  --muted:          #8a8a99;
  --accent:         #5b5bd6;
  --accent-weak:    #eeeefb;
  --accent-ink:     #4b3fc9;
  --pos:            #297a3a;
  --neg:            #c4314b;
  --warn:           #a35200;

  /* Emphasis */
  --mark-bg:        #fff2c2;   /* keyword highlight ground */
  --mark-ink:       #6b4e00;

  /* Semantic type scale (readability-first) */
  --fs-eyebrow:  12.5px;  /* section labels: uppercase + tracking */
  --fs-meta:     13px;    /* dates / counts / authors */
  --fs-body:     14.5px;  /* body / summaries */
  --fs-title:    15.5px;  /* item titles */
  --fs-card:     17px;    /* card / theme titles */
  --fs-headline: 22px;    /* today / topic headline */
  --fs-hero:     30px;    /* dashboard hero headline */
  --fs-drawer:   18px;    /* drawer title */

  --kind-convergence:   #297a3a;
  --kind-contradiction: #c4314b;
  --kind-trend:         #2f6feb;
  --kind-lineage:       #7c5cd6;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;

  /* 4-based spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --motion: 150ms;
  --ease: ease-out;

  --shadow-drawer: -8px 0 32px rgba(22, 22, 29, .08);
  --shadow-toast: 0 8px 24px rgba(22, 22, 29, .14);
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reusable section-label eyebrow: a scannable anchor above each block. */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.eyebrow::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}
mark.kw {
  background: var(--mark-bg);
  color: var(--mark-ink);
  font-weight: 600;
  border-radius: 3px;
  padding: 0 2px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }

::selection { background: var(--accent-weak); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* ── Topbar ────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  height: 56px;
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand-mark {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

.brand-name { font-size: 14.5px; }

.tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
}

.tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}

.tabs button:hover { background: var(--hover); color: var(--ink); }

.tabs button.active {
  background: var(--accent-weak);
  color: var(--accent);
}

.btn-refresh {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease),
              transform var(--motion) var(--ease);
  white-space: nowrap;
}

.btn-refresh:hover { background: var(--hover); border-color: var(--border-strong); }
.btn-refresh:active { transform: translateY(1px); }

.btn-refresh:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

/* ── Layout ────────────────────────────────────────────────────────── */
#main {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--sp-7) var(--sp-6) var(--sp-9);
}

.view { animation: view-in var(--motion) var(--ease); }

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Primitives: card / badge / chip / pill ───────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
}

.card:hover { border-color: var(--border-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--hover);
  color: var(--ink-2);
  border: 1px solid var(--border);
  line-height: 1.5;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  padding: 3px var(--sp-3);
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  cursor: default;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease);
}

/* Two-tier tags: controlled-vocab topics get an accent chip so they read as
   the high-signal facet; arXiv category codes stay quiet. */
.chip.topic-tag {
  background: var(--accent-weak);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-ink);
  font-weight: 550;
}
.chip.cat-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.chip.chip-link {
  cursor: pointer;
}

.chip.chip-link:hover {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent);
}

/* Site-wide "新" pill — small accent chip, distinct from the neutral .chip. */
.new-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-weak);
  color: var(--accent-ink);
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 2px var(--sp-2);
  border-radius: 999px;
}

.pill-pos { background: color-mix(in srgb, var(--pos) 12%, transparent); color: var(--pos); }
.pill-neg { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.pill-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); }

/* Hotness tiers — layer on top of .pill-warn, only override color/bg so a
   hotter item reads with a stronger tint of the same hue (not a new hue). */
.pill.pill-hot-1 { background: color-mix(in srgb, var(--warn) 20%, transparent); }
.pill.pill-hot-2 { background: color-mix(in srgb, var(--warn) 32%, transparent); color: var(--warn); font-weight: 700; }

/* Connection "kind" colors — convergence / contradiction / trend / lineage */
.kind {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  letter-spacing: .02em;
}

.kind-convergence   { background: color-mix(in srgb, var(--kind-convergence) 12%, transparent);   color: var(--kind-convergence); }
.kind-contradiction { background: color-mix(in srgb, var(--kind-contradiction) 12%, transparent); color: var(--kind-contradiction); }
.kind-trend         { background: color-mix(in srgb, var(--kind-trend) 12%, transparent);         color: var(--kind-trend); }
.kind-lineage       { background: color-mix(in srgb, var(--kind-lineage) 12%, transparent);       color: var(--kind-lineage); }

/* ── Hierarchy primitives ──────────────────────────────────────────────── */
/* "速览" overview strip: a compact flex row of stats/leads used at the top
   of a view. .ov-lead marks the accent-colored lead item; .ov-sep is the
   quiet separator between entries; .num gets mono numerals via .mono. */
.overview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-meta);
  color: var(--ink-2);
  margin-top: var(--sp-2);
}
.overview-bar .ov-sep { color: var(--muted); }
.overview-bar .ov-lead { color: var(--accent-ink); font-weight: 600; }
.overview-bar .num { color: var(--ink); }

/* Numbering prefix for section/card titles (e.g. "01"). */
.theme-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--muted);
  margin-right: var(--sp-2);
  font-size: 0.9em;
}

/* ── Source badges ────────────────────────────────────────────────────── */
.src-arxiv { background: color-mix(in srgb, var(--kind-lineage) 15%, var(--bg)); color: var(--kind-lineage); border-color: color-mix(in srgb, var(--kind-lineage) 25%, transparent); }
.src-hf    { background: color-mix(in srgb, var(--warn) 15%, var(--bg));        color: var(--warn);        border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.src-hn    { background: color-mix(in srgb, var(--kind-trend) 15%, var(--bg));  color: var(--kind-trend);  border-color: color-mix(in srgb, var(--kind-trend) 25%, transparent); }
.src-blog  { background: color-mix(in srgb, var(--pos) 15%, var(--bg));         color: var(--pos);         border-color: color-mix(in srgb, var(--pos) 25%, transparent); }
.src-other { background: var(--hover); color: var(--ink-2); border-color: var(--border); }

/* ── Progress banner ──────────────────────────────────────────────────── */
.progress {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 1120px;
  margin: var(--sp-4) auto 0;
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent-weak);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}

.progress.progress-error {
  background: color-mix(in srgb, var(--neg) 8%, transparent);
  border-color: color-mix(in srgb, var(--neg) 30%, transparent);
  color: var(--neg);
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: progress-pulse 1.4s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50%      { opacity: 1;  transform: scale(1); }
}

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--sp-7);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-5);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-toast);
  white-space: nowrap;
  z-index: 999;
  animation: toast-in 180ms var(--ease);
}

.toast.hidden { display: none !important; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Drawer (right slide-over) ────────────────────────────────────────── */
#drawer-root:empty { display: none; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 29, .28);
  z-index: 40;
  animation: overlay-in var(--motion) var(--ease);
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-drawer);
  z-index: 41;
  display: flex;
  flex-direction: column;
  animation: drawer-in 220ms var(--ease);
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.drawer-close {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}

.drawer-close:hover { background: var(--hover); color: var(--ink); }

.drawer-body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1;
}

/* ── Skeleton / empty states ──────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--hover) 25%, var(--surface) 37%, var(--hover) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.empty-state {
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.empty-note {
  padding: var(--sp-4) 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Dashboard (总览) ──────────────────────────────────────────────────── */
.dash-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  align-items: start;
}

.dash-card { min-width: 0; }

.dash-title {
  font-size: var(--fs-eyebrow);
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-3);
  border-left: 3px solid var(--accent);
  line-height: 1.1;
}

/* Stat tiles */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.stat-value {
  font-size: var(--fs-hero);
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--ink);
}

.stat-label {
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--ink-2);
}

/* Source distribution — categorical hue = source identity, reusing badge tokens */
.dist-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.dist-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.dist-row .badge { flex: 0 0 76px; justify-content: center; }

.dist-track {
  flex: 1;
  height: 8px;
  background: var(--hover);
  border-radius: 999px;
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  border-radius: 999px;
  transition: width var(--motion) var(--ease);
}

.dist-fill.src-arxiv { background: var(--kind-lineage); }
.dist-fill.src-hf    { background: var(--warn); }
.dist-fill.src-hn    { background: var(--kind-trend); }
.dist-fill.src-blog  { background: var(--pos); }
.dist-fill.src-other { background: var(--muted); }

.dist-count {
  flex-shrink: 0;
  width: 40px;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-2);
}

/* Top tags — sequential single-hue tint keyed to frequency (--w: 0..1) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.tag-chip {
  --w: 0;
  background: color-mix(in srgb, var(--accent) calc(var(--w) * 32%), var(--surface));
  border-color: color-mix(in srgb, var(--accent) calc(var(--w) * 55%), var(--border));
}

.tag-count {
  color: var(--muted);
  font-size: 11px;
}

/* Ingestion timeline — sparkline/bar, single accent hue, endpoint labels only */
.dash-timeline-scroll {
  overflow-x: auto;
  overflow-y: visible; /* explicit: overflow-x:auto alone would force overflow-y:auto too, clipping labels */
}

.timeline-svg {
  display: block;
  max-width: 100%;
  overflow: visible; /* safeguard: labels never get hard-clipped by the viewBox */
}

.timeline-baseline {
  stroke: var(--border);
  stroke-width: 1;
}

.timeline-bar {
  fill: var(--accent);
  opacity: .5;
  transition: opacity var(--motion) var(--ease);
}

.timeline-bar-current { opacity: 1; }

.timeline-bar:hover { opacity: .85; }

.timeline-value {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--ink-2);
}

.timeline-axis {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--muted);
}

/* Today's headline */
.headline-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

.headline-lead { margin-bottom: var(--sp-2); }

.theme-chip {
  appearance: none;
  border: 1px solid var(--border);
  font: inherit;
}

/* Latest directions */
.direction-list {
  display: flex;
  flex-direction: column;
}

.direction-item {
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--border);
}

.direction-item:first-child {
  border-top: none;
  padding-top: 0;
}

.direction-title {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.direction-rationale {
  font-size: var(--fs-body);
  color: var(--ink-2);
  line-height: 1.6;
}

.direction-item.clickable {
  cursor: pointer;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease);
}

.direction-item.clickable:hover { background: var(--hover); }

.direction-item.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Shared "landed here" highlight used after a dashboard teaser click
   scrolls another view's target element into view. */
@keyframes flash-highlight {
  0%   { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.flash-target {
  animation: flash-highlight 1.3s var(--ease);
  border-radius: var(--radius-md);
}

/* ── Today (今日) ──────────────────────────────────────────────────────── */
.today-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.today-top {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
}

.today-hero { flex: 1; min-width: 0; }

.today-headline {
  font-size: var(--fs-headline);
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

.today-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-meta);
  color: var(--muted);
}

.today-nav {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 160px;
}

.today-nav-label {
  font-size: 11.5px;
  color: var(--muted);
}

.today-nav-select {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.today-nav-select:disabled { cursor: not-allowed; opacity: .6; }

.today-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.today-theme-card { min-width: 0; }

/* Featured lead theme — applied ALONGSIDE .card.today-theme-card, so this
   only adds the accent overrides that make it stand out as the day's one
   strong signal (聚焦降噪: everything else stays neutral, see below). */
.today-lead {
  border-left-width: 4px;
  border-left-color: var(--accent);
}
.today-lead .today-theme-title { font-size: var(--fs-headline); }
.today-lead .today-theme-summary { font-size: var(--fs-body); }

.today-theme-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.today-theme-title {
  font-size: var(--fs-card);
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.35;
}

.today-theme-summary {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: var(--sp-4);
}

.today-paper-list {
  display: flex;
  flex-direction: column;
}

/* Topic view: "what's new" bullet list inside the narrative card */
.topic-whats-new {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.topic-whats-new li {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: var(--sp-4);
  position: relative;
}

.topic-whats-new li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--ink-2);
}

.today-paper-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--motion) var(--ease);
}

.today-paper-row:first-child { border-top: none; }

.today-paper-row:hover { background: var(--hover); }

/* Title + one-liner stack so neither gets truncated (readability-first). */
.today-paper-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.today-paper-title {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.today-paper-titleline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.today-paper-oneliner {
  font-size: var(--fs-body);
  color: var(--ink-2);
  line-height: 1.55;
}

/* New-item accent: a left tick + subtle tint so today's additions pop. */
.today-paper-row.is-new {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* 今日必读 mini-section: rows reuse .today-paper-row. The tick is stronger
   (3px) than .is-new's 2px so "must-read" out-ranks "new" visually when a
   row is both. */
.today-mustread {
  display: flex;
  flex-direction: column;
}

.must-read-tick {
  box-shadow: inset 3px 0 0 var(--accent);
}

.today-paper-external {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  padding: 2px var(--sp-1);
  border-radius: var(--radius-sm);
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}

.today-paper-external:hover {
  background: var(--accent-weak);
  color: var(--accent);
}

/* ── Connections (串联) ───────────────────────────────────────────────── */
.connect-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.connect-graph-card,
.connect-directions-card { min-width: 0; }

.connection-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.connection-card { min-width: 0; }

.connection-head { margin-bottom: var(--sp-2); }

.connection-claim {
  font-size: var(--fs-card);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: var(--sp-3);
}

.connection-why {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: var(--sp-3);
}

.paper-chip { font-size: var(--fs-meta); }

/* Colored left-accent bars for scannable card identity.
   聚焦降噪: non-lead theme cards get a neutral bar by default — only
   .today-lead (above) restores the strong accent, so the accent signal
   points at exactly one card. */
.today-theme-card { border-left: 3px solid var(--border-strong); }
.connect-directions-card { border-left: 3px solid var(--accent); }
.connection-card { border-left: 3px solid var(--muted); }
.connection-card:has(.kind-convergence)   { border-left-color: var(--kind-convergence); }
.connection-card:has(.kind-contradiction) { border-left-color: var(--kind-contradiction); }
.connection-card:has(.kind-trend)         { border-left-color: var(--kind-trend); }
.connection-card:has(.kind-lineage)       { border-left-color: var(--kind-lineage); }

/* Relationship graph SVG: circular layout, edges colored by kind. */
.graph-panel { width: 100%; }

.graph-wrap {
  width: 100%;
  overflow-x: auto; /* narrow viewports scroll rather than clip node labels */
}

.graph-svg { width: 100%; height: auto; }

.graph-edge {
  stroke-width: 1.6;
  opacity: .55;
  transition: opacity var(--motion) var(--ease);
}

.graph-node { cursor: pointer; }

.graph-node-dot {
  fill: var(--surface);
  stroke: var(--ink-2);
  stroke-width: 1.6;
  transition: fill var(--motion) var(--ease), stroke var(--motion) var(--ease);
}

.graph-node-label {
  font-size: 10.5px;
  fill: var(--ink-2);
  transition: fill var(--motion) var(--ease);
}

.graph-node:hover .graph-node-dot { fill: var(--accent-weak); stroke: var(--accent); }
.graph-node:hover .graph-node-label { fill: var(--accent); }

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-2);
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.graph-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.graph-tooltip {
  position: fixed;
  z-index: 80;
  max-width: 380px;
  padding: 7px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(22, 22, 29, 0.12);
  pointer-events: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ── Library (库) — faceted browser ───────────────────────────────────── */
.lib-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.lib-facets {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-5);
}

.lib-facet-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.lib-search-group { flex: 1; min-width: 200px; }

.lib-facet-label {
  font-size: 11.5px;
  color: var(--muted);
}

.lib-facet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.lib-facet-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  padding: 3px var(--sp-3);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease),
              color var(--motion) var(--ease);
}

.lib-facet-chip:hover { background: var(--hover); }

.lib-facet-chip.active {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent);
}

.lib-select {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.lib-search-input {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  width: 100%;
}

.lib-search-input:focus-visible { outline-offset: 0; }

.lib-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.lib-count {
  font-size: 12.5px;
  color: var(--muted);
}

.lib-list {
  display: flex;
  flex-direction: column;
}

.lib-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-2);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--motion) var(--ease);
}

.lib-row:first-child { border-top: none; }
.lib-row:hover { background: var(--hover); }
.lib-row.is-new { box-shadow: inset 2px 0 0 var(--accent); }

.lib-row-top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.lib-row-title {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.lib-row-title:hover { color: var(--accent-ink); }

.lib-row-sub {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-meta);
  color: var(--ink-2);
}

/* ── Detail drawer content (paper detail) ─────────────────────────────── */
.drawer-head-main { min-width: 0; flex: 1; }

.drawer-badge-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.drawer-date { font-size: 12px; color: var(--muted); }

.drawer-title {
  font-size: var(--fs-drawer);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--ink);
}

.drawer-authors {
  font-size: var(--fs-meta);
  color: var(--ink-2);
  margin-bottom: var(--sp-4);
}

.drawer-body > * + * { margin-top: var(--sp-4); }

.drawer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.drawer-link {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease),
              color var(--motion) var(--ease);
}

.drawer-link:hover {
  background: var(--accent-weak);
  border-color: var(--accent);
  color: var(--accent);
}

.drawer-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.drawer-metric {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12.5px;
}

.drawer-metric-value { font-weight: 600; color: var(--ink); }
.drawer-metric-label { color: var(--muted); }

.drawer-section-title {
  font-size: var(--fs-eyebrow);
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-2);
  border-left: 3px solid var(--accent);
  line-height: 1.1;
}

.drawer-abstract {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-line;
}

.xref-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.xref-group-title {
  font-size: var(--fs-eyebrow);
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--sp-2);
}

.xref-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.xref-item {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
  padding: var(--sp-1) 0;
}

.xref-item .kind { margin-right: var(--sp-2); }

.xref-claim { color: var(--ink-2); }

/* ── Notes (笔记) ──────────────────────────────────────────────────────── */
.notes-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.notes-form-card { min-width: 0; }

.notes-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.notes-form-label {
  font-size: 12.5px;
  color: var(--ink-2);
}

.notes-textarea {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  min-height: 96px;
  resize: vertical;
}

.notes-textarea:focus-visible { outline-offset: 0; }

.notes-submit { align-self: flex-end; }

.notes-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.note-card { min-width: 0; }

.note-excerpt {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  padding-left: var(--sp-3);
  border-left: 3px solid var(--accent);
  margin-bottom: var(--sp-2);
}

.note-date {
  font-size: var(--fs-meta);
  color: var(--muted);
  margin-bottom: var(--sp-3);
}

.notes-group { margin-top: var(--sp-3); }

.notes-group-title {
  font-size: var(--fs-eyebrow);
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: var(--sp-2);
}

.notes-bullet-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.notes-bullet {
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-2);
}

.notes-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.notes-suggestion { display: flex; flex-direction: column; gap: var(--sp-2); }

.notes-suggestion-title {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar { gap: var(--sp-3); padding: 0 var(--sp-4); }
  .brand-name { display: none; }
  .tabs { gap: 0; overflow-x: auto; }
  .tabs button { padding: var(--sp-2); font-size: 12.5px; }
  #main { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .drawer { width: 100vw; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-row { grid-template-columns: 1fr; }
  .today-top { flex-direction: column; }
  .today-nav { width: 100%; }
  .today-theme-grid { grid-template-columns: 1fr; }
  .today-paper-title { max-width: 100%; }
  .today-paper-row { flex-wrap: wrap; }
  .lib-facets { flex-direction: column; align-items: stretch; }
  .lib-search-group { min-width: 0; }
  .notes-submit { align-self: stretch; }
}

/* Reading experience: a quiet, continuous reading surface. */
:root { --reader-font: 16px; --ink-2: #414650; --muted: #6e7480; --accent: #4e5ec4; }
body { background: #fafaf9; }
.view { animation: none; }
#main { max-width: 1100px; padding-top: 44px; }
.topbar { background: rgba(250,250,249,.97); }
.tabs { min-width: 0; overflow-x: auto; }
.tabs button { white-space: nowrap; flex-shrink: 0; }
.page-heading { margin-bottom: 28px; }
.page-heading .eyebrow { font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.eyebrow::before { display: none; }
.page-heading h1 { font-size: 30px; line-height: 1.35; letter-spacing: -.035em; font-weight: 650; margin: 10px 0; }
.page-meta,.section-intro { color: var(--muted); font-size: 13px; line-height: 1.65; }
.section-intro { margin: 6px 0 18px; }
.section-title { font-size: 19px; font-weight: 650; margin: 28px 0 12px; }
.home-section,.home-links,.resume-card,.recent-history,.data-status { max-width: 800px; }
.home-change { display: flex; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--border-strong); }
.home-change .unit-number { padding-top: 4px; color: var(--muted); }
.home-change > div { min-width: 0; }
.change-title,.paper-title { appearance: none; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font-weight: 600; }
.change-title { font-size: 20px; line-height: 1.5; }
.change-title:hover,.paper-title:hover { color: var(--accent); }
.change-summary { font-size: var(--reader-font); color: var(--ink-2); margin: 8px 0; line-height: 1.75; }
.change-limit { color: var(--muted); margin-top: 8px; font-size: 14px; }
.resume-card { background: #f0f2fb; border-left: 3px solid var(--accent); padding: 22px 26px; margin-bottom: 34px; border-radius: 0 8px 8px 0; }
.resume-card h2 { margin: 6px 0 8px; font-size: 19px; font-weight: 600; line-height: 1.5; }
.primary-button,.quiet-button,.load-more { appearance: none; cursor: pointer; font-size: 13px; border-radius: 5px; padding: 7px 11px; border: 1px solid transparent; background: transparent; }
.quiet-button:hover { background: #eeeef2; }
.primary-button { background: var(--accent); color: white; margin-top: 14px; padding: 10px 16px; }
.primary-button:hover { background: #3e4eaf; }
.home-links { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 20px 0 30px; }
.reading-status { font-size: 12px; white-space: nowrap; line-height: 1.8; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.status-unread::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.status-updated { color: #965b15; font-weight: 600; }
.status-read { color: #637066; }
.reading-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.reading-actions .quiet-button { border-color: var(--border-strong); background: transparent; }
.reading-filters { display: flex; gap: 4px; flex-wrap: wrap; margin: 18px 0; }
.reading-filters .selected { color: var(--accent); background: #eceef9; }
.paper-row { border-bottom: 1px solid var(--border-strong); padding: 19px 0; }
.paper-row-top { display: flex; align-items: baseline; gap: 16px; }
.paper-title { font-size: var(--reader-font); line-height: 1.55; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.paper-summary { font-size: 14px; color: var(--ink-2); line-height: 1.75; margin-top: 6px; }
.paper-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; color: var(--muted); font-size: 12px; }
.paper-external { text-decoration: none; }
.addition-label { color: var(--muted); }
.was-read .paper-title,.was-read > .unit-heading h2 { font-weight: 500; }
.was-read { border-color: var(--border); }
.reading-unit { padding: 28px 0 38px; border-bottom: 1px solid var(--border-strong); }
.unit-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.unit-heading h2 { font-size: 23px; font-weight: 650; line-height: 1.45; flex: 1; overflow-wrap: anywhere; }
.unit-number { font-size: 12px; font-family: var(--font-mono); color: var(--muted); }
.reader-paragraph { font-size: var(--reader-font); line-height: 1.85; color: var(--ink-2); margin: 0 0 16px; overflow-wrap: anywhere; }
.reader-section h3,.reader-section-label { font-size: 13px; font-weight: 650; margin: 22px 0 10px; color: var(--ink); }
.reading-layout { display: grid; grid-template-columns: 190px minmax(0,740px); gap: 42px; align-items: start; }
.reading-body { min-width: 0; }
.reading-toc { position: sticky; top: 86px; max-height: calc(100vh - 116px); overflow-y: auto; padding-top: 28px; }
.toc-link { display: block; font-size: 12px; line-height: 1.6; background: transparent; border: 0; border-left: 2px solid transparent; width: 100%; text-align: left; color: var(--muted); padding: 8px 10px; margin-top: 7px; cursor: pointer; }
.toc-link.current { border-left-color: var(--accent); color: var(--accent); background: #f0f1f8; }
.reading-end { color: var(--muted); font-size: 14px; margin: 26px 0 10px; }
.period-select { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.period-select select,.library-facets select { border: 1px solid var(--border-strong); border-radius: 5px; padding: 5px 8px; background: white; }
.period-background,.evidence-list,.notable-models,.relationship-graph,.recent-history,.data-status { margin: 18px 0; }
summary { cursor: pointer; color: var(--ink-2); font-size: 13px; padding: 8px 0; }
.evidence-list[open] { border-left: 2px solid var(--border-strong); padding-left: 18px; }
.evidence-list .paper-row { padding: 14px 0; }
.reader-search { width: 100%; max-width: 800px; padding: 12px 14px; background: white; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 15px; }
.library-results,.library-facets { max-width: 800px; }
.library-facets { margin: 10px 0 22px; }
.library-facets label { display: inline-flex; align-items: center; gap: 5px; margin: 6px 12px 6px 0; font-size: 13px; }
.load-more { display: block; margin: 24px auto; border-color: var(--border-strong); padding: 10px 30px; }
#reader-tools { position: relative; flex-shrink: 0; }
.reading-settings > summary { font-size: 12px; white-space: nowrap; }
.settings-panel { position: absolute; top: 40px; right: 0; width: min(380px,90vw); background: white; border: 1px solid var(--border-strong); padding: 20px; box-shadow: 0 12px 40px #00000012; border-radius: 8px; z-index: 30; }
.settings-panel > * { margin-bottom: 12px; }
.settings-panel label { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.settings-panel .quiet-button { border-color: var(--border-strong); margin-right: 6px; }
.save-status { font-size: 12px; color: var(--muted); }
#reading-save-status { font-size: 11px; color: #965b15; }
.drawer { width: min(560px,100vw); animation: none; }
.drawer.focused { width: min(860px,100vw); }
.drawer.focused .drawer-body { padding-left: max(24px,calc((100% - 720px)/2)); padding-right: max(24px,calc((100% - 720px)/2)); }
.drawer-open { overflow: hidden; }
.drawer-head { padding: 24px; }
.drawer-close { width: auto; height: auto; padding: 4px 9px; font-size: 12px; }
.drawer-body { padding: 24px; scroll-behavior: auto; }
.drawer-body > * + * { margin-top: 14px; }
.private-note-label { display: block; margin-top: 26px; font-size: 13px; color: var(--muted); }
.private-note { display: block; width: 100%; min-height: 75px; background: #fafafa; border: 1px solid var(--border-strong); padding: 10px; margin-top: 8px; font-size: 14px; line-height: 1.65; resize: vertical; }
.update-note { font-size: 12px; color: #965b15; }
.detail-layout-actions { margin: 6px 0; }
.toast { white-space: normal; max-width: min(560px,90vw); }
[data-anchor] { scroll-margin-top: 90px; }
@media(max-width: 850px) { .reading-layout { grid-template-columns: 160px minmax(0,1fr); gap: 24px; } }
@media(max-width: 720px) {
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .brand-name { display: inline; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; padding-top: 5px; }
  #reader-tools { margin-left: auto; }
  .btn-refresh { padding: 6px 8px; }
  #main { padding: 28px 18px 40px; }
  .page-heading h1 { font-size: 25px; }
  .reading-layout { display: block; }
  .reading-toc { position: static; max-height: 160px; overflow-y: auto; padding: 12px 0; border-bottom: 1px solid var(--border-strong); }
  .unit-heading h2 { font-size: 21px; }
  .unit-heading { gap: 9px; }
  .home-change { gap: 13px; }
  .change-title { font-size: 18px; }
  .resume-card { padding: 18px; }
  .paper-row-top { flex-wrap: wrap; gap: 8px; }
  .paper-title { flex-basis: calc(100% - 65px); }
  .settings-panel { right: -60px; }
}

/* Semantic reading hierarchy: color always paired with text, shape and placement. */
:root { --read-green: #246b58; --read-green-bg: #edf6f1; --update-amber: #85500d; --update-bg: #fff4df; --viewed-blue: #466178; --viewed-bg: #edf3f8; }
.reading-status { border: 1px solid #d5d9e6; border-radius: 999px; padding: 2px 9px; background: #f2f3fb; color: #4351ab; font-weight: 600; }
.status-unread::before { width: 6px; height: 6px; }
.status-viewed { background: var(--viewed-bg); color: var(--viewed-blue); border-color: #cedde9; }
.status-viewed::before { content: '◐'; }
.status-read { background: var(--read-green-bg); color: var(--read-green); border-color: #c5dfd3; }
.status-updated { background: var(--update-bg); color: var(--update-amber); border-color: #e9ce96; }
.status-updated::before { content: '↻'; }
.paper-row { background: #fff; border: 1px solid #dedfe5; border-left: 3px solid #6d7bd0; border-radius: 12px; padding: 20px 23px; margin: 12px 0; }
.paper-row.was-viewed { border-left-color: #7896af; }
.paper-row.was-read { border-left-color: #5f9e87; background: #f6faf7; }
.paper-row.has-update { border-left-color: #bb832b; background: #fffcf5; }
.paper-context { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.paper-context .reading-status { margin-left: auto; }
.source-label { font-weight: 650; border-radius: 5px; padding: 3px 7px; background: #edf0f7; color: #415373; }
.source-label.src-arxiv { background: #f9efed; color: #923d34; }
.source-label.src-hf { background: #fff4dc; color: #76581c; }
.source-label.src-blog { background: #e9f3f2; color: #276b63; }
.source-label.src-hn { background: #fff0e5; color: #955026; }
.paper-date { color: #626a78; font-variant-numeric: tabular-nums; }
.paper-title { font-size: calc(var(--reader-font) + 2px); line-height: 1.6; font-weight: 650; }
.paper-summary { margin: 10px 0 0; font-size: var(--reader-font); line-height: 1.8; color: #46505d; }
.paper-summary strong,.reader-paragraph strong { font-weight: 650; color: #252f42; }
.paper-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.paper-footer .paper-meta { margin: 0; flex: 1 1 220px; align-items: center; gap: 12px; }
.paper-footer .reading-actions { margin: 0; }
.paper-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-label { border: 1px solid #dde3e6; border-radius: 999px; background: #f4f6f6; padding: 3px 8px; color: #53616d; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.tag-overflow { align-self: center; color: var(--muted); font-size: 11px; }
.paper-external { white-space: nowrap; font-weight: 600; }
.reading-actions .is-saved { color: #775218; border-color: #ddc591; background: #fff5df; }
.abstract-expansion { margin-top: 8px; }
.abstract-expansion > summary { color: var(--accent); font-weight: 600; }
.reading-filters { padding: 5px; width: fit-content; border: 1px solid #e1e3e9; border-radius: 10px; background: #f1f2f5; }
.reading-filters .selected { background: white; box-shadow: 0 1px 4px #23335118; font-weight: 650; }
.reading-unit { border-bottom: 1px solid #dfe3ea; }
.unit-number { border-radius: 6px; padding: 5px 7px; background: #edf0fa; color: #4351ab; }
.unit-heading { align-items: flex-start; }
.unit-heading .reading-status { margin-top: 5px; }
.reader-section { margin: 18px 0; padding: 15px 18px; border-left: 3px solid #aab4c5; border-radius: 0 8px 8px 0; background: #f3f5f8; }
.reader-section h3 { margin: 0 0 10px; }
.reader-section .reader-paragraph:last-child { margin-bottom: 0; }
.section-conclusion { background: #eff1fb; border-left-color: #6273c4; }
.section-conclusion h3 { color: #3e4da2; }
.section-evidence { background: #eff7f4; border-left-color: #53977f; }
.section-evidence h3 { color: #246b58; }
.section-limitations { background: #fff6e8; border-left-color: #ba8a3d; }
.section-limitations h3 { color: #85500d; }
.section-next_step { background: #edf5fb; border-left-color: #568ab3; }
.section-next_step h3 { color: #335f87; }
.evidence-list > summary { border: 1px solid #e0e5e9; border-radius: 7px; background: #f1f5f7; padding: 10px 12px; font-weight: 600; }
.evidence-list[open] { border: 0; padding-left: 0; }
.evidence-list .paper-row { padding: 16px 18px; }
.next-theme { display: block; margin: 18px 0 0 auto; color: var(--accent); border-color: #d9def0; }
.reading-layout { grid-template-columns: 230px minmax(0,740px); gap: 34px; }
.reading-toc { padding: 20px 0 10px; scrollbar-gutter: stable; }
.toc-link { display: grid; grid-template-columns: 23px minmax(0,1fr); gap: 5px 8px; -webkit-line-clamp: unset; overflow: visible; align-items: start; padding: 12px 10px; margin-top: 6px; border-radius: 0 7px 7px 0; font-size: 13px; line-height: 1.65; color: #4a5362; }
.toc-title { white-space: normal; overflow-wrap: anywhere; }
.toc-number { color: #697386; font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.toc-link .reading-status { grid-column: 2; width: fit-content; font-size: 10px; padding: 0 7px; }
.toc-link.current { border-left-width: 3px; background: #edf0fb; color: #364698; }
.toc-link.current .toc-title { font-weight: 650; }
.toc-link:hover { background: #f0f2f7; }
.reading-progress { padding: 8px 10px 14px; font-size: 12px; color: #566377; border-bottom: 1px solid #dfe3ea; }
.reading-progress progress { display: block; width: 100%; height: 5px; margin-top: 9px; appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: #e1e6ea; }
.reading-progress progress::-webkit-progress-bar { background: #e1e6ea; }
.reading-progress progress::-webkit-progress-value { background: #5f9e87; }
.reading-progress progress::-moz-progress-bar { background: #5f9e87; }
.home-change { border-radius: 10px; border: 1px solid #e0e3eb; background: white; padding: 22px; margin: 12px 0; align-items: flex-start; }
.home-change .unit-number { padding-top: 5px; }
.change-limit { border-left: 2px solid #c89847; padding-left: 10px; color: #75552b; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline: 3px solid #7a89d9; outline-offset: 3px; }
@media(max-width:850px) { .reading-layout { grid-template-columns: 200px minmax(0,1fr); gap: 22px; } }
@media(max-width:720px) {
  .reading-toc { max-height: 280px; }
  .paper-row { padding: 17px 15px; }
  .paper-title { flex-basis: 100%; }
  .paper-footer { align-items: flex-start; }
  .paper-footer .paper-meta { flex-basis: 100%; }
  .unit-heading { flex-wrap: wrap; }
  .unit-heading h2 { flex-basis: calc(100% - 50px); }
  .unit-heading .reading-status { margin-left: 41px; margin-top: 0; }
  .reader-section { padding: 14px; }
  .home-change { padding: 18px 15px; }
}
.reset-filters { margin-left: 10px; color: var(--accent); padding: 3px 8px; }
.addition-label { color: #4351ab; background: #eef0fb; border-radius: 4px; padding: 2px 6px; }
.paper-summary[hidden] { display: none; }

/* Larger muted color fields improve scanning without vivid or competing hues. */
:root { --read-green-bg: #e5f0e9; --viewed-bg: #e7edf4; --update-bg: #f5ead7; }
.paper-row { background: #f0f1f8; border-color: #d4d8e7; border-left-width: 4px; }
.paper-row.was-viewed { background: #eaf0f5; border-color: #cfdae4; border-left-color: #7891a7; }
.paper-row.was-read { background: #e8f1ec; border-color: #cddfd4; border-left-color: #719c87; }
.paper-row.has-update { background: #f7eddd; border-color: #e5d6b9; border-left-color: #b99150; }
.paper-row .source-label { background: #ffffffa8; border: 1px solid #ffffffb0; }
.paper-context { padding-bottom: 11px; border-bottom: 1px solid #7182a21c; }
.paper-footer { padding-top: 13px; border-top: 1px solid #7182a21c; }
.topic-label { background: #ffffff80; border-color: #ffffffb0; color: #4b5969; }
.reading-actions .quiet-button { background: #ffffff80; border-color: #b8c2d250; }
.reading-actions .quiet-button:hover { background: #ffffffdc; }
.reading-actions .is-favorite { background: #efe2c4; border-color: #d8bc7c; color: #735421; font-weight: 600; }
.reading-actions .is-saved { background: #e7edf7; border-color: #b9c9e2; color: #435a83; }
.favorite-unit { background: #eeedf6; border-left-color: #8c80ae; }
.favorite-results { max-width: 800px; }
.favorite-missing .page-meta { overflow-wrap: anywhere; }
.reading-unit { margin: 18px 0 26px; padding: 28px; background: #f0f2f8; border: 1px solid #dce1ed; border-radius: 12px; }
.reading-unit.was-viewed { background: #edf2f6; border-color: #d4dfe9; }
.reading-unit.was-read { background: #edf4ef; border-color: #d1e2d7; }
.reading-unit.has-update { background: #f8f0e3; border-color: #e7d8bc; }
.unit-heading { padding-bottom: 17px; border-bottom: 1px solid #7182a222; }
.reader-section { background: #ffffff80; }
.section-conclusion { background: #e4e8f5; }
.section-evidence { background: #e0eee7; }
.section-limitations { background: #f3e7d3; }
.section-next_step { background: #ddebf4; }
.home-change { background: #eceef7; border-color: #d8ddeb; }
.home-change.was-viewed { background: #eaf0f5; }
.home-change.was-read { background: #e8f1ec; }
.home-change.has-update { background: #f7eddd; }
mark.kw { background: #dfe7f1; color: #2e4b6b; font-weight: 600; border-radius: 3px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.paper-summary mark.kw,.reader-paragraph mark.kw,.change-summary mark.kw { background: #d8e3ef; border-bottom: 1px solid #a7bbd0; }
@media(max-width:720px) {
  .reading-unit { padding: 20px 16px; margin: 15px 0 22px; }
  .reading-actions { gap: 6px; }
  .reading-actions .quiet-button { padding: 7px 9px; }
}
