/* ==========================================================================
   HR AI 落地绿皮书 — 共享样式表
   绿皮书视觉体系：深林绿 + 暖纸米 + 炭黑字
   纯静态、无外部依赖、系统字体优先
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */

:root {
  /* 纸与墨 */
  --paper: #f4efe2;
  --paper-raised: #fffdf6;
  --paper-sunk: #ece5d3;
  --ink: #23261f;
  --ink-soft: #4d5347;
  --ink-faint: #737a6a;

  /* 林绿 */
  --green-900: #0d3323;
  --green-800: #114430;
  --green-700: #17563b;
  --green-600: #1d6b49;
  --green-500: #2a8560;
  --green-200: #b9d6c3;
  --green-100: #e0ecdf;
  --green-50: #eef5ec;

  /* 点缀 */
  --gold: #9c7a33;
  --gold-soft: #f0e6cd;
  --danger: #9c3524;
  --danger-soft: #f8e6e1;
  --gate: #8a5a12;
  --gate-soft: #fbeed4;

  /* 结构 */
  --rule: #dcd3bd;
  --rule-strong: #c6bba0;
  --shadow-sm: 0 1px 2px rgba(20, 32, 24, 0.06), 0 2px 8px rgba(20, 32, 24, 0.04);
  --shadow-md: 0 2px 4px rgba(20, 32, 24, 0.06), 0 12px 28px rgba(20, 32, 24, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  /* 排版 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
    "Times New Roman", "SimSun", Georgia, serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* 度量 */
  --measure: 46rem;      /* 正文栏宽 ≈ 736px */
  --measure-wide: 68rem; /* 表格 / 卡片栏宽 */
  --header-h: 64px;
}

html[data-theme="dark"] {
  --paper: #14170f;
  --paper-raised: #1b1f17;
  --paper-sunk: #101309;
  --ink: #e9e7db;
  --ink-soft: #bdc0b0;
  --ink-faint: #8d9382;

  --green-900: #d6e8d8;
  --green-800: #c3ddc7;
  --green-700: #a9d0b1;
  --green-600: #7dba92;
  --green-500: #5da678;
  --green-200: #2e4a37;
  --green-100: #22301f;
  --green-50: #1c2418;

  --gold: #d8b169;
  --gold-soft: #2d2617;
  --danger: #e79383;
  --danger-soft: #2e1b16;
  --gate: #dcb262;
  --gate-soft: #2b2213;

  --rule: #2c3226;
  --rule-strong: #3f4736;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 14px 30px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------- 2. Reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(29, 107, 73, 0.05), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(156, 122, 51, 0.06), transparent 38%);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green-700);
  text-decoration-color: var(--green-200);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-600);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 3px;
  border-radius: 4px;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

hr {
  height: 1px;
  margin: 2.6rem 0;
  border: 0;
  background: linear-gradient(to right, var(--rule-strong), transparent);
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--green-700);
  color: #fff;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

html[data-theme="dark"] .skip-link {
  background: var(--green-200);
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------- 3. Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--paper);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 84rem;
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 8px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--green-800);
}

.brand-text small {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--green-50);
  color: var(--green-700);
}

.site-nav a[aria-current="page"] {
  background: var(--green-700);
  color: #fff;
  font-weight: 600;
}

html[data-theme="dark"] .site-nav a[aria-current="page"] {
  background: var(--green-200);
  color: var(--ink);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.icon-btn:hover {
  border-color: var(--green-500);
  color: var(--green-600);
}

.nav-toggle {
  display: none;
  width: auto;
  padding: 0 13px;
  font-size: 0.85rem;
}

/* 明暗切换用内联 SVG，避免依赖系统符号字体 */
.theme-toggle svg {
  display: block;
  width: 17px;
  height: 17px;
}

.theme-toggle .i-moon {
  fill: currentColor;
}

.theme-toggle .i-sun {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.theme-toggle .i-sun circle {
  fill: currentColor;
  stroke: none;
}

html[data-theme="light"] .theme-toggle .i-sun,
html[data-theme="dark"] .theme-toggle .i-moon {
  display: none;
}

/* --------------------------------------------------------------- 4. Layout */

.page {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  max-width: 78rem;
  margin: 0 auto;
  padding: 3rem 20px 1rem;
}

.page--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 78rem;
}

.content {
  min-width: 0;
  max-width: var(--measure-wide);
}

/* 正文块统一栏宽，宽块（表、卡、图）自行放开 */
.prose > p,
.prose > ul,
.prose > ol,
.prose > h2,
.prose > h3,
.prose > h4,
.prose > blockquote,
.prose > .callout,
.prose > .lede,
.prose > .section-note {
  max-width: var(--measure);
}

/* ------------------------------------------------------------------ 5. TOC */

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 60px);
  padding: 1rem 0 1rem 1.05rem;
  border-left: 2px solid var(--rule);
  overflow-y: auto;
  font-size: 0.855rem;
}

.toc:empty {
  display: none;
}

.toc-title {
  margin: 0 0 0.6rem;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  list-style: none;
  cursor: default;
}

.toc-title::-webkit-details-marker {
  display: none;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 4px 8px 4px 10px;
  margin-left: -12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  line-height: 1.5;
  text-decoration: none;
}

.toc a:hover {
  background: var(--green-50);
  color: var(--green-700);
}

.toc .toc-h3 a {
  padding-left: 22px;
  font-size: 0.81rem;
  color: var(--ink-faint);
}

.toc a.is-active {
  border-left-color: var(--green-600);
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
}

/* ------------------------------------------------------------ 6. Typography */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--green-900);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 4.6vw, 2.5rem);
  font-weight: 700;
}

h2 {
  margin: 3.4rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(1.3rem, 3vw, 1.62rem);
  font-weight: 700;
}

h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

h3 {
  margin: 2.4rem 0 0.7rem;
  font-size: 1.16rem;
  font-weight: 700;
}

h4 {
  margin: 1.7rem 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-800);
}

p {
  margin: 0 0 1.15rem;
}

.eyebrow {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.lede {
  margin-bottom: 1.6rem;
  color: var(--ink-soft);
  font-size: 1.09rem;
  line-height: 1.8;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 2.4rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.section-note {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

ul,
ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.42rem;
}

li > ul,
li > ol {
  margin-top: 0.42rem;
  margin-bottom: 0.3rem;
}

.prose ul > li::marker {
  color: var(--green-500);
}

.prose ol > li::marker {
  color: var(--green-600);
  font-weight: 700;
}

.list-tight li {
  margin-bottom: 0.18rem;
}

.list-plain {
  padding-left: 0;
  list-style: none;
}

strong {
  font-weight: 700;
  color: var(--green-900);
}

em {
  font-style: normal;
  padding: 0 0.15em;
  background: linear-gradient(transparent 62%, var(--gold-soft) 62%);
}

code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 0.855em;
  color: var(--green-700);
}

blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.15rem;
  border-left: 3px solid var(--green-200);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.02rem;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------- 7. Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease,
    background-color 0.14s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--green-700);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--green-600);
  color: #fff;
  box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .btn--primary {
  background: var(--green-200);
  color: var(--ink);
}

html[data-theme="dark"] .btn--primary:hover {
  background: var(--green-500);
  color: #0f130d;
}

.btn--ghost {
  border-color: var(--rule-strong);
  background: var(--paper-raised);
  color: var(--green-700);
}

.btn--ghost:hover {
  border-color: var(--green-500);
  background: var(--green-50);
  color: var(--green-700);
}

.btn--muted {
  border-color: var(--rule);
  background: transparent;
  color: var(--ink-faint);
  cursor: not-allowed;
}

.btn--sm {
  padding: 7px 15px;
  font-size: 0.83rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.8rem 0;
}

/* --------------------------------------------------------------- 8. Badges */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid var(--green-200);
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag--gold {
  border-color: color-mix(in srgb, var(--gold) 40%, transparent);
  background: var(--gold-soft);
  color: var(--gold);
}

.tag--gate {
  border-color: color-mix(in srgb, var(--gate) 42%, transparent);
  background: var(--gate-soft);
  color: var(--gate);
}

.tag--danger {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.tag--plain {
  border-color: var(--rule-strong);
  background: transparent;
  color: var(--ink-faint);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.tag-row li {
  margin: 0;
}

/* --------------------------------------------------------------- 9. Cards */

.grid {
  display: grid;
  gap: 1.1rem;
  margin: 1.6rem 0 2.2rem;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3,
.card h4 {
  margin-top: 0;
}

.card h4 {
  margin-bottom: 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.card p {
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.card ul,
.card ol {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.card--accent {
  border-color: var(--green-200);
  background: linear-gradient(
    180deg,
    var(--green-50),
    var(--paper-raised) 70%
  );
}

.card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

html[data-theme="dark"] .card-num {
  background: var(--green-200);
  color: var(--paper-sunk);
}

/* -------------------------------------------------------- 10. Team cards */

.team-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.team-card + .team-card {
  margin-top: 1.4rem;
}

.team-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(
    100deg,
    var(--green-50),
    var(--paper-raised) 65%
  );
}

.team-head h3 {
  margin: 0;
  font-size: 1.22rem;
}

.team-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.team-head p {
  flex: 1 1 100%;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.team-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0;
}

.team-block {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--rule);
}

.team-block:first-child {
  border-top: 0;
}

.team-block + .team-block {
  border-left: 1px solid var(--rule);
}

.team-block h4 {
  margin: 0 0 0.6rem;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.team-block > :last-child {
  margin-bottom: 0;
}

.team-block ul,
.team-block ol {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.team-block--full {
  grid-column: 1 / -1;
  border-left: 0 !important;
}

/* --------------------------------------------------------- 11. Chain flow */

.chain {
  margin: 1.3rem 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: chain;
}

.chain > li {
  position: relative;
  margin: 0;
  padding: 0 0 1.05rem 2.7rem;
}

.chain > li::before {
  counter-increment: chain;
  content: counter(chain);
  position: absolute;
  left: 0;
  top: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-100);
  border: 1px solid var(--green-200);
  color: var(--green-700);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.chain > li::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 1.9rem;
  bottom: 0.15rem;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--rule-strong) 0 4px,
    transparent 4px 8px
  );
}

.chain > li:last-child {
  padding-bottom: 0;
}

.chain > li:last-child::after {
  display: none;
}

.chain b {
  display: block;
  color: var(--green-900);
  font-size: 0.97rem;
  line-height: 1.6;
}

.chain span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

.chain > li.is-gate::before {
  content: "闸";
  background: var(--gate-soft);
  border-color: color-mix(in srgb, var(--gate) 42%, transparent);
  color: var(--gate);
  font-family: var(--font-serif);
}

.chain > li.is-gate b {
  color: var(--gate);
}

/* 横向流程（三层结构、模型选择等） */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 1.6rem 0 2rem;
}

.flow-node {
  flex: 1 1 12rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}

.flow-node b {
  display: block;
  color: var(--green-800);
  font-family: var(--font-serif);
  font-size: 1rem;
}

.flow-node small {
  display: block;
  color: var(--ink-faint);
  font-size: 0.82rem;
  line-height: 1.6;
}

.flow-node--strong {
  border-color: var(--green-500);
  background: var(--green-50);
}

.flow-arrow {
  display: flex;
  flex: 0 0 1.4rem;
  align-items: center;
  justify-content: center;
  color: var(--green-500);
  font-size: 1.1rem;
  line-height: 1;
}

@media (max-width: 40rem) {
  .flow {
    flex-direction: column;
  }
  .flow-arrow {
    flex: none;
    height: 1.4rem;
    transform: rotate(90deg);
  }
}

/* ------------------------------------------------------------ 12. Callouts */

.callout {
  position: relative;
  margin: 1.7rem 0;
  padding: 1.05rem 1.3rem;
  border: 1px solid var(--green-200);
  border-left: 4px solid var(--green-500);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--green-50);
  font-size: 0.94rem;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0.4rem;
  color: var(--green-800);
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.callout--warn {
  border-color: color-mix(in srgb, var(--gate) 35%, transparent);
  border-left-color: var(--gate);
  background: var(--gate-soft);
}

.callout--warn .callout-title {
  color: var(--gate);
}

.callout--danger {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.callout--danger .callout-title {
  color: var(--danger);
}

.callout--sample {
  border-color: var(--rule-strong);
  border-left-color: var(--gold);
  background: var(--paper-raised);
}

.callout--sample .callout-title {
  color: var(--gold);
}

/* ------------------------------------------------------------- 13. Prompts */

.prompt {
  margin: 1rem 0 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
}

.prompt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.7rem 0.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-sunk);
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.prompt-head .copy-btn {
  margin-left: auto;
  padding: 4px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
}

.prompt-head .copy-btn:hover {
  border-color: var(--green-500);
  color: var(--green-600);
}

.prompt-head .copy-btn[data-copied="1"] {
  border-color: var(--green-500);
  background: var(--green-50);
  color: var(--green-700);
}

.prompt pre {
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.78;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------- 14. Table */

.table-wrap {
  margin: 1.6rem 0 2.2rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background-color: var(--paper-raised);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  /* 左右边缘阴影提示表格还能横向滚动：
     前两层随内容滚动（local），到边界时正好盖住后两层阴影 */
  background-image:
    linear-gradient(to right, var(--paper-raised) 55%, transparent),
    linear-gradient(to left, var(--paper-raised) 55%, transparent),
    linear-gradient(to right, rgba(20, 32, 24, 0.13), transparent),
    linear-gradient(to left, rgba(20, 32, 24, 0.13), transparent);
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-repeat: no-repeat;
  background-size: 34px 100%, 34px 100%, 15px 100%, 15px 100%;
  background-attachment: local, local, scroll, scroll;
}

html[data-theme="dark"] .table-wrap {
  background-image:
    linear-gradient(to right, var(--paper-raised) 55%, transparent),
    linear-gradient(to left, var(--paper-raised) 55%, transparent),
    linear-gradient(to right, rgba(0, 0, 0, 0.45), transparent),
    linear-gradient(to left, rgba(0, 0, 0, 0.45), transparent);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

caption {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-sunk);
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
}

th,
td {
  padding: 0.7rem 1.05rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--green-50);
  color: var(--green-800);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--green-50) 55%, transparent);
}

td strong {
  font-family: var(--font-serif);
}

/* --------------------------------------------------------------- 15. Hero */

.hero {
  max-width: 78rem;
  margin: 0 auto;
  padding: 3.6rem 20px 1rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: center;
}

.hero-plate {
  position: relative;
  padding: 2.6rem 2.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    155deg,
    var(--green-900),
    var(--green-700) 55%,
    var(--green-800)
  );
  box-shadow: var(--shadow-md);
  color: var(--green-50);
  overflow: hidden;
}

.hero-plate::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  pointer-events: none;
}

.hero-plate .eyebrow {
  color: var(--gold-soft);
}

html[data-theme="dark"] .hero-plate {
  background: linear-gradient(155deg, #14301f, #10281b 60%, #0d2317);
  color: #e6f0e4;
}

html[data-theme="dark"] .hero-plate h1,
html[data-theme="dark"] .hero-plate .eyebrow {
  color: #f2ecd8;
}

.hero-plate h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 2.85rem);
}

.hero-sub {
  margin: 0 0 1.4rem;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.7;
}

.hero-plate .hero-desc {
  margin: 0 0 1.7rem;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.94rem;
}

.hero-plate .btn--ghost {
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
}

.hero-plate .btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-plate .btn--primary {
  background: var(--gold-soft);
  color: var(--green-900);
}

.hero-plate .btn--primary:hover {
  background: #fff;
  color: var(--green-900);
}

/* 深色模式下主 CTA 改用金色，避免与深绿封面板融在一起 */
html[data-theme="dark"] .hero-plate .btn--primary {
  background: var(--gold);
  color: #12150f;
}

html[data-theme="dark"] .hero-plate .btn--primary:hover {
  background: #e7c67c;
  color: #12150f;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: 1.9rem 0 0;
  padding: 1.3rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  list-style: none;
}

.hero-stats li {
  margin: 0;
}

.hero-stats b {
  display: block;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.2;
}

.hero-stats small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.hero-aside .card {
  background: var(--paper-raised);
}

@media (max-width: 62rem) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
}

/* --------------------------------------------------- 16. Chapter / footer */

.chapter-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  max-width: 78rem;
  margin: 3rem auto 4rem;
  padding: 0 20px;
}

.chapter-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 1rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chapter-link:hover {
  border-color: var(--green-500);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.chapter-link small {
  color: var(--ink-faint);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
}

.chapter-link b {
  color: var(--green-800);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.chapter-link--next {
  text-align: right;
  align-items: flex-end;
}

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-sunk);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 2.6rem 20px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-inner h4 {
  margin: 0 0 0.6rem;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.footer-inner ul {
  padding: 0;
  list-style: none;
}

.footer-inner li {
  margin-bottom: 0.3rem;
}

.footer-inner a {
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
}

.footer-bottom {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.1rem 20px 2.2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.78rem;
}

.footer-bottom p {
  margin: 0 0 0.35rem;
  max-width: 60rem;
}

.footer-bottom .footer-sign {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.footer-sign strong {
  font-family: var(--font-serif);
  color: var(--green-800);
}

.footer-sign a {
  text-decoration: none;
}

.footer-sign a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ 17. Details */

details.fold {
  margin: 1rem 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
}

details.fold > summary {
  padding: 0.75rem 1.1rem;
  color: var(--green-800);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

details.fold > summary::-webkit-details-marker {
  display: none;
}

details.fold > summary::before {
  content: "＋";
  margin-right: 8px;
  color: var(--green-500);
  font-family: var(--font-mono);
}

details.fold[open] > summary::before {
  content: "－";
}

details.fold[open] > summary {
  border-bottom: 1px solid var(--rule);
}

.fold-body {
  padding: 1rem 1.1rem;
  font-size: 0.91rem;
}

.fold-body > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------ 18. Mobile */

@media (max-width: 68rem) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 2rem;
  }

  .toc {
    position: static;
    max-height: none;
    margin-bottom: 2rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--paper-raised);
  }

  .toc a {
    margin-left: 0;
  }

  .toc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    font-size: 0.78rem;
    cursor: pointer;
  }

  .toc-title::after {
    content: "＋";
    color: var(--green-500);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0;
  }

  .toc-fold[open] > .toc-title {
    margin-bottom: 0.55rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--rule);
  }

  .toc-fold[open] > .toc-title::after {
    content: "－";
  }
}

@media (max-width: 56rem) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .site-nav {
    display: none;
    order: 4;
    flex: 1 1 100%;
    padding: 0.5rem 0 0.7rem;
    border-top: 1px solid var(--rule);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
  }

  .site-nav a {
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .team-block + .team-block {
    border-left: 0;
  }

  .team-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter-link--next {
    text-align: left;
    align-items: flex-start;
  }
}

@media (max-width: 34rem) {
  body {
    font-size: 16px;
  }

  .brand-text small {
    display: none;
  }

  .hero {
    padding-top: 2.2rem;
  }

  .hero-plate {
    padding: 1.9rem 1.4rem;
  }

  .team-head,
  .team-block {
    padding: 1.05rem 1.15rem;
  }

  .btn {
    flex: 1 1 100%;
  }
}

/* -------------------------------------------------------------- 19. Print */

@media print {
  .site-header,
  .toc,
  .chapter-nav,
  .site-footer,
  .copy-btn,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .page {
    display: block;
    padding: 0;
  }

  .card,
  .team-card,
  .table-wrap {
    break-inside: avoid;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
