/* ============================================================
   猫与发条 · 站点样式
   设计原则：少即是多。整套配色只有两个强调色（黄铜 + 青玉），
   所有装饰都服务于信息层级，动效一律可被 prefers-reduced-motion 关闭。
   ============================================================ */

/* ---------- 1. 变量 ---------- */
:root {
  --wrap: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --pad-sec: clamp(64px, 9vw, 132px);

  --font-sans: "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", ui-monospace, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, .84, .44, 1);
}

html[data-theme="dark"] {
  --bg: #0a0b0d;
  --bg-2: #0f1114;
  --surf: #14171b;
  --surf-2: #191d22;
  --line: #262b31;
  --line-soft: #1d2126;
  --text: #e9ebee;
  --text-2: #b9c0c7;
  --dim: #939ba4;
  --dim-2: #6a7178;
  --brass: #e2a95c;
  --brass-soft: rgba(226, 169, 92, .14);
  --jade: #79b7a8;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .9);
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, .8);
  --glass: rgba(14, 16, 19, .72);
  --scrim: rgba(6, 7, 8, .72);
  --grain-op: .035;
}

html[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-2: #fffefb;
  --surf: #ffffff;
  --surf-2: #faf8f4;
  --line: #e5e1d8;
  --line-soft: #eeebe4;
  --text: #17181a;
  --text-2: #3d4247;
  --dim: #6b7077;
  --dim-2: #949aa1;
  --brass: #a2661b;
  --brass-soft: rgba(162, 102, 27, .1);
  --jade: #2f7a6b;
  --shadow: 0 24px 60px -34px rgba(60, 48, 30, .38);
  --shadow-sm: 0 8px 22px -14px rgba(60, 48, 30, .3);
  --glass: rgba(252, 251, 248, .78);
  --scrim: rgba(40, 36, 30, .42);
  --grain-op: .022;
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* 预留滚动条槽位：打开抽屉/灯箱锁滚动时页面不会横向抖一下 */
  scrollbar-gutter: stable;
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: .012em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--brass-soft);
  color: var(--brass);
  padding: .1em .42em;
  border-radius: 5px;
  word-break: break-all;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.24; letter-spacing: -.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--brass); color: #16130c; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(100% - 44px, var(--wrap)); margin-inline: auto; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.ta-l { text-align: left; }
.ta-r { text-align: right; }
.tnum { font-variant-numeric: tabular-nums; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 80;
  background: transparent;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brass), var(--jade));
  transition: width .1s linear;
}

/* ---------- 3. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text-2);
  font-size: 13px;
  letter-spacing: .02em;
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.btn:hover { border-color: var(--brass); color: var(--brass); transform: translateY(-1px); }
.btn.tiny { padding: 6px 12px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn[aria-pressed="true"] { border-color: var(--brass); color: var(--brass); background: var(--brass-soft); }

.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: var(--surf-2);
  white-space: nowrap;
}

.link-btn {
  color: var(--brass);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brass) 40%, transparent);
  text-underline-offset: 3px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--dim);
  font-size: 12.5px;
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--dim-2); }
.chip .c-count { font-family: var(--font-mono); font-size: 11px; opacity: .65; }
.chip .c-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
.chip[aria-pressed="true"] {
  background: var(--brass-soft);
  border-color: color-mix(in srgb, var(--brass) 55%, transparent);
  color: var(--brass);
}

/* 滚动入场 */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .68s var(--ease-out), transform .68s var(--ease-out);
}

/* ---------- 4. 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px max(22px, calc((100% - var(--wrap)) / 2));
  transition: background .3s var(--ease), backdrop-filter .3s var(--ease), border-color .3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line-soft);
}
.nav-brand { display: flex; align-items: center; gap: 9px; }
.mark { width: 26px; height: 26px; color: var(--brass); flex: none; }
.mark-teeth { opacity: .75; }
.nav-brand:hover .mark { animation: spin-mark 2.6s var(--ease) 1; }
@keyframes spin-mark { to { transform: rotate(180deg); } }
.nav-name { font-size: 14.5px; font-weight: 600; letter-spacing: .1em; }
.nav-ver {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--brass);
  border: 1px solid color-mix(in srgb, var(--brass) 35%, transparent);
  border-radius: 5px;
  padding: 2px 5px;
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--dim);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surf); }
.nav-links a.is-active { color: var(--brass); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 14px; height: 2px;
  border-radius: 2px;
  background: var(--brass);
  transform: translateX(-50%);
}
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  transition: all .2s var(--ease);
}
.icon-btn:hover { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 45%, transparent); }
.icon-btn svg { width: 17px; height: 17px; }
#themeBtn { width: 34px; padding: 0; justify-content: center; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }

/* ---------- 5. 首屏 ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 900px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: -4%;
  z-index: -2;
  background: #0a0b0d center/cover no-repeat;
  transform: scale(1.06);
  animation: hero-drift 34s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.13) translate3d(-1.6%, -1.2%, 0); }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 9, 11, .82) 0%, rgba(8, 9, 11, .38) 34%, rgba(8, 9, 11, .72) 82%, var(--bg) 100%),
    radial-gradient(120% 80% at 12% 60%, rgba(8, 9, 11, .76) 0%, transparent 62%);
}
html[data-theme="light"] .hero-scrim {
  background:
    linear-gradient(180deg, rgba(20, 17, 12, .74) 0%, rgba(20, 17, 12, .34) 36%, rgba(20, 17, 12, .62) 84%, var(--bg) 100%),
    radial-gradient(120% 80% at 12% 60%, rgba(20, 17, 12, .62) 0%, transparent 62%);
}
.hero-fx { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
/* 导航在亮色照片上也要读得清 */
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -28px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 7, 9, .62) 0%, rgba(6, 7, 9, .26) 58%, transparent 100%);
  opacity: 1;
  transition: opacity .3s var(--ease);
}
.nav.is-stuck::before { opacity: 0; }
.hero .wrap { position: relative; z-index: 2; }
.hero-inner { padding: clamp(96px, 14vh, 150px) 0 118px; max-width: 100%; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin-bottom: 22px;
}
html[data-theme="light"] .eyebrow { color: rgba(255, 255, 255, .9); }
.eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 4px rgba(226, 169, 92, .2);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(226, 169, 92, .22); }
  50% { box-shadow: 0 0 0 8px rgba(226, 169, 92, 0); }
}

.hero-title {
  font-size: clamp(3.6rem, 10.5vw, 8.4rem);
  font-weight: 600;
  letter-spacing: .08em;
  line-height: .98;
  color: #fff;
  text-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.hero-wordmark {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.5vw, 14px);
  letter-spacing: .58em;
  color: var(--brass);
  text-transform: uppercase;
}
.hero-lede {
  margin-top: 28px;
  max-width: 34em;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.95;
  color: rgba(255, 255, 255, .84);
}
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.hero-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(12, 14, 16, .34);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
}
.hero-chip b {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.scroll-hint {
  position: absolute;
  left: 50%; bottom: 26px;
  z-index: 2;
  width: 22px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 12px;
  transform: translateX(-50%);
}
.scroll-hint span {
  position: absolute;
  left: 50%; top: 7px;
  width: 3px; height: 7px;
  border-radius: 2px;
  background: var(--brass);
  transform: translateX(-50%);
  animation: wheel 1.9s var(--ease) infinite;
}
@keyframes wheel {
  0% { opacity: 0; transform: translate(-50%, -2px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 13px); }
}

/* 发条钟 */
.clockwork {
  position: absolute;
  right: max(22px, calc((100% - var(--wrap)) / 2));
  bottom: 78px;
  z-index: 3;
  width: min(268px, 34vw);
  padding: 20px 20px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 12, 14, .42);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--shadow);
  text-align: center;
}
html[data-theme="light"] .clockwork {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(20, 18, 14, .38);
}
.clock-svg { width: 100%; height: auto; display: block; }
.clock-read { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.clock-time {
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: .06em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.clock-note { margin-top: 8px; font-size: 10.5px; color: rgba(255, 255, 255, .42); }

/* ---------- 6. 区块 ---------- */
.sec { padding-top: var(--pad-sec); scroll-margin-top: 88px; }
.sec-head { max-width: 62ch; margin-bottom: clamp(30px, 4vw, 52px); }
.sec-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brass);
  letter-spacing: .2em;
}
.sec-head h2 {
  margin-top: 10px;
  font-size: clamp(1.72rem, 3.6vw, 2.6rem);
  letter-spacing: .02em;
}
.sec-sub { margin-top: 12px; color: var(--dim); font-size: 14px; line-height: 1.9; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surf) 0%, var(--surf-2) 100%);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-title small { font-size: 11.5px; font-weight: 400; color: var(--dim-2); letter-spacing: .04em; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 7. 概况 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surf);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.stat:hover { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); transform: translateY(-2px); }
.stat::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--brass-soft);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.stat:hover::after { opacity: .5; }
.stat-num {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-num em { font-size: .52em; font-style: normal; color: var(--dim); margin-left: 3px; letter-spacing: .04em; }
.stat-label { margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.stat-note { margin-top: 3px; font-size: 11px; color: var(--dim-2); font-family: var(--font-mono); }

.donut-wrap { display: flex; align-items: center; gap: 26px; }
.donut { width: 168px; height: 168px; flex: none; }
.donut .dn-center { font-family: var(--font-mono); fill: var(--text); }
.donut .dn-center-sub { font-family: var(--font-sans); fill: var(--dim); }
.donut circle { transition: stroke-width .2s var(--ease), opacity .2s var(--ease); cursor: pointer; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.donut-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  transition: background .18s var(--ease);
}
.donut-legend li:hover { background: var(--surf-2); }
.donut-legend .lg-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut-legend .lg-name { color: var(--text-2); }
.donut-legend .lg-val { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--dim); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bars li { position: relative; display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bars .bar-ico { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surf-2); }
.bars .bar-ico.ph { display: grid; place-items: center; font-size: 10px; color: var(--dim-2); }
.bars .bar-name { width: 9.5em; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bars .bar-track { position: relative; flex: 1; height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bars .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brass) 70%, transparent), var(--brass));
  width: 0;
  transition: width .9s var(--ease-out);
}
.bars .bar-val { width: 5.4em; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--dim); flex: none; }

/* ---------- 8. 模组库 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surf);
  position: sticky;
  top: 62px;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--brass) 60%, transparent);
  box-shadow: 0 0 0 4px var(--brass-soft);
}
.search svg { width: 17px; height: 17px; color: var(--dim); flex: none; }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 14px; min-width: 0; }
.search input::placeholder { color: var(--dim-2); }
.search input::-webkit-search-cancel-button { display: none; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.seg {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.seg button {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--dim);
  transition: all .18s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--brass-soft); color: var(--brass); }

.chips { margin-top: 16px; }
.result-line {
  margin: 18px 2px 12px;
  font-size: 12.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 12px;
}
.result-line span { font-family: var(--font-mono); color: var(--text-2); }

.sig-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.sig {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surf) 0%, var(--surf-2) 100%);
  text-align: left;
  transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease);
}
.sig:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brass) 50%, var(--line)); box-shadow: var(--shadow); }
.sig-top { display: flex; align-items: center; gap: 11px; }
.sig-ico { width: 38px; height: 38px; border-radius: 9px; background: var(--bg-2); object-fit: cover; flex: none; }
.sig-name { display: block; font-size: 14px; font-weight: 600; }
.sig-en { display: block; font-size: 11px; color: var(--dim-2); font-family: var(--font-mono); }
.sig-note { font-size: 12.5px; color: var(--dim); line-height: 1.8; }

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
}
.mod-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 12px 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surf);
  text-align: left;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
  contain: content;
  overflow: hidden;
}
/* 左侧分类色条：分类信息不用读文字也能看出来 */
.mod-card::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--gc, transparent);
  opacity: .5;
  transition: opacity .2s var(--ease), top .2s var(--ease), bottom .2s var(--ease);
}
.mod-card:hover::before { opacity: 1; top: 4px; bottom: 4px; }
.mod-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brass) 42%, var(--line));
  background: var(--surf-2);
}
.mod-ico {
  grid-row: span 2;
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
}
.mod-ico.ph {
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--dim-2);
}
.mod-body { min-width: 0; }
.mod-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--dim-2);
  min-width: 0;
}
.mod-meta .m-en { font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-meta .m-size { font-family: var(--font-mono); flex: none; color: var(--dim); }
.mod-note {
  grid-column: 2;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mod-card.no-note .mod-note { display: none; }
.mod-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brass-soft);
  color: var(--brass);
  flex: none;
}
mark {
  background: color-mix(in srgb, var(--brass) 26%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.mod-empty { text-align: center; padding: 70px 0; color: var(--text-2); }
.mod-empty .dim { font-size: 13px; margin-top: 8px; }
.more-wrap { display: flex; justify-content: center; margin-top: 22px; }

/* ---------- 9. 抽屉 ---------- */
.drawer-scrim, .palette, .lightbox { position: fixed; inset: 0; z-index: 100; }
.drawer-scrim { background: var(--scrim); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 101;
  width: min(460px, 100%);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slide-in .34s var(--ease-out);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } }
.drawer-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 19px;
  line-height: 1;
  z-index: 2;
  background: var(--surf);
}
.drawer-close:hover { color: var(--brass); border-color: var(--brass); }
.drawer-body { padding: 26px 26px 60px; }
.dw-head { display: flex; gap: 15px; align-items: flex-start; padding-right: 34px; }
.dw-ico { width: 62px; height: 62px; border-radius: 13px; background: var(--surf); border: 1px solid var(--line); flex: none; }
.dw-ico.ph { display: grid; place-items: center; font-family: var(--font-mono); color: var(--dim-2); }
.dw-name { font-size: 20px; letter-spacing: .01em; }
.dw-en { font-family: var(--font-mono); font-size: 12px; color: var(--dim-2); margin-top: 3px; }
.dw-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.badge {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
}
.badge.brass { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 40%, transparent); background: var(--brass-soft); }
.dw-quote {
  margin-top: 20px;
  padding: 14px 16px;
  border-left: 2px solid var(--brass);
  background: var(--brass-soft);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  color: var(--text-2);
}
.dw-desc { margin-top: 16px; font-size: 13.5px; line-height: 1.9; color: var(--dim); }
.dw-sec { margin-top: 26px; }
.dw-sec h4 {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin-bottom: 10px;
}
.kv { display: grid; grid-template-columns: 5.6em 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--dim-2); }
.kv dd { margin: 0; color: var(--text-2); word-break: break-word; font-family: var(--font-mono); font-size: 12px; }
.dep-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surf);
  font-size: 12px;
  color: var(--text-2);
  transition: all .18s var(--ease);
}
.dep-chip:hover { border-color: var(--brass); color: var(--brass); }
.dep-chip .dc-n { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim-2); }
.dw-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dw-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  transition: all .18s var(--ease);
}
.dw-links a:hover { border-color: var(--brass); color: var(--brass); }
.dw-file { font-family: var(--font-mono); font-size: 11px; color: var(--dim-2); word-break: break-all; }

/* ---------- 10. 图谱 ---------- */
.graph-shell {
  position: relative;
  height: min(72vh, 620px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 70% at 50% 0%, var(--surf-2) 0%, var(--bg-2) 70%),
    var(--bg-2);
  overflow: hidden;
}
#graphCanvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#graphCanvas.is-drag { cursor: grabbing; }
.graph-ui { position: absolute; inset: 0; pointer-events: none; padding: 14px; }
.graph-tools { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.graph-tools .btn { background: var(--glass); backdrop-filter: blur(10px); }
.graph-legend {
  position: absolute;
  left: 14px; bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: 60%;
  font-size: 11px;
  color: var(--dim);
}
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.graph-hint {
  position: absolute;
  right: 14px; bottom: 14px;
  font-size: 11px;
  color: var(--dim-2);
  font-family: var(--font-mono);
}
.graph-tip {
  position: absolute;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  transform: translate(-50%, -140%);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.graph-tip .gt-sub { display: block; font-size: 10.5px; color: var(--dim); font-family: var(--font-mono); }
.graph-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.gs {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surf);
  font-size: 12.5px;
  color: var(--dim);
}
.gs b { display: block; font-family: var(--font-mono); font-size: 15px; color: var(--text); font-weight: 500; margin-bottom: 3px; }

/* ---------- 11. 影像志 ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surf);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.shot:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease-out), opacity .5s var(--ease);
  opacity: 0;
}
.shot img.is-loaded { opacity: 1; }
.shot:hover img { transform: scale(1.045); }
.shot .s-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(8, 9, 11, .82));
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  text-align: left;
}
.shot:hover .s-cap, .shot:focus-visible .s-cap { opacity: 1; transform: none; }

.lightbox {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  background: rgba(6, 7, 8, .92);
  backdrop-filter: blur(6px);
  animation: fade .22s var(--ease);
}
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.lb-imgwrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #000 center/cover no-repeat;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .9);
}
.lb-imgwrap img { width: 100%; max-height: 76vh; object-fit: contain; display: block; }
.lb-figure figcaption { color: rgba(255, 255, 255, .82); font-size: 13px; display: flex; gap: 14px; align-items: baseline; }
.lb-figure figcaption .lb-meta { font-family: var(--font-mono); font-size: 11px; color: rgba(255, 255, 255, .5); }
.lb-nav, .lb-close {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .7);
  font-size: 26px;
  height: 52px;
  width: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  transition: all .2s var(--ease);
  justify-self: center;
}
.lb-nav:hover, .lb-close:hover { color: #fff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); }
.lb-close { position: absolute; top: 20px; right: 22px; }

/* ---------- 12. 主城地图 ---------- */
.map-shell {
  position: relative;
  height: min(74vh, 640px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% 0%, var(--surf-2) 0%, var(--bg-2) 72%),
    var(--bg-2);
  box-shadow: var(--shadow-sm);
}
#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#mapCanvas.is-drag { cursor: grabbing; }
.map-ui { position: absolute; inset: 0; padding: 14px; pointer-events: none; }
.map-tools { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.map-tools .btn { background: var(--glass); backdrop-filter: blur(10px); }
.map-coord {
  position: absolute;
  top: 16px; right: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  min-width: 132px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.map-hint {
  position: absolute;
  right: 16px; bottom: 14px;
  font-size: 11px;
  color: var(--dim-2);
  font-family: var(--font-mono);
}

/* ---------- 主城名片 ---------- */
.world-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surf) 0%, var(--surf-2) 100%);
  box-shadow: var(--shadow-sm);
}
.wc-icon {
  width: 96px; height: 96px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  image-rendering: pixelated;
  object-fit: cover;
}
.wc-name { font-size: 22px; letter-spacing: .01em; }
.wc-en { font-family: var(--font-mono); font-size: 11.5px; color: var(--dim-2); margin-top: 3px; }
.wc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wc-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px 22px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.wc-kv div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.wc-kv dt { color: var(--dim-2); flex: none; }
.wc-kv dd {
  margin: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.world-stats { margin-top: 16px; }
.world-stats .stat-num { font-size: clamp(1.1rem, 2vw, 1.5rem); }
.world-stats .stat-num em { font-size: .56em; }

/* ---------- 地表用料 ---------- */
.mats { display: flex; flex-direction: column; gap: 8px; }
.mats li { display: flex; align-items: center; gap: 11px; font-size: 12.5px; }
.mats .m-sw {
  width: 16px; height: 16px;
  border-radius: 4px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .14);
}
.mats .m-name { width: 8.5em; flex: none; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mats .m-id { font-family: var(--font-mono); font-size: 10.5px; color: var(--dim-2); width: 15em; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mats .m-track { position: relative; flex: 1; height: 6px; border-radius: 4px; background: var(--line-soft); overflow: hidden; min-width: 60px; }
.mats .m-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  transition: width .9s var(--ease-out);
}
.mats .m-val { width: 6.4em; text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--dim); flex: none; }

@media (max-width: 760px) {
  .world-card { grid-template-columns: 1fr; }
  .wc-icon { width: 64px; height: 64px; }
  .mats .m-id { display: none; }
  .mats .m-name { width: 6.5em; }
  .map-hint { display: none; }
}

/* ---------- 13. 命令面板 ---------- */
.palette { background: var(--scrim); backdrop-filter: blur(4px); animation: fade .18s var(--ease); display: flex; justify-content: center; padding-top: 12vh; }
.palette-box {
  width: min(620px, calc(100% - 32px));
  max-height: 64vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop .22s var(--ease-out);
}
@keyframes pop { from { transform: translateY(-10px) scale(.985); opacity: 0; } }
.palette-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.palette-input svg { width: 18px; height: 18px; color: var(--dim); }
.palette-input input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; }
.palette-list { overflow-y: auto; padding: 8px; }
.palette-list li { border-radius: 9px; }
.palette-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text-2);
}
.palette-list li.is-on button { background: var(--brass-soft); color: var(--brass); }
.palette-list .p-kind {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  flex: none;
}
.palette-list .p-sub { margin-left: auto; font-size: 11px; color: var(--dim-2); font-family: var(--font-mono); }
.palette-ico { width: 22px; height: 22px; border-radius: 5px; flex: none; object-fit: cover; }
.palette-empty { padding: 26px; text-align: center; color: var(--dim-2); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%; bottom: 30px;
  z-index: 120;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  font-size: 12.5px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toast-in .28s var(--ease-out);
}
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }

/* ---------- 14. 页脚 ---------- */
.foot { margin-top: var(--pad-sec); border-top: 1px solid var(--line-soft); padding: 34px 0 46px; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-end; }
.foot-title { font-size: 15px; font-weight: 600; letter-spacing: .06em; }
.foot-title span { font-family: var(--font-mono); font-size: 11px; color: var(--brass); margin-left: 4px; }
.foot-inner p { font-size: 12px; }
.foot-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; }
.foot-links a { color: var(--brass); }

/* ══════════════════════════════════════════════════════════════
   v4 启动页：奢侈钟表语言
   logo 一笔笔描画 → 标题逐字浮现 → 细进度线 → 平滑淡出
   ══════════════════════════════════════════════════════════════ */
html.is-booting { overflow: hidden; }
html.is-booting .nav,
html.is-booting .progress { opacity: 0; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 100% at 50% 40%, #10161c 0%, #0a0d10 58%, #05070a 100%);
  transition: opacity .85s cubic-bezier(.5, 0, .4, 1), transform .85s cubic-bezier(.5, 0, .4, 1);
}
.boot.is-open { opacity: 0; transform: translateY(-2.5vh); }
.boot.is-done { display: none; }
html[data-theme="light"] .boot {
  background: radial-gradient(120% 100% at 50% 40%, #fffdf8 0%, #f4efe6 58%, #e9e2d6 100%);
}

.boot-inner { text-align: center; padding: 28px; max-width: 88vw; }

/* logo：描边动画，圆先画、齿随后、指针与猫耳最后 */
.boot-mark { width: 74px; height: 74px; color: var(--brass); }
.boot-mark .bm {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: bm-draw .9s cubic-bezier(.6, .05, .3, 1) forwards;
}
.boot-mark .bm-1 { animation-delay: .05s; }
.boot-mark .bm-2 { animation-delay: .34s; animation-duration: .6s; }
.boot-mark .bm-3 { animation-delay: .62s; animation-duration: .42s; }
.boot-mark .bm-4 { animation-delay: .72s; animation-duration: .42s; }
.boot-mark .bm-5 { animation-delay: .82s; animation-duration: .38s; }
.boot-mark .bm-6 { animation-delay: .90s; animation-duration: .38s; }
@keyframes bm-draw { to { stroke-dashoffset: 0; } }

/* 标题逐字浮现 */
.boot-title {
  margin: 30px 0 0;
  font-size: clamp(26px, 4.6vw, 40px);
  font-weight: 500;
  letter-spacing: .30em;
  text-indent: .30em;
  color: var(--text);
}
.bt {
  display: inline-block;
  opacity: 0;
  transform: translateY(.5em);
  animation: char-in .72s cubic-bezier(.19, .8, .22, 1) forwards;
}
.bt:nth-child(1) { animation-delay: .52s; }
.bt:nth-child(2) { animation-delay: .66s; }
.bt:nth-child(3) { animation-delay: .80s; }
.bt:nth-child(4) { animation-delay: .94s; }
@keyframes char-in { to { opacity: 1; transform: none; } }

.boot-wordmark {
  margin: 13px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .52em;
  text-indent: .52em;
  color: var(--brass);
  opacity: 0;
  animation: boot-fade .8s ease forwards;
  animation-delay: 1.12s;
}

/* 进度线 + 状态行 */
.boot-line {
  width: min(46vw, 260px);
  height: 1px;
  margin: 36px auto 0;
  background: rgba(226, 169, 92, .16);
}
.boot-line i {
  display: block;
  height: 100%;
  width: 0;
  background: #e2a95c;
  box-shadow: 0 0 10px rgba(226, 169, 92, .55);
}
.boot-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--dim);
  opacity: 0;
  animation: boot-fade .8s ease forwards;
  animation-delay: 1.22s;
}
.boot-pct { color: var(--brass); font-variant-numeric: tabular-nums; }
.boot-sep { color: var(--dim-2); }
.boot-skip-btn {
  margin-left: 8px;
  color: var(--dim-2);
  cursor: pointer;
  transition: color .25s var(--ease);
}
.boot-skip-btn:hover { color: var(--text-2); }
@keyframes boot-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .boot { transition: opacity .3s linear; transform: none; }
  .boot.is-open { opacity: 0; transform: none; }
  .boot-mark .bm { animation: none; stroke-dashoffset: 0; }
  .bt, .boot-wordmark, .boot-state { animation: none; opacity: 1; transform: none; }
}

/* ══════════════════════════════════════════════════════════════
   v2 新增：光标 / WebGL 首屏 / 帮助面板 / 性能 HUD
   ══════════════════════════════════════════════════════════════ */

/* ---------- 自定义光标 ---------- */
.cur-dot, .cur-ring {
  position: fixed;
  left: 0; top: 0;
  z-index: 260;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s var(--ease);
  will-change: transform;
}
.cur-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 12px color-mix(in srgb, var(--brass) 65%, transparent);
}
.cur-ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--brass) 50%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--brass) 10%, transparent) 0%, transparent 70%);
}
html.has-cursor, html.has-cursor body, html.has-cursor a, html.has-cursor button,
html.has-cursor .chip, html.has-cursor .mod-card, html.has-cursor .shot { cursor: none; }
@media (hover: none), (max-width: 860px) {
  .cur-dot, .cur-ring { display: none; }
  html.has-cursor, html.has-cursor body, html.has-cursor a,
  html.has-cursor button, html.has-cursor .chip { cursor: auto; }
}

/* ---------- 首屏：WebGL 后处理层 ---------- */
.hero-gl {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.hero-gl.is-on { opacity: 1; }
.hero-bg { transition: opacity .9s var(--ease); }

.hero-cap {
  position: absolute;
  left: max(22px, calc((100% - var(--wrap)) / 2));
  bottom: 30px;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}
.hero-cap.is-in { opacity: 1; transform: none; }
.hero-cap b { color: rgba(255, 255, 255, .9); font-weight: 500; }
.hero-cap span { font-family: var(--font-mono); font-size: 10.5px; color: rgba(255, 255, 255, .4); }

.hero-gl-btn {
  position: absolute;
  right: max(22px, calc((100% - var(--wrap)) / 2));
  bottom: 30px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(10, 12, 14, .42);
  backdrop-filter: blur(12px);
  font-size: 11.5px;
  color: rgba(255, 255, 255, .66);
  transition: all .22s var(--ease);
}
.hero-gl-btn:hover { border-color: color-mix(in srgb, var(--brass) 60%, transparent); color: #fff; }
.hero-gl-btn b { color: var(--brass); font-weight: 500; }
.gl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 26%, transparent);
  animation: pulse 2.6s var(--ease) infinite;
}

/* ---------- 工具条次级按钮 ---------- */
.seg-actions { border-style: dashed; }
.seg-actions button { color: var(--dim-2); }
.seg-actions button:hover { color: var(--brass); }

/* ---------- 帮助面板 ---------- */
.help {
  position: fixed;
  inset: 0;
  z-index: 108;
  display: grid;
  place-items: center;
  padding: 5vh 20px;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  animation: fade .2s var(--ease);
}
.help-box {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  animation: pop .24s var(--ease-out);
}
.help-box h3 {
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim-2);
  margin: 6px 0 14px;
}
.help-box h3:not(:first-child) { margin-top: 26px; }
.help-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
}
.help-grid > div { display: flex; gap: 4px; }
.help-list { display: flex; flex-direction: column; gap: 11px; font-size: 13px; color: var(--dim); line-height: 1.85; }
.help-list li { position: relative; padding-left: 18px; }
.help-list li::before {
  content: "";
  position: absolute;
  left: 3px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--brass);
  transform: rotate(45deg);
}
.help-box .btn { margin-top: 22px; }

/* ---------- 性能 HUD ---------- */
.hud {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 95;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  box-shadow: var(--shadow-sm);
}
.hud div { display: flex; justify-content: space-between; gap: 14px; }
.hud b { color: var(--brass); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- 模组卡片：图标主色光晕 ---------- */
.mod-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 100% at 0% 50%,
    color-mix(in srgb, var(--mc, transparent) 22%, transparent) 0%, transparent 55%);
  transition: opacity .3s var(--ease);
}
.mod-card:hover::after { opacity: 1; }
.mod-card .mod-ico { box-shadow: 0 0 0 1px var(--line-soft), 0 6px 18px -10px color-mix(in srgb, var(--mc, transparent) 80%, transparent); }

.foot-title em { font-style: normal; font-size: 10.5px; color: var(--dim-2); margin-left: 6px; letter-spacing: .1em; }

/* ---------- 滚动驱动动画（支持的浏览器才启用） ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sec-num {
      animation: secNum linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 26%;
    }
    @keyframes secNum {
      from { opacity: 0; letter-spacing: .55em; }
      to { opacity: 1; letter-spacing: .2em; }
    }
  }
}

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1000px) {
  .split, .about-grid { grid-template-columns: 1fr; }
  .sig-grid { grid-template-columns: repeat(2, 1fr); }
  .launch-cols { grid-template-columns: 1fr; gap: 16px; }
  .clockwork { display: none; }
  .donut-wrap { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav { gap: 10px; }
  .hero-inner { padding-bottom: 118px; }
  .toolbar { position: static; }
  .table th { position: static; }
  .graph-legend { max-width: 100%; }
  .mod-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .lightbox { grid-template-columns: 1fr; }
  .lb-nav { position: absolute; bottom: 24px; }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  .foot-inner, .foot-links { align-items: flex-start; }
  /* v2：首屏按钮与说明在小屏改为纵向排布 */
  .hero-cap { left: 22px; right: 22px; bottom: 74px; flex-wrap: wrap; }
  .hero-gl-btn { right: 22px; bottom: 26px; }
  .graph-hint { display: none; }
  .help-grid { grid-template-columns: 1fr; gap: 6px; }
  .help-grid > div { margin-top: 8px; }
  .hud { right: 12px; bottom: 12px; }
}
@media (max-width: 520px) {
  .sig-grid { grid-template-columns: 1fr; }
  .mod-grid { grid-template-columns: 1fr 1fr; }
  .mod-note { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- 16. 可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .progress, .grain, .clockwork, .scroll-hint, .toolbar, .chips, .graph-shell { display: none; }
  body { background: #fff; color: #000; }
}
