/* =========================================================
 *  数学社 · 视觉系统 —— 简洁、克制、高级
 *  纯黑底 + 细线条 + 社徽蓝单一强调色；反馈以光感与微动效为主
 * ========================================================= */
:root {
  --bg: #000;
  --surface: #07090d;
  --surface-2: #0c0f15;
  --line: rgba(var(--ink), .08);
  --line-2: rgba(var(--ink), .14);
  --text: #ededef;
  --text-2: #8a909c;
  --text-3: #5a606b;
  --brand: #2e67b1;
  --accent: #4d8bff;
  --accent-soft: rgba(77, 139, 255, .16);
  --green: #30d158;
  --red: #ff453a;
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.22, .61, .36, 1);            /* 悬停、颜色变化 */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);         /* 入场 / 出场：强 ease-out */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);     /* 屏幕内移动 */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);      /* 底部弹窗（iOS 抽屉曲线） */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "MiSans VF", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --display: var(--sans);
  --latin: var(--sans);
  --mono: var(--sans);
  --nav-h: 60px;
  --tabbar-h: 0px;
  /* 主题相关 */
  --bg-rgb: 0, 0, 0;
  --ink: 255, 255, 255;
  --strong: #fff;
  --inverse: #fff; --inverse-ink: #000; --inverse-hover: #e6ecf8;
  --nav-bg: rgba(0, 0, 0, .72);
  --pop-bg: rgba(18, 20, 26, .92);
  --title-a: #fff; --title-b: #9fb6e0;
  --formula: #c9d6ef;
  --card-shadow: none;
}
/* 浅色主题：苹果式的浅灰白底 */
:root[data-theme="light"] {
  --bg: #fbfbfd; --bg-rgb: 251, 251, 253;
  --surface: #ffffff; --surface-2: #f5f5f7;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .14);
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #a1a1a6;
  --brand: #2e67b1; --accent: #2e67b1; --accent-soft: rgba(46, 103, 177, .12);
  --ink: 0, 0, 0;
  --strong: #000;
  --inverse: #1d1d1f; --inverse-ink: #fff; --inverse-hover: #000;
  --nav-bg: rgba(251, 251, 253, .78);
  --pop-bg: rgba(255, 255, 255, .92);
  --title-a: #1d1d1f; --title-b: #2e67b1;
  --formula: #2a3a5c;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px -14px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; background: var(--bg); color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.7; letter-spacing: .005em; overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: "kern", "calt"; }
h1, h2, h3, .brand, .stat-num, .event-date b { font-family: var(--display); }
body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
b, strong { color: var(--strong); font-weight: 600; }
::selection { background: rgba(77, 139, 255, .35); }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

#app { position: relative; min-height: 100vh; background: var(--bg); transform-origin: 50% 50vh; }
body.sheet-live #app { overflow: hidden; will-change: transform; }
#app::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(1000px 520px at 50% -12%, rgba(46, 103, 177, .16), transparent 70%); }
#app > * { position: relative; z-index: 1; }
.container { width: min(1180px, 100% - 40px); margin: 0 auto; }

/* ---------- 动效基元 ---------- */
.pressable { transition: transform .16s var(--ease-out); }
.pressable.is-pressed, .btn.is-pressed { transform: scale(.97); transition-duration: .1s; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
/* 区块标题：小标签横线伸出，大标题从遮罩里升起 */
.section-kicker { display: inline-flex; align-items: center; gap: 10px; }
.section-kicker::before { content: ""; width: 22px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform .5s var(--ease-out) .15s; }
.section-head.in .section-kicker::before { transform: none; }
.section-head.reveal { filter: none; transform: none; }
.section-head.reveal p { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease-out) .12s, transform .5s var(--ease-out) .12s; }
.section-head.in p { opacity: 1; transform: none; }
.link-u { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s var(--ease); }
.link-u:hover { background-size: 100% 1px; }

/* 聚光卡片：光斑跟随鼠标，边框随之点亮 */
.spot { position: relative; isolation: isolate; }
.spot-fx { position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(77, 139, 255, .09), transparent 45%); }
.spot-fx::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(120, 165, 255, .55), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

.card { position: relative; background: linear-gradient(180deg, rgba(var(--ink), .025), rgba(var(--ink), .01)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--card-shadow); }
:root[data-theme="light"] .card { background: var(--surface); }

/* ---------- 启动画面 ---------- */
#launch { position: fixed; inset: 0; z-index: 2000; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: opacity .6s var(--ease), visibility .6s; }
#launch.done { opacity: 0; visibility: hidden; pointer-events: none; }
#launch .launch-logo { width: 132px; height: 132px; }
#launch .launch-title { font-size: 13px; letter-spacing: .6em; padding-left: .6em; color: var(--text-2); opacity: 0; transform: translateY(6px); transition: opacity .5s var(--ease-out) .6s, transform .5s var(--ease-out) .6s; }
#launch.drawn .launch-title { opacity: 1; transform: none; }
.logo-svg .stroke { fill: none; stroke: var(--accent); stroke-width: 7; stroke-dasharray: 1; stroke-dashoffset: 1; }
.logo-svg .fill { fill: var(--brand); opacity: 0; transition: opacity .6s var(--ease); }
.logo-svg.draw .stroke { animation: logoDraw 1.3s var(--ease) forwards; }
.logo-svg.draw .stroke.s2 { animation-delay: .2s; } .logo-svg.draw .stroke.s3 { animation-delay: .4s; }
.logo-svg.filled .fill { opacity: 1; } .logo-svg.filled .stroke { opacity: 0; transition: opacity .4s; }
@keyframes logoDraw { to { stroke-dashoffset: 0; } }
#launch-fly { position: fixed; z-index: 2001; pointer-events: none; }

/* ---------- 提示条（顶部胶囊） ---------- */
#island { position: fixed; top: 14px; left: 50%; z-index: 3000; transform: translate(-50%, -14px) scale(.82, .9); transform-origin: 50% 0; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px; background: var(--pop-bg); color: var(--text); border: 1px solid var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: 14px; opacity: 0; pointer-events: none; touch-action: none; user-select: none; cursor: grab; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); max-width: calc(100% - 32px); }
#island.show { pointer-events: auto; }
#island .island-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; flex: none; }
#island .island-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 顶部导航 ---------- */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 max(20px, calc((100% - 1180px) / 2)); border-bottom: 1px solid transparent; transition: background .35s, border-color .35s; }
#nav.scrolled, #nav.solid { background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: .14em; }
.brand-logo { width: 28px; height: 28px; flex: none; }
.nav-seg { position: relative; display: flex; gap: 2px; }
.nav-seg a { position: relative; z-index: 1; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--text-2); transition: color .25s; }
.nav-seg a:hover, .nav-seg a.active { color: var(--text); }
.nav-seg .seg-pill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: rgba(var(--ink), .07); border: 1px solid var(--line); transition: opacity .2s var(--ease); opacity: 0; }
.nav-cta { padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; background: var(--inverse); color: var(--inverse-ink); border: 0; cursor: pointer; transition: background .25s var(--ease), transform .16s var(--ease-out); }
.nav-cta:hover { background: var(--inverse-hover); }

/* ---------- 底部标签栏（手机） ---------- */
#tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
#tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 3px 0; transition: color .25s; }
#tabbar a svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#tabbar a.active { color: var(--text); }

/* ---------- 按钮 ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid transparent; padding: 11px 22px; border-radius: 999px; font-size: 14.5px; font-weight: 500; letter-spacing: .02em; transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .16s var(--ease-out), translate .35s var(--ease-out), box-shadow .3s var(--ease); user-select: none; white-space: nowrap; }
.btn .arrow { transition: transform .2s var(--ease-out); }
.btn-primary { background: var(--inverse); color: var(--inverse-ink); font-weight: 600; }
.btn-primary:hover { background: var(--inverse-hover); box-shadow: 0 0 0 4px rgba(var(--ink), .07); }
.btn-plain { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-plain:hover { border-color: rgba(var(--ink), .3); background: rgba(var(--ink), .04); }
.btn-tinted { background: rgba(var(--ink), .04); color: var(--text); border-color: var(--line); }
.btn-tinted:hover { background: rgba(var(--ink), .07); border-color: var(--line-2); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 首屏 ---------- */
#hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; }
#hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 20%, rgba(var(--bg-rgb), .82) 80%), linear-gradient(to bottom, transparent 70%, var(--bg)); }
.hero-content { position: relative; z-index: 2; text-align: center; padding: 0 20px; display: flex; flex-direction: column; align-items: center; }
.emblem-wrap { width: 96px; height: 96px; margin-bottom: 26px; perspective: 800px; }
.emblem { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s var(--ease-out); }
.emblem svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 28px rgba(46, 103, 177, .55)); }
.emblem .shine { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; mix-blend-mode: overlay; }
.emblem .shine::after { content: ""; position: absolute; top: -50%; left: -70%; width: 40%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent); transform: rotate(25deg); animation: shineSweep 6s var(--ease) infinite 3s; }
@keyframes shineSweep { 0% { left: -70%; } 30%, 100% { left: 140%; } }
.emblem .comet { fill: #fff; filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 12px var(--accent)); }
.hero-eyebrow { font-size: 11.5px; letter-spacing: .5em; padding-left: .5em; color: var(--text-2); margin-bottom: 14px; }
.hero-title { font-size: clamp(56px, 10vw, 124px); font-weight: 600; line-height: 1.04; letter-spacing: .06em; padding-left: .06em; display: flex; justify-content: center; }
.hero-title .ch { display: inline-block; overflow: hidden; padding: 0 .02em .06em; }
.hero-title .ch i { display: inline-block; font-style: normal; background: linear-gradient(180deg, var(--title-a) 35%, var(--title-b)); -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: translateY(108%); transition: transform .7s var(--ease-out); transition-delay: calc(.04s + var(--i) * .06s); }
body.launched .hero-title .ch i { transform: none; }
.hero-sub { font-size: clamp(15px, 1.8vw, 18px); letter-spacing: .4em; padding-left: .4em; color: var(--text-2); margin: 14px 0 20px; }
.formula-carousel { height: 62px; width: min(620px, 92vw); position: relative; font-size: clamp(14px, 1.8vw, 19px); color: var(--formula); }
.formula-carousel .f { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); white-space: nowrap; opacity: 0; filter: blur(6px); transition: opacity .9s var(--ease), transform .9s var(--ease-out), filter .9s; }
.formula-carousel .f.on { opacity: 1; filter: none; transform: translate(-50%, -50%); }
.formula-carousel .f .name { display: block; font-size: 11px; letter-spacing: .3em; color: var(--text-3); margin-top: 2px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero-caption { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: 64px; width: min(900px, 100% - 40px); text-align: center; font-size: 12px; color: var(--text-3); }
.hero-caption b { color: var(--text-2); font-weight: 500; }
.scroll-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 2; width: 1px; height: 30px; background: linear-gradient(var(--text-3), transparent); overflow: hidden; }
.scroll-hint span { position: absolute; left: 0; top: -30px; width: 1px; height: 30px; background: linear-gradient(transparent, var(--strong)); animation: scrollLine 2.2s var(--ease) infinite; }
@keyframes scrollLine { to { top: 30px; } }

/* ---------- 区块标题 ---------- */
.section { padding: 128px 0 40px; position: relative; }
.section-head { margin-bottom: 44px; max-width: 760px; }
.section-kicker { font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: .18em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 600; letter-spacing: -.005em; line-height: 1.12; margin: 12px 0 14px; }
.section-head p { color: var(--text-2); font-size: 17px; line-height: 1.65; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.about-text { padding: 36px; }
.about-text .lead { font-size: 19px; font-weight: 500; margin-bottom: 18px; line-height: 1.6; color: var(--strong); }
.about-text p { color: var(--text-2); margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 124px; }
.stat-num { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-2); font-size: 13px; margin-top: 10px; }
.flip-row { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top: 16px; }
.flip { perspective: 1200px; cursor: pointer; min-height: 280px; border-radius: var(--r); }
.flip-inner { position: relative; width: 100%; height: 100%; min-height: 280px; transform-style: preserve-3d; transition: transform .6s var(--ease-in-out); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 26px; border: 1px solid var(--line); }
.flip-front { background: radial-gradient(circle at 50% 40%, rgba(46, 103, 177, .22), transparent 65%), var(--surface); }
.flip-front svg { width: 132px; height: 132px; }
.flip-back { background: var(--surface-2); transform: rotateY(180deg); text-align: center; }
.flip-back h3 { font-size: 18px; font-weight: 600; }
.flip-back p { color: var(--text-2); font-size: 14px; line-height: 2; }
.flip-hint { font-size: 12px; color: var(--text-3); }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pillar { padding: 24px; }
.pillar-sym { font-family: var(--latin); font-size: 30px; line-height: 1; color: var(--accent); margin-bottom: 14px; }
.pillar h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.pillar p { color: var(--text-2); font-size: 14px; }

/* ---------- 首页：实验室入口 ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lab-card { padding: 22px 22px 20px; display: flex; flex-direction: column; min-height: 176px; transition: border-color .35s, transform .5s var(--ease-out), background .35s; }
.lab-card:hover { border-color: var(--line-2); }
.lab-card .lc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.lab-card .lc-sym { font-family: var(--latin); font-size: 34px; line-height: 1; color: var(--strong); }
.lab-card .lc-no { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.lab-card h3 { font-size: 15.5px; font-weight: 600; margin-top: auto; }
.lab-card p { font-size: 13px; color: var(--text-2); }
.lab-card .lc-go { position: absolute; right: 20px; bottom: 20px; font-size: 14px; color: var(--text-3); transform: translateX(-4px); opacity: 0; transition: transform .25s var(--ease-out), opacity .25s var(--ease-out), color .25s var(--ease); }
.lab-card:hover .lc-go { transform: none; opacity: 1; color: var(--accent); }
.lab-cta { display: flex; justify-content: center; margin-top: 36px; }

/* ---------- 实验室页面 ---------- */
.lab-page { padding-top: calc(var(--nav-h) + 36px); min-height: 100vh; }
.lab-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 44px; align-items: start; }
.lab-side { position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; padding-bottom: 24px; scrollbar-width: none; }
.lab-side::-webkit-scrollbar { display: none; }
.lab-side h1 { font-size: 22px; font-weight: 600; letter-spacing: .04em; margin-bottom: 4px; }
.lab-side .side-sub { font-size: 12.5px; color: var(--text-3); margin-bottom: 24px; }
.side-group { margin-bottom: 20px; }
.side-group-title { font-size: 11px; letter-spacing: .16em; color: var(--text-3); text-transform: uppercase; margin: 0 0 6px 12px; }
.side-link { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); transition: color .2s, background .2s, opacity .2s; }
.side-link .no { font-family: var(--mono); font-size: 11px; color: var(--text-3); width: 18px; }
.side-link:hover { color: var(--text); background: rgba(var(--ink), .03); }
.side-link.active { color: var(--strong); background: rgba(var(--ink), .06); }
.side-link.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--accent); }
.side-link.active .no { color: var(--accent); }
.lab-main { min-width: 0; }
.lab-main .experiment { display: none; padding: 0 0 40px; }
.lab-main .experiment.current { display: block; animation: expIn .2s var(--ease-out); }
@keyframes expIn { from { opacity: 0; } }
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.crumb a:hover { color: var(--text); }
.exp-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.exp-pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); min-width: 180px; transition: border-color .3s, background .3s; }
.exp-pager a:hover { border-color: var(--line-2); background: rgba(var(--ink), .02); }
.exp-pager a small { font-size: 11.5px; color: var(--text-3); }
.exp-pager a span { font-size: 14px; }
.exp-pager .next { text-align: right; margin-left: auto; }
.lab-strip { display: none; }

/* ---------- 实验 ---------- */
.exp-head { margin-bottom: 10px; }
.exp-head .exp-no { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.exp-head h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 600; line-height: 1.18; margin-top: 6px; letter-spacing: -.005em; }
.exp-badge { display: none; }
.exp-desc { color: var(--text-2); max-width: 860px; margin-bottom: 24px; font-size: 15px; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: stretch; }
.stage-dual { grid-template-columns: 1fr 1fr; }
.canvas-wrap { position: relative; border-radius: var(--r); overflow: hidden; min-height: 460px; height: 64vh; max-height: 640px; background: #000; border: 1px solid var(--line); }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.canvas-wrap canvas.overlay { pointer-events: none; }
.canvas-hud { position: absolute; left: 12px; bottom: 12px; z-index: 3; pointer-events: none; max-width: calc(100% - 24px); font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .8); background: rgba(0, 0, 0, .55); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel { padding: 6px 18px 18px; display: flex; flex-direction: column; max-height: 640px; overflow-y: auto; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); scrollbar-width: none; }
.panel::-webkit-scrollbar { display: none; }
.panel > * { margin-top: 14px; }
.group { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel > .group:first-child { border-top: 0; padding-top: 4px; }
.field-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.field-label output { color: var(--text); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.math-input { width: 100%; padding: 9px 12px; border-radius: var(--r-sm); background: rgba(var(--ink), .03); color: var(--strong); border: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; outline: none; transition: border-color .25s, box-shadow .25s, background .25s; }
.math-input:hover { border-color: var(--line-2); }
.math-input:focus { border-color: var(--accent); background: rgba(77, 139, 255, .04); box-shadow: 0 0 0 3px rgba(77, 139, 255, .18); }
.math-input.bad { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 69, 58, .14); }
.tex-preview { min-height: 26px; overflow-x: auto; overflow-y: hidden; font-size: 14.5px; scrollbar-width: none; }
.tex-preview.tall { min-height: 52px; }
.tex-preview::-webkit-scrollbar, .formula-note::-webkit-scrollbar { display: none; }
.err { color: var(--red); font-size: 12px; }
.err:empty { display: none; }
#topo-param { font-size: 12px; }

/* 分段控件 */
.chips { position: relative; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(var(--ink), .03); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; z-index: 1; flex: none; padding: 5px 11px; font-size: 12.5px; border-radius: 7px; cursor: pointer; border: 0; background: transparent; color: var(--text-2); white-space: nowrap; scroll-snap-align: center; transition: color .25s, opacity .2s; }
.chip:hover { color: var(--text); }
.chip.active { color: var(--strong); }
.chips .seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 7px; z-index: 0; background: rgba(var(--ink), .09); box-shadow: inset 0 0 0 1px rgba(var(--ink), .08); transition: opacity .2s var(--ease); opacity: 0; }

/* 开关 */
.toggle-row { gap: 6px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--text); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span { order: 2; flex: none; width: 34px; height: 20px; border-radius: 10px; background: rgba(var(--ink), .12); position: relative; transition: background .3s var(--ease); }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform .2s var(--ease-out); }
.switch:hover span { background: rgba(var(--ink), .18); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }

/* 滑块：细轨道 + 渐变填充，拖动时滑钮放大并出现光环 */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; outline: none; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--brand), var(--accent) var(--p), rgba(var(--ink), .12) var(--p)); }
input[type=range]::-moz-range-track { height: 2px; background: rgba(var(--ink), .12); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(77, 139, 255, .3), 0 1px 4px rgba(0, 0, 0, .5); transition: transform .3s var(--ease-out), box-shadow .3s; }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(77, 139, 255, .14), 0 1px 4px rgba(0, 0, 0, .5); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(77, 139, 255, .18), 0 1px 4px rgba(0, 0, 0, .5); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
select { background: rgba(var(--ink), .03); color: var(--strong); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-family: inherit; font-size: 13px; outline: none; }
select:focus { border-color: var(--accent); }
select option { background: var(--surface-2); }

.formula-note { color: var(--text-2); font-size: 13.5px; overflow-x: auto; padding-top: 14px; border-top: 1px solid var(--line); scrollbar-width: none; }
.formula-note.small { font-size: 12.5px; }
.readout { font-family: var(--mono); font-size: 11.5px; line-height: 1.85; color: var(--text); padding: 12px 14px; border-radius: var(--r-sm); background: rgba(var(--ink), .02); border: 1px solid var(--line); }
.readout .k { color: var(--text-3); }
.readout .v { color: var(--strong); }
.controls-bar { margin-top: 12px; padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 22px; align-items: center; font-size: 13px; color: var(--text-2); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.controls-bar label { display: flex; align-items: center; gap: 10px; }
.controls-bar input[type=range] { width: 150px; }
.controls-bar output { color: var(--text); font-family: var(--mono); min-width: 34px; }
.controls-bar .hint { font-size: 12px; color: var(--text-3); }
.spectrum { width: 100%; height: 60px; border-radius: 8px; background: rgba(var(--ink), .02); border: 1px solid var(--line); }
.matrix-input { display: flex; align-items: center; justify-content: center; gap: 4px; }
.matrix-input .bracket { font-family: var(--latin); font-size: 64px; font-weight: 300; color: var(--text-3); line-height: 1; transform: scaleX(.55); }
.matrix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.matrix-grid input { width: 72px; padding: 8px; text-align: center; font-family: var(--mono); font-size: 15px; background: rgba(var(--ink), .03); border: 1px solid var(--line); border-radius: 8px; outline: none; transition: border-color .25s, box-shadow .25s; }
.matrix-grid input:nth-child(odd) { color: var(--green); } .matrix-grid input:nth-child(even) { color: var(--red); }
.matrix-grid input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77, 139, 255, .18); }

/* ---------- 每周一题 / 活动 ---------- */
.problems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.problem { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.problem-tag { font-size: 11.5px; color: var(--text-3); letter-spacing: .08em; }
.problem h3 { font-size: 18px; font-weight: 600; }
.problem > p { color: var(--text-2); font-size: 14.5px; }
.problem .list { margin-top: auto; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 12px 2px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--text); transition: color .2s; }
summary:hover { color: var(--strong); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 17px; font-weight: 300; color: var(--text-3); transition: transform .2s var(--ease-out); }
details[open] summary::after { transform: rotate(45deg); }
details .ans { color: var(--text-2); font-size: 14px; padding: 0 2px 14px; }
.events { max-width: 880px; }
.event-row { display: flex; gap: 22px; align-items: center; padding: 20px 24px; position: relative; transition: background .3s; }
.event-row + .event-row { border-top: 1px solid var(--line); }
.event-row:hover { background: rgba(var(--ink), .015); }
.event-date { width: 52px; flex: none; text-align: center; line-height: 1.1; }
.event-date b { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-date small { font-size: 11px; color: var(--text-3); }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { font-size: 15.5px; font-weight: 600; }
.event-body p { font-size: 13.5px; color: var(--text-2); }
.event-tag { font-size: 12px; color: var(--text-3); }

/* ---------- 加入 ---------- */
.join-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; padding: 52px; align-items: center; overflow: hidden; }
.join-card::before { content: ""; position: absolute; width: 560px; height: 560px; right: -200px; top: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 103, 177, .28), transparent 65%); pointer-events: none; }
.join-card h2 { font-size: 34px; font-weight: 600; margin-bottom: 8px; }
.join-card p { color: var(--text-2); }
.join-formula { font-size: 18px; color: var(--formula); margin: 18px 0 0; }
.join-right { position: relative; display: flex; flex-direction: column; gap: 10px; }

/* ---------- 底部弹窗 ---------- */
#sheet-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; }
body.sheet-live #sheet-backdrop { visibility: visible; }
body.sheet-live:not(.sheet-open) #sheet-backdrop { pointer-events: none; }
#sheet { position: fixed; left: 50%; bottom: 0; z-index: 901; width: min(520px, 100%); max-height: 92vh; overflow-y: auto; transform: translate(-50%, 105%); background: var(--surface); overscroll-behavior: contain; border-radius: 20px 20px 0 0; border: 1px solid var(--line-2); border-bottom: 0; padding: 8px 22px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -24px 60px rgba(0, 0, 0, .7); }
#sheet.dragging { transition: none; }
.grabber { width: 36px; height: 4px; border-radius: 2px; background: rgba(var(--ink), .2); margin: 6px auto 14px; cursor: grab; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h3 { font-size: 18px; font-weight: 600; }
.sheet-close { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; transition: background .2s, color .2s; }
.sheet-close:hover { background: rgba(var(--ink), .06); color: var(--strong); }
.form-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; transition: border-color .25s; }
.form-group:focus-within { border-color: rgba(77, 139, 255, .5); }
.form-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; position: relative; }
.form-row + .form-row { border-top: 1px solid var(--line); }
.form-row label { width: 76px; flex: none; font-size: 14px; color: var(--text-2); }
.form-row input, .form-row textarea { flex: 1; background: transparent; border: 0; outline: none; color: var(--strong); font-size: 14.5px; font-family: inherit; padding: 13px 0; resize: none; }
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--text-3); }
.form-foot { font-size: 12px; color: var(--text-3); padding: 0 4px 14px; }

/* ---------- 页脚 ---------- */
.footer { padding: 40px 0 44px; text-align: center; color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 80px; }
.particle-logo { width: min(380px, 100%); height: 300px; margin: 0 auto; display: block; cursor: pointer; }
.footer-formula { font-size: 19px; color: var(--text-2); margin: 8px 0 12px; }
.footer.slim { margin-top: 40px; padding: 28px 0; }

.katex { font-size: 1.04em; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .lab-grid { grid-template-columns: repeat(3, 1fr); }
  .stage, .stage-dual { grid-template-columns: 1fr; }
  .canvas-wrap { height: 56vh; min-height: 340px; }
  .panel { max-height: none; }
  .about-grid, .join-card, .flip-row { grid-template-columns: 1fr; }
  .problems { grid-template-columns: 1fr; }
  .lab-shell { grid-template-columns: 1fr; gap: 0; }
  .lab-side { display: none; }
  .lab-strip { display: flex; position: sticky; top: var(--nav-h); z-index: 50; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; margin-bottom: 18px; background: var(--nav-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
  .lab-strip::-webkit-scrollbar { display: none; }
  .lab-strip a { position: relative; z-index: 1; flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); border: 1px solid transparent; transition: color .25s var(--ease), opacity .2s; }
  .lab-strip a.active { color: var(--strong); }
  .lab-page { padding-top: var(--nav-h); }
}
@media (max-width: 760px) {
  :root { --tabbar-h: 62px; }
  .container { width: calc(100% - 32px); }
  .nav-seg, .nav-cta { display: none; }
  #nav { justify-content: center; }
  #tabbar { display: flex; }
  #app { padding-bottom: var(--tabbar-h); }
  .section { padding: 84px 0 24px; }
  .lab-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lab-card { min-height: 150px; padding: 18px; }
  .hero-caption, .scroll-hint { display: none; }
  .hero-sub { letter-spacing: .25em; }
  .join-card { padding: 30px 22px; }
  .about-text { padding: 26px; }
  .pillars { grid-template-columns: 1fr; }
  .exp-pager a { min-width: 0; flex: 1; }
  .event-row { padding: 18px; gap: 16px; }
}
@media (hover: none) { .spot-fx { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* 装饰性循环动画直接停掉 */
  .shiny, .scroll-hint span, .emblem .shine::after { animation: none !important; }
  /* 入场：只保留 150ms 淡入，不再位移、缩放、模糊 */
  .reveal, .split .sc, .hero-title .ch i, .hero-content > *, .hero-entries a, .formula-carousel .f, .rot-word .rc, .section-head.reveal p {
    transform: none !important; filter: none !important; transition: opacity .15s linear !important; }
  .section-kicker::before { transform: none !important; transition: none !important; }
  /* 界面反馈保留，但更短 */
  .pressable, .btn, .switch span::after, .chips .seg-thumb, .nav-seg .seg-pill, .side-ind, .settings-pop, #island, #sheet, #app, .flip-inner, .lab-card, .icon-btn svg { transition-duration: .15s !important; }
  .pressable.is-pressed, .btn.is-pressed { transform: none !important; }
  .lab-side .side-link, .lab-main .experiment.current { animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-old(lab-main), ::view-transition-new(lab-main) { animation: vtOut .12s linear both !important; }
  ::view-transition-new(root), ::view-transition-new(lab-main) { animation-name: vtFadeIn !important; }
}
@keyframes vtFadeIn { from { opacity: 0; } }

/* =========================================================
 *  动效编排
 * ========================================================= */

/* 首屏入场：启动画面结束后，各元素依次从模糊中浮现（社徽本身由启动动画“飞入”） */
.hero-content > :not(.emblem-wrap):not(.hero-title) { opacity: 0; transform: translateY(10px); transition: opacity .55s var(--ease-out), transform .6s var(--ease-out); }
body.launched .hero-content > :not(.emblem-wrap):not(.hero-title) { opacity: 1; transform: none; }
body.launched .hero-eyebrow { transition-delay: 0s; }
body.launched .hero-sub { transition-delay: .12s; }
body.launched .formula-carousel { transition-delay: .18s; }
body.launched .hero-actions { transition-delay: .24s; }
.hero-caption { opacity: 0; transition: opacity .6s var(--ease-out) .45s; }
body.launched .hero-caption { opacity: 1; }
#hero-canvas { opacity: 0; transition: opacity 1.2s var(--ease-out); }
body.launched #hero-canvas { opacity: .85; }

/* 滚动驱动（支持的浏览器）：首屏内容随滚动后退、淡出，背景缓慢放大 */
@supports (animation-timeline: scroll()) {
  .hero-content { animation: heroOut linear both; animation-timeline: scroll(root); animation-range: 0 85vh; }
  @keyframes heroOut { to { transform: translateY(-90px) scale(.94); opacity: 0; filter: blur(6px); } }
  #hero .hero-caption, #hero .scroll-hint { animation: fadeAway linear both; animation-timeline: scroll(root); animation-range: 0 30vh; }
  @keyframes fadeAway { to { opacity: 0; } }
  .lab-card, .stat, .pillar { animation: cardDepth linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
  @keyframes cardDepth { from { scale: .96; } to { scale: 1; } }
}

/* 页面之间：跨文档视图过渡（首页 ↔ 实验室），导航栏保持不动 */
@view-transition { navigation: auto; }
#nav { view-transition-name: site-nav; }
::view-transition-old(root) { animation: vtOut .15s var(--ease-out) both; }
::view-transition-new(root) { animation: vtIn .22s var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; filter: blur(2px); } }

/* 实验切换：同页视图过渡 */
.lab-main { view-transition-name: lab-main; }
::view-transition-old(lab-main) { animation: vtOut .15s var(--ease-out) both; }
::view-transition-new(lab-main) { animation: vtIn .22s var(--ease-out) both; }
.lab-main .experiment.current.vt { animation: none; }

/* 实验室侧栏：入场逐项浮现，选中指示条平滑滑动 */
.lab-side { position: sticky; }
.lab-side .side-link { animation: sideIn .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes sideIn { from { opacity: 0; transform: translateX(-8px); } }
.side-link.active::before { display: none; }
.side-ind { position: absolute; top: 0; left: 0; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px rgba(77, 139, 255, .7); transition: transform .25s var(--ease-out), opacity .2s var(--ease); pointer-events: none; }
.side-link { transition: color .2s var(--ease), background .2s var(--ease); }

/* 折叠题解：高度平滑展开（支持的浏览器） */
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  details::details-content { height: 0; opacity: 0; overflow: clip; transition: height .25s var(--ease-out), opacity .2s var(--ease-out), content-visibility .25s allow-discrete; }
  details[open]::details-content { height: auto; opacity: 1; }
}

/* 按钮：按下更紧致，松开回弹 */
.btn-primary { box-shadow: 0 0 0 0 rgba(var(--ink), 0); }
.btn-primary:hover { box-shadow: 0 0 0 5px rgba(var(--ink), .08), 0 10px 30px -8px rgba(77, 139, 255, .45); }

/* 卡片：悬停时数学符号轻轻上浮 */
.lab-card .lc-sym, .pillar-sym { transition: transform .3s var(--ease-out), color .3s var(--ease); display: inline-block; }
.lab-card:hover .lc-sym { color: var(--accent); }

/* 数字计数时的模糊到清晰 */


/* =========================================================
 *  外观设置面板
 * ========================================================= */
.nav-right { display: flex; align-items: center; gap: 10px; position: relative; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: rgba(var(--ink), .03); color: var(--text); cursor: pointer; transition: background .25s, border-color .25s, transform .16s var(--ease-out); }
.icon-btn:hover { background: rgba(var(--ink), .07); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: transform .3s var(--ease-out), opacity .2s var(--ease); }
.icon-btn[data-mode="dark"] .i-sun, .icon-btn:not([data-mode]) .i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
.icon-btn[data-mode="light"] .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
.settings-pop { position: absolute; top: calc(100% + 12px); right: 0; width: 264px; padding: 14px; border-radius: 16px; background: var(--pop-bg); border: 1px solid var(--line-2); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; pointer-events: none; transition: opacity .15s var(--ease-out), transform .2s var(--ease-out); z-index: 120; }
.settings-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.sp-title { font-size: 12px; color: var(--text-3); letter-spacing: .12em; margin: 0 2px 10px; }
.sp-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: border-color .25s, background .25s, box-shadow .25s; }
.sp-opt:hover { background: rgba(var(--ink), .03); }
.sp-opt.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-swatch { width: 100%; height: 62px; border-radius: 8px; position: relative; overflow: hidden; display: block; }
.sp-swatch i { position: absolute; left: 10px; height: 6px; border-radius: 3px; }
.sp-swatch i:nth-child(1) { top: 12px; width: 46%; }
.sp-swatch i:nth-child(2) { top: 26px; width: 70%; height: 4px; }
.sp-swatch i:nth-child(3) { top: 38px; width: 30%; height: 12px; border-radius: 6px; }
.sw-dark { background: #000; border: 1px solid rgba(255, 255, 255, .12); }
.sw-dark i { background: rgba(255, 255, 255, .5); }
.sw-dark i:nth-child(3) { background: #fff; }
.sw-light { background: #fbfbfd; border: 1px solid rgba(0, 0, 0, .1); }
.sw-light i { background: rgba(0, 0, 0, .35); }
.sw-light i:nth-child(3) { background: #1d1d1f; }
.sp-name { font-size: 13px; }
.sp-foot { font-size: 11.5px; color: var(--text-3); margin: 10px 2px 0; }

/* 主题切换：圆形揭开新主题时关闭其他视图过渡 */
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt #nav, html.theme-vt .lab-main { view-transition-name: none; }

/* 浅色主题下的细节 */
:root[data-theme="light"] .canvas-wrap { background: #fff; border-color: rgba(0, 0, 0, .09); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 44px -26px rgba(0, 0, 0, .22); }
:root[data-theme="light"] .canvas-hud { background: rgba(255, 255, 255, .82); color: #1d1d1f; border-color: rgba(0, 0, 0, .08); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .18); }
:root[data-theme="light"] #app::before { background: radial-gradient(1000px 520px at 50% -12%, rgba(46, 103, 177, .1), transparent 70%); }
:root[data-theme="light"] .flip-front { background: radial-gradient(circle at 50% 40%, rgba(46, 103, 177, .1), transparent 65%), var(--surface); }
:root[data-theme="light"] .emblem svg { filter: drop-shadow(0 10px 24px rgba(46, 103, 177, .3)); }
:root[data-theme="light"] .spot-fx { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(46, 103, 177, .07), transparent 45%); }
:root[data-theme="light"] .spot-fx::after { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(46, 103, 177, .45), transparent 55%); }

/* =========================================================
 *  reactbits 风格动效
 * ========================================================= */
/* SplitText */
.section-head.reveal h2 { clip-path: none; transform: none; }
.split .sc { display: inline-block; white-space: pre; opacity: 0; transform: translateY(.35em); filter: blur(3px); transition: opacity .5s var(--ease-out), transform .55s var(--ease-out), filter .5s var(--ease-out); transition-delay: calc(var(--i) * 24ms); }
.in .split .sc, .experiment.current .split .sc { opacity: 1; transform: none; filter: none; }

/* ShinyText */
.shiny { background: linear-gradient(110deg, var(--text-2) 35%, var(--strong) 50%, var(--text-2) 65%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shiny 4.5s linear infinite; }
@keyframes shiny { from { background-position: 125% 0; } to { background-position: -125% 0; } }

/* RotatingText */
.rotator { position: relative; display: inline-block; vertical-align: bottom; height: 1.7em; overflow: hidden; color: var(--strong); text-align: left; }
.rot-word { position: absolute; left: 0; top: 0; white-space: nowrap; }
.rot-word .rc { display: inline-block; transform: translateY(110%); opacity: 0; transition: transform .7s var(--ease-out), opacity .5s; transition-delay: calc(var(--i) * 45ms); }
.rot-word.in .rc { transform: none; opacity: 1; }
.rot-word.now .rc { transition: none; }
.rot-word.out .rc { transform: translateY(-110%); opacity: 0; transition-delay: calc(var(--i) * 30ms); }

/* ClickSpark */
.spark-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2500; }

/* TiltedCard */
.tilt { transform-style: preserve-3d; will-change: transform; }
.tilt .glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease); background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(var(--ink), .08), transparent 40%); z-index: 2; }
.tilt:hover .glare { opacity: 1; }

/* DotGrid */
#lab { overflow: hidden; }
.dot-grid { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%); mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 80%); }
#lab > .container { position: relative; z-index: 1; }

/* ScrollVelocity */
.velocity { padding: 70px 0 10px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.vel-row { white-space: nowrap; font-size: clamp(30px, 5vw, 60px); font-weight: 600; line-height: 1.25; letter-spacing: .01em; color: var(--text); }
.vel-track { display: inline-flex; align-items: center; gap: .5em; will-change: transform; }
.vel-track > span { display: inline-block; }
.vel-track > i { font-style: normal; color: var(--accent); font-size: .6em; }
.vel-row.outline { color: transparent; -webkit-text-stroke: 1px rgba(var(--ink), .35); font-family: var(--display); letter-spacing: .06em; }
.vel-row.outline .vel-track > i { -webkit-text-stroke: 0; }

@media (max-width: 760px) {
  .nav-right { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
  .settings-pop { width: 240px; }
  .velocity { padding-top: 40px; }
}

/* 底部弹窗收起时连同阴影一起隐藏（浅色主题下阴影会露出来） */
/* 弹窗的位置、背景压暗与后退都由 js/ios.js 的弹簧逐帧驱动；下方的同色投影在回弹略高时补住底边 */
#sheet { visibility: hidden; box-shadow: none; }
body.sheet-live #sheet { visibility: visible; box-shadow: 0 -24px 60px rgba(0, 0, 0, .35), 0 80px 0 var(--surface); }
#sheet .grabber, #sheet .sheet-head { touch-action: none; cursor: grab; }
#sheet.dragging, #sheet.dragging * { cursor: grabbing; user-select: none; }
/* =========================================================
 *  深蓝流体社徽（移植自 React Bits MetallicPaint）
 * ========================================================= */
.metal-logo { display: block; width: 100%; height: 100%; }
.emblem-metal, .flip-metal { width: 100%; height: 100%; }
.emblem-wrap { width: 136px; height: 136px; margin-bottom: 22px; }
.emblem .metal-logo { filter: drop-shadow(0 0 26px rgba(46, 103, 177, .55)); }
:root[data-theme="light"] .emblem .metal-logo { filter: drop-shadow(0 12px 22px rgba(46, 103, 177, .28)); }
.flip-front .flip-metal { width: 176px; height: 176px; }
.brand-logo .metal-logo { filter: drop-shadow(0 0 6px rgba(46, 103, 177, .5)); }

/* 启动画面：描线 → 流体倒入（与描线严格对齐）→ 整体飞到首屏 */
#launch .launch-logo, #launch-fly { position: relative; }
#launch-fly { position: fixed; }
#launch .logo-svg .disc, #launch .logo-svg .fill, #launch-fly .logo-svg .disc, #launch-fly .logo-svg .fill { display: none; }
.launch-metal { position: absolute; inset: 0; opacity: 0; transition: opacity .5s var(--ease); }
#launch.drawn .launch-metal, #launch-fly .launch-metal { opacity: 1; }
#launch-fly .logo-svg { opacity: 0; }
#launch-fly { transform-origin: 0 0; transition: transform .7s var(--ease-out), opacity .3s var(--ease); will-change: transform; }
.logo-svg.filled .stroke { transition: opacity .9s var(--ease) .2s; }
@media (max-width: 760px) { .emblem-wrap { width: 112px; height: 112px; } }

/* =========================================================
 *  多页面：首页一屏不滚动，各板块独立成页
 * ========================================================= */
body[data-page="home"] { overflow: hidden; height: 100svh; }
body[data-page="home"] #app { padding-bottom: 0; min-height: 0; }
body[data-page="home"] #hero { height: 100svh; min-height: 0; }
.hero-entries { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 3; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(980px, 100% - 40px); }
.hero-entries a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(var(--bg-rgb), .42); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); text-align: left; opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease-out), transform .55s var(--ease-out), border-color .25s var(--ease), background .25s var(--ease); }
body.launched .hero-entries a { opacity: 1; transform: none; }
body.launched .hero-entries a:nth-child(1) { transition-delay: .3s, .3s, 0s, 0s; }
body.launched .hero-entries a:nth-child(2) { transition-delay: .36s, .36s, 0s, 0s; }
body.launched .hero-entries a:nth-child(3) { transition-delay: .42s, .42s, 0s, 0s; }
body.launched .hero-entries a:nth-child(4) { transition-delay: .48s, .48s, 0s, 0s; }
body.launched .hero-entries a:hover { border-color: var(--line-2); background: rgba(var(--bg-rgb), .66); transition-delay: 0s; }
.he-no { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.he-name { font-size: 15px; font-weight: 600; color: var(--text); }
.he-sub { font-size: 12px; color: var(--text-2); }
body[data-page="home"] .hero-caption { bottom: 132px; }
@media (max-height: 820px) { body[data-page="home"] .hero-caption { display: none; } }
@media (max-height: 640px) { .hero-entries { display: none; } }
@media (max-width: 760px) { .hero-entries { display: none; } }

/* 子页面：第一屏的标题离导航近一点 */
.page > .section:first-child { padding-top: calc(var(--nav-h) + 72px); }
@media (max-width: 760px) { .page > .section:first-child { padding-top: calc(var(--nav-h) + 36px); } }

/* =========================================================
 *  关于页 · 棱镜百叶横幅
 * ========================================================= */
.about-banner { position: relative; height: 72vh; min-height: 460px; max-height: 760px; overflow: hidden; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.about-banner .prism-slats { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.about-banner .prism-slats.fallback { background: linear-gradient(118deg, #050507 20%, #10306f 45%, #3d7ee8 55%, #050507 80%); }
:root[data-theme="light"] .about-banner .prism-slats.fallback { background: linear-gradient(118deg, #f8f9fc 20%, #b9cdf3 45%, #6aa0f0 55%, #f8f9fc 80%); }
.about-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, var(--bg) 0%, rgba(var(--bg-rgb), .55) 28%, transparent 60%); }
.banner-inner { position: relative; z-index: 2; padding-bottom: 56px; pointer-events: none; }
.banner-inner .section-head { margin-bottom: 14px; }
.banner-inner .section-head h2 { font-size: clamp(40px, 6.4vw, 76px); letter-spacing: -.01em; }
.banner-hint { font-size: 12.5px; color: var(--text-3); letter-spacing: .06em; }
.page > .about-banner + .section { padding-top: 64px; }
@media (max-width: 760px) { .about-banner { height: 62vh; min-height: 400px; } .banner-inner { padding-bottom: 36px; } .banner-hint { display: none; } }

/* =========================================================
 *  悬停位移：只在有鼠标的设备上生效（触屏点按会留下“粘住”的悬停状态）
 * ========================================================= */
@media (hover: hover) and (pointer: fine) {
  .btn:hover .arrow { transform: translateX(3px); }
  .lab-card:hover { transform: translateY(-3px); }
  .lab-card:hover .lc-sym { transform: translateY(-3px) scale(1.06); }
  .pillar:hover .pillar-sym { transform: translateY(-2px); }
  body.launched .hero-entries a:hover { transform: translateY(-3px); }
  .spot:hover .spot-fx { opacity: 1; }
}

/* =========================================================
 *  新增：手机端实验切换条的滑动选中块；底部标签栏的按压反馈
 * ========================================================= */
.strip-ind { position: absolute; top: 10px; bottom: 10px; left: 0; z-index: 0; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(var(--ink), .06); pointer-events: none; opacity: 0; transition: transform .25s var(--ease-out), opacity .2s var(--ease); }
#tabbar a svg { transition: transform .16s var(--ease-out); }
#tabbar a.is-pressed svg { transform: scale(.9); transition-duration: .1s; }
@media (prefers-reduced-motion: reduce) { .strip-ind { transition-duration: .15s; } #tabbar a.is-pressed svg { transform: none; } }

/* 首页：底部四个入口出现时，把中间内容整体上移，避免与按钮重叠 */
@media (min-height: 641px) and (min-width: 761px) { body[data-page="home"] .hero-content { padding-bottom: 120px; } }

/* ================= iOS 质感：按压、材质、无障碍 =================
 * 位移类的运动（弹窗、灵动岛、分段块、翻转卡）都在 JS 里用弹簧驱动，这里只管静态外观和按压态。 */
/* 按下即变暗、松开淡回（拖出按钮 10px 以外会取消，见 js/ios.js） */
.side-link.is-pressed, .lab-strip a.is-pressed, .nav-seg a.is-pressed, .chip.is-pressed:not(.active) { opacity: .5; transition-duration: 0s; }
.chip.active { touch-action: none; }
.chip.hover { color: var(--strong); }
.flip { touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* 滚动边缘：导航栏下不画硬分隔线，内容滚到下面时出现一道柔和的渐隐 */
#nav.scrolled, #nav.solid { border-bottom-color: transparent; }
#nav::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none; background: linear-gradient(rgba(var(--bg-rgb), .55), rgba(var(--bg-rgb), 0)); opacity: 0; transition: opacity .35s var(--ease); }
#nav.scrolled::after, #nav.solid::after { opacity: 1; }

/* 玻璃材质：顶边一道细亮线，像光打在材质边缘上；越大的面越“厚”（更强的模糊和更深的投影） */
#island, .settings-pop, #tabbar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 40px rgba(0, 0, 0, .45); }
#tabbar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); border-top-color: transparent; }
:root[data-theme="light"] #island, :root[data-theme="light"] .settings-pop { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 16px 40px rgba(0, 0, 0, .12); }
:root[data-theme="light"] #tabbar { box-shadow: inset 0 1px 0 rgba(0, 0, 0, .06); }
/* 半透明面上的小字：略加粗、略加字距，保证在变化的背景上也清楚 */
.settings-pop .sp-title, #tabbar a { font-weight: 500; letter-spacing: .02em; }
body { font-optical-sizing: auto; }

/* 减少透明度：玻璃变实心 */
@media (prefers-reduced-transparency: reduce) {
  #nav.scrolled, #nav.solid, #tabbar, .settings-pop, #island, .lab-strip, .hero-entries a, .canvas-hud { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--surface) !important; }
  #nav::after { display: none; }
}
/* 增强对比度：线条和次要文字加深，玻璃面换成实底 + 清晰边框 */
@media (prefers-contrast: more) {
  html:root { --line: rgba(var(--ink), .3); --line-2: rgba(var(--ink), .45); --text-2: #c4c8d0; --text-3: #9aa0ab; }
  html:root[data-theme="light"] { --line: rgba(0, 0, 0, .35); --line-2: rgba(0, 0, 0, .5); --text-2: #3a3a3c; --text-3: #5a5a5e; }
  #nav.scrolled, #tabbar, .settings-pop, #island { background: var(--surface); border: 1px solid var(--line-2); }
}

