/* Scaling Law 入门站点共享样式 — 复刻 Agentic RL 入门页风格 + 左侧三级可折叠目录 */
:root {
  --primary: #111;
  --bg: #fff;
  --card: #fff;
  --text: #222;
  --muted: #666;
  --sbw: 240px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'STIX Two Text', 'Noto Serif SC', 'CMU Serif', 'Times New Roman', serif;
  background: var(--bg); color: var(--text); line-height:1.9; font-size:15px;
}
.main { margin:0 auto; max-width:760px; padding:48px 40px 120px; }

/* ===== 左侧三级可折叠目录（宽度/缩进与 RL for LLM 站点一致） ===== */
.toc-sidebar {
  position:fixed; left:0; top:0; width:var(--sbw); height:100vh;
  background:#fafafa; color:#222; overflow-y:auto;
  padding:24px 16px 60px; z-index:100; border-right:1px solid #ddd;
}
.toc-sidebar h2 { font-size:13px; margin-bottom:16px; letter-spacing:2px; text-transform:uppercase; color:#444; font-weight:700; }

/* ===== 三级可折叠目录（完全对齐 RL for LLM 参考站） ===== */
.toc-sidebar .nav-home { display:block; color:#111; font-weight:700; text-decoration:none; font-size:12.5px; padding:5px 8px; margin-bottom:10px; border-left:2px solid #000; background:#f0f0f0; }
.toc-sidebar details.l1 { margin:2px 0 6px; }
.toc-sidebar details.l1 > summary { cursor:pointer; font-size:11.5px; letter-spacing:1.5px; text-transform:uppercase; color:#333; font-weight:700; padding:6px 8px; list-style:none; user-select:none; border-radius:2px; }
.toc-sidebar details.l1 > summary::-webkit-details-marker { display:none; }
.toc-sidebar details.l1 > summary::before { content:"\25B8"; color:#999; margin-right:6px; font-size:10px; }
.toc-sidebar details.l1[open] > summary::before { content:"\25BE"; color:#111; }
.toc-sidebar details.l1 > summary:hover { background:#f0f0f0; }
.toc-sidebar .l1-body { padding:2px 0 4px 8px; }
.toc-sidebar .l2 > a { display:block; color:#555; text-decoration:none; padding:4px 8px 4px 14px; font-size:12.5px; margin:1px 0; border-left:2px solid transparent; }
.toc-sidebar .l2 > a:hover { border-left:2px solid #111; color:#111; background:#f0f0f0; }
.toc-sidebar .l2.current > a { color:#000; font-weight:700; border-left:2px solid #000; background:#f0f0f0; }
.toc-sidebar .l2 .num { color:#aaa; font-family:'SFMono-Regular','Consolas',monospace; font-size:10.5px; margin-right:5px; }
.toc-sidebar .l3 { padding:1px 0 3px 0; }
.toc-sidebar .l3 > a { display:block; color:#999; text-decoration:none; padding:2.5px 8px 2.5px 32px; font-size:11px; margin:0; border-left:2px solid transparent; }
.toc-sidebar .l3 > a:hover { color:#111; background:#f0f0f0; border-left:2px solid #000; }
.toc-sidebar .l3 .num { color:#ccc; font-family:'SFMono-Regular','Consolas',monospace; font-size:9.5px; margin-right:5px; }

@media(max-width:900px){
  .toc-sidebar { transform:translateX(-240px); }
}

/* ===== 正文组件 ===== */
.topnav {
  display:flex; flex-wrap:wrap; gap:4px 14px; align-items:baseline;
  border-bottom:2px solid #000; padding-bottom:10px; margin-bottom:36px;
}
.topnav .brand { font-size:11px; letter-spacing:2.5px; text-transform:uppercase; font-weight:700; color:#000; margin-right:auto; }
.topnav a { color:#555; text-decoration:none; font-size:12px; }
.topnav a:hover { color:#000; text-decoration:underline; text-underline-offset:3px; }
.topnav a.cur { color:#000; font-weight:700; border-bottom:1px solid #000; }

h1 { font-size:26px; color:#000; margin-bottom:6px; line-height:1.35; font-weight:700; }
.subtitle { color:#666; font-size:13px; margin-bottom:36px; }
h2 { font-size:19px; color:#000; margin:48px 0 14px; padding-bottom:6px; border-bottom:2px solid #000; font-weight:700; scroll-margin-top:20px; }
h3 { font-size:15.5px; color:#000; margin:28px 0 10px; font-weight:700; scroll-margin-top:20px; }
p { margin-bottom:12px; text-align:justify; }
ul, ol { margin: 0 0 12px 20px; }
li { margin-bottom: 4px; }

pre {
  background:#f7f7f7; border-left:2px solid #000; padding:14px 18px;
  margin:14px 0; overflow-x:auto; font-size:12.5px; line-height:1.7;
}
.formula, .formula-block {
  background:#f7f7f7; padding:14px 18px;
  margin:14px 0; font-family:'STIX Two Text','Courier New',monospace; font-size:13.5px;
  overflow-x:auto; border-left:2px solid #000;
}
code { font-family:'SFMono-Regular','Consolas','Liberation Mono',monospace; }
a { color:#111; text-decoration:underline; text-underline-offset:3px; }
.highlight { background:#f5f5f0; padding:14px 18px; margin:14px 0; border-left:3px solid #000; }

.trajectory-visual {
  margin:18px 0 30px; padding:16px 18px;
  background:#f7f7f7; border-left:3px solid #000;
}
.flow-row { display:grid; grid-template-columns:92px 1fr; gap:12px; align-items:center; margin:8px 0; }
.flow-label { font-weight:700; color:#000; font-size:13.5px; }
.flow-path { display:flex; flex-wrap:wrap; align-items:center; gap:7px; font-size:13px; line-height:1.55; }
.flow-path span { background:#fff; border:1px solid #ddd; padding:3px 7px; }
.flow-path i { font-style:normal; color:#777; }
.flow-row.agent .flow-path span { border-color:#aaa; }
.flow-note { margin-top:10px; color:#555; font-size:12.5px; line-height:1.55; }

.card-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0; }
.card { background:#f7f7f7; border-left:3px solid #000; padding:12px 14px; }
.card .ct { font-size:13px; font-weight:700; color:#000; margin-bottom:4px; }
.card .cd { font-size:12.5px; color:#444; line-height:1.6; }

.compare { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:14px 0; }
.compare-col { background:#f7f7f7; border-left:3px solid #000; padding:12px 14px; }
.compare-col .ch { font-size:12.5px; font-weight:700; color:#000; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid #ddd; }
.compare-col .ch.bad::before { content:"\2717\00a0\00a0"; }
.compare-col .ch.good::before { content:"\2713\00a0\00a0"; }
.compare-col .cl { font-size:12.5px; color:#444; line-height:1.65; }
.compare-col .cl .step { display:block; }
.compare-col .cl i { font-style:normal; color:#999; padding:0 2px; }
@media(max-width:900px){ .card-grid,.compare{ grid-template-columns:1fr; } }

.fig { margin:18px 0 26px; text-align:center; }
.fig img { max-width:100%; background:#fff; border:1px solid #ddd; padding:8px; }
.figcap { font-size:12px; color:#666; margin-top:6px; text-align:center; line-height:1.6; }

table.data { border-collapse:collapse; margin:14px 0; width:100%; font-size:12.5px; }
table.data th, table.data td { border:1px solid #ccc; padding:6px 10px; text-align:left; }
table.data th { background:#f0f0f0; font-weight:700; color:#000; }
table.data td { color:#333; }

.chap-nav { display:flex; justify-content:space-between; margin-top:64px; padding-top:14px; border-top:2px solid #000; font-size:13px; }
.chap-nav a { color:#333; text-decoration:none; }
.chap-nav a:hover { color:#000; text-decoration:underline; text-underline-offset:3px; }

html { scroll-behavior:smooth; }
@media(max-width:900px){
  .main { padding:24px 20px 80px; }
  .flow-row { grid-template-columns:1fr; gap:4px; }
}
