/* =========================================================
   深潜智力 deepdive intelligence — 官网样式 V1.1
   两套主题，自动跟随访客的系统设置：
     浅色 → 浅滩（极淡的蓝绿到浅绿）
     深色 → 深海（顶部海面蓝，向下渐深到海底深蓝）
   主题由 <html data-theme="light|dark"> 控制；无脚本时由 prefers-color-scheme 决定
   ========================================================= */

/* ---------- 1. 字体：Noto Sans Mono CJK SC 子集（中文 2 列、英文 1 列，保证 ASCII 图对齐） ---------- */
@font-face {
  font-family: "DD Mono";
  src: url("../fonts/dd-mono-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DD Mono";
  src: url("../fonts/dd-mono-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. 设计变量 ---------- */
:root {
  --mono: "DD Mono", "Sarasa Mono SC", "Noto Sans Mono CJK SC", "Source Han Mono SC", ui-monospace,
    "SFMono-Regular", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --maxw: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --header-h: 68px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* 浅滩 */
  color-scheme: light;
  --page-bg:
    radial-gradient(1100px 620px at 88% -8%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, #d9eff1 0%, #ddf1ef 22%, #e0f2ec 55%, #e2f0ea 82%, #e5edeb 93%, #e9eceb 100%);
  --page-base: #e0f2ec;
  --text: #0f2c35;
  --text-2: #365a62;
  --text-3: #4f6f75;
  --line: #5f8f8b;           /* ASCII 线条 */
  --rule: rgba(15, 44, 53, .16);
  --accent: #0a6e62;
  --accent-ink: #f4fbf9;
  --accent-tint: rgba(10, 110, 98, .09);
  --warn: #875700;
  --surface: rgba(255, 255, 255, .5);
  --surface-strong: rgba(255, 255, 255, .72);
  --header-bg: rgba(220, 241, 241, .82);
  --deco: #3f938c;           /* 海面、浪花 */
  --deco-op: .72;
  --sand-wave: #4f9f98;
  --sand-grain: #98a3a3;     /* 沙粒：接近银色 */
  --sand-spark: #6fa8b6;     /* 沙地反光 */
  --coral: #e3998e;          /* 珊瑚 */
  --starfish: #e3a464;       /* 海星 */
  --shell: #c9a988;          /* 贝壳 */
  --turtle: #5a9f86;         /* 海龟 */
  --fish: #3f938c;           /* 鱼群 */
  --ray: rgba(255, 255, 255, .4);     /* 入射光 */
  --ps-user: #0a6e62;        /* 提示符 用户@主机 */
  --ps-path: #2b6aa6;        /* 提示符 路径 */
  --ps-punct: #4f6f75;       /* 提示符 : 与 $ */
  --cmd: #6b8084;            /* 命令文字 */
  --cmd-str: #9a7a45;        /* 命令里的字符串 */
  --cmd-cm: #4f8f88;         /* 命令里的注释 */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page-bg:
      radial-gradient(1000px 520px at 82% -6%, rgba(150, 205, 255, .22), rgba(150, 205, 255, 0) 60%),
      linear-gradient(180deg, #185a98 0%, #155089 7%, #103f73 22%, #0b2d59 45%, #071e42 70%, #040f27 100%);
    --page-base: #0b2d59;
    --text: #eef5fc;
    --text-2: #c6d9ee;
    --text-3: #b0c8e2;
    --line: #7fa6d2;
    --rule: rgba(190, 220, 250, .18);
    --accent: #a6dcff;
    --accent-ink: #082646;
    --accent-tint: rgba(166, 220, 255, .12);
    --warn: #ffd98a;
    --surface: rgba(3, 18, 44, .22);
    --surface-strong: rgba(3, 18, 44, .38);
    --header-bg: rgba(20, 80, 137, .78);
    --deco: #b3dbff;
    --deco-op: .6;
    --bubble: #bfe0ff;
    --sb-ridge: #4a76ad;
    --sb-fill: #2f5687;
    --sb-kelp: #4a95ad;
    --sb-snow: #7fa2cc;
    --fish: #a9d2f5;
    --jelly: #c3c9ff;
    --ray: rgba(150, 200, 245, .06);
    --ps-user: #7fb0d6;
    --ps-path: #6a9cc9;
    --ps-punct: #8aa6c4;
    --cmd: #a9bfd6;
    --cmd-str: #d9bd80;
    --cmd-cm: #86b5d8;
    --turtle-deep: #93c4d6;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg:
    radial-gradient(1000px 520px at 82% -6%, rgba(150, 205, 255, .22), rgba(150, 205, 255, 0) 60%),
    linear-gradient(180deg, #185a98 0%, #155089 7%, #103f73 22%, #0b2d59 45%, #071e42 70%, #040f27 100%);
  --page-base: #0b2d59;
  --text: #eef5fc;
  --text-2: #c6d9ee;
  --text-3: #b0c8e2;
  --line: #7fa6d2;
  --rule: rgba(190, 220, 250, .18);
  --accent: #a6dcff;
  --accent-ink: #082646;
  --accent-tint: rgba(166, 220, 255, .12);
  --warn: #ffd98a;
  --surface: rgba(3, 18, 44, .22);
  --surface-strong: rgba(3, 18, 44, .38);
  --header-bg: rgba(20, 80, 137, .78);
  --deco: #b3dbff;
  --deco-op: .6;
  --bubble: #bfe0ff;
  --sb-ridge: #4a76ad;
  --sb-fill: #2f5687;
  --sb-kelp: #4a95ad;
  --sb-snow: #7fa2cc;
  --fish: #a9d2f5;
  --jelly: #c3c9ff;
  --ray: rgba(150, 200, 245, .06);
  --ps-user: #7fb0d6;
  --ps-path: #6a9cc9;
  --ps-punct: #8aa6c4;
  --cmd: #a9bfd6;
  --cmd-str: #d9bd80;
  --cmd-cm: #86b5d8;
  --turtle-deep: #93c4d6;
}

/* ---------- 3. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

:focus-visible { outline: 2px dashed var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 4. ASCII 文本元素 ---------- */
.ascii {
  --cols: 48;
  --pre-max: 15px;
  margin: 0;
  font-family: var(--mono);
  font-size: min(var(--pre-max), calc((100vw - var(--gutter) * 2 - 2px) * 2 / var(--cols)));
  line-height: 1.32;
  white-space: pre;
  overflow: hidden;
  color: var(--text);
  font-kerning: none;
  font-variant-ligatures: none;
  letter-spacing: 0;
  tab-size: 2;
}
.w30 { --cols: 30; }
.w44 { --cols: 44; }
.w48 { --cols: 48; }
.w50 { --cols: 50; }
.w52 { --cols: 52; }
.w77 { --cols: 77; --pre-max: 14.5px; }
.w85 { --cols: 85; --pre-max: 14.5px; }

.ascii .ln { color: var(--line); }
.ascii .dim { color: var(--text-3); }
.ascii .hl { color: var(--accent); }
.ascii .b { font-weight: 700; }
.ascii .ok { color: var(--accent); }
.ascii .warn { color: var(--warn); }

.only-narrow { display: none; }
@media (max-width: 680px) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
}

/* [ 按钮 ] */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 .35em;
  font-size: 16px;
  color: var(--text-2);
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.btn::before { content: "[\00a0"; color: var(--line); }
.btn::after { content: "\00a0]"; color: var(--line); }
.btn:hover, .btn:focus-visible { background: var(--text); color: var(--page-base); }
.btn:hover::before, .btn:hover::after,
.btn:focus-visible::before, .btn:focus-visible::after { color: inherit; }
.btn-primary { color: var(--accent); font-weight: 700; }
.btn-primary::before, .btn-primary::after { color: var(--accent); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent); color: var(--accent-ink); }

.tag {
  display: inline-block;
  color: var(--text);
  white-space: nowrap;
}
.tag::before { content: "["; color: var(--line); margin-right: .25em; }
.tag::after { content: "]"; color: var(--line); margin-left: .25em; }

/* 键值表：像对齐的终端输出 */
.kv > div {
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 4px 20px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}
.kv > div:last-child { border-bottom: 1px dashed var(--rule); }
.kv dt { color: var(--accent); font-weight: 700; }
.kv dd { color: var(--text-2); }

/* ---------- 5. 页眉 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom-color: var(--rule);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { margin-right: auto; display: block; flex: none; }
.logo { height: 48px; width: auto; }
.logo--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo--light { display: none; }
  :root:not([data-theme="light"]) .logo--dark { display: block; }
}
:root[data-theme="dark"] .logo--light { display: none; }
:root[data-theme="dark"] .logo--dark { display: block; }

.site-nav ul { display: flex; gap: 6px; }
.site-nav a {
  display: inline-block;
  padding: 4px 2px;
  font-size: 15px;
  color: var(--text-2);
}
.site-nav a::before { content: "["; color: transparent; margin-right: .2em; }
.site-nav a::after { content: "]"; color: transparent; margin-left: .2em; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="true"] { color: var(--accent); }
.site-nav a[aria-current="true"]::before,
.site-nav a[aria-current="true"]::after { color: var(--accent); }

.theme-switch {
  display: none;
  align-items: center;
  font-size: 14px;
  color: var(--line);
}
.js .theme-switch { display: inline-flex; }
.theme-switch button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text-3);
  padding: 6px 2px;
  cursor: pointer;
}
.theme-switch button::before { content: "["; color: transparent; margin-right: .15em; }
.theme-switch button::after { content: "]"; color: transparent; margin-left: .15em; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { color: var(--accent); font-weight: 700; }
.theme-switch button[aria-pressed="true"]::before,
.theme-switch button[aria-pressed="true"]::after { color: var(--accent); }

.menu-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  padding: 8px 0;
  cursor: pointer;
}
.menu-toggle::before { content: "[\00a0"; color: var(--line); }
.menu-toggle::after { content: "\00a0]"; color: var(--line); }

/* ---------- 6. 首屏 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 128px) 0 clamp(88px, 9vw, 112px);
  overflow: hidden;
}

/* 海洋装饰：由脚本用字符绘制，颜色接近主题色 */
.surface, .bubbles, .school, .seabed {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 16px;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-kerning: none;
}
/* 首屏：一条海面线 + 偶尔的浪花，左右两端淡出 */
.surface {
  position: absolute;
  top: calc(var(--header-h) + 14px);
  left: 0;
  right: 0;
  height: 32px;
  z-index: -1;
  color: var(--deco);
  opacity: var(--deco-op);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}
/* 入射光：从右上方平行斜射下来的三道光，聚在一起，从左到右由细到粗、由短到长，颜色很淡
   光线图案固定为 1240×960 px，靠右上角对齐，窄屏只露出右侧较粗的光；遮罩从右上角向外淡出，并在首屏底部之前消失；缓慢平移 */
.rays {
  position: absolute;
  top: 0;
  right: 0;
  width: min(1240px, 92vw);
  height: 100%;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 60.7%, var(--ray) 61%, transparent 61.3%),
    linear-gradient(112deg, transparent 64.1%, var(--ray) 64.6%, transparent 65.1%),
    linear-gradient(112deg, transparent 67.8%, var(--ray) 68.6%, transparent 69.4%);
  background-size: 1240px 960px;
  background-position: 100% 0;
  background-repeat: no-repeat;
  -webkit-mask-image:
    radial-gradient(90% 140% at 100% 0%, #000 26%, rgba(0, 0, 0, .6) 58%, transparent 98%),
    linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(90% 140% at 100% 0%, #000 26%, rgba(0, 0, 0, .6) 58%, transparent 98%),
    linear-gradient(180deg, #000 55%, transparent 100%);
  mask-composite: intersect;
  filter: blur(2px);
  animation: rays 16s ease-in-out infinite alternate;
}
@keyframes rays {
  from { opacity: .8; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(28px); }
}
/* 区块小装饰：浅滩是吐泡泡的小鱼和贝壳沙地，深海是往下游的海龟和水母
   窄屏放在导语下方占一整行；宽屏放在标题右侧 */
.section .wrap { position: relative; }
.deco {
  display: none;
  position: relative;
  width: 100%;
  height: 96px;
  margin: 20px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 16px;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-kerning: none;
}
.js .deco { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .deco--trace { display: none; }
}
:root[data-theme="dark"] .deco--trace { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .deco--forms,
  :root:not([data-theme="light"]) .deco--why { display: none; }
}
:root[data-theme="dark"] .deco--forms,
:root[data-theme="dark"] .deco--why { display: none; }
.js .deco--jelly { display: none; }
:root[data-theme="dark"] .deco--jelly { display: block; }
@media (min-width: 1180px) {
  .deco {
    position: absolute;
    top: 60px;
    right: var(--gutter);
    width: 221px;
    height: 144px;
    margin: 0;
  }
}
.deco .fi { color: var(--fish); }
.deco .bb { color: var(--fish); opacity: .55; }
/* 深海：一只往左下方潜的海龟压在「05 追溯」的分隔线上，尾部在上一层，大半身子在下一层；分隔线在它经过处断开 */
.rule-gap, .rule-fill--tail { display: none; }
.deco.deco--dive {
  display: none;
  position: absolute;
  left: -74px;
  top: -84px;
  right: auto;
  width: 216px;
  height: 253px;
  margin: 0;
  font-size: 9px;
  line-height: 11px;
  overflow: visible;
  animation: dive 9s ease-in-out infinite;
}
:root[data-theme="dark"] .rule--dive { overflow: visible; }
:root[data-theme="dark"] .rule-gap { display: block; position: relative; flex: 0 0 132px; align-self: stretch; }
:root[data-theme="dark"] .rule-fill--tail { display: block; flex: 0 0 52px; }
:root[data-theme="dark"] .deco--dive { display: block; }
@keyframes dive {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, 5px); }
}
.deco--dive .te { color: var(--turtle-deep, var(--turtle)); }
.deco--dive .tl { color: var(--turtle-deep, var(--turtle)); opacity: .9; }
.deco--dive .tr { color: var(--turtle-deep, var(--turtle)); opacity: .8; }
.deco--dive .ts { color: var(--fish); opacity: .7; }
.deco--dive .tf { color: var(--turtle-deep, var(--turtle)); opacity: .5; }
.deco--dive .ty { color: #dff1ff; font-weight: 700; }
.deco--dive .bb { color: var(--bubble, var(--fish)); opacity: .7; }
@media (max-width: 900px) {
  :root[data-theme="dark"] .rule--dive { margin-bottom: 120px; }
}
@media (max-width: 760px) {
  .deco.deco--dive { font-size: 7px; line-height: 8.5px; left: -55px; top: -62px; width: 168px; height: 196px; }
  :root[data-theme="dark"] .rule-gap { flex-basis: 107px; }
  :root[data-theme="dark"] .rule-fill--tail { flex-basis: 26px; }
}
.deco .jf { color: var(--jelly, var(--fish)); opacity: .65; }
.deco .sh { color: var(--shell); }
.deco .st { color: var(--starfish); }
.deco .sg { color: var(--sand-grain); opacity: .7; }
.deco .sp { color: var(--sand-spark); font-weight: 700; }

/* 首屏底部：游过的鱼群 */
.school {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 80px;
  z-index: -1;
  color: var(--fish);
  opacity: .7;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
/* 深海首屏：上升的气泡与水母 */
.bubbles {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: none;
}
.bubbles .bb { color: var(--bubble); opacity: .55; }
.bubbles .jf { color: var(--jelly); opacity: .6; }
/* 页底：浅滩是沙地与反光，深海是海床 */
.seabed {
  display: block;
  height: 192px;
  margin-top: 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.seabed .sd-w { color: var(--sand-wave); opacity: .6; }
.seabed .sd-g { color: var(--sand-grain); opacity: .75; }
.seabed .sd-s { color: var(--sand-spark); font-weight: 700; }
.seabed .sd-c { color: var(--coral); }
.seabed .sd-st { color: var(--starfish); }
.seabed .sd-sh { color: var(--shell); }
.seabed .sd-t { color: var(--turtle); opacity: .85; }
.seabed .sd-t2 { color: var(--turtle); opacity: .45; }
.seabed .sb-r { color: var(--sb-ridge); }
.seabed .sb-f { color: var(--sb-fill); }
.seabed .sb-k { color: var(--sb-kelp); }
.seabed .sb-s { color: var(--sb-snow); opacity: .7; }
.seabed .sb-a { color: var(--sb-snow); }
.seabed .sb-l { color: #ffe39a; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bubbles { display: block; }
}
:root[data-theme="dark"] .bubbles { display: block; }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
}

/* 终端提示符：diver@deepdive-ai:~$ 命令 */
.cmd {
  margin: 22px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cmd);
  overflow-wrap: break-word;
}
.cmd .ps1 { color: var(--ps-punct); margin-right: .15em; }
.cmd .u { color: var(--ps-user); font-weight: 700; }
.cmd .w { color: var(--ps-path); font-weight: 700; }
.cmd .s { color: var(--cmd-str); }
.cmd .cm { color: var(--cmd-cm); }
.cmd .a { white-space: nowrap; }
.cmd--block {
  font-family: var(--mono);
  white-space: pre;
  overflow-x: auto;
  font-kerning: none;
}
.cmd--last { margin-top: 48px; }
.out { margin-top: 2px; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.hero .cmd { margin-top: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: .3em;
  vertical-align: -.17em;
  background: currentColor;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.3rem, 1.25rem + 3.6vw, 3.7rem);
  line-height: 1.22;
  letter-spacing: .01em;
}
.hero h1 .keep { display: inline-block; }

.hero-sub {
  margin-top: 26px;
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
  line-height: 1.85;
  color: var(--text-2);
}
.actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-left: -.35em;
}

.hero-card .ascii { --pre-max: 15px; }
.hero-card figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- 7. 区块通用 ---------- */
.section { padding-block: clamp(48px, 6vw, 76px); }

.rule {
  display: flex;
  align-items: baseline;
  gap: .6em;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
}
.rule::before { content: "--"; color: var(--line); }
.rule-label { color: var(--text-2); }
.rule-fill { flex: 1; min-width: 0; overflow: hidden; color: var(--line); }
.rule-fill::before {
  content: "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
}
.rule::after { content: "--"; color: var(--line); }

.section h2 {
  margin-top: 10px;
  font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.25rem);
  line-height: 1.35;
}
.lead { margin-top: 18px; color: var(--text-2); font-size: 16.5px; max-width: 46em; }
.lead--sm { font-size: 15.5px; }
.sub { margin-top: clamp(56px, 7vw, 80px); }
.sub h3 { font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); }
.sub .ascii { margin-top: 28px; }
.sub .cmd + h3 { margin-top: 8px; }

/* 01 四个追问 */
.checks { margin-top: 40px; }
.checks li {
  display: grid;
  grid-template-columns: 10em minmax(0, 1fr);
  gap: 4px 24px;
  padding: 18px 0;
  border-top: 1px dashed var(--rule);
}
.checks li:last-child { border-bottom: 1px dashed var(--rule); }
.ck-key { font-weight: 700; color: var(--text); }
.ck-no { color: var(--accent); margin-right: .6em; }
.ck-q { color: var(--text-2); }

.quote {
  margin: 48px 0 0;
  font-size: clamp(1.05rem, .95rem + .45vw, 1.3rem);
  line-height: 1.75;
  font-weight: 700;
}
.quote p { position: relative; padding-left: 1.4em; }
.quote p::before { content: ">"; position: absolute; left: 0; color: var(--accent); }

/* 02 本体 */
.onto {
  margin-top: 44px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.onto-graph figcaption,
.arch-fig figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-3);
  max-width: 34em;
}

/* 03 四种形态：四张字符卡片，不加底色 */
.forms {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 28px 48px;
}

.note { margin-top: 28px; color: var(--text-2); font-size: 15.5px; }
/* 「④ 的要点」与深海的两只水母同一行：要点在左，水母在本层右下方；窄屏时水母换到下一行靠右 */
.forms-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 32px;
  margin-top: 28px;
}
.forms-foot .note { margin-top: 0; }
.deco.deco--jelly {
  position: relative;
  top: auto;
  right: auto;
  flex: none;
  width: 221px;
  height: 96px;
  margin: 0 0 0 auto;
}
.note p:first-child { color: var(--text); font-weight: 700; }

/* 04 架构 */
.arch {
  margin-top: 44px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.roles h3 { font-size: 17px; margin-bottom: 14px; }
.fine { margin-top: 16px; font-size: 13.5px; color: var(--text-3); }

/* 05 三条链 */
.chains { margin-top: 40px; }
.chains > li {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 6px 24px;
  padding: 18px 0;
  border-top: 1px dashed var(--rule);
}
.chains > li:last-child { border-bottom: 1px dashed var(--rule); }
.chain-name { font-weight: 700; color: var(--accent); }
.chain-steps { display: flex; flex-wrap: wrap; gap: 2px 0; color: var(--text); }
.chain-steps li { white-space: nowrap; }
.chain-steps li:not(:last-child)::after { content: "\00a0--->\00a0"; color: var(--line); }

.facts {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  color: var(--text-2);
}

/* 06 关于 */
.about {
  margin-top: 36px;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 80px);
}
.about-text p { color: var(--text-2); }
.about-text p + p { margin-top: 18px; }
.about-text .cmd { margin-top: 0; }
.about-text .about-lead { margin-top: 24px; color: var(--text); }
.about-text .out + .ascii-logo { margin-top: 20px; }
.about-text p.out { margin-top: 4px; }
.about-name {
  margin-top: 32px !important;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
  font-size: 15px;
}
.principles .cmd { margin: 0 0 8px; }
.principles li {
  position: relative;
  padding: 14px 0 14px 1.4em;
  border-bottom: 1px dashed var(--rule);
}
.principles li:last-child { border-bottom: 0; }
.principles li::before { content: "*"; position: absolute; left: 0; top: 14px; color: var(--accent); font-weight: 700; }
.principles h4 { font-size: 16px; }
.principles p { margin-top: 4px; font-size: 15px; color: var(--text-2); }

/* 07 联系 */
.contact {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
}
.contact .cmd--block { margin-top: 0; }
.contact h2 { margin-top: 18px !important; }
.contact-box .kv dd a { color: var(--text); border-bottom: 1px dashed var(--accent); }
.contact-box .kv dd a:hover { color: var(--accent); }
.contact-box .btn { margin-top: 20px; margin-left: -.35em; }

/* ---------- 8. 页脚 ---------- */
.site-footer { padding: 24px 0 0; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  padding-top: 32px;
}
.site-footer .rule::before { display: none; }
.ascii-logo {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  font-size: clamp(10px, 2.6vw, 14px);
  line-height: 1.2;
  color: var(--ps-path);
  white-space: pre;
  font-kerning: none;
}
.footer-meta { font-size: 13.5px; color: var(--text-2); }
.footer-meta p:first-child { color: var(--text-2); white-space: pre; }

/* ---------- 9. 场景详情页 / 文章（模板使用） ---------- */
.page-head { padding: calc(var(--header-h) + 72px) 0 40px; }
.page-head h1 { margin-top: 18px; font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.7rem); line-height: 1.3; }
.page-head .lead { margin-top: 18px; }
.prose { max-width: 44em; padding-block: 24px 96px; }
.prose h2 { font-size: 1.4rem; margin-top: 52px; }
.prose h3 { font-size: 1.15rem; margin-top: 32px; }
.prose p, .prose ul, .prose ol { margin-top: 16px; color: var(--text-2); }
.prose ul li { position: relative; padding-left: 1.4em; }
.prose ul li::before { content: "-"; position: absolute; left: 0; color: var(--accent); }
.prose a { color: var(--accent); border-bottom: 1px dashed var(--accent); }
.back-link { font-size: 14px; color: var(--text-3); }
.back-link::before { content: "<\00a0"; color: var(--accent); }

.not-found {
  min-height: 100vh;
  display: grid;
  place-content: center;
  padding: var(--header-h) var(--gutter);
}
.not-found h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.not-found p { margin-top: 12px; color: var(--text-2); }
.not-found .btn { margin-top: 28px; margin-left: -.35em; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 900px) {
  .forms { grid-template-columns: max-content; }
}

@media (max-width: 1100px) {
  .arch { grid-template-columns: minmax(0, 1fr); }
  .roles { max-width: 40em; }
}

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .onto { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 900px) {
  .header-inner { gap: 16px; }
  .menu-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
  }
  .is-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 4px var(--gutter) 12px; }
  .site-nav a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    color: var(--text);
    border-bottom: 1px dashed var(--rule);
  }
  .site-nav li:last-child a { border-bottom: 0; }
  html:not(.js) .site-nav { position: static; display: block; background: none; border: 0; }
  .about, .contact { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .cmd { font-size: 12.5px; }
  .out { font-size: 12px; }
  .logo { height: 36px; }
  .hero { padding: calc(var(--header-h) + 112px) 0 112px; }
  .forms { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .checks li, .chains > li { grid-template-columns: minmax(0, 1fr); padding: 14px 0; }
  .kv > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lead { font-size: 15.5px; }
  .footer-meta { text-align: left; }
}

@media (max-width: 400px) {
  .theme-switch { font-size: 13px; }
  .header-inner { gap: 10px; }
}

/* ---------- 11. 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor, .rays, .deco--dive { animation: none; }
}

/* ---------- 12. 打印 ---------- */
@media print {
  .site-header, .rays, .surface, .bubbles, .school, .seabed, .deco, .theme-switch, .menu-toggle, .cursor { display: none !important; }
  body { background: #fff; }
  .hero { min-height: auto; padding: 0 0 24px; }
}
