/* =========================================================
   赵洋 · 科研影像工具 —— 前台样式
   设计语言：影像工作站。深色为主，PET 热图（黄→橙→红）作为强调色，
   CT 冷色（青 / 蓝）作为辅助；等值线、十字光标、等宽读数作为装饰元素。
   ========================================================= */

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/space-grotesk.woff2") format("woff2-variations"), url("/static/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono.woff2") format("woff2-variations"), url("/static/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 设计令牌 ---------- */
:root {
  --font: "Space Grotesk", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC", monospace;
  --wrap: 1240px;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --head-h: 68px;
  --hot1: #ffd166;
  --hot2: #ff9f43;
  --hot3: #ff5e3a;
  --hot4: #ff3d6e;
  --blue: #60a5fa;
}

:root[data-theme="dark"], .force-dark {
  color-scheme: dark;
  --bg: #07090d;
  --bg-2: #0b0e14;
  --bg-3: #10141c;
  --surface: rgba(255, 255, 255, .032);
  --surface-2: rgba(255, 255, 255, .06);
  --surface-3: rgba(255, 255, 255, .09);
  --solid: #0d1118;
  --glass: rgba(10, 13, 19, .62);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --ink: #f1f3f6;
  --ink-2: #b9c1cd;
  --muted: #7b8494;
  --prose: #d3d9e2;
  --accent: #ffad5a;
  --accent-ink: #ffc58a;
  --on-accent: #1b0d03;
  --grad: linear-gradient(100deg, #ffe7ad 0%, #ffb547 28%, #ff7a45 58%, #ff4d6d 100%);
  --c-tutorial: #63d8f2;
  --c-demo: #ffb547;
  --c-product: #bba2ff;
  --spot: rgba(255, 170, 90, .13);
  --spot-edge: rgba(255, 190, 120, .55);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 40px 80px -36px rgba(0, 0, 0, .9);
  --grain-o: .05;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4ef;
  --bg-2: #efede6;
  --bg-3: #e8e5dc;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --surface-3: #ebe8e0;
  --solid: #ffffff;
  --glass: rgba(250, 249, 245, .72);
  --line: rgba(20, 18, 12, .08);
  --line-2: rgba(20, 18, 12, .16);
  --ink: #0e1014;
  --ink-2: #3d4350;
  --muted: #6c7280;
  --prose: #23272f;
  --accent: #d9480f;
  --accent-ink: #b3390a;
  --on-accent: #fff;
  --grad: linear-gradient(100deg, #f59f00 0%, #f76707 45%, #e03131 100%);
  --c-tutorial: #0b7285;
  --c-demo: #d9480f;
  --c-product: #6741d9;
  --spot: rgba(247, 103, 7, .07);
  --spot-edge: rgba(247, 103, 7, .45);
  --shadow: 0 1px 2px rgba(20, 18, 12, .04), 0 12px 28px -18px rgba(20, 18, 12, .25);
  --shadow-lg: 0 2px 4px rgba(20, 18, 12, .04), 0 36px 60px -32px rgba(20, 18, 12, .35);
  --grain-o: .035;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 24px); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain-o);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
main { flex: 1; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--mono); }
.mono { font-feature-settings: "zero", "ss02"; letter-spacing: .02em; }
button { font: inherit; color: inherit; }
::selection { background: rgba(255, 159, 67, .35); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 6px; z-index: 200; }
.skip:focus { left: 8px; }
.ic { display: inline-flex; width: 1.1em; height: 1.1em; flex: none; }
.ic svg { width: 100%; height: 100%; display: block; }

html[data-theme="dark"] { scrollbar-color: #2a303b #07090d; }

/* 页面切换（支持的浏览器） */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* 滚动出现 */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ---------- 顶栏 ---------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
  color: var(--ink);
}
.site-head.scrolled, body:not(.has-hero) .site-head {
  background: var(--glass);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom-color: var(--line);
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 600; font-size: 16px; min-width: 0; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; flex: none; transition: transform .6s var(--ease-out); }
.brand:hover .mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { position: relative; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; font-size: 14.5px; white-space: nowrap; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--line-2); margin-left: 6px; }
.nav .nav-cta:hover { border-color: var(--accent); }
.theme-btn {
  position: relative; width: 38px; height: 38px; margin-left: 6px; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--ink-2);
  display: inline-grid; place-items: center; overflow: hidden; transition: border-color .2s, color .2s;
}
.theme-btn:hover { color: var(--ink); border-color: var(--accent); }
.theme-btn > span { grid-area: 1 / 1; display: grid; place-items: center; transition: transform .5s var(--ease-out), opacity .3s; }
.theme-btn .ic { width: 17px; height: 17px; }
[data-theme="dark"] .t-sun { transform: translateY(120%) rotate(90deg); opacity: 0; }
[data-theme="light"] .t-moon { transform: translateY(-120%) rotate(-90deg); opacity: 0; }

.banner-preview { font-size: 12.5px; text-align: center; padding: 6px 16px; line-height: 1.5; display: flex; justify-content: center; align-items: center; gap: 8px; }
.banner-preview { background: #1d4ed8; color: #fff; }
.banner-preview a { color: #fff; text-decoration: underline; margin-left: 8px; }

.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 70; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgba(255, 140, 60, .6); }
body:not(.is-doc) .progress { display: none; }

/* ---------- 按钮 / 标签 ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 42px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 550; font-size: 14.5px; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap;
  transition: transform .3s var(--ease-out), background-color .2s, border-color .2s, box-shadow .3s, color .2s;
}
.btn:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ic { transition: transform .35s var(--ease-out); }
.btn:hover .ic:last-child:not(:first-child) { transform: translateX(3px); }
.btn.lg { min-height: 52px; padding: 12px 24px; font-size: 15.5px; }
.btn.primary {
  border: 0; color: var(--on-accent); background: var(--grad); background-size: 160% 100%; background-position: 0 0;
  box-shadow: 0 10px 30px -10px rgba(255, 110, 50, .65), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 16px 40px -12px rgba(255, 110, 50, .85), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.glass { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .16); color: #f1f3f6; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.glass:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--mono); letter-spacing: .06em;
  padding: 6px 10px 6px 9px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, currentColor 12%, transparent); border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.t-tutorial { color: var(--c-tutorial); }
.badge.t-demo { color: var(--c-demo); }
.badge.t-product { color: var(--c-product); }

.tag { display: inline-flex; font-size: 12.5px; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; line-height: 1.6; white-space: nowrap; border: 1px solid var(--line); transition: all .2s; }
.tag::before { content: "#"; color: var(--muted); margin-right: 2px; }
a.tag:hover { color: var(--ink); border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 15px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font-size: 13.5px; cursor: pointer; white-space: nowrap; line-height: 1.3; transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tagchip::before { content: "#"; opacity: .5; margin-right: 2px; }

.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.eyebrow span { color: var(--accent); }

/* ---------- 首页 · 主视觉 ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: max(720px, min(100svh, 1000px));
  display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(60% 70% at 78% 45%, rgba(255, 90, 40, .12), transparent 70%),
    radial-gradient(40% 50% at 95% 10%, rgba(96, 165, 250, .08), transparent 70%),
    #07090d;
  color: var(--ink);
}
.hero-canvas { position: absolute; inset: 0; z-index: -2; opacity: 0; transition: opacity 1.4s ease .2s; }
.hero.is-live .hero-canvas { opacity: 1; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, #07090d 0%, rgba(7, 9, 13, .9) 26%, rgba(7, 9, 13, .35) 52%, rgba(7, 9, 13, 0) 70%),
    linear-gradient(180deg, rgba(7, 9, 13, .7) 0%, transparent 18%, transparent 70%, #07090d 100%);
}
.hero-inner { padding-top: calc(var(--head-h) + 96px); padding-bottom: 56px; }
.hero-copy { max-width: 680px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #aeb7c4; padding: 7px 14px 7px 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; background: rgba(255, 255, 255, .03); backdrop-filter: blur(8px); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: live 2s infinite; flex: none; display: inline-block; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.hero-title { margin-top: 26px; font-size: clamp(52px, 8vw, 112px); line-height: .98; letter-spacing: -.045em; font-weight: 700; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .08em; }
.js .hero-title .line { animation: rise 1.1s var(--ease-out) both; }
.js .hero-title .line:nth-child(2) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(40%); filter: blur(8px); } }
.grad {
  background: var(--grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }
.hero-tag { margin-top: 26px; font-size: clamp(18px, 1.7vw, 22px); color: #e3e7ed; font-weight: 500; letter-spacing: -.01em; }
.hero-intro { margin-top: 14px; color: #9aa3b2; font-size: 16px; max-width: 34em; line-height: 1.8; }
.js .hero-tag, .js .hero-intro, .js .hero-actions, .js .kicker { animation: fade-up 1s var(--ease-out) both; }
.js .kicker { animation-delay: .05s; }
.js .hero-tag { animation-delay: .3s; }
.js .hero-intro { animation-delay: .4s; }
.js .hero-actions { animation-delay: .5s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .08); position: relative; }
.hero-stats { display: flex; gap: 44px; }
.hstat { display: flex; align-items: baseline; gap: 10px; color: #9aa3b2; font-size: 13.5px; }
.hstat b { font-size: 30px; font-weight: 500; color: #f1f3f6; letter-spacing: -.02em; }
.hstat:hover span { color: #f1f3f6; }
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; color: #7b8494; font-size: 11.5px; letter-spacing: .16em; }
.scroll-cue:hover { color: #f1f3f6; }
.mouse { width: 20px; height: 32px; border: 1.5px solid currentColor; border-radius: 12px; position: relative; }
.mouse i { position: absolute; left: 50%; top: 6px; width: 2px; height: 6px; margin-left: -1px; border-radius: 2px; background: currentColor; animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }

/* 头部在主视觉上方时保持浅色文字 */
body.has-hero .site-head:not(.scrolled) { color: #f1f3f6; --ink: #f1f3f6; --ink-2: #c2c9d3; --line-2: rgba(255, 255, 255, .18); --surface-2: rgba(255, 255, 255, .08); }

/* ---------- 跑马灯 ---------- */
.marquee {
  position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 18px 0; background: var(--bg-2);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; flex: none; }
.marquee-group span { font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0 28px; white-space: nowrap; display: inline-flex; align-items: center; gap: 28px; }
.marquee-group span::after { content: "✦"; color: var(--accent); font-size: 9px; opacity: .8; margin-right: -28px; margin-left: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- 版块 ---------- */
.section { padding: 128px 0; position: relative; }
.section-tools { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 48px; }
.sec-head h2 { margin-top: 14px; font-size: clamp(30px, 3.6vw, 48px); font-weight: 650; letter-spacing: -.035em; max-width: 16em; }
.more { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14.5px; white-space: nowrap; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s, gap .3s var(--ease-out); }
.more:hover { color: var(--ink); border-color: var(--accent); gap: 12px; }

/* ---------- 卡片 ---------- */
[data-spot] { --mx: 50%; --my: 50%; }
.card {
  position: relative; display: flex; flex-direction: column; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .6s var(--ease-out), border-color .3s, box-shadow .6s var(--ease-out);
}
[data-spot]::before, [data-spot]::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s; z-index: 3; }
[data-spot]::before { background: radial-gradient(520px circle at var(--mx) var(--my), var(--spot), transparent 42%); }
[data-spot]::after {
  padding: 1px;
  background: radial-gradient(360px circle at var(--mx) var(--my), var(--spot-edge), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
[data-spot]:hover::before, [data-spot]:hover::after { opacity: 1; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card[hidden] { display: none; }
.card-link { display: flex; flex-direction: column; flex: 1; color: var(--ink); position: relative; z-index: 2; }
.card-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #05070a; border-bottom: 1px solid var(--line); }
.card-cover > img, .card-cover > .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease-out), filter .6s; }
.card:hover .card-cover > img, .card:hover .card-cover > .art { transform: scale(1.05); }
.card-cover > img { filter: saturate(1.05) contrast(1.05); }
.cover-scan { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5, 7, 10, .55)), repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px); pointer-events: none; }
.card-cover .badge { position: absolute; left: 14px; top: 14px; z-index: 2; background: rgba(7, 9, 13, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.card-body { padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; gap: 10px; color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.card-meta span + span::before { content: "/"; margin-right: 10px; opacity: .5; }
.card-body h3 { font-size: 20px; font-weight: 620; letter-spacing: -.02em; line-height: 1.35; }
.card-body p { color: var(--muted); font-size: 14.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-go { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--mono); letter-spacing: .06em; color: var(--accent); }
.card-go .ic { transition: transform .4s var(--ease-out); }
.card:hover .card-go .ic, .tool:hover .card-go .ic { transform: translateX(5px); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 20px; position: relative; z-index: 4; }

.art { display: block; }
.art-label { font: 500 7.5px var(--mono); fill: rgba(255, 255, 255, .5); letter-spacing: .14em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

/* 精选：不对称网格 */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card-xl { grid-column: span 2; grid-row: span 2; }
.card-xl .card-cover { aspect-ratio: auto; flex: 1; min-height: 340px; }
.card-xl .card-link > .card-body { padding: 26px 30px 22px; flex: none; }
.card-xl .card-body h3 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.03em; }
.card-xl .card-body p { font-size: 15.5px; -webkit-line-clamp: 2; max-width: 46em; }
.card-xl .card-tags { padding: 0 30px 26px; }

/* 工具 */
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tool {
  position: relative; display: grid; grid-template-columns: 42% 1fr; min-height: 280px; overflow: hidden; isolation: isolate;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
}
.tool:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tool-art { position: relative; overflow: hidden; background: #05070a; }
.tool-art .art { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform 1.4s var(--ease-out); }
.tool:hover .tool-art .art { transform: scale(1.08) rotate(-1.5deg); }
.tool-body { padding: 28px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 2; }
.tool-k { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-product); }
.tool-body h3 { font-size: 22px; line-height: 1.3; }
.tool-body p { color: var(--muted); font-size: 14.5px; }

/* 索引 */
.big-search {
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 22px; margin-bottom: 18px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  transition: border-color .3s, box-shadow .3s;
}
.big-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent); }
.big-search .ic { width: 20px; height: 20px; }
.big-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 17px; height: 48px; }
.cat-row { margin-bottom: 40px; }
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: grid; grid-template-columns: 44px 104px minmax(0, 1fr) 140px 110px 24px; align-items: center; gap: 16px;
  padding: 22px 12px; color: var(--ink); position: relative; transition: background-color .3s, padding .4s var(--ease-out);
}
.index a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--grad); transform: scaleY(0); transition: transform .4s var(--ease-out); }
.index a:hover { background: var(--surface); padding-left: 22px; }
.index a:hover::before { transform: scaleY(1); }
.idx { color: var(--muted); font-size: 12.5px; }
.index-title { font-size: 18px; font-weight: 560; letter-spacing: -.01em; }
.index-cat { color: var(--muted); font-size: 14px; }
.index-date { color: var(--muted); font-size: 12.5px; text-align: right; }
.index .ic { color: var(--muted); opacity: 0; transform: translateX(-8px); transition: all .4s var(--ease-out); }
.index a:hover .ic { opacity: 1; transform: none; color: var(--accent); }

/* 联系 */
.contact { position: relative; overflow: hidden; padding: 140px 0; border-top: 1px solid var(--line); isolation: isolate; }
.contact-bg { position: absolute; inset: 0 0 0 45%; z-index: -1; opacity: .5; -webkit-mask-image: radial-gradient(60% 70% at 60% 50%, #000, transparent 75%); mask-image: radial-gradient(60% 70% at 60% 50%, #000, transparent 75%); }
.contact-bg .art { width: 100%; height: 100%; }
[data-theme="light"] .contact-bg { opacity: .7; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.contact-title { margin-top: 18px; font-size: clamp(32px, 4.4vw, 60px); line-height: 1.12; letter-spacing: -.04em; font-weight: 650; }
.contact-lead { margin-top: 20px; color: var(--muted); max-width: 32em; font-size: 16.5px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }
.email-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 10px 20px;
  border-radius: 999px; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 14.5px;
  transition: all .25s;
}
.email-pill:hover { color: var(--ink); border-style: solid; border-color: var(--accent); }
.email-pill.block { width: 100%; min-height: 44px; margin-top: 10px; font-size: 13px; }
.email-pill .mono { word-break: break-all; }
.about-card { position: relative; padding: 32px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); overflow: hidden; }
.about-k { font-size: 11.5px; letter-spacing: .18em; color: var(--accent); }
.about-name { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin: 10px 0 12px; }
.bio { color: var(--ink-2); line-height: 1.85; }

/* ---------- 页面头部（目录、详情） ---------- */
.page-hero, .doc-hero { position: relative; overflow: hidden; isolation: isolate; padding: calc(var(--head-h) + 88px) 0 64px; border-bottom: 1px solid var(--line); }
.page-hero-art, .doc-hero-art {
  position: absolute; inset: 0 0 0 40%; z-index: -1; opacity: .75;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%), linear-gradient(0deg, transparent, #000 40%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.page-hero-art .art, .doc-hero-art .art, .doc-hero-art img { width: 100%; height: 100%; object-fit: cover; }
[data-theme="light"] .page-hero, [data-theme="light"] .doc-hero { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
[data-theme="light"] .page-hero-art, [data-theme="light"] .doc-hero-art { opacity: .8; }
/* 浅色主题：装饰背景反相并保持色相，变成“浅底彩色等值线” */
[data-theme="light"] .page-hero-art .art, [data-theme="light"] .doc-hero-art .art,
[data-theme="light"] .contact-bg .art, [data-theme="light"] .nf-art .art, [data-theme="light"] .empty-art .art { filter: invert(1) hue-rotate(180deg) saturate(1.4); mix-blend-mode: multiply; }
.page-hero h1 { margin-top: 18px; font-size: clamp(44px, 6.6vw, 88px); letter-spacing: -.05em; font-weight: 680; line-height: 1; }
.page-hero .lead, .doc-hero .lead { margin-top: 22px; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 18.5px); max-width: 38em; line-height: 1.75; }
.page-hero .wrap, .doc-hero .wrap { position: relative; }
.js .page-hero h1, .js .doc-hero h1 { animation: rise 1s var(--ease-out) both; }
.js .page-hero .lead, .js .doc-hero .lead, .js .doc-meta { animation: fade-up 1s var(--ease-out) .15s both; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { opacity: .4; }
.doc-hero h1 { margin-top: 22px; font-size: clamp(34px, 4.8vw, 62px); letter-spacing: -.04em; font-weight: 680; line-height: 1.08; max-width: 18em; }
.doc-hero .lead { max-width: 42em; }
.doc-hero.compact { padding-bottom: 40px; }
.doc-hero.compact h1 { font-size: clamp(30px, 3.6vw, 46px); }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 28px; font-size: 12px; color: var(--muted); }

/* ---------- 内容目录 ---------- */
.page { padding-top: 48px; padding-bottom: 96px; }
.lib { padding-top: 36px; }
.filters {
  position: relative; z-index: 10; margin: 0 0 36px; padding: 20px 22px; display: grid; gap: 16px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: var(--shadow);
}
.search-box {
  display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px 0 18px;
  border: 1px solid var(--line-2); border-radius: 14px; color: var(--muted); background: var(--surface); transition: border-color .25s, box-shadow .25s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent); }
.search-box .ic { width: 19px; height: 19px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 16px; color: var(--ink); height: 100%; }
.search-box kbd { font-size: 11px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.filter-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; }
.filter-label { font-size: 11.5px; letter-spacing: .14em; color: var(--muted); padding-top: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); width: max-content; max-width: 100%; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); transition: all .25s var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5); }
.filter-status { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; letter-spacing: .04em; }
.js .grid .card.pop { animation: pop .5s var(--ease-out) both; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.empty { position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); isolation: isolate; }
.empty[hidden] { display: none; }
.empty-art { position: absolute; inset: 0; z-index: -1; opacity: .35; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); }
.empty-art .art { width: 100%; height: 100%; }
.empty-t { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.empty .btn { margin-top: 22px; }

/* ---------- 文章 ---------- */
.doc { padding-top: 64px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; }
.doc-side { position: sticky; top: calc(var(--head-h) + 24px); display: grid; gap: 16px; max-height: calc(100vh - var(--head-h) - 40px); overflow: auto; padding-bottom: 8px; scrollbar-width: none; }
.side-rest { display: grid; gap: 16px; }
.side-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; overflow: hidden; }
.side-card h2, .side-card summary { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.side-card p { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.side-card .cc-t { font-size: 17px; color: var(--ink); font-weight: 600; margin-bottom: 6px; letter-spacing: -.01em; }
.contact-card.strong { border-color: color-mix(in srgb, var(--c-product) 40%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--c-product) 12%, transparent), var(--surface) 60%); }
.toc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "−"; font-size: 14px; }
.toc:not([open]) summary { margin-bottom: 0; }
.toc:not([open]) summary::after { content: "+"; }
.toc ol { list-style: none; margin: 0; padding: 0; font-size: 13.5px; position: relative; }
.toc ol::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line-2); }
.toc li a { position: relative; display: block; padding: 6px 0 6px 16px; color: var(--muted); line-height: 1.5; transition: color .2s; }
.toc li.l3 a { padding-left: 28px; font-size: 12.5px; }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--ink); font-weight: 550; }
.toc li a.on::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px rgba(255, 140, 60, .6); }
.videos .video { display: flex; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 12px; color: var(--ink); position: relative; z-index: 4; }
.videos .video:hover { background: var(--surface-2); }
.video-thumb { width: 56px; height: 40px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #fb7299, #e05a8a); box-shadow: 0 8px 18px -8px rgba(251, 114, 153, .7); }
.video-thumb .ic { width: 20px; height: 20px; }
.videos .video strong { display: block; font-size: 13.5px; font-weight: 560; line-height: 1.45; }
.videos .video small { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 2px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; position: relative; z-index: 4; }
.related a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; margin: 0 -10px; border-radius: 10px; color: var(--ink); font-size: 14px; line-height: 1.45; }
.related a:hover { background: var(--surface-2); }
.related .badge { font-size: 10px; padding: 4px 7px; }
.related .badge::before { display: none; }
.related .ic { color: var(--muted); width: 14px; transition: transform .3s var(--ease-out); }
.related a:hover .ic { transform: translateX(3px); color: var(--accent); }
.side-card .btn, .side-card .email-pill { position: relative; z-index: 4; }

.prose { font-size: 17px; line-height: 1.9; color: var(--prose); min-width: 0; max-width: 760px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { position: relative; color: var(--ink); font-size: 28px; font-weight: 660; letter-spacing: -.03em; margin-top: 2.4em; padding-top: 1.1em; scroll-margin-top: calc(var(--head-h) + 24px); }
.prose h2::before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 3px; border-radius: 3px; background: var(--grad); }
.prose h3 { color: var(--ink); font-size: 21px; font-weight: 620; letter-spacing: -.02em; margin-top: 2em; }
.prose h4 { color: var(--ink); font-size: 17px; margin-top: 1.6em; }
.prose > h2:first-child { margin-top: 0; }
.prose .anchor { margin-left: 10px; color: var(--muted); opacity: 0; font: 400 .7em var(--mono); transition: opacity .2s; text-decoration: none; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose strong { color: var(--ink); font-weight: 620; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 4px; }
.prose ul { padding-left: 0; list-style: none; }
.prose ul > li { position: relative; padding-left: 1.6em; }
.prose ul > li::before { content: ""; position: absolute; left: .2em; top: .9em; width: .7em; height: 2px; border-radius: 2px; background: var(--grad); }
.prose ol { padding-left: 0; list-style: none; counter-reset: step; }
.prose ol > li { position: relative; padding-left: 2.8em; counter-increment: step; }
.prose ol > li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: .25em;
  width: 2em; height: 1.55em; display: grid; place-items: center; border-radius: 7px;
  font: 600 .7em/1 var(--mono); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.prose li + li { margin-top: .65em; }
.prose code { font-size: .84em; background: var(--surface-2); border: 1px solid var(--line); padding: .12em .45em; border-radius: 6px; color: var(--ink); word-break: break-word; }
.prose pre { background: #05070a; color: #e6edf3; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); overflow-x: auto; font-size: 13.5px; line-height: 1.65; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.prose figure { margin: 2.2em 0; }
.prose figure img, .prose p > img { display: block; border-radius: 16px; border: 1px solid var(--line-2); background: #000; margin: 0 auto; cursor: zoom-in; box-shadow: var(--shadow-lg); transition: transform .5s var(--ease-out); }
.prose figure img:hover { transform: scale(1.01); }
.prose figcaption { font: 12.5px/1.7 var(--mono); color: var(--muted); margin-top: 14px; text-align: center; letter-spacing: .02em; }
.prose figcaption::before { content: "FIG · "; color: var(--accent); }
.prose hr { border: 0; height: 1px; background: var(--line-2); margin: 3em 0; }
.prose .callout, .prose .note {
  position: relative; padding: 14px 18px 14px 46px; border-radius: 14px; font-size: 15px; line-height: 1.7;
  color: var(--ink-2); border: 1px solid color-mix(in srgb, var(--hot2) 35%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hot2) 10%, transparent), transparent);
}
.prose .callout::before { content: "!"; position: absolute; left: 16px; top: 15px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 700 11px/1 var(--mono); color: var(--on-accent); background: var(--grad); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin: 1.8em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; }
.prose th, .prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font: 600 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.prose tbody tr { transition: background-color .2s; }
.prose tbody tr:hover { background: var(--surface-2); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.prose td:first-child { color: var(--ink); font-weight: 520; }

/* 图片放大 */
.lightbox { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 32px; background: rgba(4, 6, 9, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0; transition: opacity .3s; cursor: zoom-out; }
.lightbox.open { opacity: 1; }
.lightbox figure { margin: 0; max-width: min(1400px, 96vw); transform: scale(.94); transition: transform .45s var(--ease-out); }
.lightbox.open figure { transform: none; }
.lightbox img { max-width: 100%; max-height: 84vh; border-radius: 14px; display: block; margin: 0 auto; box-shadow: 0 40px 100px -20px #000; }
.lightbox figcaption { color: #aab2bf; font: 12.5px var(--mono); text-align: center; margin-top: 16px; }

/* ---------- 交互演示 ---------- */
.demo-wrap { max-width: 1680px; margin: 0 auto; padding: 40px 32px 0; }
.device { position: relative; border-radius: 20px; border: 1px solid var(--line-2); background: var(--solid); box-shadow: var(--shadow-lg), 0 0 0 6px var(--surface); overflow: hidden; }
.device::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; background: linear-gradient(140deg, rgba(255, 180, 90, .55), transparent 30%, transparent 70%, rgba(96, 165, 250, .45)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.device-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; height: 48px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dots { display: inline-flex; gap: 8px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.dots i:nth-child(1) { background: #ff5f57; } .dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.device-title { display: inline-flex; align-items: center; gap: 10px; font-size: 11.5px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
.device-actions { display: flex; justify-content: flex-end; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font-size: 12.5px; cursor: pointer; transition: all .2s; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.icon-btn .ic { width: 15px; height: 15px; }
.demo-frame { display: block; width: 100%; height: max(660px, calc(100vh - var(--head-h) - 120px)); border: 0; background: #f6f7f9; }
.device-loading { position: absolute; inset: 48px 0 0 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--solid); color: var(--muted); font-size: 12.5px; letter-spacing: .08em; transition: opacity .5s; }
.device.loaded .device-loading { opacity: 0; pointer-events: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.device:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.device:fullscreen .demo-frame { flex: 1; height: auto; }
.demo-note { margin: 18px auto 0; text-align: center; color: var(--muted); font-size: 13.5px; max-width: 60em; }
.demo-after { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; padding-top: 56px; padding-bottom: 96px; align-items: start; }

/* ---------- 404 ---------- */
.nf { position: relative; overflow: hidden; padding: calc(var(--head-h) + 140px) 0 160px; isolation: isolate; }
.nf-art { position: absolute; inset: 0; z-index: -1; opacity: .45; -webkit-mask-image: radial-gradient(50% 60% at 50% 50%, #000, transparent); mask-image: radial-gradient(50% 60% at 50% 50%, #000, transparent); }
.nf-art .art { width: 100%; height: 100%; }
.nf h1 { font-size: clamp(36px, 5vw, 64px); margin: 18px 0 12px; letter-spacing: -.04em; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.center p + p { margin-top: 28px; }

/* ---------- 页脚 ---------- */
.site-foot { position: relative; border-top: 1px solid var(--line); padding: 80px 0 32px; color: var(--muted); font-size: 14px; overflow: hidden; background: var(--bg-2); }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; }
.foot-word { font-size: clamp(36px, 6vw, 84px); font-weight: 680; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, var(--ink) 20%, color-mix(in srgb, var(--ink) 15%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot-note { margin-top: 20px; max-width: 34em; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.foot-cols h2 { font: 500 11px var(--mono); letter-spacing: .16em; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; }
.foot-cols a, .foot-copy { display: flex; align-items: center; gap: 6px; color: var(--ink-2); padding: 5px 0; font-size: 14px; word-break: break-all; }
.foot-cols a:hover, .foot-copy:hover { color: var(--ink); }
.foot-copy { background: none; border: 0; cursor: pointer; }
.foot-copy .ic { width: 14px; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12.5px; }
.foot-bottom .mono { letter-spacing: .16em; font-size: 11px; }

.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 50; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--glass); color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer; opacity: 0; transform: translateY(16px); pointer-events: none; transition: all .4s var(--ease-out); box-shadow: var(--shadow); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top .ic { width: 18px; height: 18px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 160; display: flex; align-items: center; gap: 10px; background: var(--glass); color: var(--ink); border: 1px solid var(--line-2); padding: 12px 20px; border-radius: 999px; font-size: 14px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .3s, transform .45s var(--ease-out); pointer-events: none; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 浅色主题微调 ---------- */
[data-theme="light"] .card, [data-theme="light"] .tool, [data-theme="light"] .side-card { background: var(--surface); }
[data-theme="light"] .marquee { background: var(--bg-2); }
[data-theme="light"] .prose pre { background: #12161d; }
[data-theme="light"] .demo-frame { background: #f6f7f9; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-xl { grid-column: span 2; grid-row: auto; }
  .card-xl .card-cover { aspect-ratio: 16 / 8; min-height: 0; flex: none; }
  .tools { grid-template-columns: 1fr; }
  .index a { grid-template-columns: 40px 96px minmax(0, 1fr) 100px 24px; }
  .index-cat { display: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .foot-top { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .doc-grid { display: flex; flex-direction: column; align-items: stretch; gap: 32px; }
  .doc-side { display: contents; }
  .doc-side .toc { order: -1; }
  .prose { max-width: none; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 18px; }
  .head-row { height: 60px; gap: 8px; }
  :root { --head-h: 60px; }
  .brand { font-size: 15px; gap: 9px; }
  .brand .mark { width: 26px; height: 26px; }
  .nav { gap: 0; }
  .nav a { padding: 7px 9px; font-size: 14px; }
  .nav .nav-cta { display: none; }
  .theme-btn { width: 34px; height: 34px; margin-left: 4px; }
  .hero { min-height: 0; }
  .hero-inner { padding-top: calc(var(--head-h) + 56px); padding-bottom: 36px; }
  .hero-shade { background: linear-gradient(180deg, rgba(7, 9, 13, .55) 0%, rgba(7, 9, 13, .25) 30%, rgba(7, 9, 13, .82) 62%, #07090d 100%); }
  .hero-title { font-size: clamp(44px, 13vw, 64px); margin-top: 20px; }
  .hero-tag { margin-top: 18px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero-stats { gap: 26px; }
  .hstat b { font-size: 24px; }
  .scroll-cue { display: none; }
  .section { padding: 80px 0; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
  .bento, .grid { grid-template-columns: 1fr; gap: 18px; }
  .card-xl { grid-column: auto; }
  .card-xl .card-cover { aspect-ratio: 16 / 10; }
  .card-xl .card-body { padding: 20px 22px 18px; }
  .card-xl .card-tags { padding: 0 22px 20px; }
  .tool { grid-template-columns: 1fr; }
  .tool-art { aspect-ratio: 16 / 8; }
  .tool-body { padding: 22px; }
  .big-search { padding: 6px 6px 6px 16px; }
  .big-search input { font-size: 16px; height: 44px; }
  .big-search .btn { padding: 8px 16px; min-height: 40px; }
  .index a { grid-template-columns: 30px minmax(0, 1fr) 20px; gap: 6px 12px; padding: 18px 4px; }
  .index a .badge { grid-column: 2; grid-row: 1; justify-self: start; }
  .index-title { grid-column: 2; grid-row: 2; font-size: 16.5px; }
  .index-date { grid-column: 2; grid-row: 3; text-align: left; }
  .index .idx { grid-row: 1 / span 3; align-self: start; padding-top: 4px; }
  .index .ic { grid-column: 3; grid-row: 1 / span 3; opacity: .6; transform: none; }
  .contact { padding: 88px 0; }
  .contact-bg { inset: 0; opacity: .3; }
  .email-row .btn, .email-pill { flex: 1 1 auto; }
  .about-card { padding: 24px; }
  .page-hero, .doc-hero { padding: calc(var(--head-h) + 52px) 0 40px; }
  .page-hero-art, .doc-hero-art { inset: 0; opacity: .35; }
  .filters { padding: 14px; border-radius: 18px; }
  .filter-row { grid-template-columns: 1fr; gap: 8px; }
  .filter-label { padding-top: 0; }
  .search-box kbd { display: none; }
  .doc { padding-top: 36px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 23px; }
  .prose h3 { font-size: 19px; }
  .prose th, .prose td { padding: 10px 12px; font-size: 13px; }
  .demo-wrap { padding: 24px 8px 0; }
  .device { border-radius: 14px; box-shadow: var(--shadow); }
  .device-bar { grid-template-columns: auto 1fr; padding: 0 8px 0 12px; }
  .device-title { display: none; }
  .icon-btn span { display: none; }
  .demo-frame { height: 84vh; min-height: 560px; }
  .demo-after { padding-top: 36px; }
  .foot-cols { grid-template-columns: 1fr; gap: 24px; }
  .to-top { right: 16px; bottom: 16px; }
}

.pdf-reader { min-width: 0; }
.pdf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.pdf-controls button:disabled { opacity: .45; cursor: default; }
.pdf-reader canvas:not([hidden]) {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  background: white;
}
