/* 大模型视觉 — 项目落地实践（家电包装过程监控）
   版式：深色通栏封面 + 顶部吸附导航 + 居中单栏，杂志式技术长文
   配色：暖灰纸底 + 墨黑 + 琥珀点缀（取自现场泡沫件的暖橙） */

:root {
  --bg: #f6f4f1;
  --surface: #fff;
  --surface-2: #fbfaf8;
  --ink: #14110e;
  --ink-2: #514a42;
  --muted: #8c8378;
  --line: #e6e1da;
  --line-2: #d3ccc2;
  --accent: #c2410c;
  --accent-2: #ea7317;
  --accent-soft: #fdf1e7;
  --dark: #171310;
  --ok: #15803d;
  --ng: #b42318;

  --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;

  /* 正文、图版、表格、视频全部对齐到同一栏宽，不留出挑 */
  --col: 800px;
  --wide: 800px;
  --bar: 52px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 24px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

#progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  background: var(--accent-2);
  z-index: 80;
  transition: width .1s linear;
}

/* ── 顶部吸附导航 ───────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(246, 244, 241, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.topbar .brand span {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.topbar nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav ol {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topbar nav a {
  display: block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.topbar nav a:hover { background: var(--line); color: var(--ink); }
.topbar nav a.here { background: var(--ink); color: #fff; }

.topbar .lang {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.topbar .lang:hover { color: var(--accent); border-color: var(--accent); }

/* ── 深色通栏封面 ───────────────────────────────── */
.hero {
  position: relative;
  background: var(--dark);
  color: #fff;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 50% 42%;
  opacity: .3;
  filter: saturate(.7);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(23,19,16,.96) 30%, rgba(23,19,16,.62) 100%);
}
.hero-in {
  position: relative;
  z-index: 1;
  max-width: calc(var(--col) + 48px);   /* 和正文左右边界对齐 */
  margin: 0 auto;
  padding: 88px 24px 76px;
}

.eyebrow {
  margin: 0 0 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
}
.hero h1 .nb { color: var(--accent-2); }

.hero .lead {
  margin: 26px 0 0;
  font-size: 17px;
  line-height: 1.8;
  color: #cfc7bd;
}
.hero .lead em {
  font-style: normal;
  color: #fff;
}

.hero .by {
  margin: 34px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13px;
  color: #9d948a;
}
.hero .by b { color: #fff; font-weight: 600; }

/* ── 正文容器 ───────────────────────────────────── */
main {
  max-width: calc(var(--col) + 48px);
  margin: 0 auto;
  padding: 0 24px 96px;
  display: flow-root;   /* 让要点卡的负边距能压到封面上，而不是被外边距合并吃掉 */
}

/* 要点卡 */
.brief {
  max-width: var(--col);
  margin: -86px auto 76px;
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px;
  padding: 30px 34px 26px;
  box-shadow: 0 18px 40px -24px rgba(20,17,14,.4);
}
.brief h2 {
  margin: 0 0 16px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.brief ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: b;
}
.brief li {
  counter-increment: b;
  position: relative;
  padding-left: 34px;
  margin-bottom: 13px;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--ink-2);
}
.brief li:last-child { margin-bottom: 0; }
.brief li::before {
  content: counter(b, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .1em;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
}
.brief b { color: var(--ink); font-weight: 600; }

/* ── 章节 ───────────────────────────────────────── */
section { margin: 0 0 76px; }

.sec-hd {
  max-width: var(--col);
  margin: 0 auto 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.sec-hd .no {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--line-2);
  flex: none;
}
.sec-hd h2 {
  margin: 0;
  font-size: clamp(21px, 2.7vw, 27px);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.005em;
}
.sec-hd .tag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

h3 {
  margin: 40px auto 14px;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--ink);
}
h3::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 10px;
  transform: translateY(-2px);
}

p { margin: 0 0 18px; color: var(--ink-2); }
p.lede {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
}
p b, li b { color: var(--ink); font-weight: 600; }

main ol, main ul { margin: 0 0 20px; padding-left: 1.35em; color: var(--ink-2); }
main li { margin-bottom: 9px; }

/* ── 图版 ───────────────────────────────────────── */
figure {
  max-width: var(--wide);
  margin: 30px auto 34px;
}
figure img, figure video {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
figure img { cursor: zoom-in; }
figcaption {
  max-width: var(--col);
  margin: 12px auto 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}
figcaption .fno {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
figcaption b { color: var(--ink-2); font-weight: 600; }

.chaps {
  max-width: var(--col);
  margin: 12px auto 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chaps button {
  font: inherit;
  font-size: 12.5px;
  font-family: var(--mono);
  padding: 4px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.chaps button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── 引块 ───────────────────────────────────────── */
.pull {
  max-width: var(--col);
  margin: 28px auto;
  padding: 22px 26px;
  background: var(--dark);
  color: #ddd5cb;
  border-radius: 4px;
  font-size: 15.5px;
  line-height: 1.78;
}
.pull p { color: inherit; margin-bottom: 14px; }
.pull p:last-child { margin-bottom: 0; }
.pull b { color: #fff; }

.pull.plain {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
}
.pull.plain b { color: var(--ink); }

/* ── 表格 ───────────────────────────────────────── */
.tbl {
  max-width: var(--wide);
  margin: 26px auto 30px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
thead th {
  padding: 12px 18px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
tbody td {
  padding: 13px 18px;
  vertical-align: top;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  line-height: 1.65;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tbody td:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
td.num { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
td.ok { color: var(--ok); font-weight: 600; }
td.ng { color: var(--ng); font-weight: 600; }

/* ── 落款 ───────────────────────────────────────── */
.colophon {
  max-width: var(--col);
  margin: 84px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--line-2);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 26px;
}
.sig {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.colophon .who {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.colophon p { font-size: 14.5px; line-height: 1.75; margin-bottom: 12px; }
.colophon p:last-child { margin-bottom: 0; }

/* ── 点击放大 ───────────────────────────────────── */
#lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 3vh 3vw;
  background: rgba(20, 17, 14, .93);
  cursor: zoom-out;
}
#lb.on { display: grid; }
#lb img {
  max-width: 100%;
  max-height: 84vh;
  border-radius: 4px;
  background: #fff;
}
#lb p {
  margin: 14px auto 0;
  max-width: 66ch;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.65;
  color: #b8b0a6;
}

/* ── 响应式 ─────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-in { padding: 60px 20px 54px; }
  main { padding: 0 20px 72px; }
  .brief { margin-top: -28px; padding: 24px 22px 20px; }
  .sec-hd { flex-wrap: wrap; gap: 10px; }
  .sec-hd .tag { margin-left: 0; width: 100%; }
  .colophon { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar .brand span { display: none; }
  .sec-hd .no { font-size: 26px; }
  .pull { padding: 18px 18px; }
  thead th, tbody td { padding: 10px 12px; }
}

@media print {
  .topbar, .chaps, #progress, #lb { display: none !important; }
  .hero { background: #fff; color: #000; }
  .hero::before, .hero::after { display: none; }
  .hero h1, .hero .lead em { color: #000; }
  .hero .lead, .hero .by { color: #444; }
  .pull { background: #f4f4f4; color: #000; }
  section { break-inside: avoid; }
}
