:root {
  --paper: #f4f1e8;
  --paper-2: #fbf9f3;
  --ink: #1b1c1e;
  --muted: #6b685f;
  --line: #d8d1c2;
  --line-strong: #b9b09d;
  --accent: #a8432a;
  --accent-soft: #f0ddd4;
  --jade: #2d6a52;
  --jade-soft: #dce8df;
  --gold: #8a6a22;
  --gold-soft: #efe5c9;
  --slate-soft: #e4e1d8;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --shadow: 0 1px 0 rgba(27, 28, 30, 0.04), 0 12px 32px -18px rgba(27, 28, 30, 0.28);
  --radius: 4px;
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141517;
    --paper-2: #1a1c1f;
    --ink: #e9e4d8;
    --muted: #a09c90;
    --line: #34362f;
    --line-strong: #4a4c43;
    --accent: #d97a5b;
    --accent-soft: #3a221b;
    --jade: #7cbf9f;
    --jade-soft: #1d2b24;
    --gold: #d5b25f;
    --gold-soft: #302818;
    --slate-soft: #24262a;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(168, 67, 42, 0.07), transparent 60%),
    linear-gradient(180deg, var(--paper-2), var(--paper) 320px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

code, .mono { font-family: var(--mono); font-size: 0.9em; }

.topbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper-2);
  font-family: var(--serif); font-size: 22px;
  border-radius: 2px;
}

.brand-text { font-family: var(--serif); font-size: 16px; letter-spacing: 0.04em; line-height: 1.2; }
.brand-text small {
  display: block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.18em; color: var(--muted); margin-top: 4px;
}

.modes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

main { max-width: var(--max); margin: 0 auto; padding: 0 28px 72px; }

.hero { padding: 74px 0 44px; max-width: 900px; }

.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 20px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.6vw, 4.35rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  border-bottom: 0.09em solid var(--accent);
  padding-bottom: 0.04em;
}

.lede { font-size: 17.5px; max-width: 680px; color: var(--muted); margin: 0 0 30px; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  font-size: 13px; color: var(--muted);
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

.notice {
  border: 1px solid var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin: 0 0 28px;
}

.notice::before {
  content: "MOCK / 限制";
  display: inline-block;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  border: 1px solid var(--gold); padding: 1px 6px; margin-right: 10px;
  vertical-align: 1px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  margin: 0 0 66px;
}

.stat {
  padding: 20px 18px 17px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}

.stat-value {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.stat-label { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; letter-spacing: 0.04em; }

section { margin-bottom: 68px; scroll-margin-top: 24px; }

.section-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 420px);
  align-items: baseline;
  gap: 14px;
  border-top: 1px solid var(--line-strong);
  padding-top: 14px;
  margin-bottom: 28px;
}

.section-no { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.12em; }
.section-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; letter-spacing: 0.01em; }
.section-head p { margin: 0; font-size: 13px; color: var(--muted); }

.chain-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
  border-left: 1px solid var(--line);
}

.chain-list li { padding: 16px 16px 16px 18px; border-right: 1px solid var(--line); }
.chain-list li::before {
  content: counter(list-item, decimal-leading-zero);
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  display: block; margin-bottom: 18px;
}
.chain-list li span {
  display: block; font-family: var(--serif); font-size: 17px; font-weight: 600;
  border-top: 2px solid var(--accent); padding-top: 8px; margin-bottom: 8px;
}
.chain-list li p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 10px;
  width: 1px; background: var(--line-strong);
}

.round {
  position: relative;
  padding: 0 0 34px 0;
}
.round::before {
  content: ""; position: absolute; left: -27px; top: 8px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
}
.round:last-child { padding-bottom: 4px; }

.round-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.round-no { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.round-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }

.round h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0 0 8px; line-height: 1.4; }
.round h3 a { text-decoration: none; }
.round h3 a:hover { color: var(--accent); }
.round-summary { margin: 0 0 12px; font-size: 14.5px; color: var(--muted); max-width: 820px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px;
}
.round-link { font-size: 12.5px; color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.round-link:hover { border-bottom-color: var(--accent); }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}
.pill.ok { color: var(--jade); background: var(--jade-soft); }
.pill.warn { color: var(--gold); background: var(--gold-soft); }
.pill.bad { color: var(--accent); background: var(--accent-soft); }
.pill.mute { color: var(--muted); background: var(--slate-soft); }
.pill.dark { color: var(--paper-2); background: var(--ink); border-color: var(--ink); }

.table-wrap { overflow-x: auto; border-top: 1px solid var(--line-strong); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
td.id { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; color: var(--accent); }
td.note { color: var(--muted); font-size: 12.5px; }

.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.skill {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-2) 55%, transparent);
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.skill-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.skill h3 { font-family: var(--serif); font-size: 17px; margin: 0; font-weight: 600; }
.skill .desc { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); min-height: 40px; }
.skill .sched { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 46px; }

.issue-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.issue-list li { border-bottom: 1px solid var(--line); padding: 14px 0; }
.issue-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.issue-top .id { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
.issue-title { font-size: 14px; font-weight: 600; }
.issue-solution { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

.audit table { font-size: 12.5px; }
.audit td.time { font-family: var(--mono); font-size: 11px; white-space: nowrap; color: var(--muted); }

.loading, .empty { color: var(--muted); font-size: 13px; font-style: italic; }
.error-box {
  border: 1px solid var(--accent); color: var(--accent);
  padding: 16px; border-radius: var(--radius); font-size: 13px;
}

footer {
  border-top: 1px solid var(--line-strong);
  max-width: var(--max); margin: 0 auto; padding: 22px 28px 40px;
  font-size: 12px; color: var(--muted);
}
footer p { margin: 0 0 4px; }
.footer-note { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; }

/* round detail */
.article-head { padding: 54px 0 26px; border-bottom: 1px solid var(--line-strong); margin-bottom: 34px; }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.25; margin: 8px 0 16px; font-weight: 600; }
.back { font-family: var(--mono); font-size: 11px; color: var(--muted); text-decoration: none; letter-spacing: 0.06em; }
.back:hover { color: var(--accent); }
.article { max-width: 820px; }
.article h2 { font-family: var(--serif); font-size: 24px; margin: 38px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }
.article h3 { font-family: var(--serif); font-size: 18px; margin: 26px 0 8px; }
.article p { margin: 0 0 13px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article blockquote { margin: 0 0 16px; padding: 6px 0 6px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.article pre {
  background: var(--ink); color: var(--paper-2);
  padding: 14px 16px; overflow-x: auto; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
.article code { background: var(--slate-soft); padding: 1px 5px; border-radius: 2px; }
.article pre code { background: none; padding: 0; }
.article table { margin: 0 0 18px; min-width: 520px; }
.article a { color: var(--accent); }

@media (max-width: 900px) {
  .section-head { grid-template-columns: 34px 1fr; }
  .section-head p { grid-column: 2; }
  .chain-list { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 52px; }
  .hero { padding-top: 48px; }
}

@media (max-width: 620px) {
  .topbar { padding: 16px; align-items: flex-start; flex-direction: column; }
  main { padding: 0 16px 56px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .chain-list { grid-template-columns: 1fr; }
  .timeline { padding-left: 22px; }
  .round::before { left: -21px; }
  footer { padding: 18px 16px 32px; }
  .hero-meta { display: block; }
  .hero-meta span { display: block; margin-bottom: 6px; }
}
