/* ============================================================
   PANDA//LAB — base.css
   设计令牌 / 主题引擎 / 重置 / 布局骨架 / 背景层
   ============================================================ */

/* ---------- 主题：赛博霓虹 ---------- */
:root,
:root[data-theme="neon"] {
  --bg: #05060f;
  --bg-soft: #080a18;
  --bg-deep: #01020a;
  --panel: rgba(15, 18, 38, 0.62);
  --panel-2: rgba(22, 26, 54, 0.78);
  --panel-3: rgba(9, 11, 24, 0.9);
  /* 不带毛玻璃的实底面板：大面积常驻卡片用，避免每帧重新模糊 */
  --panel-card: rgba(12, 16, 34, 0.94);
  --text: #eaf2ff;
  --text-soft: #b9c6e6;
  --muted: #7783a8;
  --line: rgba(120, 160, 255, 0.16);
  --line-strong: rgba(120, 200, 255, 0.42);
  --accent: #00f0ff;
  --accent-2: #ff2fb5;
  --accent-3: #9b6bff;
  --accent-ink: #00131a;
  --ok: #4dffa6;
  --warn: #ffd166;
  --danger: #ff5d7a;
  --glow: 0 0 34px rgba(0, 240, 255, 0.32);
  --glow-2: 0 0 60px rgba(255, 47, 181, 0.24);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.65);
  --blur: 18px;
  --panda-fur: #f4f8ff;
  --panda-fur-2: #c9d6f2;
  --panda-ink: #0a0c18;
  --panda-blush: #ff8fc4;
  --avatar-ink: #0a0c18;
  --grid-color: rgba(0, 240, 255, 0.1);
  --grid-opacity: 1;
  --aurora-1: rgba(0, 240, 255, 0.16);
  --aurora-2: rgba(255, 47, 181, 0.14);
  --noise-opacity: 0.05;
  --holo-opacity: 1;
  --font-body: "Inter", "Segoe UI Variable Text", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Inter Tight", "Segoe UI Variable Display", "Segoe UI", "PingFang SC",
    "Microsoft YaHei UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", "Consolas", "Menlo", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 主题：软萌棉花糖 ---------- */
:root[data-theme="cute"] {
  --bg: #fdf3f7;
  --bg-soft: #fff7fb;
  --bg-deep: #ffe9f2;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-2: rgba(255, 255, 255, 0.94);
  --panel-3: rgba(255, 246, 250, 0.96);
  --panel-card: rgba(255, 255, 255, 0.97);
  --text: #40243a;
  --text-soft: #6d4a60;
  --muted: #a9829a;
  --line: rgba(214, 128, 168, 0.22);
  --line-strong: rgba(240, 120, 175, 0.55);
  --accent: #ff7ab8;
  --accent-2: #7cc5ff;
  --accent-3: #b79bff;
  --accent-ink: #4a1631;
  --ok: #38c98a;
  --warn: #f0a92c;
  --danger: #f4587e;
  --glow: 0 10px 30px rgba(255, 122, 184, 0.28);
  --glow-2: 0 14px 44px rgba(124, 197, 255, 0.24);
  --radius: 22px;
  --radius-lg: 34px;
  --shadow: 0 16px 40px rgba(214, 128, 168, 0.22);
  --shadow-lg: 0 30px 80px rgba(214, 128, 168, 0.26);
  --blur: 22px;
  --panda-fur: #ffffff;
  --panda-fur-2: #ffe6f1;
  --panda-ink: #3a2337;
  --avatar-ink: #3a2337;
  --grid-color: rgba(255, 122, 184, 0.14);
  --aurora-1: rgba(255, 168, 205, 0.55);
  --aurora-2: rgba(160, 208, 255, 0.5);
  --noise-opacity: 0.03;
  --holo-opacity: 0.6;
}

/* ---------- 主题：深空观测站 ---------- */
:root[data-theme="space"] {
  --bg: #070a10;
  --bg-soft: #0b1119;
  --bg-deep: #040609;
  --panel: rgba(17, 24, 34, 0.66);
  --panel-2: rgba(24, 33, 46, 0.82);
  --panel-3: rgba(10, 14, 21, 0.92);
  --panel-card: rgba(15, 22, 32, 0.94);
  --text: #edf1f7;
  --text-soft: #b3bfcd;
  --muted: #6d7b8c;
  --line: rgba(255, 208, 145, 0.14);
  --line-strong: rgba(255, 200, 128, 0.4);
  --accent: #ffc46b;
  --accent-2: #6fa8ff;
  --accent-3: #9fe0d4;
  --accent-ink: #20160a;
  --ok: #7ee0b0;
  --warn: #ffc46b;
  --danger: #ff7f7f;
  --glow: 0 0 30px rgba(255, 196, 107, 0.26);
  --glow-2: 0 0 50px rgba(111, 168, 255, 0.2);
  --radius: 6px;
  --radius-lg: 10px;
  --radius-pill: 4px;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.7);
  --blur: 14px;
  --panda-fur: #f2f4f8;
  --panda-fur-2: #c2c9d6;
  --panda-ink: #0b0f15;
  --avatar-ink: #0b0f15;
  --grid-color: rgba(255, 196, 107, 0.08);
  --aurora-1: rgba(255, 196, 107, 0.1);
  --aurora-2: rgba(111, 168, 255, 0.12);
  --noise-opacity: 0.06;
  --holo-opacity: 0.75;
}

/* ---------- 主题：竹林终端 ---------- */
:root[data-theme="bamboo"] {
  --bg: #03110a;
  --bg-soft: #051a10;
  --bg-deep: #010a05;
  --panel: rgba(7, 30, 18, 0.7);
  --panel-2: rgba(10, 42, 24, 0.84);
  --panel-3: rgba(3, 16, 9, 0.94);
  --panel-card: rgba(6, 27, 16, 0.94);
  --text: #d9ffe6;
  --text-soft: #a3dcb8;
  --muted: #5f8f73;
  --line: rgba(90, 255, 160, 0.15);
  --line-strong: rgba(110, 255, 170, 0.45);
  --accent: #61ff9e;
  --accent-2: #b9ff5c;
  --accent-3: #4bd8ff;
  --accent-ink: #03140a;
  --ok: #61ff9e;
  --warn: #d6ff5c;
  --danger: #ff8866;
  --glow: 0 0 30px rgba(97, 255, 158, 0.28);
  --glow-2: 0 0 60px rgba(185, 255, 92, 0.2);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 6px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.65);
  --blur: 12px;
  --panda-fur: #e8fff0;
  --panda-fur-2: #b6e3c8;
  --panda-ink: #04130a;
  --avatar-ink: #04130a;
  --grid-color: rgba(97, 255, 158, 0.12);
  --aurora-1: rgba(97, 255, 158, 0.12);
  --aurora-2: rgba(75, 216, 255, 0.1);
  --noise-opacity: 0.08;
  --holo-opacity: 0.9;
}

/* ---------- 主题：樱雪极简 ---------- */
:root[data-theme="sakura"] {
  --bg: #f7f5f4;
  --bg-soft: #fffdfc;
  --bg-deep: #ece7e6;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-2: rgba(255, 255, 255, 0.96);
  --panel-3: rgba(250, 246, 245, 0.98);
  --panel-card: rgba(255, 255, 255, 0.97);
  --text: #17161a;
  --text-soft: #4a4750;
  --muted: #8d8892;
  --line: rgba(23, 22, 26, 0.1);
  --line-strong: rgba(23, 22, 26, 0.32);
  --accent: #e2618b;
  --accent-2: #1f2933;
  --accent-3: #7f95b5;
  --accent-ink: #fff7f9;
  --ok: #2f9e6b;
  --warn: #b8791a;
  --danger: #cf3b5c;
  --glow: 0 8px 24px rgba(226, 97, 139, 0.14);
  --glow-2: 0 8px 24px rgba(31, 41, 51, 0.1);
  --radius: 4px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(23, 22, 26, 0.07);
  --shadow-lg: 0 24px 70px rgba(23, 22, 26, 0.1);
  --blur: 10px;
  --panda-fur: #ffffff;
  --panda-fur-2: #e8e6e4;
  --panda-ink: #17161a;
  --avatar-ink: #17161a;
  --grid-color: rgba(23, 22, 26, 0.05);
  --aurora-1: rgba(255, 214, 226, 0.5);
  --aurora-2: rgba(214, 228, 245, 0.5);
  --noise-opacity: 0.02;
  --holo-opacity: 0.35;
}

/* ============================================================
   重置
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.6s var(--ease-out), color 0.6s var(--ease-out);
}

[hidden] { display: none !important; }

img, svg, canvas { display: block; max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: content-box; }

/* ============================================================
   排版工具类
   ============================================================ */
.dim { color: var(--muted); }
.ok { color: var(--ok); }
.code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.12em 0.42em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--line);
  color: var(--accent);
  white-space: nowrap;
}
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  min-width: 20px;
  text-align: center;
  display: inline-block;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  color: var(--text-soft);
}

/* ============================================================
   背景层
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 12% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    radial-gradient(900px 600px at 96% 4%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%),
    var(--bg);
  transition: background 0.6s var(--ease-out);
}
.bg__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.9; }

.bg__aurora {
  position: absolute;
  inset: -20% -20% auto -20%;
  height: 90vh;
  background:
    radial-gradient(closest-side, var(--aurora-1), transparent 78%) 22% 30%/62% 78% no-repeat,
    radial-gradient(closest-side, var(--aurora-2), transparent 78%) 78% 22%/58% 72% no-repeat;
  filter: blur(28px);
  animation: auroraDrift 26s ease-in-out infinite alternate;
  opacity: 0.9;
}

.bg__grid {
  position: absolute;
  inset: 55% -40% -10% -40%;
  background-image:
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(560px) rotateX(64deg);
  transform-origin: 50% 0;
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 55%, transparent 92%);
  opacity: var(--grid-opacity);
}

.bg__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0px,
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
}
:root[data-theme="cute"] .bg__scan,
:root[data-theme="sakura"] .bg__scan { opacity: 0.25; }

.bg__noise {
  position: absolute;
  inset: 0;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, transparent 40%, color-mix(in srgb, var(--bg-deep) 92%, transparent) 100%);
  opacity: 0.85;
}
:root[data-theme="cute"] .bg__vignette,
:root[data-theme="sakura"] .bg__vignette {
  background: radial-gradient(120% 90% at 50% 30%, transparent 45%, color-mix(in srgb, var(--bg-deep) 70%, transparent) 100%);
  opacity: 0.5;
}

@keyframes auroraDrift {
  0% { transform: translate3d(-3%, 0, 0) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-1%, -2%, 0) scale(1.02); }
}

/* 鼠标聚光灯 */
.spotlight {
  position: fixed;
  top: 0; left: 0;
  width: 620px; height: 620px;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
body.has-pointer .spotlight { opacity: 1; }
:root[data-theme="sakura"] .spotlight { background: radial-gradient(closest-side, rgba(226, 97, 139, 0.09), transparent 72%); }

/* ============================================================
   应用骨架
   ============================================================ */
.app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  /* 只做透明度动画：任何 transform 都会让 .app 变成 fixed 元素的包含块，
     手机端底部导航就会被“固定”到整页底部而不是视口底部。 */
  animation: appIn 0.9s var(--ease-out) both;
}
@keyframes appIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 3.4vw, 52px) 0;
  flex: 1;
}

.section {
  position: relative;
  padding: clamp(56px, 8vw, 110px) 0 clamp(24px, 4vw, 52px);
}

.section__head {
  max-width: 900px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section__eyebrow::after {
  content: "";
  flex: 0 0 70px;
  height: 1px;
  background: linear-gradient(to right, var(--accent), transparent);
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.section__title-en {
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section__lead {
  margin-top: 12px;
  color: var(--text-soft);
  max-width: 68ch;
  font-size: 14.5px;
}
.section__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #05060f;
  color: #fff;
}

/* ============================================================
   滚动进入动画
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
