/* ==========================================================================
   科研图鉴 —— 设计系统
   纸感近白底 + 墨色文字，克制的分隔线，像一本印刷的图录而不是一个仪表盘。
   ========================================================================== */

:root {
  --paper:        #fbfaf7;
  --paper-2:      #f4f2ec;
  --paper-3:      #ece9e1;
  --card:         #ffffff;
  --ink:          #1a1a18;
  --ink-2:        #4a4843;
  --ink-3:        #78756d;
  --ink-4:        #a5a199;
  --rule:         #e2dfd6;
  --rule-soft:    #eeebe3;

  --accent:       #b4472e;   /* 朱砂 —— 只用于关键动作与当前状态 */
  --accent-soft:  #fbeee9;
  --accent-line:  #e6c4b8;
  --green:        #2f6f52;
  --green-soft:   #eaf2ed;

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 14px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
          "Source Han Sans SC", sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
           "Georgia", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --shadow-s: 0 1px 2px rgba(26, 26, 24, .05);
  --shadow-m: 0 2px 8px rgba(26, 26, 24, .06), 0 1px 2px rgba(26, 26, 24, .04);
  --shadow-l: 0 12px 32px rgba(26, 26, 24, .10), 0 2px 8px rgba(26, 26, 24, .05);

  --maxw: 1280px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- 页头 ---------- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251, 250, 247, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand__mark { color: var(--accent); display: grid; place-items: center; }
.brand__text {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .06em;
  font-weight: 600;
}
.masthead__nav { display: flex; gap: 22px; flex: none; }
.masthead__nav a {
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 4px 0;
  position: relative;
  transition: color .15s;
}
.masthead__nav a:hover { color: var(--ink); }
.masthead__nav a.is-active { color: var(--ink); }
.masthead__nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1.5px; background: var(--accent); border-radius: 1px;
}

.masthead__search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 0 10px 0 12px;
  height: 34px;
  width: 280px;
  transition: border-color .15s, background .15s, width .2s;
  color: var(--ink-4);
}
.masthead__search:focus-within {
  border-color: var(--accent-line);
  background: var(--card);
  width: 340px;
  color: var(--ink-2);
}
.masthead__search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font-size: 13.5px; color: var(--ink);
}
.masthead__search input::placeholder { color: var(--ink-4); }
.masthead__search kbd {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-4);
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 15px;
}
.masthead__search:focus-within kbd { display: none; }

/* ---------- 通用容器 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- 首屏 ---------- */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--rule); }
.hero__eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero__title {
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 20px;
  max-width: 20em;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-line);
  padding-bottom: 1px;
}
.hero__lede {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 40em;
  margin: 0 0 28px;
}
.hero__stats { display: flex; gap: 0; flex-wrap: wrap; }
.hero__stat {
  padding: 0 28px;
  border-left: 1px solid var(--rule);
}
.hero__stat:first-child { padding-left: 0; border-left: 0; }
.hero__stat b {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.hero__stat span {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
}

/* ---------- 筛选条 ---------- */
.filters {
  position: sticky; top: 60px; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.filters__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filters__label {
  font-size: 12px; color: var(--ink-4); letter-spacing: .06em;
  margin-right: 2px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip b { font-weight: 500; color: var(--ink-4); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.chip.is-on {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.chip.is-on b { color: rgba(255,255,255,.55); }
.chip--open { border-style: dashed; }
.chip--open.is-on { background: var(--green); border-color: var(--green); border-style: solid; }

.filters__sep { width: 1px; height: 20px; background: var(--rule); margin: 0 4px; }

select.fsel {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a5a199' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  border-radius: 20px;
  padding: 6px 30px 6px 13px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s;
}
select.fsel:hover { border-color: var(--ink-4); }
select.fsel.is-on { border-color: var(--accent-line); color: var(--accent); background-color: var(--accent-soft); }

/* ---------- 图鉴网格 ---------- */
.gallery { padding: 28px 0 80px; }
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin: 36px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.section-head:first-child { margin-top: 8px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .02em;
}
.section-head .count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-4);
}
.section-head .blurb {
  font-size: 13px; color: var(--ink-3); margin-left: auto; text-align: right;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 20px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
  cursor: pointer;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-l);
  border-color: var(--paper-3);
}
.card__fig {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #fff;
  overflow: hidden;
  border-bottom: 1px solid var(--rule-soft);
}
.card__fig img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  padding: 6px;
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
}
.card:hover .card__fig img { transform: scale(1.02); }
.card__fig .card__alt {
  position: absolute; inset: 0; display: none;
  padding: 6px;
}
.card__fig:hover .card__alt { display: block; background: #fff; }

.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__id {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-4);
  letter-spacing: .04em;
}
.card__title {
  font-size: 14.5px; font-weight: 600; line-height: 1.4;
  margin: 0; color: var(--ink);
}
.card__title-en {
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.35;
  letter-spacing: .01em;
  margin-top: -3px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__desc {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-3);
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.tag {
  font-size: 11px; line-height: 1;
  padding: 4px 7px;
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--ink-3);
  white-space: nowrap;
}
.tag--open {
  background: var(--green-soft); color: var(--green);
  font-weight: 500;
}
.tag--open::before { content: '▶ '; font-size: 8px; }

.empty {
  padding: 90px 0; text-align: center; color: var(--ink-3);
}
.empty b { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); margin-bottom: 8px; }

/* ---------- 详情页 ---------- */
.detail { padding: 32px 0 90px; }

.crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-4);
  margin-bottom: 22px;
}
.crumb a:hover { color: var(--accent); }
.crumb span { color: var(--ink-3); }

.dhead { display: flex; gap: 32px; align-items: flex-start; margin-bottom: 26px; }
.dhead__main { flex: 1; min-width: 0; }
.dhead__id {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  color: var(--accent); margin-bottom: 10px;
}
.dhead h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.25; font-weight: 600;
  margin: 0 0 12px;
}
.dhead__desc { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); margin: 0; max-width: 44em; }
.dhead__aside { flex: none; width: 210px; }
.kv { font-size: 12.5px; }
.kv__row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--rule); }
.kv__row:last-child { border-bottom: 0; }
.kv__k { color: var(--ink-4); flex: none; width: 62px; }
.kv__v { color: var(--ink-2); }

/* 播放器 */
.stage-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 24px;
  align-items: start;
}
.player-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-m);
}
.player-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.ptab {
  border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--ink-3);
  padding: 7px 13px;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: color .15s, background .15s;
}
.ptab:hover { color: var(--ink); background: var(--paper-2); }
.ptab.is-on { color: var(--ink); font-weight: 500; }
.ptab.is-on::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.ptab:disabled { opacity: .38; cursor: default; }
.ptab__sub { font-size: 10px; color: var(--ink-4); margin-left: 4px; }
.player-tabs__right { margin-left: auto; display: flex; gap: 6px; padding-bottom: 6px; }

.stage {
  position: relative;
  min-height: 320px;
  padding: 22px 26px 10px;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    repeating-linear-gradient(0deg, var(--rule-soft) 0 1px, transparent 1px 24px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.stage__fig { width: 100%; }
.stage__fig img { width: 100%; height: auto; display: block; }
.stage__badge {
  position: absolute; top: 12px; left: 16px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: .06em;
  pointer-events: none;
}
.stage__hint {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(251,250,247,.9);
  font-size: 13px; color: var(--ink-3);
}

/* 控制条 */
.controls {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper);
}
.btn-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s;
  color: var(--ink-2);
}
.btn-icon:hover { border-color: var(--ink-4); color: var(--ink); }
.btn-icon--play {
  width: 40px; height: 40px;
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.btn-icon--play:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.scrub {
  flex: 1; position: relative; height: 34px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
}
.scrub__track {
  position: absolute; left: 0; right: 0; height: 4px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}
.scrub__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: var(--accent);
  border-radius: 2px;
}
.scrub__ticks { position: absolute; left: 0; right: 0; height: 100%; pointer-events: none; }
.scrub__tick {
  position: absolute; top: 50%; width: 1px; height: 9px;
  margin-top: -4.5px;
  background: var(--paper-3);
}
.scrub__knob {
  position: absolute; width: 11px; height: 11px;
  border-radius: 50%; background: var(--card);
  border: 2px solid var(--accent);
  transform: translateX(-50%);
  left: 0;
  transition: transform .1s;
  pointer-events: none;
}
.scrub:hover .scrub__knob { transform: translateX(-50%) scale(1.15); }
.timecode {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  flex: none; min-width: 76px; text-align: right;
}

/* 阶段侧栏 */
.stages { display: flex; flex-direction: column; gap: 0; }
.stages__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.stages__head h3 {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500; margin: 0;
}
.stages__head button {
  border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--ink-3);
  padding: 0;
}
.stages__head button:hover { color: var(--accent); }

.stagelist { display: flex; flex-direction: column; position: relative; }
.stagelist::before {
  content: ''; position: absolute; left: 13px; top: 16px; bottom: 16px;
  width: 1px; background: var(--rule);
}
.stage-item {
  display: flex; gap: 12px;
  padding: 9px 10px 9px 0;
  cursor: pointer;
  border-radius: var(--radius-s);
  position: relative;
  transition: background .15s;
}
.stage-item:hover { background: var(--paper-2); }
.stage-item__dot {
  flex: none; width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-4);
  position: relative; z-index: 1;
  transition: all .2s;
}
.stage-item__body { min-width: 0; flex: 1; }
.stage-item__name {
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  line-height: 1.4;
  display: flex; align-items: baseline; gap: 6px;
}
.stage-item__name small {
  font-family: var(--mono); font-size: 10px; color: var(--ink-4); font-weight: 400;
}
.stage-item__note {
  font-size: 12px; line-height: 1.6; color: var(--ink-4);
  margin: 3px 0 0;
  display: none;
}
.stage-item.is-done .stage-item__dot {
  background: var(--paper-2); border-color: var(--paper-3); color: var(--ink-3);
}
.stage-item.is-on {
  background: var(--accent-soft);
}
.stage-item.is-on .stage-item__dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.stage-item.is-on .stage-item__name { color: var(--ink); font-weight: 600; }
.stage-item.is-on .stage-item__note { display: block; color: var(--ink-2); }

/* 版本下拉与读图要素高亮 */
.version-select {
  margin-left: 8px;
  height: 26px;
  max-width: 220px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 12px;
  padding: 0 24px 0 10px;
  cursor: pointer;
}
.version-select:hover { border-color: var(--ink-4); color: var(--ink); }

.readchips {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--paper);
}
.readchips__label {
  font-size: 11px; letter-spacing: .08em;
  color: var(--ink-4); margin-right: 2px;
}
.rchip {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  transition: all .15s;
}
.rchip:hover { border-color: var(--ink-4); color: var(--ink); }
.rchip.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
  font-weight: 500;
}

/* 高亮用类而不是内联透明度，避免覆盖播放器逐层写入的 opacity */
.hl-dim { opacity: .12 !important; }
.hl-target {
  stroke: var(--accent) !important;
  stroke-width: 2.4px !important;
}

.finalimg { padding: 18px; }
.finalimg img { width: 100%; height: auto; display: block; }

/* 数据文件面板 */
.data-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.datafile__head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.datafile__name {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.datafile__name:hover { border-color: var(--accent); color: var(--accent); }
.datafile__meta { font-size: 12px; color: var(--ink-4); }
.datafile__dl { margin-left: auto; font-size: 12px; color: var(--accent); }
.datafile__sub {
  font-size: 11px; letter-spacing: .08em; color: var(--ink-4);
  margin: 12px 0 6px;
}
.datatable {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.datatable th, .datatable td {
  text-align: left; padding: 6px 10px;
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
}
.datatable th {
  font-weight: 500; color: var(--ink-3);
  background: var(--paper-2);
}
.datatable td { color: var(--ink-2); }
.datatable tr:last-child td { border-bottom: 0; }

/* 信息面板 */
.panels { margin-top: 44px; }
.tabs {
  display: flex; gap: 26px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 26px;
}
.tab {
  border: 0; background: none; cursor: pointer;
  font-size: 14px; color: var(--ink-3);
  padding: 10px 0;
  position: relative;
  transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 500; }
.tab.is-on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px 40px;
}
.block h4 {
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 500;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.block p { font-size: 14px; line-height: 1.8; color: var(--ink-2); margin: 0 0 12px; }
.block ul { margin: 0; padding-left: 0; list-style: none; }
.block li {
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
  padding: 7px 0 7px 16px;
  position: relative;
  border-bottom: 1px dotted var(--rule-soft);
}
.block li::before {
  content: ''; position: absolute; left: 2px; top: 16px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-4);
}
.block li:last-child { border-bottom: 0; }

/* 源码 */
.code-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0;
}
.langtabs { display: flex; gap: 2px; background: var(--paper-2); padding: 3px; border-radius: 7px; }
.langtab {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; padding: 5px 14px; border-radius: 5px;
  color: var(--ink-3);
  transition: all .15s;
}
.langtab.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); font-weight: 500; }

.codebox {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: #fcfcfa;
  overflow: hidden;
}
.codebox__bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-2);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
}
.codebox__bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-3); }
.codebox__bar .copy {
  margin-left: auto; border: 1px solid var(--rule); background: var(--card);
  border-radius: 4px; padding: 2px 9px; cursor: pointer;
  font-family: var(--sans); font-size: 11.5px; color: var(--ink-2);
}
.codebox__bar .copy:hover { border-color: var(--ink-4); }
.codebox pre {
  margin: 0; padding: 16px 18px;
  max-height: 560px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  color: var(--ink-2);
  tab-size: 4;
}
.codebox code { font-family: inherit; }
.tok-kw  { color: #8c3b6b; }
.tok-str { color: #2f6f52; }
.tok-com { color: var(--ink-4); font-style: italic; }
.tok-num { color: #a35a1f; }
.tok-fn  { color: #2d5a8a; }

/* 提示词 */
.promptbox {
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--card);
  padding: 20px 22px;
  font-size: 13.5px; line-height: 1.85; color: var(--ink-2);
  max-height: 460px; overflow: auto;
  white-space: pre-wrap;
  font-family: var(--sans);
}

/* 相关案例 */
.related { margin-top: 44px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- 叙述页 ---------- */
.prose { max-width: 44em; }
.prose h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  margin: 44px 0 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); }
.prose blockquote {
  margin: 20px 0; padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent-line);
  color: var(--ink-3); font-family: var(--serif);
}
.prose code {
  font-family: var(--mono); font-size: .88em;
  background: var(--paper-2); padding: 1px 5px; border-radius: 3px;
}

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 36px 0; margin-top: 20px; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: flex; gap: 40px; align-items: flex-start;
}
.footer__brand { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.footer p { font-size: 12.5px; color: var(--ink-3); margin: 0; line-height: 1.7; max-width: 40em; }
.footer a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.footer a:hover { color: var(--accent); }
.footer__col--meta { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); text-align: right; line-height: 1.9; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .stage-wrap { grid-template-columns: 1fr; }
  .stages { order: 2; }
  .stage-item__note { display: block; color: var(--ink-4); }
  .dhead { flex-direction: column; gap: 20px; }
  .dhead__aside { width: 100%; }
  .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 24px; }
  .kv__row { border-bottom: 0; }
}
@media (max-width: 760px) {
  .masthead__inner { padding: 0 16px; gap: 14px; height: 54px; }
  .masthead__nav { display: none; }
  .masthead__search { width: 100%; }
  .masthead__search:focus-within { width: 100%; }
  .wrap, .filters__inner, .footer__inner { padding: 0 16px; }
  .hero { padding: 40px 0 28px; }
  .hero__stat { padding: 0 16px; }
  .hero__stat b { font-size: 21px; }
  .filters { top: 54px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card__body { padding: 10px; }
  .card__title { font-size: 13px; }
  .card__desc { display: none; }
  .stage { padding: 14px; min-height: 200px; }
  .section-head { flex-wrap: wrap; }
  .section-head .blurb { margin-left: 0; text-align: left; width: 100%; }
  .footer__inner { flex-direction: column; gap: 20px; }
  .footer__col--meta { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 首屏向导入口 */
.hero__cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff;
  padding: 11px 18px; border-radius: 3px;
  font-size: 14px; font-weight: 500;
  transition: background .15s;
}
.btn-primary:hover { background: #9c3a24; }
.hero__cta-note { font-size: 12.5px; color: var(--ink-4); }

.tag--cat { color: var(--ink-3); background: var(--paper-2); border-color: transparent; }

/* 选图向导 */
.wizard { max-width: 920px; padding-top: 44px; padding-bottom: 80px; }
.wizard__head { margin-bottom: 28px; }
.wizard__crumb { font-size: 12.5px; color: var(--ink-4); }
.wizard__crumb:hover { color: var(--accent); }
.wizard__title { font-size: 30px; margin-top: 10px; letter-spacing: -.01em; }
.wizard__intro { font-size: 14px; color: var(--ink-3); margin-top: 10px; line-height: 1.7; max-width: 720px; }
.wizard__progress {
  height: 3px; background: var(--rule-soft);
  border-radius: 99px; overflow: hidden; margin-bottom: 22px;
}
.wizard__progress-fill { height: 100%; background: var(--accent); transition: width .3s; }
.wizard__card {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px; padding: 28px 30px;
}
.wizard__count {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; color: var(--ink-4);
}
.wizard__question { font-size: 23px; margin: 10px 0 8px; }
.wizard__help { font-size: 13.5px; color: var(--ink-3); margin-bottom: 20px; }
.wopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wopt {
  display: flex; flex-direction: column; gap: 4px;
  text-align: left; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: 3px;
  background: var(--card); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.wopt:hover { border-color: var(--ink-4); }
.wopt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.wopt__label { font-size: 14px; color: var(--ink); font-weight: 500; }
.wopt__desc { font-size: 12px; color: var(--ink-4); line-height: 1.5; }
.wizard__nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.wizard__spacer { flex: 1; }
.wizard__next {
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 3px;
  padding: 9px 16px; font-size: 13px; cursor: pointer;
}
.wizard__next.is-disabled { opacity: .35; cursor: not-allowed; }
.wizard__privacy { font-size: 11.5px; color: var(--ink-4); margin-top: 14px; text-align: center; }
.wizard__answers {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; margin-bottom: 20px;
}
.wizard__answers-label {
  font-size: 11px; letter-spacing: .08em; color: var(--ink-4); margin-right: 4px;
}
.wizard__answer {
  font-size: 12px; background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 4px 10px; color: var(--ink-3);
}
.wresults { border-top: 1px solid var(--rule); }
.wres { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.wres__rank {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  padding-top: 3px; width: 24px; flex: none;
}
.wres__body { flex: 1; min-width: 0; }
.wres__title { font-size: 18px; color: var(--ink); }
.wres__title:hover { color: var(--accent); }
.wres__meta { font-size: 11.5px; color: var(--ink-4); margin: 3px 0 8px; }
.wres__desc { font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.wres__reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wres__reason {
  font-size: 11.5px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 999px; padding: 3px 9px;
}
.wres__req { font-size: 12px; color: var(--ink-4); margin-bottom: 10px; }
.wres__req-label { color: var(--ink-3); margin-right: 6px; }
.wres__go { font-size: 12.5px; color: var(--accent); }
.wizard__foot { display: flex; gap: 10px; margin-top: 22px; }

@media (max-width: 720px) {
  .wopts { grid-template-columns: 1fr; }
  .wizard__card { padding: 22px 18px; }
  .wizard__title { font-size: 25px; }
}
