/* ============================================================
   LAB 设计系统 · RhineLab 风格重构
   基准（提取自参考工程 style.css / DESIGN.md）：
   暖灰白底 #e8e5e1 / 近黑 #080a08 / 暖杏金选中 #a67d48；
   MiSans 300·400·600·750；9–14px 紧凑排布 + 1px 宽字距标签；
   1px 暖灰发丝线；卡片 = 档案盒端面。
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --bg: #e8e5e1;             /* 暖灰白底 */
  --bg-raise: #eeEBE6;       /* 浅一度：卡片/面板 */
  --bg-sink: #e0ddd8;        /* 深一度：凹陷区 */
  --ink: #080a08;            /* 近黑 */
  --ink-2: #24221f;          /* 次黑 */
  --muted: #726f67;          /* 暖灰次级文字 */
  --faint: #817b70;          /* 更弱说明文字 */
  --line: #b8b3a9;           /* 发丝线 */
  --line-strong: #8d826c;    /* 强发丝线 */
  --accent: #a67d48;         /* 暖杏金（选中信号，可被后台主题色覆盖） */
  --accent-deep: #946b3c;
  --accent-soft: #e4d5c1;    /* 杏金浅底 */
  --paper-card: #f4f3eb;     /* 卡片端面纸色 */
  --danger: #9c3b2a;

  --font: "MiSans", "Mi Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --fs-9: 9px;  --fs-10: 10px; --fs-11: 11px; --fs-12: 12px; --fs-13: 13px;
  --fs-14: 14px; --fs-15: 15px; --fs-16: 16px; --fs-18: 18px; --fs-22: 22px;
  --fs-24: 24px; --fs-38: clamp(30px, 4.6vw, 44px);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 40px; --sp-7: 64px; --sp-8: 96px;

  --shadow-1: 0 1px 4px rgba(8, 10, 8, .08), 0 6px 18px rgba(8, 10, 8, .06);
  --shadow-2: 0 2px 8px rgba(8, 10, 8, .10), 0 14px 34px rgba(8, 10, 8, .10);
  --shadow-3: 0 6px 16px rgba(8, 10, 8, .12), 0 28px 64px rgba(8, 10, 8, .14);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 160ms; --dur-base: 320ms; --dur-slow: 640ms;

  --w-wide: 1180px;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(60rem 34rem at 86% -6%, rgba(166, 125, 72, .06), transparent 60%),
    radial-gradient(50rem 30rem at -8% 8%, rgba(8, 10, 8, .035), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.75;
  letter-spacing: .3px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
p { text-wrap: pretty; margin: 0 0 var(--sp-3); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--sp-5); }
.center { text-align: center; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 16px; }
.skip-link:focus { left: 8px; }
/* 仅供读屏的文本 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* hidden 属性优先于 img{display:block} 等作者样式，保证隐藏语义可靠 */
[hidden] { display: none !important; }

/* 实验室标签：小号 + 1px 宽字距 + 前置短线 */
.kicker {
  font-size: var(--fs-10); letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 var(--sp-2); display: flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 18px; height: 1px; background: var(--accent); }

/* 链接下划线扫过 */
.link-sweep {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 0% 1px; background-position: 0 100%;
  padding-bottom: 2px; transition: background-size var(--dur-base) var(--ease-out), color var(--dur-fast) ease;
}
.link-sweep:hover { background-size: 100% 1px; color: var(--accent-deep); }

/* ---------- 3. 顶栏（终端状态条） ---------- */
.lab-top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lab-top-inner {
  max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--sp-5);
  height: 46px; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.lab-brand { display: flex; align-items: center; gap: 10px; font-size: var(--fs-13); font-weight: 600; letter-spacing: 1px; }
.lab-mark {
  width: 14px; height: 14px; background: var(--ink); display: inline-block;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.lab-meta { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; }
.lab-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); }
@media (max-width: 720px) { .lab-meta span.hide-m { display: none; } }

/* 目录导航常驻：跟随滚动钉在顶栏下方（毛玻璃防透字） */
.topnav {
  position: sticky; top: 46px; z-index: 49;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topnav-inner {
  max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--sp-5);
  display: flex; gap: var(--sp-4); overflow-x: auto; scrollbar-width: none;
}
.topnav-inner::-webkit-scrollbar { display: none; }
.topnav a {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 2px;
  font-size: var(--fs-11); letter-spacing: 1px; white-space: nowrap;
  color: var(--muted); border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.topnav a i { font-style: normal; font-size: var(--fs-10); color: var(--accent); font-variant-numeric: tabular-nums; }
.topnav a:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- 4. 章节头 ---------- */
.section { padding: var(--sp-7) 0; scroll-margin-top: 96px; }
.sec-head {
  display: flex; align-items: flex-end; gap: var(--sp-4);
  max-width: var(--w-wide); margin: 0 auto var(--sp-5); padding: 0 var(--sp-5);
}
.sec-no {
  font-size: var(--fs-22); line-height: 1; color: var(--accent);
  font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 1px;
  border-right: 1px solid var(--line); padding-right: var(--sp-4);
}
.sec-title { margin: 0; font-size: var(--fs-24); font-weight: 600; line-height: 1.2; letter-spacing: 1px; }
.sec-hairline { flex: 1; height: 1px; background: var(--line); margin-bottom: 6px; }

/* ---------- 5. 首屏 ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-bg-gradient {
  background:
    radial-gradient(52rem 30rem at 84% 6%, rgba(166, 125, 72, .10), transparent 62%),
    radial-gradient(40rem 26rem at 4% 92%, rgba(8, 10, 8, .04), transparent 58%);
}
.hero-bg-solid { background: var(--bg-sink); }
.hero-bg-minimal { background: var(--bg); }
.hero-grid {
  max-width: var(--w-wide); margin: 0 auto; padding: var(--sp-8) var(--sp-5);
  display: grid; grid-template-columns: 1fr auto; gap: var(--sp-6); align-items: center;
  min-height: 56vh; position: relative;
}
.hero-main { max-width: 620px; min-width: 0; }   /* min-width:0：窄屏下允许收缩，避免网格按最小内容顶破视口 */
.hero-kicker { margin-bottom: var(--sp-3); }
.hero h1 {
  margin: 0 0 var(--sp-4); font-size: var(--fs-38); font-weight: 750;
  line-height: 1.12; letter-spacing: 1px;
}
.hero-sub {
  margin: 0 0 var(--sp-5); font-size: var(--fs-15); line-height: 1.9;
  color: var(--muted); padding-left: var(--sp-4); border-left: 2px solid var(--accent);
  white-space: pre-line;
}
.hero-cta { margin: 0; display: flex; align-items: center; gap: var(--sp-4); }
.hero-cta-link { font-size: var(--fs-14); font-weight: 600; letter-spacing: 1px; }
.hero-cta-link .arrow { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.hero-cta-link:hover .arrow { transform: translateX(6px); }
.hero-readout {
  font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--faint);
  text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 4px var(--sp-3);
  margin-top: var(--sp-5);
}
.hero-readout b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-portrait {
  margin: 0; padding: 8px; background: var(--paper-card);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  position: relative; transform: rotate(.6deg);
}
.hero-portrait img { width: min(280px, 30vw); aspect-ratio: 1; object-fit: cover; }
.hero-portrait::after {
  content: ""; position: absolute; right: -7px; bottom: -7px; width: 38px; height: 38px;
  border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
}
.hero-vertical {
  writing-mode: vertical-rl; font-size: var(--fs-10); letter-spacing: 6px;
  color: var(--faint); border-left: 1px solid var(--line); padding-left: var(--sp-3);
  align-self: stretch; display: flex; align-items: flex-start; padding-top: var(--sp-2);
}

/* 入场编排 */
.anim { opacity: 0; transform: translateY(16px); }
body.anim-go .anim { animation: rise var(--dur-slow) var(--ease-out) forwards; }
body.anim-go .a1 { animation-delay: 100ms; }
body.anim-go .a2 { animation-delay: 190ms; }
body.anim-go .a3 { animation-delay: 280ms; }
body.anim-go .a4 { animation-delay: 370ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 6. 简介 ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-6); align-items: start; }
.about-body { max-width: 40em; }
.about-body p { color: var(--ink-2); }
.about-portrait { margin: 0; padding: 8px; background: var(--paper-card); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.figures { display: flex; margin: var(--sp-5) 0 0; padding: 0; border-top: 1px solid var(--line); }
.figure { flex: 1; padding: var(--sp-3) var(--sp-4) 0; border-left: 1px solid var(--line); }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure-label { font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); margin: 0 0 2px; text-transform: uppercase; }
.figure-no { margin: 0; font-size: var(--fs-24); font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: .5px; }

/* ---------- 7. 循环档案阵列（作品展示 · 主题感知展台） ----------
   视觉冲击设计：舞台 = 独立于页面的「展台面板」，颜色全部走本节令牌——
   浅色模式是「美术馆白展台」（暖纸白 + 杏金氛围光 + 强投影），深色模式是
   「暗场剧场」（暖炭黑 + 杏金辉光），两套主题共用同一结构。
   氛围：透视网格地台 + 暗角/细扫描纹理 + 尘埃粒子（stagefx.js，颜色随主题）。
   卡片 = 玻璃档案盒：封面图 + 左上角位置序号 + 标题 + 分类标签；
   选中卡点亮四角括号 + 主题色辉光，其余卡片退入背景。
   阵列本体仍由 array.js 按无界 lane/row 坐标驱动（机制与原版一致）。 */
:root {
  /* 舞台 */
  --stage-bg:
    radial-gradient(58rem 26rem at 50% 118%, rgba(166, 125, 72, .13), transparent 60%),
    radial-gradient(34rem 20rem at 88% -10%, rgba(102, 122, 148, .08), transparent 60%),
    radial-gradient(30rem 18rem at 6% 0%, rgba(166, 125, 72, .06), transparent 55%),
    linear-gradient(180deg, #f8f6f1, #efece5 46%, #e9e6de);
  --stage-border: #d5cfc2;
  --stage-ring: rgba(141, 130, 108, .16);
  --stage-shadow: 0 24px 70px rgba(8, 10, 8, .16), 0 0 110px rgba(166, 125, 72, .10);
  --stage-scan:
    repeating-linear-gradient(0deg, rgba(8, 10, 8, .016) 0 1px, transparent 1px 3px),
    radial-gradient(125% 95% at 50% 46%, transparent 55%, rgba(101, 92, 74, .20) 100%);
  --stage-grid:
    linear-gradient(rgba(141, 130, 108, .20) 1px, transparent 1px) 0 0 / 100% 30px,
    linear-gradient(90deg, rgba(141, 130, 108, .15) 1px, transparent 1px) 0 0 / 30px 100%;
  /* 卡片 */
  --card-bg: linear-gradient(180deg, #fdfcf9, #f2f0e9);
  --card-border: rgba(141, 130, 108, .38);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 10px 26px rgba(8, 10, 8, .12);
  --card-hover-border: rgba(166, 125, 72, .65);
  --card-pressed-bg: linear-gradient(180deg, #f1eee7, #e9e6de);
  --card-pressed-ring: inset 0 0 0 1px rgba(166, 125, 72, .4);
  --card-sel-bg: linear-gradient(180deg, #fffef9, #f8f5ed);
  --card-sel-border: rgba(166, 125, 72, .9);
  --card-sel-shadow: 0 0 0 1px rgba(166, 125, 72, .35), 0 18px 46px rgba(8, 10, 8, .20), 0 0 38px rgba(166, 125, 72, .26);
  --card-media-bg: linear-gradient(135deg, #ddd8cb, #eae6db);   /* 纸色调占位：动图解码期间不再闪白 */
  --card-media-overlay: linear-gradient(180deg, rgba(24, 22, 18, 0) 62%, rgba(24, 22, 18, .16));
  --card-no-bg: rgba(255, 253, 247, .95);
  --card-no-border: rgba(166, 125, 72, .5);
  --card-inset-line: rgba(141, 130, 108, .22);
  --bracket: var(--accent);
  --screw: rgba(141, 130, 108, .45);
  --scan-sweep: linear-gradient(180deg,
    transparent 38%,
    rgba(166, 125, 72, .30) 47%,
    rgba(255, 253, 247, .92) 50%,
    rgba(166, 125, 72, .24) 53%,
    transparent 62%);
  --ring-base: 0 10px 26px rgba(8, 10, 8, .14);
  --ring-c1: rgba(166, 125, 72, .85);
  --ring-c2: rgba(166, 125, 72, .22);
  --ring-c3: rgba(166, 125, 72, 0);
  --stage-ink-strong: var(--ink);
  --stage-ink: var(--muted);
  --stage-ink-dim: #8a8478;
  --stage-accent: var(--accent-deep);
  --stage-accent-bright: var(--accent);
  /* 控制台（状态条 + 详情读出） */
  --console-bg: linear-gradient(180deg, #f2f0e9, #edeae2);
  --console-border: #d5cfc2;
  --console-shadow: 0 14px 34px rgba(8, 10, 8, .10);
  --detail-bg: linear-gradient(180deg, #f7f5ee, #f1efe7);
  --detail-shadow: 0 16px 44px rgba(8, 10, 8, .12), inset 0 1px 0 rgba(255, 255, 255, .7);
  --detail-bar: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 12%, transparent));
  --detail-flash-from: #f2e5d0;
  --detail-flash-glow: 0 0 34px rgba(166, 125, 72, .28), 0 16px 44px rgba(8, 10, 8, .12);
  --d-thumb-border: #cfc9bb;
  --d-thumb-bg: #e9e6de;
  --d-tag-bg: rgba(166, 125, 72, .08);
  --d-tag-border: rgba(166, 125, 72, .45);
  --zoom-bg: rgba(166, 125, 72, .06);
  --zoom-bg-hover: rgba(166, 125, 72, .14);
  --zoom-border: rgba(166, 125, 72, .55);
  --zoom-glow: 0 0 22px rgba(166, 125, 72, .22);
}
html[data-theme="dark"] {
  --stage-bg:
    radial-gradient(58rem 26rem at 50% 118%, rgba(207, 157, 92, .22), transparent 60%),
    radial-gradient(34rem 20rem at 88% -10%, rgba(102, 122, 148, .12), transparent 60%),
    radial-gradient(30rem 18rem at 6% 0%, rgba(207, 157, 92, .07), transparent 55%),
    linear-gradient(180deg, #1a1b17, #101110 46%, #0b0c0a);
  --stage-border: #050605;
  --stage-ring: rgba(224, 178, 110, .10);
  --stage-shadow: 0 24px 70px rgba(8, 10, 8, .38), 0 0 110px rgba(198, 148, 84, .15);
  --stage-scan:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .013) 0 1px, transparent 1px 3px),
    radial-gradient(125% 95% at 50% 46%, transparent 55%, rgba(3, 4, 3, .48) 100%);
  --stage-grid:
    linear-gradient(rgba(216, 180, 120, .15) 1px, transparent 1px) 0 0 / 100% 30px,
    linear-gradient(90deg, rgba(216, 180, 120, .11) 1px, transparent 1px) 0 0 / 30px 100%;
  --card-bg: linear-gradient(180deg, rgba(44, 43, 38, .97), rgba(26, 26, 22, .98));
  --card-border: rgba(222, 196, 148, .17);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 26px rgba(4, 5, 4, .5);
  --card-hover-border: rgba(226, 180, 112, .6);
  --card-pressed-bg: linear-gradient(180deg, #37352e, #1f1f1a);
  --card-pressed-ring: inset 0 0 0 1px rgba(224, 178, 110, .4);
  --card-sel-bg: linear-gradient(180deg, rgba(70, 63, 50, .98), rgba(38, 36, 29, .99));
  --card-sel-border: rgba(234, 198, 140, .9);
  --card-sel-shadow: 0 0 0 1px rgba(224, 178, 110, .4), 0 18px 46px rgba(4, 5, 4, .65), 0 0 38px rgba(207, 157, 92, .35);
  --card-media-bg: linear-gradient(135deg, #2c2b25, #23231d);
  --card-media-overlay: linear-gradient(180deg, rgba(11, 12, 10, 0) 60%, rgba(11, 12, 10, .45));
  --card-no-bg: rgba(12, 13, 11, .88);
  --card-no-border: rgba(224, 178, 110, .45);
  --card-inset-line: rgba(255, 255, 255, .07);
  --bracket: #e8c288;
  --screw: rgba(236, 201, 143, .35);
  --scan-sweep: linear-gradient(180deg,
    transparent 38%,
    rgba(224, 178, 110, .45) 47%,
    rgba(255, 244, 222, .9) 50%,
    rgba(224, 178, 110, .36) 53%,
    transparent 62%);
  --ring-base: 0 10px 26px rgba(4, 5, 4, .5);
  --ring-c1: rgba(224, 178, 110, .8);
  --ring-c2: rgba(224, 178, 110, .2);
  --ring-c3: rgba(224, 178, 110, 0);
  --stage-ink-strong: #f2eee3;
  --stage-ink: #a49d8d;
  --stage-ink-dim: #6e695c;
  --stage-accent: #e2b470;
  --stage-accent-bright: #e8c288;
  --console-bg: linear-gradient(180deg, #0e0f0c, #0c0d0b);
  --console-border: #26251f;
  --console-shadow: 0 14px 34px rgba(8, 10, 8, .22);
  --detail-bg: linear-gradient(180deg, #16170f, #101110);
  --detail-shadow: 0 16px 44px rgba(8, 10, 8, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
  --detail-bar: linear-gradient(180deg, #e2b470, rgba(226, 180, 112, .12));
  --detail-flash-from: #31291d;
  --detail-flash-glow: 0 0 34px rgba(224, 178, 110, .3), 0 16px 44px rgba(8, 10, 8, .3);
  --d-thumb-border: #3a382e;
  --d-thumb-bg: #1b1c17;
  --d-tag-bg: rgba(224, 178, 110, .1);
  --d-tag-border: rgba(224, 178, 110, .42);
  --zoom-bg: rgba(224, 178, 110, .08);
  --zoom-bg-hover: rgba(224, 178, 110, .18);
  --zoom-border: rgba(224, 178, 110, .5);
  --zoom-glow: 0 0 22px rgba(224, 178, 110, .28);
}
.array-wrap { position: relative; max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--sp-5); }
/* 幕后巨型描边字：杂志式底纹，强化栏目气场 */
.array-wrap::before {
  content: "WORKS · 档案阵列";
  position: absolute; top: -.52em; right: var(--sp-2); z-index: 0;
  font-size: clamp(52px, 8.6vw, 112px); font-weight: 750; line-height: 1;
  letter-spacing: 4px; white-space: nowrap; pointer-events: none; user-select: none;
  color: transparent; -webkit-text-stroke: 1px rgba(141, 130, 108, .30);
}
.array-intro { position: relative; z-index: 1; color: var(--muted); font-size: var(--fs-13); margin: -.2em 0 var(--sp-4); }
.array-stage {
  position: relative; overflow: hidden; z-index: 1; height: 560px;
  border: 1px solid var(--stage-border);
  border-radius: 18px 18px 0 0;
  background: var(--stage-bg);
  box-shadow: 0 0 0 1px var(--stage-ring), var(--stage-shadow);
  touch-action: pan-y;
}
.array-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 暗角 + CRT 细扫描纹理：压在最上层，聚拢视线（不影响交互） */
.array-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: var(--stage-scan);
}
.array-plane { position: absolute; inset: 0; z-index: 1; }
/* 透视网格地台：舞台地板向纵深退去 */
.array-floor {
  position: absolute; left: -14%; right: -14%; bottom: -36%; height: 66%; z-index: 0; pointer-events: none;
  background: var(--stage-grid);
  transform: perspective(520px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 46%);
  mask-image: linear-gradient(180deg, transparent 2%, #000 46%);
}
/* 尘埃粒子画布（stagefx.js 注入）：位于地台之上、卡片之下 */
.array-dust { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* 卡片：玻璃档案盒（尺寸由 array.js 按视口写入 --card-w / --card-h） */
.acard {
  position: absolute; top: 0; left: 0;
  width: var(--card-w, 160px); height: var(--card-h, 128px);
  appearance: none; border: 1px solid var(--card-border); border-radius: 10px; cursor: pointer;
  background: var(--card-bg);
  color: var(--stage-ink-strong); text-align: left; font-family: inherit;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--card-shadow);
  will-change: transform;
  transform-origin: center bottom;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-base) ease, background var(--dur-base) ease;
}
.acard.is-out { visibility: hidden; }
.acard:hover { border-color: var(--card-hover-border); }
.acard.pressed { background: var(--card-pressed-bg); box-shadow: var(--card-pressed-ring); }
/* 选中态：点亮 —— 描边 + 外辉光 + 更亮的表面，其余卡片退入背景 */
.acard.selected {
  border-color: var(--card-sel-border);
  background: var(--card-sel-bg);
  box-shadow: var(--card-sel-shadow);
  z-index: 5;
}

/* 封面图（后台上传的图片在此展示）：微缩放悬停 + 底部压暗渐变 */
.acard-media { position: relative; flex: 0 0 56%; background: var(--card-media-bg); overflow: hidden; }
.acard-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--card-media-overlay);
}
.acard-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease-out), filter var(--dur-base) ease; }
.acard:hover .acard-img, .acard.selected .acard-img { transform: scale(1.06); filter: saturate(1.12) brightness(1.04); }
.acard:not(.has-img) .acard-media { display: none; }
.acard:not(.has-img) .acard-body { flex: 1; }

/* 左上角位置序号：随阵列移动自动改变（滚动/切换时跳动） */
.acard-no {
  position: absolute; top: 5px; left: 5px; z-index: 3;
  min-width: 1.9em; text-align: center;
  font-size: 9px; letter-spacing: 1.2px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--stage-accent);
  background: var(--card-no-bg); border: 1px solid var(--card-no-border);
  padding: 1px 4px;
}
.acard:not(.has-img) .acard-no { top: 6px; left: 6px; }
.acard-no.tick { animation: no-tick 220ms var(--ease-out); }
@keyframes no-tick {
  0% { transform: translateY(-6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* 文本区 */
.acard-body { flex: 0 0 44%; padding: 7px 10px 6px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
/* 无封面图时：文字区占满，并为左上角序号留出空间 */
.acard:not(.has-img) .acard-body { flex: 1; padding-top: 22px; }
.acard-title {
  font-size: var(--fs-12); font-weight: 600; letter-spacing: .4px; line-height: 1.4; color: var(--stage-ink-strong);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acard-meta {
  font-size: var(--fs-9); letter-spacing: 1px; color: var(--stage-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--card-inset-line); padding-top: 4px;
}

/* 端面刻线（未选中）→ 四角括号（选中，主题色） */
.acard::before {
  content: ""; position: absolute; inset: 4px; pointer-events: none; z-index: 2;
  border: 1px solid var(--card-inset-line);
  transition: border-color var(--dur-base) ease;
}
.acard.selected::before {
  border-color: transparent;
  background:
    linear-gradient(var(--bracket), var(--bracket)) left top / 13px 2px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) left top / 2px 13px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) right top / 13px 2px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) right top / 2px 13px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) left bottom / 13px 2px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) left bottom / 2px 13px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) right bottom / 13px 2px no-repeat,
    linear-gradient(var(--bracket), var(--bracket)) right bottom / 2px 13px no-repeat;
}
/* 四角螺钉 */
.acard::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(circle 2px at 6px 6px, var(--screw) 98%, transparent),
    radial-gradient(circle 2px at calc(100% - 6px) 6px, var(--screw) 98%, transparent),
    radial-gradient(circle 2px at 6px calc(100% - 6px), var(--screw) 98%, transparent),
    radial-gradient(circle 2px at calc(100% - 6px) calc(100% - 6px), var(--screw) 98%, transparent);
  opacity: .5;
}
.acard.selected::after { opacity: .3; }

/* 点击反馈：环形闪光 + 保密级扫描线 */
.acard-scan {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: var(--scan-sweep);
}
.acard.hit .acard-scan { animation: scan-sweep 820ms var(--ease-out); }
@keyframes scan-sweep {
  0% { opacity: 1; transform: translateY(-105%); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(105%); }
}
.acard.hit {
  animation: ring-flash 700ms var(--ease-out);
}
/* 边框高亮只存在于动画期间（0% 亮起，结束后回落到常规边框），不再常驻 .hit 类上
   —— 修复「点击过的卡片永久保持高亮」 */
@keyframes ring-flash {
  0% { box-shadow: 0 0 0 0 var(--ring-c1, rgba(166, 125, 72, .8)), var(--ring-base); border-color: var(--stage-accent); }
  60% { box-shadow: 0 0 0 12px var(--ring-c2, rgba(166, 125, 72, .2)), var(--ring-base); }
  100% { box-shadow: 0 0 0 26px var(--ring-c3, rgba(166, 125, 72, 0)), var(--ring-base); }
}

/* 状态读出条：编号 / 列内序号 / 列号列名 —— 与舞台连成一台「控制台」 */
.array-status {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-4);
  margin-top: 0; padding: 10px 16px 12px;
  background: var(--console-bg);
  border: 1px solid var(--console-border); border-top: 0;
  border-radius: 0 0 14px 14px;
  font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--stage-ink); text-transform: uppercase;
  box-shadow: var(--console-shadow);
}
.array-status .as-item { display: inline-flex; align-items: baseline; gap: 6px; }
.array-status b { color: var(--stage-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.array-status i { font-style: normal; color: var(--stage-ink-dim); }
.array-status .as-name { color: var(--stage-ink-strong); letter-spacing: 1px; }
.array-status .as-hint { margin-left: auto; color: var(--stage-ink-dim); }

/* 滚动数字（460ms，与参考一致）：数字带竖排，窗口只露出一位 */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; }
.roll .digit { display: inline-block; width: .62em; height: 1.05em; overflow: hidden; position: relative; }
.roll .digit > span { display: block; line-height: 1.05; transition: transform 460ms cubic-bezier(.22, .61, .36, 1); }
.roll .digit > span > span { display: block; height: 1.05em; line-height: 1.05; }
.array-detail .d-no .roll .digit { width: .58em; height: 1.08em; }
.array-detail .d-no .roll .digit > span > span { height: 1.08em; line-height: 1.08; }

/* 详情读出条：控制台面板 + 左侧信号灯条（颜色随主题） */
.array-detail {
  position: relative; margin-top: var(--sp-3);
  border: 1px solid var(--console-border); border-radius: 14px;
  background: var(--detail-bg);
  box-shadow: var(--detail-shadow);
  padding: var(--sp-4) var(--sp-5) var(--sp-4) calc(var(--sp-4) + 6px);
  display: grid; grid-template-columns: auto auto 1fr auto; gap: var(--sp-4); align-items: center;
  min-height: 96px; transition: border-color var(--dur-base) ease, box-shadow var(--dur-base) ease;
}
.array-detail::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px;
  background: var(--detail-bar);
}
.array-detail.flash { animation: detail-flash 520ms var(--ease-out); }
@keyframes detail-flash {
  0% { background: var(--detail-flash-from); box-shadow: var(--detail-flash-glow); }
  100% { background: var(--detail-bg); }
}
.array-detail .d-no { font-size: var(--fs-38); font-weight: 300; letter-spacing: 1px; color: var(--stage-accent-bright); line-height: 1; display: flex; }
.array-detail .d-thumb {
  width: 96px; height: 64px; object-fit: cover;
  border: 1px solid var(--d-thumb-border); background: var(--d-thumb-bg);
  box-shadow: 0 6px 18px rgba(4, 5, 4, .18);
}
.array-detail .d-main { min-width: 0; }
.array-detail .d-title { font-size: var(--fs-18); font-weight: 600; letter-spacing: 1px; margin: 0 0 2px; color: var(--stage-ink-strong); }
.array-detail .d-desc { font-size: var(--fs-13); color: var(--stage-ink); margin: 0 0 6px; max-width: 46em; }
.array-detail .d-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.array-detail .d-tag {
  font-size: var(--fs-10); letter-spacing: 1px; color: var(--stage-accent);
  border: 1px solid var(--d-tag-border); background: var(--d-tag-bg); padding: 1px 8px;
}
.array-detail .d-link { font-size: var(--fs-12); letter-spacing: 1px; }
.array-detail .d-link a { color: var(--stage-accent); }
/* 右侧操作列：访问链接 + 大图详情按钮 */
.array-detail .d-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* 详情放大按钮：打开灯箱大图 */
.d-zoom {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: var(--fs-12); letter-spacing: 1.2px; color: var(--stage-accent);
  background: var(--zoom-bg); border: 1px solid var(--zoom-border);
  padding: 8px 14px; border-radius: 8px; white-space: nowrap;
  transition: background var(--dur-fast) ease, box-shadow var(--dur-base) ease, transform var(--dur-fast) ease;
}
.d-zoom:hover { background: var(--zoom-bg-hover); box-shadow: var(--zoom-glow); }
.d-zoom:active { transform: scale(.96); }

/* ---------- 7.5 作品灯箱（lightbox.js）：大图详情浮层 ---------- */
.works-lightbox {
  position: fixed; inset: 0; z-index: 220; display: flex; align-items: center; justify-content: center;
  padding: 4vmin; background: rgba(6, 7, 5, .8); backdrop-filter: blur(12px);
  animation: lb-in 280ms var(--ease-out);
}
.works-lightbox[hidden] { display: none; }
.works-lightbox.closing { animation: lb-out 200ms ease forwards; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-out { to { opacity: 0; } }
.lb-panel {
  position: relative; width: min(960px, 94vw); max-height: 92vh; overflow: hidden auto;
  display: grid; grid-template-rows: auto 1fr;
  border: 1px solid rgba(224, 178, 110, .3); border-radius: 18px;
  background: linear-gradient(180deg, #1a1b16, #0e0f0d);
  box-shadow: 0 40px 130px rgba(0, 0, 0, .65), 0 0 90px rgba(198, 148, 84, .18);
  animation: lb-pop 320ms var(--ease-out);
}
@keyframes lb-pop { from { transform: translateY(22px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.lb-media { position: relative; background:
  radial-gradient(40rem 18rem at 50% 0%, rgba(207, 157, 92, .12), transparent 60%), #0a0b09;
  display: flex; align-items: center; justify-content: center; min-height: 180px; }
.lb-media img { width: 100%; max-height: min(52vh, 460px); object-fit: contain; display: block; }
.lb-media .lb-empty {
  padding: 48px 20px; font-size: var(--fs-12); letter-spacing: 3px; color: #6e695c; text-transform: uppercase;
}
.lb-body { padding: 18px 24px 22px; }
.lb-top { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: 4px; }
.lb-no { font-size: var(--fs-22); font-weight: 300; color: #e8c288; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.lb-cat { font-size: var(--fs-10); letter-spacing: 1.8px; color: #8f887a; text-transform: uppercase; }
.lb-title { margin: 0 0 6px; font-size: var(--fs-24); font-weight: 600; letter-spacing: 1px; color: #f2eee3; line-height: 1.3; }
.lb-desc { margin: 0 0 12px; color: #a49d8d; font-size: var(--fs-14); line-height: 1.9; max-width: 56em; white-space: pre-line; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lb-tag { font-size: var(--fs-10); letter-spacing: 1px; color: #ecc98f; border: 1px solid rgba(224, 178, 110, .42); background: rgba(224, 178, 110, .1); padding: 1px 8px; }
.lb-actions { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.lb-open {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); font-weight: 600; letter-spacing: 1px; color: #16150f;
  background: linear-gradient(180deg, #ecce9c, #dcb277); border: none; border-radius: 8px;
  padding: 9px 18px; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 20px rgba(224, 178, 110, .3);
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-base) ease;
}
.lb-open:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(224, 178, 110, .42); }
.lb-note { font-size: var(--fs-11); letter-spacing: 1px; color: #6e695c; }
.lb-close, .lb-nav {
  position: absolute; z-index: 2; appearance: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #e8c288; background: rgba(12, 13, 11, .72); backdrop-filter: blur(6px);
  border: 1px solid rgba(224, 178, 110, .4); border-radius: 50%;
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.lb-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 16px; }
.lb-close:hover { background: rgba(224, 178, 110, .22); }
.lb-nav { top: 50%; width: 44px; height: 44px; font-size: 18px; transform: translateY(-50%); }
.lb-nav:hover { background: rgba(224, 178, 110, .22); }
.lb-nav:active { transform: translateY(-50%) scale(.94); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* ---------- 8. 技能 ---------- */
.skill-group { margin-bottom: var(--sp-5); }
.skill-cat { font-size: var(--fs-11); letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; margin: 0 0 var(--sp-3); font-weight: 400; }
.skill-lines { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-6); }
.skill-line { display: grid; grid-template-columns: 9.5em 1fr 3.4em; align-items: center; gap: var(--sp-3); }
.skill-name { font-size: var(--fs-13); letter-spacing: .5px; }
.skill-rule { position: relative; height: 1px; background: var(--line); }
.skill-rule::before, .skill-rule::after { content: ""; position: absolute; top: -3px; width: 1px; height: 7px; background: var(--line-strong); }
.skill-rule::before { left: 0; } .skill-rule::after { right: 0; }
.skill-fill { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--accent); transition: width .9s var(--ease-out); }
.skill-fill::after { content: ""; position: absolute; right: -3px; top: -2px; width: 7px; height: 7px; background: var(--ink); transform: rotate(45deg); }
.skill-pct { font-size: var(--fs-12); text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 9. 时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 56em; }
.timeline::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 11em 1fr; gap: var(--sp-5); padding: 0 0 var(--sp-5) var(--sp-5); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -3.5px; top: 9px; width: 7px; height: 7px; background: var(--bg); border: 1px solid var(--accent); transform: rotate(45deg); }
.timeline-period { margin: 2px 0 0; font-size: var(--fs-11); letter-spacing: 1.8px; color: var(--muted); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.timeline-title { margin: 0 0 var(--sp-1); font-size: var(--fs-15); font-weight: 600; letter-spacing: .5px; }
.timeline-desc { margin: 0; color: var(--muted); font-size: var(--fs-13); max-width: 42em; }

/* ---------- 10. 通讯录 ---------- */
.contact-intro { color: var(--muted); margin-top: -0.5em; }
.contact-list { margin: 0; border-top: 1px solid var(--line-strong); max-width: 56em; }
.contact-row {
  display: grid; grid-template-columns: 13em 1fr; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-fast) ease;
}
.contact-row:hover { background: var(--bg-raise); }
.contact-key { font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; align-self: center; }
.contact-val { margin: 0; font-size: var(--fs-15); font-weight: 600; letter-spacing: .5px; overflow-wrap: anywhere; }

/* ---------- 11. 档案陈列（插件，保留可用） ---------- */
.arch-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); max-width: 62em; }
.arch-row { border-bottom: 1px solid var(--line); }
.arch-row-head {
  display: grid; grid-template-columns: 5em 1fr auto auto; gap: var(--sp-3);
  align-items: center; width: 100%; padding: var(--sp-3) var(--sp-2);
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; color: inherit; transition: background-color var(--dur-fast) ease;
}
.arch-row-head:hover { background: var(--bg-raise); }
.arch-no { font-size: var(--fs-15); color: var(--accent-deep); font-weight: 600; letter-spacing: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.arch-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.arch-title { font-size: var(--fs-15); font-weight: 600; letter-spacing: .5px; line-height: 1.4; }
.arch-en { font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); font-weight: 400; margin-left: 8px; text-transform: uppercase; }
.arch-meta { font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); }
.arch-toggle { font-size: var(--fs-16); color: var(--muted); width: 1.6em; text-align: center; transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast); }
.arch-row.open .arch-toggle { transform: rotate(45deg); color: var(--accent); }
.arch-body { padding: 0 var(--sp-2) var(--sp-4); max-width: 52em; }
.arch-row.open .arch-body { animation: rise var(--dur-slow) var(--ease-out); }
.arch-clearance {
  display: inline-block; font-size: var(--fs-10); letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--accent-deep); border: 1px solid var(--accent); padding: 2px 10px;
  margin: 0 0 var(--sp-3); transform: rotate(-.6deg);
}
.arch-abstract { margin: 0 0 var(--sp-3); }
.arch-findings { margin: 0 0 var(--sp-3); padding-left: 1.6em; color: var(--muted); }
.arch-findings li { margin-bottom: 4px; }
.arch-findings li::marker { color: var(--accent); }
.arch-ops { margin: 0; display: flex; gap: var(--sp-4); align-items: baseline; }
.arch-export {
  border: none; background: none; cursor: pointer; padding: 0 0 2px;
  font-family: inherit; font-size: var(--fs-13); color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-size: 0% 1px; background-position: 0 100%;
  transition: background-size var(--dur-base) var(--ease-out), color var(--dur-fast) ease;
}
.arch-export:hover { background-size: 100% 1px; color: var(--accent-deep); }
.arch-credit { margin: var(--sp-4) 0 0; font-size: var(--fs-10); letter-spacing: .5px; color: var(--faint); max-width: 56em; }

/* ---------- 12. 状态栏页脚 ---------- */
.colophon { border-top: 1px solid var(--line-strong); margin-top: var(--sp-7); background: var(--bg-sink); }
.colophon-inner {
  max-width: var(--w-wide); margin: 0 auto; padding: 10px var(--sp-5);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  font-size: var(--fs-10); letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase;
}
.colophon-mark { color: var(--accent); }
.colophon-icp {
  color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.colophon-icp:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ---------- 13. 滚动触发 ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.sec-empty { padding: var(--sp-8) 0; }
.sec-empty a { color: var(--accent-deep); }

/* ---------- 14. 降级与响应式 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anim, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .skill-fill { transition: none; }
  .roll .digit > span { transition: none; }
  .acard-no.tick, .acard.hit, .acard.hit .acard-scan, .array-detail.flash { animation: none !important; }
  .works-lightbox, .lb-panel { animation: none !important; }
  .acard-img, .acard:hover .acard-img { transition: none; transform: none; }
}

@media (max-width: 900px) {
  /* 手机上把不可见卡片彻底移除渲染：阵列池有约百张卡，若都用 visibility 隐藏，
     会占满移动端 GPU 的合成层预算 → 被迫每帧重绘 → 内嵌动图持续闪烁。
     display:none 释放图层，让可见的几张卡稳定走合成路径。 */
  .acard.is-out { display: none; }
  .section { padding: var(--sp-6) 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; padding: var(--sp-6) var(--sp-4); }
  .hero-portrait { justify-self: start; }
  .hero-portrait img { width: 200px; }
  .hero-vertical { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .skill-lines { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: var(--sp-1); }
  .contact-row { grid-template-columns: 1fr; gap: 2px; }
  .sec-head { flex-wrap: wrap; }
  .sec-hairline { display: none; }
  .array-stage { height: 420px; }
  .array-status .as-hint { margin-left: 0; }
  .array-detail { grid-template-columns: auto 1fr; }
  .array-detail .d-thumb { width: 64px; height: 48px; }
  .array-detail .d-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .figures { flex-direction: column; }
  .figure { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--sp-2); }
  .figure:first-child { border-top: 0; padding-top: 0; }
  .msg-grid { grid-template-columns: 1fr; }
  .lb-nav { display: none; }
}

@media (max-width: 720px) {
  .array-wrap::before { font-size: 44px; letter-spacing: 2px; top: -.4em; }
  .works-lightbox { padding: 2.5vmin; }
  .lb-body { padding: 14px 16px 18px; }
  .lb-title { font-size: var(--fs-18); }
}

/* ---------- 15. 全站深色模式（html[data-theme="dark"]） ----------
   令牌整体反转：暖炭黑纸面 + 提亮墨色 + 杏金提亮；作品区舞台本就是暗场，天然兼容。 */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141511;
  --bg-raise: #1c1e18;
  --bg-sink: #0f100d;
  --ink: #ece8dc;
  --ink-2: #d8d3c4;
  --muted: #a29b8a;
  --faint: #7e7869;
  --line: #34332b;
  --line-strong: #4b4739;
  --accent-soft: #453623;
  --paper-card: #1f201a;
  --danger: #d3705a;
  --shadow-1: 0 1px 4px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .4);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, .5), 0 14px 34px rgba(0, 0, 0, .45);
  --shadow-3: 0 6px 16px rgba(0, 0, 0, .55), 0 28px 64px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] body {
  background:
    radial-gradient(60rem 34rem at 86% -6%, rgba(207, 157, 92, .08), transparent 60%),
    radial-gradient(50rem 30rem at -8% 8%, rgba(0, 0, 0, .42), transparent 55%),
    var(--bg);
}
html[data-theme="dark"] .hero-bg-solid { background: var(--bg-sink); }

/* 主题切换按钮（终端风） */
.theme-toggle {
  appearance: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-10); letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted); background: none; border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-base) ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 0 14px rgba(224, 178, 110, .25); }
html[data-theme="dark"] .theme-toggle .tt-ico { color: var(--accent); }

/* ---------- 16. 阅读进度条 + 回到顶部 + 导航高亮 ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 80;
  width: 100%; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ffd9a0));
  transform-origin: 0 50%; transform: scaleX(0);
}
.back-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  width: 42px; height: 42px; appearance: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink);
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base), border-color var(--dur-fast) ease;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { border-color: var(--accent); }
.topnav a.active { color: var(--ink); border-color: var(--accent); }

/* ---------- 17. 访客留言板（前台表单） ---------- */
.msg-form {
  margin-top: var(--sp-6); max-width: 56em;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-raise) 70%, transparent), var(--bg-raise));
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
}
.msg-form-title {
  margin: 0 0 2px; font-size: var(--fs-13); font-weight: 600; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.msg-form-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
.msg-form-hint { margin: 0 0 var(--sp-4); font-size: var(--fs-11); color: var(--faint); letter-spacing: .5px; }
.msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.msg-form label { display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-11); letter-spacing: 1.2px; color: var(--muted); margin-bottom: var(--sp-3); }
.msg-form input, .msg-form textarea {
  font-family: inherit; font-size: var(--fs-14); color: var(--ink); letter-spacing: .3px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 9px 12px; resize: vertical; min-height: 0;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.msg-form textarea { min-height: 96px; line-height: 1.7; }
.msg-form input:focus, .msg-form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.msg-foot { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.msg-submit {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: var(--fs-13); font-weight: 600; letter-spacing: 1.5px;
  color: var(--bg); background: var(--ink); border: 1px solid var(--ink);
  padding: 10px 22px; border-radius: 8px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease,
              border-color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.msg-submit:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.msg-submit[disabled] { opacity: .55; cursor: not-allowed; }
.msg-status { font-size: var(--fs-12); letter-spacing: .5px; color: var(--faint); }
.msg-status.ok { color: var(--accent-deep); }
.msg-status.err { color: var(--danger); }

/* ---------- 18. 访客终端（terminal.js） ---------- */
.term-overlay {
  position: fixed; inset: 0; z-index: 240;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 6vmin 4vmin; background: rgba(6, 7, 5, .66); backdrop-filter: blur(8px);
  animation: lb-in 200ms var(--ease-out);
}
.term-overlay[hidden] { display: none; }
.term-panel {
  width: min(720px, 94vw); max-height: 76vh; display: flex; flex-direction: column;
  border: 1px solid rgba(224, 178, 110, .32); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #17180f, #0d0e0b);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), 0 0 80px rgba(198, 148, 84, .14);
  animation: lb-pop 280ms var(--ease-out);
}
.term-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid rgba(224, 178, 110, .18);
  background: rgba(224, 178, 110, .05);
}
.term-dots { display: inline-flex; gap: 5px; }
.term-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(224, 178, 110, .55); }
.term-dots i:first-child { background: #d3705a; }
.term-dots i:nth-child(2) { background: #d9a441; }
.term-title {
  font-size: var(--fs-10); letter-spacing: 1.8px; text-transform: uppercase;
  color: #a49d8d; margin-right: auto;
}
.term-close {
  appearance: none; cursor: pointer; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  color: #e8c288; background: none; border: 1px solid rgba(224, 178, 110, .4); border-radius: 7px;
  font-size: 12px; transition: background var(--dur-fast) ease;
}
.term-close:hover { background: rgba(224, 178, 110, .18); }
.term-out {
  padding: 12px 14px 6px; min-height: 200px; max-height: 46vh; overflow-y: auto;
  font-size: var(--fs-13); line-height: 1.85; letter-spacing: .3px; color: #d8d3c4;
  scrollbar-width: thin;
}
.term-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line.err { color: #e08a72; }
.term-line.ok { color: #ecc98f; }
.term-line.dim { color: #7e7869; }
.term-tag {
  display: inline-block; margin-right: 8px; font-size: var(--fs-11); letter-spacing: 1px;
  color: #ecc98f;
}
.term-tag.err { color: #e08a72; }
.term-tag.dim { color: #7e7869; }
.term-tag.warn { color: #e8b36a; }
.term-tag.prompt { color: #8fbf7f; }
.term-inrow {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 13px; border-top: 1px solid rgba(224, 178, 110, .18);
}
.term-prompt { font-size: var(--fs-12); letter-spacing: .5px; color: #8fbf7f; white-space: nowrap; }
.term-input {
  flex: 1; min-width: 0; font-family: inherit; font-size: var(--fs-14); letter-spacing: .3px;
  color: #f0ece1; background: none; border: none; outline: none; caret-color: #e8c288;
}
.term-input::placeholder { color: #6e695c; }
/* 顶栏终端入口按钮：与主题切换同族 */
.term-chip { font-weight: 600; }
.term-chip:hover { color: #ecc98f; }

/* ---------- 19. 开机自检动画（boot.js） ---------- */
.boot-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(50rem 26rem at 50% 112%, rgba(207, 157, 92, .16), transparent 62%),
    #0b0c0a;
  cursor: pointer;
  transition: opacity 600ms var(--ease-out);
}
.boot-overlay.done { opacity: 0; pointer-events: none; }
.boot-box { width: min(560px, 88vw); }
.boot-line {
  font-size: 13px; letter-spacing: 1.2px; line-height: 2.1; color: #a49d8d;
  text-shadow: 0 0 12px rgba(224, 178, 110, .25);
  opacity: 0; animation: boot-line-in 260ms var(--ease-out) forwards;
}
@keyframes boot-line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.boot-line.b-head { color: #e8c288; letter-spacing: 2.4px; margin-bottom: 10px; }
.boot-line.b-ok { color: #9ec98f; }
.boot-line.b-brand {
  margin-top: 14px; font-size: 15px; font-weight: 600; letter-spacing: 3px; color: #f2eee3;
}
.boot-hint {
  margin-top: 26px; font-size: 10px; letter-spacing: 2.4px; text-transform: uppercase;
  color: #57534a; opacity: 0; animation: boot-line-in 400ms ease forwards;
}

/* ---------- 20. 页脚每日格言（MOTD） ---------- */
.colophon .motd {
  font-size: var(--fs-10); letter-spacing: 1.2px; color: var(--muted);
  max-width: 46em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.colophon .motd::before { content: "◆ "; color: var(--accent); }
@media (max-width: 720px) {
  .colophon .motd, .colophon-inner > span:last-child { display: none; }
  .colophon-inner { letter-spacing: 1.1px; }
}

/* ---------- 21. 打印版式：Ctrl+P 输出干净的纸质档案 ---------- */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .lab-top, .topnav, .array-stage, .array-status, .array-detail, .array-wrap .array-intro,
  .back-top, .scroll-progress, .theme-toggle, .term-chip, .works-lightbox,
  .term-overlay, .boot-overlay, .aiw-root, .array-wrap::before,
  .msg-form form, .msg-form-hint, .skill-rule, .hero-readout, .skip-link { display: none !important; }
  .anim, .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
  .section { padding: 14pt 0 !important; }
  .sec-head, .array-wrap, .container, .hero-grid { max-width: 100% !important; }
  .hero h1 { font-size: 22pt; }
  .sec-title { font-size: 15pt; }
  .about-body p { color: #000; }
  /* 作品区：打印时用服务器端渲染的清单替代交互阵列 */
  .print-works { display: block !important; margin: 8pt 0 0; padding: 0 0 0 1.4em; }
  .print-works li { font-size: 10.5pt; line-height: 1.7; margin-bottom: 3pt; }
  .print-works b { color: #946b3c; }
  a { text-decoration: none !important; color: #000 !important; }
}
/* 屏幕上隐藏打印清单 */
.print-works { display: none; }

/* ---------- 22. 留言墙（公开留言） ---------- */
.msg-public-row {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important;
  font-size: var(--fs-12) !important; color: var(--muted) !important; letter-spacing: .3px !important;
  margin: -2px 0 var(--sp-4) !important; cursor: pointer;
}
.msg-public-row input { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.msg-wall { margin-top: var(--sp-5); max-width: 56em; }
.msg-wall-title {
  margin: 0 0 var(--sp-3); font-size: var(--fs-13); font-weight: 600; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.msg-wall-title::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
.msg-wall-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg-wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.wall-card {
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: linear-gradient(180deg, var(--paper-card), color-mix(in srgb, var(--paper-card) 86%, var(--bg-sink)));
  box-shadow: var(--shadow-1);
  transform: rotate(-.5deg);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease;
}
.wall-card.tilt-r { transform: rotate(.55deg); }
.wall-card:hover { transform: rotate(0deg) translateY(-2px); box-shadow: var(--shadow-2); }
.wall-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.wall-name { font-size: var(--fs-13); font-weight: 600; letter-spacing: .5px; color: var(--ink); }
.wall-name::before { content: "◆ "; color: var(--accent); font-size: 9px; }
.wall-date { margin-left: auto; font-size: var(--fs-10); letter-spacing: 1px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wall-text {
  margin: 0; font-size: var(--fs-13); line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.msg-wall-empty { grid-column: 1 / -1; margin: 0; font-size: var(--fs-13); color: var(--faint); }
@media (prefers-reduced-motion: reduce) {
  .wall-card, .wall-card.tilt-r { transform: none !important; }
}

/* ---------- 23. 终端留言墙文字 + TOP SECRET 印章 ---------- */
.term-wall-name { color: #ecc98f; }
.lab-stamp {
  position: fixed; top: 42%; left: 50%; z-index: 310;
  font-size: clamp(34px, 6vw, 64px); font-weight: 750; letter-spacing: 10px;
  color: #c2492f; border: 4px solid #c2492f; border-radius: 10px;
  padding: 10px 30px; background: rgba(8, 9, 7, .25); backdrop-filter: blur(2px);
  transform: translate(-50%, -50%) rotate(-8deg) scale(1.6);
  opacity: 0; pointer-events: none;
  text-shadow: 0 0 18px rgba(194, 73, 47, .4);
  box-shadow: 0 0 40px rgba(194, 73, 47, .25), inset 0 0 24px rgba(194, 73, 47, .15);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.lab-stamp.show { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }

/* ---------- 24. 系统监控 HUD（telemetry.js） ---------- */
.sys-hud {
  position: fixed; left: 16px; bottom: 16px; z-index: 65;
  width: 248px; font-size: var(--fs-10);
  border: 1px solid rgba(224, 178, 110, .32); border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 19, 15, .93), rgba(11, 12, 10, .95));
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px rgba(4, 5, 4, .45), 0 0 30px rgba(198, 148, 84, .10);
  color: #a49d8d; overflow: hidden;
  transition: opacity var(--dur-base) ease;
}
.sys-hud[hidden] { display: none; }
.sys-hud-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-bottom: 1px solid rgba(224, 178, 110, .16);
}
.sys-hud.collapsed .sys-hud-head { border-bottom: none; }
.sys-hud-title { font-size: 9px; letter-spacing: 2.2px; color: #e8c288; text-transform: uppercase; }
.sys-hud-title::before { content: "● "; color: #9ec98f; font-size: 8px; }
.sys-hud-toggle {
  appearance: none; cursor: pointer; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #a49d8d; background: none; border: 1px solid rgba(224, 178, 110, .3); border-radius: 5px;
  font-size: 11px; line-height: 1; transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.sys-hud-toggle:hover { color: #e8c288; border-color: rgba(224, 178, 110, .6); }
.sys-hud-body { padding: 8px 10px 10px; }
.sys-hud.collapsed .sys-hud-body { display: none; }
.hud-row { display: flex; gap: 8px; line-height: 1.9; }
.hud-k { width: 30px; flex-shrink: 0; color: #6e695c; letter-spacing: 1.5px; }
.hud-v { color: #c9c3b4; font-variant-numeric: tabular-nums; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-log {
  margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(224, 178, 110, .14);
  max-height: 104px; overflow-y: auto; scrollbar-width: none;
}
.hud-log::-webkit-scrollbar { display: none; }
.hud-log-line { line-height: 1.7; color: #8f887a; overflow-wrap: anywhere; }
.hud-log-line i { font-style: normal; color: #57534a; font-variant-numeric: tabular-nums; margin-right: 5px; }
.hud-log-line.ok { color: #b8c99a; }
.hud-log-line.err { color: #e08a72; }
/* 离线时顶栏指示灯变灰 */
#net-status.offline { color: var(--danger); }
#net-status.offline .dot { background: var(--danger); box-shadow: 0 0 6px var(--danger); animation: none; }
@media (max-width: 720px) { .sys-hud { display: none; } }

/* ---------- 25. 技能双视图（条形 / 雷达） ---------- */
.skill-view-toggle { display: flex; gap: 8px; margin-bottom: var(--sp-4); }
.skill-view-btn {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: var(--fs-11); letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--muted); background: none; border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.skill-view-btn:hover { color: var(--ink); border-color: var(--accent); }
.skill-view-btn.active {
  color: var(--bg); background: var(--ink); border-color: var(--ink);
}
.skill-radar-pane { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.skill-radar-pane[hidden] { display: none; }
#skill-radar { max-width: 100%; }
.skill-radar-note { margin: 0; font-size: var(--fs-11); letter-spacing: 1.2px; color: var(--faint); }
@media print { .skill-view-toggle, .skill-radar-pane { display: none !important; } }

/* ---------- 26. 新栏目模块：链接收藏 / 书单 / 常见问题 / 相册 ---------- */
.sec-hint { color: var(--faint); font-size: var(--fs-13); padding: var(--sp-3) 0; }

/* 链接收藏：卡片墙 */
.links-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--sp-3); max-width: 62em;
}
.link-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, var(--paper-card), color-mix(in srgb, var(--paper-card) 88%, var(--bg-sink)));
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) ease, transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) ease;
}
.link-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-2), 0 0 20px color-mix(in srgb, var(--accent) 18%, transparent);
}
.link-icon { font-size: 22px; flex-shrink: 0; }
.link-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-name { font-size: var(--fs-14); font-weight: 600; letter-spacing: .5px; color: var(--ink); }
.link-arrow { font-size: var(--fs-11); color: var(--accent); transition: transform var(--dur-fast) ease; }
.link-card:hover .link-arrow { transform: translate(2px, -2px); }
.link-desc {
  font-size: var(--fs-12); color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 书单：行式清单 */
.book-list {
  list-style: none; margin: 0; padding: 0; max-width: 56em;
  border-top: 1px solid var(--line-strong);
}
.book-row {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-2); border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-fast) ease;
}
.book-row:hover { background: var(--bg-raise); }
.book-main { flex: 1; min-width: 0; }
.book-title { margin: 0; font-size: var(--fs-15); font-weight: 600; letter-spacing: .5px; color: var(--ink); }
.book-status {
  display: inline-block; margin-left: 10px; font-size: var(--fs-10); letter-spacing: 1.5px;
  padding: 1px 8px; border-radius: 999px; vertical-align: 2px;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.book-status[data-status="在读"] { border-color: var(--accent); color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.book-status[data-status="读完"] { border-color: transparent; background: var(--ink); color: var(--bg); }
.book-author { margin: 2px 0 0; font-size: var(--fs-12); letter-spacing: 1px; color: var(--muted); }
.book-comment { margin: 6px 0 0; font-size: var(--fs-13); line-height: 1.7; color: var(--ink-2); max-width: 44em; }
.book-stars {
  flex-shrink: 0; font-size: var(--fs-15); letter-spacing: 3px;
  color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 2px;
}

/* 常见问题：折叠问答 */
.faq-list { list-style: none; margin: 0; padding: 0; max-width: 62em; border-top: 1px solid var(--line-strong); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-head {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: var(--sp-4) var(--sp-2); cursor: pointer; text-align: left;
  background: none; border: none; font-family: inherit; color: inherit;
  transition: background-color var(--dur-fast) ease;
}
.faq-head:hover { background: var(--bg-raise); }
.faq-q { flex: 1; font-size: var(--fs-15); font-weight: 600; letter-spacing: .5px; line-height: 1.5; }
.faq-q::before { content: "Q "; color: var(--accent); font-weight: 750; margin-right: 2px; }
.faq-toggle {
  flex-shrink: 0; width: 1.6em; text-align: center; font-size: var(--fs-16); color: var(--muted);
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) ease;
}
.faq-item.open .faq-toggle { transform: rotate(45deg); color: var(--accent); }
.faq-body { padding: 0 var(--sp-2) var(--sp-4); max-width: 52em; }
.faq-body p { margin: 0; color: var(--muted); line-height: 1.9; }
.faq-item.open .faq-body { animation: rise var(--dur-slow) var(--ease-out); }

/* 相册：图片网格 */
.gallery-grid {
  display: grid; grid-template-columns: repeat(var(--gallery-cols, 3), 1fr);
  gap: var(--sp-3); max-width: 62em;
}
.gallery-item { margin: 0; }
.gallery-shot {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: zoom-in; background: var(--bg-sink); appearance: none;
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
}
.gallery-shot:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-2), 0 0 22px color-mix(in srgb, var(--accent) 16%, transparent);
}
.gallery-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .6s var(--ease-out); }
.gallery-shot:hover img { transform: scale(1.04); }
.gallery-cap {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 2px 0;
  font-size: var(--fs-12);
}
.gallery-cap-text { color: var(--ink-2); letter-spacing: .3px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-cap-date { margin-left: auto; flex-shrink: 0; color: var(--faint); font-variant-numeric: tabular-nums; }

/* 图片放大预览器（相册等 .gallery-shot / [data-full] 通用） */
.img-viewer {
  position: fixed; inset: 0; z-index: 230; display: flex; align-items: center; justify-content: center;
  padding: 4vmin; background: rgba(6, 7, 5, .84); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-base) ease, visibility var(--dur-base);
}
.img-viewer.open { opacity: 1; visibility: visible; }
.img-viewer img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  border: 1px solid rgba(224, 178, 110, .3); border-radius: 12px;
  box-shadow: 0 40px 130px rgba(0, 0, 0, .65), 0 0 80px rgba(198, 148, 84, .15);
}
.img-viewer-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: #e8c288; background: rgba(12, 13, 11, .72); border: 1px solid rgba(224, 178, 110, .4);
  border-radius: 50%; cursor: pointer; font-size: 15px;
  transition: background var(--dur-fast) ease;
}
.img-viewer-close:hover { background: rgba(224, 178, 110, .22); }
@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .book-stars { display: none; }
}

/* ---------- 27. 动态笔记（终端日志式时间线） ---------- */
.notes-feed { list-style: none; margin: 0; padding: 0; max-width: 56em; }
.note-entry { display: flex; gap: var(--sp-4); padding-bottom: var(--sp-5); }
.note-entry:last-child { padding-bottom: 0; }
.note-entry:last-child .note-rail::after { display: none; }
.note-rail { position: relative; flex-shrink: 0; width: 14px; display: flex; justify-content: center; }
.note-rail::after {
  content: ""; position: absolute; top: 22px; bottom: -6px; width: 1px;
  background: var(--line);
}
.note-dot {
  width: 9px; height: 9px; margin-top: 7px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--accent); transform: rotate(45deg);
}
.note-main { flex: 1; min-width: 0; }
.note-meta { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; }
.note-date { font-size: var(--fs-11); letter-spacing: 1.8px; color: var(--muted); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.note-tag {
  font-size: var(--fs-10); letter-spacing: 1px; color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent); padding: 0 8px;
}
.note-title { margin: 0; font-size: var(--fs-16); font-weight: 600; letter-spacing: .5px; color: var(--ink); line-height: 1.5; }
.note-body { margin-top: 4px; }
.note-body p { margin: 0 0 4px; color: var(--muted); font-size: var(--fs-13); line-height: 1.85; }

/* ---------- 28. 倒计时 ---------- */
.countdown {
  max-width: 56em; padding: var(--sp-5);
  border: 1px solid var(--line-strong); border-radius: 14px;
  background:
    radial-gradient(30rem 14rem at 50% 118%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    var(--bg-raise);
  box-shadow: var(--shadow-1);
  text-align: center;
}
.countdown-label { margin: 0 0 var(--sp-3); font-size: var(--fs-13); letter-spacing: 1.5px; color: var(--muted); }
.countdown-digits { display: flex; justify-content: center; gap: clamp(10px, 3vw, 28px); }
.cd-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cd-num {
  font-size: clamp(34px, 6vw, 56px); font-weight: 300; line-height: 1.15;
  color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 2px;
  min-width: 1.6em; text-align: center;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding-bottom: 4px;
}
.cd-unit { font-style: normal; font-size: var(--fs-11); letter-spacing: 2px; color: var(--faint); }
.countdown-target { margin: var(--sp-3) 0 0; font-size: var(--fs-11); letter-spacing: 2px; color: var(--faint); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.countdown-done { margin: 0; font-size: var(--fs-24); font-weight: 600; letter-spacing: 2px; color: var(--accent-deep); }
.countdown-done[hidden] { display: none; }

/* ---------- 29. HUD FPS 曲线 + 仪器准星 ---------- */
.hud-spark { display: block; width: 100%; height: 26px; }
.wall-more {
  grid-column: 1 / -1; justify-self: center;
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: var(--fs-12); letter-spacing: 1.5px; color: var(--accent-deep);
  background: none; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px; padding: 7px 20px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.wall-more:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* ---------- 31. 终端 AI 思考过程（流式 + 自动折叠） ---------- */
.term-think {
  margin: 6px 0 8px; padding-left: 10px;
  border-left: 2px solid rgba(224, 178, 110, .35);
}
.term-think-head {
  cursor: pointer; user-select: none;
  font-size: 11px; letter-spacing: 1px; color: #8f887a;
  transition: color var(--dur-fast) ease;
}
.term-think-head:hover { color: #e8c288; }
.term-think-body {
  margin-top: 4px; font-size: 12px; line-height: 1.75; color: #7e7869;
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 150px; overflow-y: auto; scrollbar-width: thin;
}
.term-think.collapsed .term-think-body { display: none; }
.term-think.collapsed { border-left-color: rgba(224, 178, 110, .2); }
.term-answer { margin-top: 2px; }

/* ---------- 32. 终端 Markdown 渲染样式 ---------- */
.md-body { line-height: 1.85; }
.md-body .md-p { margin: 3px 0 6px; }
.md-body .md-h {
  margin: 9px 0 4px; font-weight: 600; color: #f0ece1; font-size: 13px;
  letter-spacing: .5px;
}
.md-body .md-h::before { content: ""; display: inline-block; width: 8px; height: 1px; background: rgba(224,178,110,.7); margin-right: 7px; vertical-align: 4px; }
.md-body .md-h4, .md-body .md-h5, .md-body .md-h6 { color: #c9c3b4; font-size: 12.5px; }
.md-body strong { color: #f6f2e7; font-weight: 600; }
.md-body em { font-style: italic; color: #d8d3c4; }
.md-body del { color: #8f887a; }
.md-body a { color: #e8c288; text-decoration: underline; text-underline-offset: 2px; }
.md-body a:hover { color: #f4d9a6; }
.md-body code {
  background: rgba(224, 178, 110, .12); border: 1px solid rgba(224, 178, 110, .25);
  border-radius: 4px; padding: 0 4px; font-size: 11.5px; color: #ecc98f;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
}
.md-body .md-pre {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px; overflow-x: auto;
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(224, 178, 110, .2);
}
.md-body .md-pre code { background: none; border: none; padding: 0; color: #d8d3c4; font-size: 11.5px; line-height: 1.7; }
.md-body .md-list { margin: 4px 0 6px; padding-left: 18px; }
.md-body .md-list li { margin: 2px 0; }
.md-body .md-list li::marker { color: #a67d48; }
.md-body .md-quote {
  margin: 4px 0; padding: 2px 0 2px 10px;
  border-left: 2px solid rgba(224, 178, 110, .4); color: #a49d8d;
}
.md-body .md-hr { border: none; border-top: 1px solid rgba(224, 178, 110, .25); margin: 8px 0; }
.md-body .md-table { border-collapse: collapse; margin: 6px 0; font-size: 11.5px; }
.md-body .md-table th, .md-body .md-table td {
  border: 1px solid rgba(224, 178, 110, .25); padding: 3px 8px; text-align: left;
}
.md-body .md-table th { color: #ecc98f; font-weight: 600; }

/* ---------- 33. AI 悬浮窗（aichat.js；思考过程块复用 .term-think* 样式） ---------- */
.aiw-root {
  position: fixed; right: 22px; bottom: 74px; z-index: 200;   /* 让开右下角的回顶按钮 */
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.aiw-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 999px; font-family: inherit;
  font-size: var(--fs-12); letter-spacing: 1.6px; color: #f0e6d2;
  background: linear-gradient(180deg, #1b1c12, #0e0f0b);
  border: 1px solid rgba(224, 178, 110, .45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  transition: transform var(--dur-fast) ease, border-color var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}
.aiw-btn:hover {
  transform: translateY(-1px); border-color: rgba(232, 194, 136, .85);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .5), 0 0 26px rgba(198, 148, 84, .22);
}
.aiw-orb { color: #e8c288; font-size: 13px; }
.aiw-btn[data-unread="1"]::after {
  content: ""; width: 7px; height: 7px; border-radius: 50%; margin-left: 2px;
  background: #e8b36a; box-shadow: 0 0 10px rgba(232, 179, 106, .9);
  animation: aiw-pulse 1.6s ease-in-out infinite;
}
@keyframes aiw-pulse { 50% { opacity: .35; } }

.aiw-panel {
  width: min(380px, calc(100vw - 32px)); height: min(560px, 70vh);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(224, 178, 110, .32); border-radius: 16px;
  background: linear-gradient(180deg, #17180f, #0d0e0b);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6), 0 0 70px rgba(198, 148, 84, .12);
  animation: lb-pop 240ms var(--ease-out);
}
.aiw-panel[hidden] { display: none; }
.aiw-head {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 12px; border-bottom: 1px solid rgba(224, 178, 110, .18);
  background: rgba(224, 178, 110, .05);
}
.aiw-title { font-size: var(--fs-10); letter-spacing: 1.8px; text-transform: uppercase; color: #a49d8d; }
.aiw-persona {
  max-width: 120px; flex-shrink: 0; font-family: inherit; font-size: 11px;
  letter-spacing: .5px; color: #e8c288; cursor: pointer;
  background: rgba(224, 178, 110, .08); border: 1px solid rgba(224, 178, 110, .35);
  border-radius: 7px; padding: 3px 6px; outline: none;
}
.aiw-persona[hidden] { display: none; }
.aiw-persona:hover, .aiw-persona:focus { border-color: rgba(232, 194, 136, .7); }
.aiw-persona option { background: #17180f; color: #d8d3c4; }
.aiw-status { margin-left: auto; font-size: var(--fs-10); letter-spacing: .6px; color: #7e7869; }
.aiw-status.busy { color: #e8b36a; }
.aiw-icon {
  appearance: none; cursor: pointer; flex-shrink: 0; min-width: 26px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #e8c288; background: none; border: 1px solid rgba(224, 178, 110, .4);
  border-radius: 7px; font-size: 11px; font-family: inherit;
  transition: background var(--dur-fast) ease;
}
.aiw-icon:hover { background: rgba(224, 178, 110, .18); }
.aiw-body {
  flex: 1; overflow-y: auto; padding: 12px 12px 4px;
  font-size: var(--fs-13); line-height: 1.8; letter-spacing: .2px; color: #d8d3c4;
  scrollbar-width: thin;
}
.aiw-msg { margin-bottom: 12px; }
.aiw-msg.user { display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; }
.aiw-who { flex-shrink: 0; margin-top: 5px; font-size: var(--fs-10); letter-spacing: 1px; color: #7e7869; }
.aiw-bubble {
  max-width: 82%; padding: 7px 11px; border-radius: 10px 10px 2px 10px;
  background: rgba(224, 178, 110, .13); border: 1px solid rgba(224, 178, 110, .32);
  color: #f0ece1; white-space: pre-wrap; overflow-wrap: anywhere;
}
.aiw-msg.ai .term-think { margin-top: 0; }
.aiw-answer { margin-top: 2px; }
.aiw-note { margin: 2px 0 10px; font-size: var(--fs-11); color: #7e7869; overflow-wrap: anywhere; }
.aiw-note.err { color: #e08a72; }
.aiw-form {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
  padding: 10px 12px 8px; border-top: 1px solid rgba(224, 178, 110, .18);
}
.aiw-input {
  flex: 1; min-width: 0; font-family: inherit; font-size: var(--fs-13); letter-spacing: .3px;
  color: #f0ece1; caret-color: #e8c288;
  background: rgba(224, 178, 110, .06); border: 1px solid rgba(224, 178, 110, .28);
  border-radius: 9px; padding: 8px 11px; outline: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.aiw-input:focus { border-color: rgba(232, 194, 136, .6); background: rgba(224, 178, 110, .1); }
.aiw-input::placeholder { color: #6e695c; }
.aiw-send {
  appearance: none; cursor: pointer; flex-shrink: 0; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #17180f; background: linear-gradient(180deg, #e8c288, #c99a5f);
  border: none; border-radius: 9px; font-size: 14px;
  transition: filter var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.aiw-send:hover { filter: brightness(1.08); transform: translateY(-1px); }
.aiw-foot { flex-shrink: 0; padding: 0 12px 10px; font-size: 10px; letter-spacing: .4px; color: #6e695c; }
@media (max-width: 560px) {
  /* 手机上 AI 助手改为全屏：更像原生对话界面，输入与阅读都更从容 */
  .aiw-root { right: 12px; bottom: 66px; }
  .aiw-panel {
    position: fixed; inset: 0; width: auto; height: auto;
    max-width: none; max-height: none; border: 0; border-radius: 0;
    animation: none;    /* 全屏不需要入场缩放动画（也避免动画被挂起时残留缩放位移） */
  }
  .aiw-head { padding: 12px 14px; }
  .aiw-body { padding: 14px 14px 6px; font-size: var(--fs-14); overscroll-behavior: contain; }
  .aiw-form { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .aiw-input { padding: 11px 13px; font-size: 16px; }   /* 16px：避免 iOS 聚焦时整页缩放 */
  .aiw-send { width: 42px; height: 42px; font-size: 16px; }
  .aiw-foot { display: none; }                          /* 全屏下省掉底注 */
  .aiw-panel:not([hidden]) + .aiw-btn { display: none; } /* 面板开着时收起悬浮按钮 */
  .aiw-bubble { max-width: 88%; }
}

/* ---------- 34. 平板/窄屏布局修正（≤ 900px） ----------
   注：文件中部早期写过一份同名规则，但它们位于对应基础样式之前，
   同权重下会被后面的基础规则覆盖（例如 .msg-grid 在手机上没塌成单列）。
   这里在文件末尾重述一遍，确保真正生效。 */
@media (max-width: 900px) {
  .section { padding: var(--sp-6) 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; padding: var(--sp-6) var(--sp-4); }
  .hero-portrait { justify-self: start; }
  .hero-portrait img { width: 200px; }
  .hero-vertical { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .skill-lines { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: var(--sp-1); }
  .contact-row { grid-template-columns: 1fr; gap: 2px; }
  .sec-head { flex-wrap: wrap; }
  .sec-hairline { display: none; }
  .array-status .as-hint { margin-left: 0; }
  .array-detail { grid-template-columns: auto 1fr; }
  .array-detail .d-thumb { width: 64px; height: 48px; }
  .array-detail .d-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .figures { flex-direction: column; }
  .figure { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--sp-2); }
  .figure:first-child { border-top: 0; padding-top: 0; }
  .msg-grid { grid-template-columns: 1fr; }
  .msg-form label { min-width: 0; }
  .lb-nav { display: none; }
}

/* ---------- 35. 手机浏览适配（≤ 480px） ---------- */
@media (max-width: 480px) {
  /* 顶栏与目录：紧凑化；品牌过长省略号，整行不顶出屏幕 */
  .lab-top-inner { height: 42px; padding: 0 var(--sp-3); gap: var(--sp-2); }
  .lab-brand {
    font-size: var(--fs-12); min-width: 0; max-width: 44vw;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lab-brand .lab-mark { flex-shrink: 0; }
  .lab-meta { gap: var(--sp-2); }
  .lab-meta #lab-clock { display: none; }   /* 手机系统状态栏已有时间，让位给站点标题 */
  .theme-toggle { padding: 6px 9px; letter-spacing: 1px; }
  .topnav { top: 42px; }
  .topnav-inner { padding: 0 var(--sp-3); gap: var(--sp-3); }
  .topnav a { font-size: var(--fs-10); padding: 8px 0; }

  /* 锚点落位偏移随头部收紧（与 site.js 的动态偏移一致） */
  .section { padding: var(--sp-6) 0; scroll-margin-top: 78px; }

  /* 首屏：字号与留白收紧，读条允许换行 */
  .hero-grid { padding: var(--sp-5) var(--sp-3) var(--sp-6); gap: var(--sp-4); }
  .hero h1 { font-size: 26px; letter-spacing: .5px; }
  .hero-sub { font-size: var(--fs-13); line-height: 1.8; padding-left: var(--sp-3); }
  .hero-cta { gap: var(--sp-3); flex-wrap: wrap; }
  .hero-readout { margin-top: var(--sp-4); font-size: var(--fs-9); letter-spacing: 1.2px; gap: 4px var(--sp-2); }
  .hero-portrait { transform: none; }
  .hero-portrait img { width: 100%; max-width: 240px; }

  /* 通用容器留白 */
  .container, .array-wrap { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .sec-title { font-size: var(--fs-22); }

  /* 作品阵列：状态条/详情条更紧凑（列数由 array.js 按宽度自适应） */
  .array-status { padding: 8px 10px 10px; gap: 4px var(--sp-3); letter-spacing: 1px; }
  .array-status .as-hint { margin-left: 0; }
  .array-detail { padding: 10px 12px; }
  .lb-body { padding: 12px 14px 16px; }
  .lb-title { font-size: var(--fs-16); }

  /* 终端：手机上接近全屏，方便阅读与输入 */
  .term-overlay { padding: 2.5vmin 2vmin; }
  .term-panel { width: 100%; max-height: 92vh; border-radius: 12px; }
  .term-out { max-height: 60vh; }
  .term-inrow { padding: 10px 12px 12px; }

  /* 触控：主要可点元素保证足够高度 */
  .theme-toggle, .term-close, .aiw-icon { min-height: 32px; }
  .wall-more { padding: 9px 22px; }
}


/* ---------- 留言板：登录条 ---------- */
.msg-auth {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 var(--sp-3); padding: 9px 14px;
  border: 1px dashed var(--line-strong); background: var(--bg-raise);
  font-size: var(--fs-11); letter-spacing: .3px;
}
.msg-auth-text { color: var(--muted); }
.msg-auth-btn {
  margin-left: auto; background: none; border: 1px solid var(--line-strong);
  color: var(--ink); font: inherit; font-size: var(--fs-11);
  padding: 5px 12px; cursor: pointer; letter-spacing: .06em;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.msg-auth-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg-auth-btn.ghost { color: var(--muted); }
.msg-auth-btn.ghost:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
