/* ============================================================
   人造人鲁班 · 多智能体团队图鉴
   Direction B: 国风手办展陈 / Museum of Agents
   Palette: rice paper, ink, cinnabar, brass, bamboo
   ============================================================ */

:root {
  --bg: #F6F1E7;
  --paper: #FFFDF8;
  --paper-2: #EADFCB;
  --paper-3: #F0E7D7;
  --ink: #1D1B18;
  --ink-soft: #5B554B;
  --ash: #8A8378;
  --cinnabar: #B23A2C;
  --cinnabar-soft: rgba(178, 58, 44, 0.08);
  --brass: #A9853F;
  --brass-light: #D8C08A;
  --brass-soft: rgba(169, 133, 63, 0.12);
  --bamboo: #6E7F63;
  --line: rgba(29, 27, 24, 0.14);
  --line-strong: rgba(29, 27, 24, 0.28);
  --shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 24px 60px -38px rgba(29,27,24,0.45);
  --serif: "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Noto Sans Mono CJK SC", monospace;
  --max: 1200px;
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body {
  margin: 0;
  background:
    radial-gradient(800px 520px at 78% 6%, rgba(169,133,63,0.09), transparent 65%),
    radial-gradient(700px 500px at 8% 42%, rgba(110,127,99,0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(29,27,24,0.018) 0 1px, transparent 1px 4px),
    radial-gradient(rgba(29,27,24,0.035) 0.5px, transparent 0.5px);
  background-size: 100% 4px, 5px 5px;
  mix-blend-mode: multiply;
}
::selection { background: var(--cinnabar); color: #FFFDF8; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button:disabled { opacity: 0.55; cursor: wait; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(var(--max), calc(100% - 80px)); margin: 0 auto; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.cinnabar { color: var(--cinnabar); }
.brass { color: var(--brass); }
.ash { color: var(--ash); }

button.role-card, button.agent-card, button.team-card, button.mini-agent,
button.orbit-node, button.team-tab, button.sim-task, button.pipe-item, button.chip {
  font-family: var(--sans);
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.role-card, .agent-card { padding: 0; }

/* ---------- scroll progress ---------- */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brass), var(--cinnabar));
  z-index: 300;
  pointer-events: none;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 120;
  background: rgba(246, 241, 231, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: min(1320px, calc(100% - 52px));
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px;
  border: 1px solid var(--cinnabar);
  color: var(--cinnabar);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 19px;
  background: var(--paper);
  flex: none;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 3px;
  border: 1px solid rgba(178,58,44,0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: 0.16em; }
.brand-text span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.26em; color: var(--ash); margin-top: 4px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  position: relative;
  padding: 8px 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--cinnabar);
  transition: width 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cinnabar); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ash);
  letter-spacing: 0.08em;
}
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bamboo); box-shadow: 0 0 0 3px rgba(110,127,99,0.14); }
.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 9px; width: 16px; height: 1px; background: currentColor;
  content: "";
}
.nav-toggle span { top: 17px; }
.nav-toggle span::before { top: -5px; left: 0; }
.nav-toggle span::after { top: 5px; left: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 42px) 0 34px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(620px 520px at 78% 38%, rgba(169,133,63,0.13), transparent 68%),
    linear-gradient(90deg, rgba(246,241,231,0.96) 0%, rgba(246,241,231,0.72) 44%, rgba(246,241,231,0.10) 100%);
  pointer-events: none;
}
.hero::after {
  content: "九";
  position: absolute;
  right: -30px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: clamp(300px, 38vw, 560px);
  line-height: 1;
  color: rgba(169,133,63,0.06);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.04fr 0.96fr; gap: 48px; align-items: center; }
.hero-kicker {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--cinnabar);
  text-transform: uppercase;
}
.hero-kicker::before { content: ""; width: 32px; height: 1px; background: var(--cinnabar); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(52px, 6.6vw, 92px);
  line-height: 1.12;
  letter-spacing: 0.04em;
  margin: 18px 0 24px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--cinnabar); position: relative; }
.hero h1 em::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 5px;
  height: 6px;
  background: rgba(169,133,63,0.22);
  z-index: -1;
}
.hero-sub { max-width: 560px; color: var(--ink-soft); font-size: 16px; line-height: 1.95; }
.hero-sub strong { color: var(--ink); font-weight: 500; }
.hero-label {
  margin-top: 30px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  font-size: 11px;
  color: var(--ash);
  line-height: 1.8;
  max-width: 560px;
}
.hero-label b { color: var(--cinnabar); font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; font-weight: 400; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--cinnabar);
  background: var(--cinnabar);
  color: #FFFDF8;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: 0.28s;
}
.btn:hover { background: #972F24; border-color: #972F24; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft); }
.btn svg { width: 14px; height: 14px; }

.hero-stage { position: relative; height: 600px; }
.hero-stage::before {
  content: "";
  position: absolute; left: 6%; right: 6%; top: 292px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-light), transparent);
}
.hero-case {
  position: absolute;
  background: linear-gradient(160deg, #FFFDF8, #E7DCC8);
  border: 1px solid rgba(169,133,63,0.5);
  box-shadow: var(--shadow);
  padding: 9px;
}
.hero-case::before {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid rgba(169,133,63,0.16);
  pointer-events: none;
}
.hero-case::after {
  content: "";
  position: absolute; inset: 9px;
  background: linear-gradient(115deg, rgba(255,255,255,0.48), transparent 34%);
  pointer-events: none;
}
.hero-case img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  filter: saturate(0.86) contrast(0.99);
  position: relative; z-index: 1;
}
.hero-case .hc-no {
  position: absolute; left: 13px; top: 13px; z-index: 2;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  color: var(--cinnabar); background: rgba(255,253,248,0.86);
  padding: 3px 5px;
}
.hero-case .hc-label {
  position: relative; z-index: 2;
  padding: 9px 6px 5px;
  border-top: 1px solid rgba(169,133,63,0.32);
  margin-top: 9px;
  background: var(--paper);
}
.hc-label b { display: block; font-family: var(--serif); font-size: 14px; font-weight: 600; line-height: 1.3; }
.hc-label span { display: block; font-size: 9px; color: var(--ash); margin-top: 2px; }
.hero-case.main { width: 280px; left: 50%; top: 20px; transform: translateX(-50%); z-index: 3; }
.hero-case.left { width: 170px; left: -40px; top: 180px; z-index: 4; }
.hero-case.right { width: 180px; right: -40px; top: 210px; z-index: 4; }
.hero-seal {
  position: absolute; right: 26px; bottom: 2px;
  width: 88px; height: 88px;
  border: 2px solid var(--cinnabar);
  color: var(--cinnabar);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-align: center;
  transform: rotate(-5deg);
  background: rgba(255,253,248,0.72);
  z-index: 4;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 52px;
  border-top: 1px solid var(--line-strong);
}
.stat { padding: 18px 18px 0 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 8px; font-size: 10px; letter-spacing: 0.12em; color: var(--ash); }

/* ---------- chapters / sections ---------- */
section { position: relative; padding: 108px 0; }
.chapter {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 26px;
  margin-bottom: 48px;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
}
.chapter-no {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
  color: var(--cinnabar);
  font-weight: 500;
}
.chapter-no small {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ash);
  letter-spacing: 0.16em;
  margin-top: 8px;
  font-weight: 400;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--brass);
  text-transform: uppercase;
}
.chapter h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.22;
  letter-spacing: 0.02em;
  margin: 8px 0 16px;
  text-wrap: balance;
}
.lead { max-width: 780px; color: var(--ink-soft); font-size: 15px; line-height: 1.95; }
.section-note {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ash);
  letter-spacing: 0.06em;
}

/* ---------- generic cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.3s, border-color 0.3s;
}
.card:hover { transform: translateY(-2px); border-color: rgba(169,133,63,0.55); }
.card .num { font-family: var(--mono); font-size: 10px; color: var(--cinnabar); letter-spacing: 0.16em; }
.card h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin: 14px 0 10px; line-height: 1.4; }
.card p { font-size: 13px; line-height: 1.9; color: var(--ink-soft); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ---------- overview ---------- */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.principle {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.principle::before {
  content: "";
  position: absolute; left: 22px; right: 22px; top: 0;
  height: 1px;
  background: var(--brass-light);
}
.principle .p-num { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--cinnabar); }
.principle h3 { font-family: var(--serif); font-size: 20px; margin: 22px 0 10px; }
.principle p { font-size: 12px; line-height: 1.9; color: var(--ink-soft); }
.principle .p-icon { margin-top: auto; width: 24px; height: 24px; color: var(--brass); }

.compare {
  margin-top: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.compare-col {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.compare-col.new { border-top: 3px solid var(--cinnabar); }
.compare-col.old { border-top: 3px solid var(--ash); }
.compare-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ash);
}
.compare-head b { display: block; font-family: var(--serif); font-size: 22px; letter-spacing: 0.02em; color: var(--ink); margin-top: 4px; }
.compare-row { padding: 14px 22px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.85; color: var(--ink-soft); }
.compare-row:last-child { border-bottom: 0; }
.compare-row strong { color: var(--ink); font-weight: 600; }
.compare-col.old .compare-row { color: var(--ash); }
.compare-col.new .compare-row strong { color: var(--cinnabar); }

/* ---------- special exhibition (Luban) ---------- */
.special-band {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,253,248,0.72), rgba(234,223,203,0.55)),
    repeating-linear-gradient(90deg, rgba(139,94,60,0.05) 0 2px, transparent 2px 9px);
  border-top: 4px solid #8B5E3C;
  border-bottom: 1px solid var(--brass);
  padding: 42px 44px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.special-band::before {
  content: "特展";
  position: absolute;
  right: 26px; top: 24px;
  width: 78px; height: 78px;
  border: 2px solid var(--cinnabar);
  color: var(--cinnabar);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.12em;
  transform: rotate(-5deg);
  opacity: 0.9;
}
.special-band::after {
  content: "LUBAN FORGER";
  position: absolute;
  right: 18px; bottom: 12px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: rgba(139,94,60,0.45);
}
.special-top { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 44px; align-items: center; position: relative; z-index: 1; }
.special-top h3 { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 42px); line-height: 1.3; margin: 10px 0 16px; }
.special-top p { color: var(--ink-soft); font-size: 14px; line-height: 1.95; max-width: 660px; }
.special-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line);
  background: rgba(255,253,248,0.55);
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.tag.gold { border-color: rgba(178,58,44,0.4); color: var(--cinnabar); background: var(--cinnabar-soft); }
.special-seal-wrap { display: flex; justify-content: center; }
.special-seal {
  width: 210px; height: 210px;
  border: 1px solid var(--brass);
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
  background: radial-gradient(circle, rgba(255,253,248,0.9), rgba(234,223,203,0.4));
}
.special-seal::before { content: ""; position: absolute; inset: 14px; border: 1px dashed rgba(169,133,63,0.45); border-radius: 50%; }
.special-seal span { font-family: var(--serif); font-size: 74px; color: var(--cinnabar); line-height: 1; }
.special-seal small {
  position: absolute; bottom: 30px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.24em; color: var(--ash);
}

/* ---------- process wall ---------- */
.process-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 54px; }
.process-head h3 { font-family: var(--serif); font-size: clamp(25px, 3vw, 34px); line-height: 1.35; margin-top: 6px; }
.process-actions { display: flex; align-items: center; gap: 12px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: 0.25s;
}
.mini-btn:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.mini-btn.playing { border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft); }

.process-wall {
  margin-top: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 30px 24px 24px;
  position: relative;
}
.process-line {
  position: absolute; left: 6.25%; right: 6.25%; top: 46px;
  height: 1px; background: var(--brass-light);
}
.process-steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; position: relative; z-index: 1; }
.pipe-item {
  background: transparent;
  border: 0;
  padding: 0 4px;
  text-align: center;
  cursor: pointer;
  position: relative;
}
.pipe-item .n {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  margin: 0 auto;
  border: 1px solid var(--brass);
  border-radius: 50%;
  background: var(--paper);
  color: var(--brass);
  font-family: var(--mono);
  font-size: 9px;
  transition: 0.25s;
}
.pipe-item .t { display: block; font-family: var(--serif); font-size: 14px; line-height: 1.35; margin-top: 10px; color: var(--ink); }
.pipe-item .role { display: block; font-size: 9px; color: var(--ash); margin-top: 3px; line-height: 1.4; }
.pipe-item .arr { display: none; }
.pipe-item:hover .n { border-color: var(--cinnabar); color: var(--cinnabar); }
.pipe-item.active .n { background: var(--cinnabar); border-color: var(--cinnabar); color: #FFFDF8; }
.pipe-item.active .t { color: var(--cinnabar); }
.pipe-detail {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  min-height: 190px;
}
.pd-top { display: flex; gap: 20px; align-items: flex-start; }
.pd-portrait { width: 94px; height: 94px; object-fit: cover; border: 1px solid var(--line); padding: 4px; background: var(--paper-3); flex: none; }
.pd-no { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--cinnabar); }
.pd-title { font-family: var(--serif); font-size: 28px; line-height: 1.25; margin: 4px 0 3px; }
.pd-role { font-size: 11px; color: var(--ash); }
.pd-desc { margin-top: 18px; font-size: 13px; line-height: 1.95; color: var(--ink-soft); max-width: 820px; }
.pd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.pd-meta span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--brass); margin-bottom: 4px; }
.pd-meta strong { font-size: 12px; font-weight: 500; line-height: 1.7; display: block; color: var(--ink); }

.gates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.gate { background: var(--paper); border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow); }
.gate .g-icon { width: 22px; height: 22px; color: var(--brass); }
.gate h4 { font-family: var(--serif); font-size: 18px; margin: 14px 0 7px; }
.gate p { font-size: 11px; line-height: 1.85; color: var(--ink-soft); }
.gate .g-no { float: right; font-family: var(--mono); font-size: 8px; color: var(--cinnabar); }

.ir-map { display: grid; grid-template-columns: 1fr 48px 1fr; align-items: stretch; margin-top: 30px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.ir-box { padding: 24px; }
.ir-box h4 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.ir-box p { font-size: 11px; color: var(--ink-soft); line-height: 1.85; }
.ir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.ir-chip { font-family: var(--mono); font-size: 9px; border: 1px solid var(--line); padding: 5px 7px; color: var(--cinnabar); background: var(--cinnabar-soft); }
.ir-arrow { display: grid; place-items: center; color: var(--brass); font-family: var(--mono); border-left: 1px dashed var(--line); border-right: 1px dashed var(--line); background: var(--paper-3); }
.ir-right { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.ir-layer { border: 1px solid var(--line); padding: 12px 14px; background: var(--paper-3); }
.ir-layer b { font-family: var(--serif); font-size: 15px; display: block; }
.ir-layer span { font-size: 10px; color: var(--ink-soft); }

.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.role-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 9px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  transition: transform 0.3s, border-color 0.3s;
}
.role-card:hover { transform: translateY(-3px); border-color: var(--brass); }
.role-card .rc-img { position: relative; overflow: hidden; border: 1px solid var(--line); }
.role-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: saturate(0.86); transition: transform 0.6s, filter 0.6s; }
.role-card:hover img { transform: scale(1.035); filter: saturate(0.98); }
.role-card .rc-layer {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em;
  color: var(--cinnabar);
  background: rgba(255,253,248,0.88);
  border: 1px solid rgba(178,58,44,0.28);
  padding: 3px 5px;
}
.role-card .rc-body { padding: 12px 8px 8px; border-top: 1px solid var(--line); margin-top: 9px; }
.role-card .rc-en { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--ash); }
.role-card .rc-name { font-family: var(--serif); font-size: 20px; margin: 4px 0 3px; }
.role-card .rc-tag { font-size: 11px; color: var(--ink-soft); line-height: 1.6; }
.role-card .rc-no { position: absolute; right: 12px; top: 12px; font-family: var(--serif); font-size: 18px; color: var(--cinnabar); background: rgba(255,253,248,0.9); padding: 0 4px; }

/* ---------- teams ---------- */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.team-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  transition: transform 0.3s, border-color 0.3s;
  overflow: hidden;
}
.team-card::after { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 0; background: var(--cinnabar); transition: height 0.35s; }
.team-card:hover, .team-card.selected { transform: translateY(-3px); border-color: var(--brass); }
.team-card:hover::after, .team-card.selected::after { height: 100%; }
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tc-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--cinnabar); color: var(--cinnabar);
  font-family: var(--serif); font-size: 20px;
  background: var(--cinnabar-soft);
}
.tc-count { font-family: var(--mono); font-size: 9px; color: var(--ash); }
.tc-count b { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--cinnabar); margin-right: 3px; }
.team-card h3 { font-family: var(--serif); font-size: 22px; margin: 16px 0 3px; }
.team-card .tc-alias { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--ash); }
.team-card p { font-size: 11px; color: var(--ink-soft); line-height: 1.85; margin-top: 11px; min-height: 56px; }
.tc-sig { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; color: var(--brass); line-height: 1.55; }
.tc-avatars { display: flex; margin-top: 12px; }
.tc-avatars img { width: 28px; height: 28px; object-fit: cover; border-radius: 50%; border: 1px solid var(--paper); margin-left: -7px; }
.tc-avatars img:first-child { margin-left: 0; }

.team-panel {
  margin-top: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 30px 32px;
  scroll-margin-top: 96px;
}
.tp-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tp-title { font-family: var(--serif); font-size: 36px; line-height: 1.2; }
.tp-mission { font-size: 13px; color: var(--ink-soft); line-height: 1.9; margin-top: 8px; max-width: 720px; }
.tp-stats { text-align: right; }
.tp-stats b { display: block; font-family: var(--serif); font-size: 44px; color: var(--cinnabar); line-height: 1; font-weight: 500; }
.tp-stats span { font-family: var(--mono); font-size: 8px; color: var(--ash); letter-spacing: 0.12em; }
.tp-story { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0 22px; }
.tp-story div { border-left: 1px solid var(--brass-light); padding-left: 14px; }
.tp-story span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: var(--brass); margin-bottom: 5px; }
.tp-story p { font-size: 11px; color: var(--ink-soft); line-height: 1.9; }
.tp-roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-agent {
  display: flex; gap: 10px; align-items: center;
  background: var(--paper-3);
  border: 1px solid var(--line);
  padding: 8px;
  cursor: pointer;
  transition: 0.25s;
  text-align: left;
  color: inherit;
}
.mini-agent:hover { border-color: var(--brass); background: var(--paper); transform: translateY(-1px); }
.mini-agent img { width: 48px; height: 48px; object-fit: cover; flex: none; border: 1px solid rgba(169,133,63,0.35); }
.mini-agent .ma-name { display: block; font-family: var(--serif); font-size: 14px; line-height: 1.3; }
.mini-agent .ma-tag { display: block; font-size: 9px; color: var(--ash); line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- orchestration ---------- */
.route-board {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px 26px;
}
.route-center { display: flex; flex-direction: column; align-items: center; }
.route-node {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--paper-3);
  padding: 10px 16px;
  font-size: 12px;
  position: relative;
  z-index: 1;
}
.route-node.primary { border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft); }
.route-node.user { border-color: var(--bamboo); color: var(--bamboo); background: rgba(110,127,99,0.08); }
.route-arrow { height: 24px; width: 1px; background: linear-gradient(var(--line-strong), var(--brass)); position: relative; }
.route-arrow::after { content: ""; position: absolute; bottom: 0; left: -2px; width: 5px; height: 5px; border-right: 1px solid var(--brass); border-bottom: 1px solid var(--brass); transform: rotate(45deg); }
.lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.lane { border: 1px solid var(--line); background: var(--paper-3); padding: 20px; position: relative; }
.lane::before { display: none; }
.lane.l1 { border-top: 3px solid var(--bamboo); }
.lane.l2 { border-top: 3px solid var(--brass); }
.lane.l3 { border-top: 3px solid var(--cinnabar); }
.lane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lane-code { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }
.lane.l1 .lane-code { color: var(--bamboo); }
.lane.l2 .lane-code { color: var(--brass); }
.lane.l3 .lane-code { color: var(--cinnabar); }
.lane-time { font-family: var(--mono); font-size: 8px; color: var(--ash); }
.lane h4 { font-family: var(--serif); font-size: 21px; margin: 10px 0 7px; }
.lane p { font-size: 11px; color: var(--ink-soft); line-height: 1.9; min-height: 62px; }
.lane-meta { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 10px; color: var(--ash); line-height: 1.75; }
.lane-meta b { color: var(--ink); font-weight: 500; }

.sim { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top: 34px; }
.sim-tasks { display: flex; flex-direction: column; gap: 8px; }
.sim-task {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow: var(--shadow);
}
.sim-task:hover { border-color: var(--brass); }
.sim-task.active { border-color: var(--cinnabar); background: var(--cinnabar-soft); }
.sim-task .st-level { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--cinnabar); }
.sim-task .st-title { font-family: var(--serif); font-size: 16px; margin-top: 4px; line-height: 1.4; }
.sim-task .st-desc { font-size: 10px; color: var(--ash); margin-top: 3px; }
.sim-console {
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, rgba(29,27,24,0.018) 0 1px, transparent 1px 4px),
    var(--paper);
  padding: 20px;
  min-height: 340px;
  box-shadow: var(--shadow);
  position: relative;
}
.sim-console::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(169,133,63,0.16); pointer-events: none; }
.sim-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); margin-bottom: 13px; font-family: var(--mono); font-size: 8px; color: var(--ash); letter-spacing: 0.08em; }
.sim-dots { display: flex; gap: 5px; }
.sim-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brass-light); display: block; }
.sim-path { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; position: relative; z-index: 1; }
.sim-path span { border: 1px solid var(--line); padding: 5px 8px; font-size: 9px; color: var(--ash); background: var(--paper); transition: 0.3s; }
.sim-path span.active { border-color: var(--cinnabar); color: var(--cinnabar); background: var(--cinnabar-soft); }
.sim-log { position: relative; z-index: 1; font-family: var(--mono); font-size: 10px; line-height: 1.95; color: var(--ink-soft); min-height: 180px; }
.log-line { opacity: 0; transform: translateY(5px); transition: 0.32s; padding: 4px 0; border-bottom: 1px dashed rgba(29,27,24,0.08); }
.log-line.show { opacity: 1; transform: none; }
.log-line .lt { color: var(--ash); margin-right: 7px; }
.log-line .lw { color: var(--cinnabar); }
.log-line .lg { color: var(--bamboo); }
.log-line .lr { color: #C2543F; }
.sim-run { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.sim-cost { font-family: var(--mono); font-size: 8px; color: var(--ash); }

.functions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 34px; }
.function { background: var(--paper); border: 1px solid var(--line); padding: 20px 18px; box-shadow: var(--shadow); }
.function .f-no { font-family: var(--mono); font-size: 9px; color: var(--cinnabar); }
.function h4 { font-family: var(--serif); font-size: 17px; margin: 10px 0 6px; }
.function p { font-size: 10px; color: var(--ink-soft); line-height: 1.8; }
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.rule { border-left: 2px solid var(--brass); padding-left: 12px; }
.rule b { display: block; font-family: var(--serif); font-size: 15px; margin-bottom: 4px; }
.rule span { font-size: 10px; color: var(--ink-soft); line-height: 1.7; }

/* ---------- QC ---------- */
.qc-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.qc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.qc-table th { text-align: left; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--ash); font-weight: 400; padding: 12px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.qc-table td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); line-height: 1.8; }
.qc-table td strong { color: var(--ink); font-weight: 500; }
.qc-table tr:hover td { background: var(--paper-3); }
.blooper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.reject-card { background: var(--paper); border: 1px solid var(--line); padding: 22px; position: relative; box-shadow: var(--shadow); }
.reject-card .rc-cn { font-family: var(--serif); font-size: 52px; line-height: 1; color: rgba(178,58,44,0.35); position: absolute; top: 10px; right: 16px; }
.reject-card h4 { font-family: var(--serif); font-size: 20px; margin-bottom: 7px; }
.reject-card p { font-size: 11px; color: var(--ink-soft); line-height: 1.85; }
.reject-card .rc-who { margin-top: 14px; font-family: var(--mono); font-size: 8px; color: var(--ash); line-height: 1.7; }
.dims { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
.dim { background: var(--paper); border: 1px solid var(--line); padding: 22px; display: grid; grid-template-columns: 34px 1fr; gap: 14px; box-shadow: var(--shadow); }
.dim .d-icon { color: var(--brass); }
.dim h4 { font-family: var(--serif); font-size: 19px; margin-bottom: 4px; }
.dim p { font-size: 11px; color: var(--ink-soft); line-height: 1.85; }
.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.chain-item { background: var(--paper); border: 1px solid var(--line); padding: 18px; position: relative; box-shadow: var(--shadow); }
.chain-item .ci-no { font-family: var(--mono); font-size: 8px; color: var(--cinnabar); }
.chain-item h4 { font-family: var(--serif); font-size: 16px; margin: 8px 0 4px; }
.chain-item p { font-size: 10px; color: var(--ink-soft); line-height: 1.75; }
.qc-quote {
  margin-top: 32px;
  border: 1px solid rgba(178,58,44,0.35);
  background: var(--paper);
  padding: 30px 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
  position: relative;
}
.qc-quote::before {
  content: "退";
  position: absolute; right: 18px; top: 10px;
  font-family: var(--serif); font-size: 68px; color: rgba(178,58,44,0.12); line-height: 1;
}
.qc-quote blockquote { font-family: var(--serif); font-size: clamp(22px, 2.6vw, 32px); line-height: 1.55; color: var(--ink); }
.qc-quote .qc-sign { font-family: var(--mono); font-size: 8px; color: var(--ash); text-align: right; line-height: 1.9; position: relative; z-index: 1; }

/* ---------- roster ---------- */
.roster-toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: rgba(246,241,231,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-bottom: 24px;
}
.toolbar-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ash); }
#roster-search {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 12px 9px 34px;
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  transition: 0.25s;
}
#roster-search:focus { border-color: var(--cinnabar); }
#roster-search::placeholder { color: var(--ash); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  padding: 6px 10px;
  font-size: 10px;
  cursor: pointer;
  transition: 0.25s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--brass); }
.chip.active { background: var(--cinnabar); border-color: var(--cinnabar); color: #FFFDF8; }
.roster-count { font-family: var(--mono); font-size: 9px; color: var(--ash); white-space: nowrap; }
.roster-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.agent-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 16px 34px -30px rgba(29,27,24,0.4);
}
.agent-card:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 22px 40px -28px rgba(29,27,24,0.45); }
.agent-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: saturate(0.86); transition: transform 0.5s, filter 0.5s; border: 1px solid rgba(169,133,63,0.25); }
.agent-card:hover img { transform: scale(1.025); filter: saturate(0.98); }
.agent-card .ac-no { position: absolute; left: 14px; top: 14px; z-index: 2; font-family: var(--mono); font-size: 8px; color: var(--cinnabar); background: rgba(255,253,248,0.9); padding: 2px 4px; }
.agent-card .ac-body { padding: 10px 6px 7px; border-top: 1px solid var(--line); margin-top: 8px; }
.agent-card .ac-meta { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 8px; color: var(--ash); letter-spacing: 0.03em; }
.agent-card .ac-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brass); }
.agent-card .ac-name { font-family: var(--serif); font-size: 15px; line-height: 1.3; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-card .ac-tag { font-size: 9px; color: var(--ink-soft); line-height: 1.5; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 27px; }
.agent-card .ac-hover {
  position: absolute; inset: 8px;
  background: linear-gradient(0deg, rgba(29,27,24,0.72), transparent 46%);
  opacity: 0;
  transition: 0.3s;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 12px;
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: #FFFDF8;
  pointer-events: none;
}
.agent-card:hover .ac-hover { opacity: 1; }
.empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; border: 1px dashed var(--line); color: var(--ash); font-family: var(--mono); font-size: 11px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 250; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(29,27,24,0.58); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal-panel {
  position: relative; z-index: 1;
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: 360px 1fr;
  box-shadow: 0 30px 80px rgba(29,27,24,0.35);
}
.modal-img-wrap { position: relative; background: var(--paper-2); min-height: 540px; border-right: 1px solid var(--line); }
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; position: sticky; top: 0; filter: saturate(0.9); }
.modal-img-wrap .mi-team { position: absolute; left: 14px; top: 14px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: var(--cinnabar); background: rgba(255,253,248,0.9); border: 1px solid rgba(178,58,44,0.3); padding: 4px 7px; }
.modal-body { padding: 32px 34px 34px; }
.modal-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--brass); }
.modal-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mc, var(--cinnabar)); }
.modal-body h3 { font-family: var(--serif); font-size: 40px; line-height: 1.2; margin: 9px 0 4px; letter-spacing: 0.02em; }
.modal-en { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--ash); }
.modal-tagline { margin-top: 15px; font-family: var(--serif); font-size: 19px; color: var(--cinnabar); line-height: 1.55; }
.modal-desc { margin-top: 12px; font-size: 13px; line-height: 2; color: var(--ink-soft); }
.modal-sec { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-sec h4 { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--brass); margin-bottom: 9px; }
.modal-sec ul { display: grid; gap: 6px; }
.modal-sec li { position: relative; padding-left: 13px; font-size: 12px; line-height: 1.8; color: var(--ink-soft); }
.modal-sec li::before { content: ""; position: absolute; left: 0; top: 9px; width: 4px; height: 4px; background: var(--brass); transform: rotate(45deg); }
.modal-sec.not li::before { background: var(--cinnabar); }
.modal-quote { margin-top: 20px; border-left: 2px solid var(--cinnabar); padding: 4px 0 4px 15px; font-family: var(--serif); font-size: 17px; line-height: 1.7; color: var(--ink); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.modal-tags span { border: 1px solid var(--line); padding: 4px 7px; font-family: var(--mono); font-size: 8px; color: var(--ash); background: var(--paper-3); }
.modal-flow { display: grid; grid-template-columns: 1fr 22px 1fr; gap: 8px; align-items: center; margin-top: 18px; }
.modal-flow .mf-box { border: 1px solid var(--line); padding: 9px 11px; background: var(--paper-3); }
.modal-flow .mf-box span { display: block; font-family: var(--mono); font-size: 7px; color: var(--brass); margin-bottom: 3px; }
.modal-flow .mf-box b { font-size: 12px; font-weight: 500; line-height: 1.55; }
.modal-flow .mf-arrow { text-align: center; color: var(--brass); font-family: var(--mono); }
.modal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-nav button { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); padding: 8px 12px; font-size: 10px; cursor: pointer; transition: 0.25s; }
.modal-nav button:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.modal-nav .mn-index { font-family: var(--mono); font-size: 9px; color: var(--ash); }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 1px solid var(--line-strong); background: rgba(255,253,248,0.92); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.modal-close:hover { background: var(--paper); color: var(--cinnabar); }

/* ---------- footer ---------- */
.footer { padding: 84px 0 32px; border-top: 1px solid var(--line-strong); position: relative; overflow: hidden; }
.footer::before { content: "藏"; position: absolute; right: -20px; bottom: -130px; font-family: var(--serif); font-size: 380px; color: rgba(169,133,63,0.07); pointer-events: none; }
.footer h2 { font-family: var(--serif); font-size: clamp(32px, 5vw, 64px); line-height: 1.25; letter-spacing: 0.03em; max-width: 840px; }
.footer h2 em { font-style: normal; color: var(--cinnabar); }
.footer p { margin-top: 16px; max-width: 660px; color: var(--ink-soft); font-size: 13px; line-height: 2; }
.footer-meta { margin-top: 42px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 8px; color: var(--ash); letter-spacing: 0.08em; }
.footer-meta a:hover { color: var(--cinnabar); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(.22,1,.36,1), transform 0.6s cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-stage { height: 520px; max-width: 560px; margin: 0 auto; }
  .hero-case.main { width: 280px; }
  .hero-case.left { width: 168px; top: 130px; }
  .hero-case.right { width: 178px; top: 160px; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .special-top { grid-template-columns: 1fr; }
  .special-seal-wrap { justify-content: flex-start; }
  .gates { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-roster { grid-template-columns: repeat(3, 1fr); }
  .roster-grid { grid-template-columns: repeat(4, 1fr); }
  .functions { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  :root { --nav-h: 62px; }
  .wrap { width: calc(100% - 40px); }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(246,241,231,0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 20px 14px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .live-pill { display: none; }
  section { padding: 82px 0; }
  .chapter { grid-template-columns: 1fr; gap: 8px; }
  .chapter-no { font-size: 34px; }
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 36px); }
  .hero h1 { font-size: clamp(44px, 10vw, 64px); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .process-steps { grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
  .process-line { display: none; }
  .pipe-item .t { font-size: 13px; }
  .pd-top { flex-direction: column; }
  .ir-map { grid-template-columns: 1fr; }
  .ir-arrow { padding: 8px; border: 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .lanes { grid-template-columns: 1fr; }
  .lane::before { display: none; }
  .sim { grid-template-columns: 1fr; }
  .functions { grid-template-columns: repeat(2, 1fr); }
  .rules { grid-template-columns: repeat(2, 1fr); }
  .blooper { grid-template-columns: 1fr; }
  .dims { grid-template-columns: 1fr; }
  .chain { grid-template-columns: repeat(2, 1fr); }
  .roster-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-panel { grid-template-columns: 1fr; }
  .modal-img-wrap { min-height: 0; height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .modal-img-wrap img { position: static; height: 300px; }
  .modal-body { padding: 26px 24px 30px; }
  .tp-story { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .hero-stage { height: 420px; }
  .hero-case.main { width: 230px; top: 6px; }
  .hero-case.left, .hero-case.right { display: none; }
  .hero-case.main { width: 260px; top: 10px; z-index: 3; }
  .hero-stage { height: 390px; }
  .hero-case .hc-label b { font-size: 11px; }
  .hero-case .hc-label span { font-size: 8px; }
  .hero-seal { width: 68px; height: 68px; font-size: 10px; right: 8px; bottom: 0; }
  .hero-stats { margin-top: 32px; }
  .stat b { font-size: 30px; }
  .principles, .gates, .role-grid, .team-grid, .functions, .rules, .chain, .tp-roster { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .roster-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar-inner { gap: 8px; }
  .chips { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  .tp-head { grid-template-columns: 1fr; }
  .tp-stats { text-align: left; }
  .qc-quote { grid-template-columns: 1fr; }
  .qc-quote .qc-sign { text-align: left; }
  .modal { padding: 0; }
  .modal-panel { max-height: 100vh; height: 100vh; }
  .modal-img-wrap { height: 240px; }
  .modal-img-wrap img { height: 240px; }
  .modal-flow { grid-template-columns: 1fr; }
  .modal-flow .mf-arrow { transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
