/* 大模型视觉 — 项目落地实践（装配过程监控）
   版式：左侧固定索引栏 + 宽内容区，技术文档路线
   配色：冷灰蓝底 + 白面 + 靛蓝点缀，全字体走无衬线，数字用等宽 */

:root {
  --bg: #eef1f5;
  --surface: #fff;
  --surface-2: #f7f9fc;
  --ink: #101828;
  --ink-2: #475467;
  --muted: #8a94a6;
  --line: #e3e8ef;
  --line-2: #cfd6e0;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --ok: #15803d;
  --ng: #b42318;
  --warn: #b54708;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --rail: 232px;
  --gap: 56px;
  /* 正文、图版、表格全部对齐到同一栏宽，避免图比字宽出一截 */
  --content: 800px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  /* 冷灰底上压一层极淡的工程纸网格 */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(16, 24, 40, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, .022) 1px, transparent 1px);
  background-size: 32px 32px;
}

#progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width .1s linear;
}

/* ── 骨架 ───────────────────────────────── */
.shell {
  max-width: calc(var(--rail) + var(--gap) + var(--content));
  margin: 0 auto;
  padding: 0 32px 96px;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: start;
}

/* ── 左侧索引栏 ─────────────────────────── */
.rail {
  position: sticky;
  top: 0;
  padding: 40px 0;
  grid-row: 1 / span 2;
}
.rail-brand {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 .35rem;
}
.rail-sub {
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
  letter-spacing: .04em;
}
.rail ol {
  list-style: none;
  margin: 0;
  padding: 0 0 1.4rem;
  border-top: 1px solid var(--line-2);
  padding-top: 1rem;
}
.rail li { margin: 0; }
.rail ol a {
  display: grid;
  grid-template-columns: 1.9rem 1fr;
  align-items: baseline;
  gap: .15rem;
  padding: .34rem 0;
  font-size: .82rem;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: .7rem;
  margin-left: -.7rem;
  transition: color .15s, border-color .15s;
}
.rail ol a i {
  font-style: normal;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
}
.rail ol a:hover { color: var(--ink); }
.rail ol a.here { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.rail ol a.here i { color: var(--accent); }
.rail-foot {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.65;
  border-top: 1px solid var(--line-2);
  padding-top: 1rem;
}
.rail-foot a { color: var(--accent); text-decoration: none; }
.rail-foot a:hover { text-decoration: underline; }

/* ── 报头 ───────────────────────────────── */
.mast {
  grid-column: 2;
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 40px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dfe3ff;
  padding: .28rem .7rem;
  border-radius: 3px;
  margin: 0 0 1.3rem;
}
h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  line-height: 1.22;
  letter-spacing: -.022em;
  font-weight: 750;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.nb { white-space: nowrap; }
.subtitle {
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--ink-2);
  margin: 0 0 1.6rem;
}
.subtitle em { font-style: normal; color: var(--ink); font-weight: 600; }
.byline {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
}
.byline b { color: var(--ink); font-weight: 600; }
.byline a { color: var(--accent); text-decoration: none; }
.byline a:hover { text-decoration: underline; }

/* ── 主体 ───────────────────────────────── */
.col { grid-column: 2; min-width: 0; }

section { margin: 0 0 4.5rem; scroll-margin-top: 2rem; }

.sec-no {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .6rem;
}
.sec-no b {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  padding: .18rem .48rem;
  border-radius: 3px;
  letter-spacing: .02em;
}
.sec-no span {
  font-size: .705rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.sec-no.alt b { background: var(--accent); }

h2 {
  font-size: 1.62rem;
  line-height: 1.35;
  letter-spacing: -.018em;
  font-weight: 700;
  margin: 0 0 1.2rem;
}
h3 {
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 700;
  margin: 2.6rem 0 .8rem;
  padding-left: .7rem;
  border-left: 3px solid var(--accent);
}

p { margin: 0 0 1.1rem; }
.lede { font-size: 1.08rem; color: var(--ink-2); }
b, strong { font-weight: 650; color: var(--ink); }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--accent); }
a { color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: .87em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: .06em .34em;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── 摘要板 ─────────────────────────────── */
.brief {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  padding: 1.5rem 1.7rem .5rem;
  margin: 0 0 2.4rem;
}
.brief h2 {
  font-size: .72rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.brief ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: b;
  max-width: none;
}
.brief li {
  counter-increment: b;
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 1rem;
  font-size: .95rem;
  line-height: 1.72;
  color: var(--ink-2);
}
.brief li::before {
  content: counter(b, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .12rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .1rem .34rem;
  border-radius: 3px;
}

/* ── 关键矛盾 / 小结 ────────────────────── */
.pull {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 1.2rem 1.5rem;
  margin: 1.9rem 0;
}
.pull::before {
  content: "关键矛盾";
  display: block;
  font-size: .66rem;
  letter-spacing: .19em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .5rem;
}
.pull.plain { border-left-color: var(--line-2); background: var(--surface-2); }
.pull.plain::before { content: "小结"; color: var(--muted); }
.pull p { margin: 0; max-width: none; font-size: .97rem; }
.pull p + p { margin-top: .6rem; }

/* ── 图版 ───────────────────────────────── */
figure { margin: 2rem 0; }
figure img, figure video {
  width: 100%;
  display: block;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
}
figure img { cursor: zoom-in; }
figcaption {
  font-size: .805rem;
  line-height: 1.68;
  color: var(--ink-2);
  margin: .75rem 0 0;
  padding-left: .85rem;
  border-left: 2px solid var(--line-2);
}
figcaption b { color: var(--ink); font-weight: 650; }
.fno {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--accent);
  font-weight: 700;
  margin-right: .55em;
  white-space: nowrap;
}

/* ── 视频章节 ───────────────────────────── */
.chaps {
  list-style: none;
  padding: 0;
  margin: .7rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  max-width: none;
}
.chaps li { margin: 0; }
.chaps button {
  font: inherit;
  font-size: .74rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: .3rem .62rem;
  border-radius: 3px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.chaps button:hover { color: var(--accent); border-color: var(--accent); }
.chaps b { font-family: var(--mono); font-size: .95em; color: var(--accent); margin-right: .4em; }

/* ── 工序链 ─────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  max-width: none;
}
.steps li {
  margin: 0;
  padding: .7rem .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
}
.steps li.edge { border-top-color: var(--ink); }
.steps em {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.steps b { display: block; font-size: .87rem; margin: .15rem 0 .1rem; }
.steps span { display: block; font-size: .72rem; color: var(--ink-2); line-height: 1.5; }

/* ── 能做 / 不做 ────────────────────────── */
.limits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
  margin: 1.6rem 0;
  max-width: none;
}
.limits > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ok);
  padding: .85rem 1rem 1rem;
}
.limits > div.mid { border-top-color: var(--warn); }
.limits > div.no { border-top-color: var(--ng); }
.limits h4 {
  margin: 0 0 .55rem;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.limits ul { margin: 0; padding-left: 1rem; max-width: none; }
.limits li { font-size: .8rem; line-height: 1.6; margin-bottom: .32rem; color: var(--ink-2); }

/* ── 表格 ───────────────────────────────── */
.tbl {
  margin: 1.7rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .845rem;
  line-height: 1.62;
}
thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .05em;
  text-align: left;
  padding: .68rem .9rem;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
tbody td {
  padding: .66rem .9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fbfcfe; }
tbody td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
tbody td b { color: var(--ink); }
td.num { font-family: var(--mono); font-size: .82rem; white-space: nowrap; }
.ok { color: var(--ok); font-weight: 700; }
.ng { color: var(--ng); font-weight: 700; }

/* ── 落款 ───────────────────────────────── */
.colophon {
  grid-column: 2;
  margin-top: 1rem;
  padding: 1.7rem 0 0;
  border-top: 1px solid var(--line-2);
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.8rem;
  font-size: .855rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.sig {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  display: block;
}
.who { font-weight: 700; color: var(--ink); margin: 0 0 .4rem; font-size: .95rem; }
.colophon p { margin: 0 0 .75rem; }
.colophon p:last-child { margin: 0; }

/* ── 灯箱 ───────────────────────────────── */
#lb {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 24, .95);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1.5rem;
  cursor: zoom-out;
}
#lb.on { display: grid; }
#lb img { max-width: 100%; max-height: 88vh; object-fit: contain; }
#lb p {
  position: absolute;
  bottom: 1.1rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #aab3c2;
  font-size: .76rem;
  margin: 0;
  padding: 0 1.5rem;
}

/* ── 窄屏：索引栏收成顶部横条 ───────────── */
@media (max-width: 62rem) {
  .shell {
    display: block;
    padding: 0 20px 64px;
    max-width: 46rem;
  }
  .rail {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0;
    margin: 0 -20px;
    background: rgba(238, 241, 245, .95);
    backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--line-2);
  }
  .rail-brand, .rail-sub, .rail-foot { display: none; }
  .rail ol {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 0;
    padding: .5rem 20px;
    margin: 0;
  }
  .rail ol::-webkit-scrollbar { display: none; }
  .rail ol a {
    display: block;
    white-space: nowrap;
    padding: .1rem 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    margin: 0;
    font-size: .76rem;
  }
  .rail ol a i { display: none; }
  .rail ol a.here { border-left: 0; border-bottom-color: var(--accent); }
  .mast { padding-top: 32px; }
  figure { margin: 1.7rem -20px; }
  figure img, figure video { border-left: 0; border-right: 0; }
  figcaption { padding: 0 20px 0 calc(20px + .85rem); }
  .tbl { margin: 1.5rem -20px; border-left: 0; border-right: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .limits { grid-template-columns: 1fr; }
  .colophon { grid-template-columns: 1fr; gap: .7rem; }
}

/* ── 英文版适配 ─────────────────────────── */
html[lang="en"] {
  --content: 830px;
  --rail: 246px;
}
html[lang="en"] body { line-height: 1.72; }
html[lang="en"] h1 { letter-spacing: -.024em; font-weight: 700; }
html[lang="en"] .rail ol a { font-size: .785rem; line-height: 1.45; }
html[lang="en"] .rail ol a span { display: block; }
html[lang="en"] thead th,
html[lang="en"] tbody td:first-child { white-space: normal; }
html[lang="en"] .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[lang="en"] .pull::before { content: "THE CORE TENSION"; }
html[lang="en"] .pull.plain::before { content: "IN SHORT"; }
html[lang="en"] .brief h2 { letter-spacing: .15em; }

@media print {
  body { background: #fff; }
  .rail, #progress, #lb { display: none; }
  .shell { display: block; max-width: none; padding: 0; }
  figure { break-inside: avoid; }
}
