:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #0d1322;
  --panel: rgba(15, 23, 42, 0.76);
  --panel-strong: rgba(20, 30, 52, 0.92);
  --text: #eef4ff;
  --muted: #9aa9bf;
  --faint: #64748b;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #78dbff;
  --accent-2: #a78bfa;
  --good: #69f0ae;
  --warn: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.72;
}
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 8% 0%, rgba(120, 219, 255, 0.20), transparent 32rem),
    radial-gradient(circle at 92% 10%, rgba(167, 139, 250, 0.18), transparent 28rem),
    linear-gradient(180deg, #070a12 0%, #0b1020 48%, #070a12 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #b8edff; text-decoration: underline; }
code, pre { font-family: var(--mono); }
.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06101b; font-weight: 900; box-shadow: 0 14px 40px rgba(120, 219, 255, 0.22);
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
  color: var(--muted); padding: 8px 12px; border: 1px solid transparent; border-radius: 999px;
}
.nav a:hover { color: var(--text); border-color: var(--line); text-decoration: none; background: rgba(255,255,255,0.04); }
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto 80px; }
.hero, .page-title, .panel, .paper-article, .source-details {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.58));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero { padding: clamp(28px, 6vw, 68px); overflow: hidden; position: relative; }
.hero::after {
  content: ""; position: absolute; width: 280px; height: 280px; right: -100px; top: -80px;
  background: radial-gradient(circle, rgba(120, 219, 255, 0.22), transparent 68%); pointer-events: none;
}
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
h1, h2, h3 { line-height: 1.22; letter-spacing: -0.02em; }
h1 { margin: 0; font-size: clamp(36px, 8vw, 72px); }
h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); }
h3 { margin: 0 0 12px; font-size: 21px; }
.hero-text, .page-title p, .section-head p, .card p, .article-summary { color: var(--muted); }
.hero-text { max-width: 760px; font-size: 18px; }
.hero-actions, .chip-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,0.04); font-weight: 700;
}
.button:hover { text-decoration: none; border-color: rgba(120,219,255,.5); transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07111d; border: 0; }
.button.ghost { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 34px; }
.stat-card { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,0.04); }
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 24px; margin-top: 4px; }
.section, .panel { margin-top: 28px; }
.panel, .page-title { padding: clamp(22px, 4vw, 34px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cards-grid.single { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.card {
  border: 1px solid var(--line); border-radius: 22px; padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.035));
  box-shadow: 0 14px 50px rgba(0,0,0,.22);
}
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.pill, .mini-chip {
  display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(120, 219, 255, 0.08); color: #c9f3ff; font-size: 12px; font-weight: 700;
}
.mini-chip { color: var(--muted); background: rgba(255,255,255,.04); }
.link-chip:hover { color: var(--text); text-decoration: none; border-color: rgba(120,219,255,.45); }
.card h3 a { color: var(--text); }
.card .button { margin-top: 14px; }
.timeline-list { display: grid; gap: 10px; }
.date-group + .date-group { margin-top: 24px; }
.date-group h3 { color: var(--muted); font-size: 16px; margin: 0 0 10px; }
.timeline-item {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); color: var(--text);
}
.timeline-item:hover { text-decoration: none; background: rgba(120,219,255,.07); border-color: rgba(120,219,255,.35); }
.timeline-date, .timeline-count, .timeline-main small { color: var(--muted); }
.timeline-main { min-width: 0; }
.timeline-main strong, .timeline-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-count { white-space: nowrap; font-size: 13px; }
.page-title { margin-bottom: 28px; }
.article-shell { max-width: 900px; margin: 0 auto; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); margin: 10px 0 18px; font-size: 14px; }
.paper-article { overflow: hidden; }
.article-header { padding: clamp(24px, 5vw, 44px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.article-header h1 { font-size: clamp(30px, 6vw, 54px); }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); margin: 18px 0; }
.digest-body { padding: clamp(22px, 5vw, 44px); font-size: 17px; }
.digest-body h2, .digest-body h3, .digest-body h4 { margin: 26px 0 12px; }
.digest-body h2 { font-size: 28px; }
.digest-body p { margin: 0; }
.digest-body .md-gap { height: 12px; }
.digest-body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.md-line.indent { padding-left: 1.1rem; }
.md-line.paper-line { margin-top: 18px; font-size: 19px; }
.md-line.callout { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.065); }
.md-line.idea-line { border-left: 3px solid var(--warn); }
.md-line.fit-line { border-left: 3px solid var(--good); }
.md-line.link-line { border-left: 3px solid var(--accent); }
.quote-line, blockquote { color: var(--muted); border-left: 3px solid var(--accent-2); padding-left: 12px; }
.digest-body strong { color: #fff; }
.digest-body em { color: #c7d2fe; }
.digest-body code { padding: .15em .35em; background: rgba(255,255,255,.08); border-radius: 6px; color: #dbeafe; }
pre { overflow-x: auto; padding: 16px; border-radius: 16px; background: #050816; border: 1px solid var(--line); }
.source-details { margin-top: 18px; padding: 18px 22px; color: var(--muted); }
.source-details summary { cursor: pointer; color: var(--text); font-weight: 800; }
dl { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 8px 14px; }
dt { color: var(--faint); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.empty { color: var(--muted); padding: 20px; border: 1px dashed var(--line); border-radius: 18px; }
.footer {
  width: min(1180px, calc(100% - 32px)); margin: 0 auto 28px; color: var(--faint);
  display: flex; justify-content: space-between; gap: 12px; font-size: 13px;
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-main strong, .timeline-main small { white-space: normal; }
  .digest-body { font-size: 16px; }
  .md-line.indent { padding-left: .4rem; }
  .footer { flex-direction: column; }
  dl { grid-template-columns: 1fr; }
  .prev-next { flex-direction: column; }
}
@media (max-width: 430px) {
  .page, .topbar, .footer { width: min(100% - 20px, 1180px); }
  .hero, .page-title, .panel, .article-header, .digest-body { border-radius: 18px; }
  .stats-grid { grid-template-columns: 1fr; }
}
