/* ============================================================
   合成元素 II · 元素编年史
   视觉方向：世界中的玻璃编年馆 × 十境自然奇观
   ============================================================ */

:root {
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "SimSun", "Songti TC", serif;
  --font-num: "Didot", "Bodoni MT", "Times New Roman", serif;
  --radius-lg: 30px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.16, 1.12, .3, 1);
  --shadow-lg: 0 30px 80px rgba(2, 8, 16, .28);
  --shadow-md: 0 16px 40px rgba(2, 8, 16, .20);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background: #0a1220;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; border: 0; cursor: pointer; background: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, h4, blockquote { margin: 0; }
b, strong { font-weight: 700; }
[hidden] { display: none !important; }
::selection { background: rgba(var(--accent-rgb), .35); color: var(--ink); }

/* ============================================================
   十境主题变量
   ============================================================ */
body {
  --ink: #163449;
  --muted: #547182;
  --faint: #7d93a0;
  --panel: rgba(255, 255, 255, .55);
  --panel-strong: rgba(255, 255, 255, .78);
  --panel-solid: #f6fbfd;
  --panel-deep: rgba(14, 40, 58, .68);
  --line: rgba(22, 62, 84, .16);
  --line-strong: rgba(22, 62, 84, .28);
  --accent: #0b7fcf;
  --accent-2: #4cc6cc;
  --accent-soft: rgba(11, 127, 207, .12);
  --accent-rgb: 11, 127, 207;
  --accent-ink: #fff;
  --sky-1: #bfe9ff;
  --sky-2: #8bd7fb;
  --sky-3: #f5f2df;
  --glow-1: rgba(255, 246, 194, .92);
  --glow-2: rgba(85, 202, 255, .6);
  --world-ink: #1a4056;
  --shadow-tint: rgba(10, 41, 63, .18);
  --scroll: rgba(15, 72, 102, .22);
  --danger: #c94d42;
}

body[data-world="origin"] {
  --ink: #0f2d40;
  --muted: #3b5f73;
  --faint: #647f8e;
  --panel: rgba(250, 254, 255, .64);
  --panel-strong: rgba(252, 255, 255, .86);
  --panel-solid: #f5fbfd;
  --panel-deep: rgba(17, 50, 68, .72);
  --line: rgba(19, 61, 84, .19);
  --line-strong: rgba(19, 61, 84, .34);
  --accent: #0678bf;
  --accent-2: #33bdc6;
  --accent-soft: rgba(6, 120, 191, .12);
  --accent-rgb: 6, 120, 191;
  --accent-ink: #fff;
  --sky-1: #b7e8ff;
  --sky-2: #66c9f4;
  --sky-3: #f4edcf;
  --glow-1: rgba(255, 247, 194, .92);
  --glow-2: rgba(63, 188, 255, .54);
  --shadow-tint: rgba(10, 43, 64, .20);
  --scroll: rgba(15, 72, 102, .28);
}

body[data-world="tide"] {
  --ink: #e9fcff;
  --muted: #9bc9d2;
  --faint: #6d9ba7;
  --panel: rgba(5, 38, 51, .48);
  --panel-strong: rgba(5, 34, 47, .75);
  --panel-solid: #082c3b;
  --panel-deep: rgba(2, 23, 33, .82);
  --line: rgba(157, 238, 246, .17);
  --line-strong: rgba(157, 238, 246, .30);
  --accent: #55e3d4;
  --accent-2: #7bc4ff;
  --accent-soft: rgba(85, 227, 212, .13);
  --accent-rgb: 85, 227, 212;
  --accent-ink: #05242b;
  --sky-1: #0f5d72;
  --sky-2: #073c54;
  --sky-3: #021c2d;
  --glow-1: rgba(103, 255, 232, .40);
  --glow-2: rgba(30, 159, 214, .35);
  --shadow-tint: rgba(0, 8, 14, .5);
  --scroll: rgba(140, 233, 240, .25);
}

body[data-world="verdant"] {
  --ink: #f1ffe9;
  --muted: #b4cfa9;
  --faint: #809b76;
  --panel: rgba(12, 36, 25, .51);
  --panel-strong: rgba(12, 34, 24, .76);
  --panel-solid: #102d20;
  --panel-deep: rgba(5, 22, 14, .82);
  --line: rgba(207, 246, 183, .16);
  --line-strong: rgba(207, 246, 183, .28);
  --accent: #c8f28b;
  --accent-2: #72d5a2;
  --accent-soft: rgba(200, 242, 139, .12);
  --accent-rgb: 200, 242, 139;
  --accent-ink: #102610;
  --sky-1: #365b3d;
  --sky-2: #193c2a;
  --sky-3: #071c16;
  --glow-1: rgba(225, 255, 171, .38);
  --glow-2: rgba(70, 175, 121, .38);
  --shadow-tint: rgba(0, 9, 5, .55);
  --scroll: rgba(206, 248, 184, .22);
}

body[data-world="ember"] {
  --ink: #fff2e6;
  --muted: #d5ac96;
  --faint: #9f7867;
  --panel: rgba(34, 14, 11, .55);
  --panel-strong: rgba(32, 13, 11, .80);
  --panel-solid: #2b1511;
  --panel-deep: rgba(21, 7, 6, .86);
  --line: rgba(255, 181, 132, .17);
  --line-strong: rgba(255, 181, 132, .3);
  --accent: #ff9a58;
  --accent-2: #ff5c5c;
  --accent-soft: rgba(255, 154, 88, .13);
  --accent-rgb: 255, 154, 88;
  --accent-ink: #2a0d08;
  --sky-1: #56201b;
  --sky-2: #2a100e;
  --sky-3: #0d0707;
  --glow-1: rgba(255, 101, 45, .52);
  --glow-2: rgba(255, 205, 82, .28);
  --shadow-tint: rgba(0, 0, 0, .56);
  --scroll: rgba(255, 188, 144, .24);
}

body[data-world="skylife"] {
  --ink: #fff4e9;
  --muted: #d5b9c2;
  --faint: #9f8593;
  --panel: rgba(48, 32, 53, .48);
  --panel-strong: rgba(44, 28, 51, .76);
  --panel-solid: #33233e;
  --panel-deep: rgba(29, 17, 36, .82);
  --line: rgba(255, 222, 206, .18);
  --line-strong: rgba(255, 222, 206, .31);
  --accent: #ffd08b;
  --accent-2: #ff9db5;
  --accent-soft: rgba(255, 208, 139, .13);
  --accent-rgb: 255, 208, 139;
  --accent-ink: #332032;
  --sky-1: #6c4a6e;
  --sky-2: #3e4666;
  --sky-3: #14192d;
  --glow-1: rgba(255, 217, 143, .44);
  --glow-2: rgba(255, 125, 166, .28);
  --shadow-tint: rgba(4, 3, 14, .5);
  --scroll: rgba(255, 225, 208, .24);
}

body[data-world="gears"] {
  --ink: #fff2d4;
  --muted: #cbb78e;
  --faint: #987d53;
  --panel: rgba(38, 28, 17, .55);
  --panel-strong: rgba(36, 27, 16, .80);
  --panel-solid: #2c2315;
  --panel-deep: rgba(24, 17, 10, .88);
  --line: rgba(236, 197, 123, .19);
  --line-strong: rgba(236, 197, 123, .32);
  --accent: #e1b25f;
  --accent-2: #b7e0d1;
  --accent-soft: rgba(225, 178, 95, .13);
  --accent-rgb: 225, 178, 95;
  --accent-ink: #2a1c0b;
  --sky-1: #5d462a;
  --sky-2: #342719;
  --sky-3: #120f0b;
  --glow-1: rgba(236, 185, 92, .42);
  --glow-2: rgba(103, 166, 155, .22);
  --shadow-tint: rgba(0, 0, 0, .54);
  --scroll: rgba(237, 197, 122, .24);
}

body[data-world="myth"] {
  --ink: #f7edff;
  --muted: #c0aad8;
  --faint: #886f9e;
  --panel: rgba(24, 17, 50, .52);
  --panel-strong: rgba(22, 15, 46, .78);
  --panel-solid: #1c1436;
  --panel-deep: rgba(15, 9, 36, .85);
  --line: rgba(216, 190, 255, .17);
  --line-strong: rgba(216, 190, 255, .31);
  --accent: #c9a4ff;
  --accent-2: #ffd792;
  --accent-soft: rgba(201, 164, 255, .13);
  --accent-rgb: 201, 164, 255;
  --accent-ink: #1d1033;
  --sky-1: #362060;
  --sky-2: #1a1339;
  --sky-3: #080717;
  --glow-1: rgba(185, 137, 255, .42);
  --glow-2: rgba(255, 204, 117, .24);
  --shadow-tint: rgba(2, 0, 12, .58);
  --scroll: rgba(216, 190, 255, .23);
}

body[data-world="neon"] {
  --ink: #ebfdff;
  --muted: #9fb8cb;
  --faint: #64849b;
  --panel: rgba(5, 13, 31, .52);
  --panel-strong: rgba(4, 12, 29, .80);
  --panel-solid: #08162b;
  --panel-deep: rgba(3, 8, 21, .88);
  --line: rgba(112, 239, 255, .18);
  --line-strong: rgba(112, 239, 255, .32);
  --accent: #5ce7ff;
  --accent-2: #ff6cc7;
  --accent-soft: rgba(92, 231, 255, .12);
  --accent-rgb: 92, 231, 255;
  --accent-ink: #041923;
  --sky-1: #10214c;
  --sky-2: #0b122c;
  --sky-3: #050711;
  --glow-1: rgba(41, 193, 255, .42);
  --glow-2: rgba(255, 65, 180, .28);
  --shadow-tint: rgba(0, 0, 8, .6);
  --scroll: rgba(97, 235, 255, .24);
}

body[data-world="star"] {
  --ink: #edf3ff;
  --muted: #a8b5d3;
  --faint: #71809e;
  --panel: rgba(7, 13, 33, .50);
  --panel-strong: rgba(6, 12, 30, .78);
  --panel-solid: #0b1631;
  --panel-deep: rgba(4, 8, 21, .88);
  --line: rgba(182, 201, 255, .17);
  --line-strong: rgba(182, 201, 255, .30);
  --accent: #a8b9ff;
  --accent-2: #77e9dc;
  --accent-soft: rgba(168, 185, 255, .12);
  --accent-rgb: 168, 185, 255;
  --accent-ink: #0a1430;
  --sky-1: #172954;
  --sky-2: #0a1732;
  --sky-3: #030712;
  --glow-1: rgba(137, 164, 255, .38);
  --glow-2: rgba(74, 223, 211, .22);
  --shadow-tint: rgba(0, 0, 8, .6);
  --scroll: rgba(183, 201, 255, .23);
}

body[data-world="genesis"] {
  --ink: #fff6ff;
  --muted: #c7b9d2;
  --faint: #8a7b97;
  --panel: rgba(12, 9, 19, .55);
  --panel-strong: rgba(10, 8, 17, .82);
  --panel-solid: #17111f;
  --panel-deep: rgba(7, 5, 12, .9);
  --line: rgba(241, 213, 255, .17);
  --line-strong: rgba(241, 213, 255, .3);
  --accent: #ffd3f1;
  --accent-2: #a8f7ff;
  --accent-soft: rgba(255, 211, 241, .1);
  --accent-rgb: 255, 211, 241;
  --accent-ink: #21101e;
  --sky-1: #2a1837;
  --sky-2: #120d20;
  --sky-3: #040308;
  --glow-1: rgba(255, 114, 213, .28);
  --glow-2: rgba(96, 213, 255, .26);
  --shadow-tint: rgba(0, 0, 0, .64);
  --scroll: rgba(242, 215, 255, .22);
}

/* ============================================================
   世界背景
   ============================================================ */
.world {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background: var(--sky-2);
}
.world-sky {
  position: absolute;
  inset: -2%;
  background:
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 47%, var(--sky-3) 100%);
  transition: background 1.2s var(--ease), filter 1.2s var(--ease);
}
.world-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 46% at 78% 12%, var(--glow-1), transparent 58%),
    radial-gradient(58% 48% at 16% 60%, var(--glow-2), transparent 68%),
    linear-gradient(180deg, transparent 62%, rgba(3, 8, 14, .26) 100%);
  opacity: .92;
  transition: background 1.2s var(--ease);
}
.world-orb {
  position: absolute;
  width: min(48vw, 650px);
  aspect-ratio: 1;
  right: -7vw;
  top: -17vw;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(255, 255, 255, .95), var(--glow-1) 22%, transparent 66%);
  opacity: .75;
  animation: orb-breathe 14s ease-in-out infinite;
  transform: translateZ(0);
}
.world-haze {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -16%;
  height: 60%;
  background:
    radial-gradient(60% 80% at 50% 100%, rgba(255, 255, 255, .2), transparent 70%),
    linear-gradient(180deg, transparent, rgba(3, 9, 15, .26));
}
.world-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .9;
}
.world-grain {
  position: absolute;
  inset: 0;
  opacity: .08;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.world-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 88% at 50% 42%, transparent 55%, rgba(2, 7, 13, .32) 100%),
    linear-gradient(90deg, rgba(2, 7, 13, .13), transparent 20%, transparent 80%, rgba(2, 7, 13, .13));
}

/* 世界独立背景 */
body[data-world="origin"] .world-orb { right: 6vw; top: -24vw; opacity: .82; }
body[data-world="origin"] .world-haze { background: linear-gradient(180deg, transparent 20%, rgba(244, 238, 204, .25) 80%); }
body[data-world="tide"] .world-sky {
  background:
    linear-gradient(180deg, #137b96 0%, #0a4e68 35%, #032536 75%, #011521 100%);
}
body[data-world="tide"] .world-orb {
  width: min(38vw, 500px); right: 24vw; top: -18vw; opacity: .35;
  background: radial-gradient(circle, rgba(168, 255, 246, .8), transparent 65%);
}
body[data-world="tide"] .world-haze {
  height: 65%;
  background: linear-gradient(180deg, transparent, rgba(7, 90, 110, .3));
}
body[data-world="verdant"] .world-sky {
  background:
    radial-gradient(50% 40% at 20% 18%, rgba(211, 255, 156, .15), transparent 70%),
    linear-gradient(180deg, #4f7151 0%, #244a35 36%, #0e2a21 72%, #051711 100%);
}
body[data-world="verdant"] .world-orb {
  width: 32vw; right: 9vw; top: 7vh; opacity: .2;
  background: radial-gradient(circle, rgba(231, 255, 171, .9), transparent 64%);
}
body[data-world="ember"] .world-sky {
  background:
    radial-gradient(48% 30% at 52% 100%, rgba(255, 118, 37, .5), transparent 72%),
    linear-gradient(180deg, #1e0d12 0%, #361413 44%, #531e16 72%, #1a0807 100%);
}
body[data-world="ember"] .world-orb {
  width: 52vw; right: 23vw; top: auto; bottom: -36vw; opacity: .65;
  background: radial-gradient(circle, rgba(255, 187, 75, .82), rgba(255, 76, 36, .38) 32%, transparent 68%);
  filter: blur(12px);
  animation: lava-breathe 9s ease-in-out infinite;
}
body[data-world="skylife"] .world-sky {
  background:
    radial-gradient(70% 40% at 20% 88%, rgba(255, 187, 133, .3), transparent 70%),
    linear-gradient(180deg, #4e426e 0%, #735475 33%, #4c3b62 60%, #15182d 100%);
}
body[data-world="skylife"] .world-orb {
  width: 26vw; right: 13vw; top: 7vw; opacity: .55;
  background: radial-gradient(circle, rgba(255, 236, 189, .9), rgba(255, 167, 140, .32) 36%, transparent 66%);
}
body[data-world="gears"] .world-sky {
  background:
    radial-gradient(70% 54% at 50% 100%, rgba(169, 103, 37, .3), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 236, 180, .035) 0 2px, transparent 2px 96px),
    linear-gradient(180deg, #3e3224 0%, #2b2116 44%, #15100a 100%);
}
body[data-world="gears"] .world-orb {
  width: 40vw; right: 5vw; top: -15vw; opacity: .22;
  background: radial-gradient(circle, rgba(255, 218, 143, .9), transparent 65%);
}
body[data-world="myth"] .world-sky {
  background:
    radial-gradient(45% 38% at 50% 18%, rgba(201, 164, 255, .19), transparent 70%),
    linear-gradient(180deg, #26183f 0%, #181231 45%, #080612 100%);
}
body[data-world="myth"] .world-orb {
  width: 30vw; right: 36vw; top: 4vh; opacity: .3;
  background: radial-gradient(circle, rgba(255, 232, 178, .88), rgba(195, 151, 255, .28) 40%, transparent 68%);
}
body[data-world="neon"] .world-sky {
  background:
    radial-gradient(60% 42% at 78% 20%, rgba(255, 50, 170, .18), transparent 70%),
    radial-gradient(60% 40% at 15% 18%, rgba(54, 208, 255, .17), transparent 70%),
    linear-gradient(180deg, #0c1532 0%, #0b1028 42%, #05060f 100%);
}
body[data-world="neon"] .world-orb {
  width: 34vw; right: 9vw; top: 5vh; opacity: .26;
  background: radial-gradient(circle, rgba(99, 231, 255, .75), transparent 60%);
}
body[data-world="star"] .world-sky {
  background:
    radial-gradient(46% 34% at 73% 20%, rgba(118, 145, 255, .19), transparent 70%),
    radial-gradient(42% 30% at 21% 70%, rgba(86, 223, 212, .12), transparent 70%),
    linear-gradient(180deg, #0b1530 0%, #060d21 54%, #02040d 100%);
}
body[data-world="star"] .world-orb {
  width: 30vw; right: 13vw; top: 8vh; opacity: .35;
  background: radial-gradient(circle at 38% 38%, rgba(222, 232, 255, .9), rgba(95, 125, 220, .5) 24%, transparent 64%);
  filter: blur(2px);
}
body[data-world="genesis"] .world-sky {
  background:
    radial-gradient(50% 45% at 50% 50%, rgba(112, 59, 128, .3), transparent 62%),
    radial-gradient(36% 30% at 78% 25%, rgba(64, 181, 216, .16), transparent 70%),
    linear-gradient(180deg, #100b1a 0%, #080510 56%, #020206 100%);
}
body[data-world="genesis"] .world-orb {
  width: 46vw; right: 26vw; top: 16vh; opacity: .22;
  background: radial-gradient(circle, rgba(255, 224, 253, .9), rgba(241, 131, 224, .2) 32%, transparent 67%);
}

/* ---- 场景装饰：云 / 气泡 / 神光 / 叶子 / 浮岛 / 齿轮 / 符文 / 霓虹 / 行星 / 漩涡 ---- */
.cl {
  position: absolute;
  width: 30vw;
  height: 9vw;
  min-height: 55px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 50%, rgba(255, 255, 255, .46), rgba(255, 255, 255, .12) 55%, transparent 74%);
  filter: blur(8px);
  opacity: .7;
  animation: cloud-drift linear infinite;
}
.cl.c1 { left: -10%; top: 18%; animation-duration: 100s; }
.cl.c2 { right: -15%; top: 35%; width: 42vw; opacity: .45; animation-duration: 135s; animation-direction: reverse; }
.cl.c3 { left: 30%; top: 6%; width: 24vw; height: 7vw; opacity: .35; animation-duration: 120s; animation-delay: -20s; }
.cl.c4 { left: 12%; bottom: 13%; width: 38vw; height: 9vw; opacity: .34; animation-duration: 150s; animation-direction: reverse; }
.cloud-svg {
  position: absolute;
  width: clamp(160px, 23vw, 360px);
  height: auto;
  fill: rgba(255, 255, 255, .46);
  opacity: .8;
  animation: cloud-drift linear infinite;
  will-change: transform;
}
.cloud-svg.c1 { left: -3%; top: 12%; animation-duration: 120s; }
.cloud-svg.c2 { right: -5%; top: 31%; width: clamp(210px, 32vw, 470px); opacity: .42; animation-duration: 160s; animation-direction: reverse; }
.cloud-svg.c3 { left: 29%; top: 4%; width: clamp(130px, 17vw, 260px); opacity: .33; animation-duration: 140s; animation-delay: -34s; }
.cloud-svg.c4 { left: 9%; bottom: 7%; width: clamp(190px, 28vw, 420px); opacity: .28; animation-duration: 180s; animation-direction: reverse; }
.ws-scene-art .cloud-svg { opacity: .5; }

.bub {
  position: absolute;
  bottom: -12vh;
  width: var(--s, 9px);
  height: var(--s, 9px);
  border-radius: 50%;
  border: 1px solid rgba(188, 255, 249, .35);
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .55), transparent 60%);
  animation: bubble-rise var(--d, 16s) linear infinite;
  animation-delay: var(--de, 0s);
  opacity: .55;
}
.ray {
  position: absolute;
  top: -20%;
  width: 16vw;
  height: 80%;
  transform-origin: top center;
  background: linear-gradient(180deg, rgba(181, 255, 240, .2), transparent 80%);
  filter: blur(9px);
  clip-path: polygon(42% 0, 60% 0, 100% 100%, 0 100%);
  animation: ray-sway 13s ease-in-out infinite alternate;
  opacity: .4;
}
.ray.r1 { left: 8%; transform: rotate(13deg); }
.ray.r2 { left: 35%; width: 12vw; transform: rotate(-8deg); animation-delay: -4s; opacity: .24; }
.ray.r3 { right: 14%; width: 20vw; transform: rotate(9deg); animation-delay: -7s; opacity: .3; }

.tree-sil {
  position: absolute;
  bottom: -2%;
  width: 14vw;
  height: 64vh;
  opacity: .42;
  background:
    radial-gradient(ellipse 48% 30% at 50% 18%, #102818 20%, transparent 70%),
    conic-gradient(from 90deg at 50% 100%, transparent 38%, #12261a 38% 42%, transparent 42% 58%, #12261a 58% 62%, transparent 62%);
  filter: blur(1px);
  transform-origin: bottom center;
  animation: tree-sway 12s ease-in-out infinite alternate;
}
.tree-sil.t1 { left: -3%; }
.tree-sil.t2 { right: 1%; height: 48vh; opacity: .3; animation-delay: -5s; }

.lava-crack {
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 24vh;
  background:
    linear-gradient(170deg, transparent 48%, rgba(255, 127, 54, .15) 49% 52%, transparent 53%),
    linear-gradient(190deg, transparent 58%, rgba(255, 172, 78, .24) 59% 61%, transparent 62%),
    linear-gradient(180deg, transparent 55%, rgba(255, 74, 28, .12));
  filter: blur(3px);
  opacity: .8;
}
.ember-particle {
  position: absolute;
  bottom: 5%;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #ffc66a;
  box-shadow: 0 0 9px 3px rgba(255, 124, 44, .5);
  animation: ember-rise var(--d, 8s) linear infinite;
  animation-delay: var(--de, 0s);
}

.island {
  position: absolute;
  width: 27vw;
  height: 8vw;
  min-height: 55px;
  opacity: .55;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(174, 169, 195, .3), transparent 70%),
    linear-gradient(180deg, #443e50 0%, #28283b 24%, transparent 26%);
  clip-path: polygon(0 18%, 33% 11%, 54% 19%, 78% 9%, 100% 22%, 85% 50%, 65% 76%, 48% 98%, 28% 68%, 9% 48%);
  filter: blur(.6px);
  animation: island-float 12s ease-in-out infinite alternate;
}
.island.i1 { left: 5%; top: 37%; }
.island.i2 { right: 3%; top: 20%; width: 20vw; height: 6vw; opacity: .36; animation-delay: -4s; }
.lantern {
  position: absolute;
  width: 7px; height: 11px;
  border-radius: 45%;
  background: radial-gradient(circle at 50% 35%, #fff7d1, #ffc77c 55%, #ff8e68 100%);
  box-shadow: 0 0 20px 7px rgba(255, 192, 108, .45);
  opacity: .75;
  animation: lantern-rise var(--d, 18s) linear infinite;
  animation-delay: var(--de, 0s);
}
.big-gear {
  position: absolute;
  width: var(--s, 38vw);
  height: var(--s, 38vw);
  left: var(--x, -8vw);
  top: var(--y, 12vh);
  opacity: .11;
  animation: gear-spin var(--d, 80s) linear infinite;
  filter: drop-shadow(0 0 18px rgba(255, 203, 112, .12));
}
.big-gear.rev { animation-direction: reverse; }
.big-gear svg { width: 100%; height: 100%; }
.steam-cloud {
  position: absolute;
  width: 24vw; height: 12vw;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 245, 220, .09), transparent 68%);
  filter: blur(20px);
  animation: cloud-drift 80s linear infinite;
}
.steam-cloud.s1 { left: -6%; bottom: 20%; }
.steam-cloud.s2 { right: -10%; top: 22%; animation-direction: reverse; animation-duration: 100s; }

.rune-arch {
  position: absolute;
  left: 50%;
  top: 12%;
  width: min(36vw, 540px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border: 1px solid rgba(218, 187, 255, .16);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(179, 124, 255, .1), inset 0 0 80px rgba(179, 124, 255, .04);
  animation: rune-spin 60s linear infinite;
  opacity: .6;
}
.rune-arch::before, .rune-arch::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: 8%;
  border: 1px dashed rgba(255, 227, 172, .15);
}
.rune-arch::after { inset: 20%; border-style: solid; border-color: rgba(218, 187, 255, .11); }
.rune-glyph {
  position: absolute;
  color: rgba(255, 227, 172, .34);
  font-family: var(--font-display);
  font-size: clamp(16px, 1.8vw, 28px);
  text-shadow: 0 0 18px rgba(255, 217, 153, .35);
  animation: glyph-glow 6s ease-in-out infinite;
}
.rune-glyph.g1 { left: 4%; top: 26%; }
.rune-glyph.g2 { right: 6%; top: 16%; animation-delay: -1.5s; }
.rune-glyph.g3 { left: 19%; bottom: 7%; animation-delay: -3s; }
.rune-glyph.g4 { right: 15%; bottom: 12%; animation-delay: -4.5s; }
.pillar {
  position: absolute;
  bottom: 0;
  width: 7vw;
  height: 47vh;
  opacity: .26;
  background: linear-gradient(90deg, transparent, #16102b 18% 50%, #090713 82%, transparent);
  filter: blur(1px);
}
.pillar.p1 { left: 1%; }
.pillar.p2 { right: 2%; transform: scaleX(-1); }

.neon-city {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 34vh;
  opacity: .5;
  background:
    linear-gradient(90deg, transparent 4%, #071426 4% 8%, transparent 8% 12%, #071426 12% 15%, transparent 15% 21%, #071426 21% 26%, transparent 26% 31%, #071426 31% 35%, transparent 35% 46%, #071426 46% 51%, transparent 51% 58%, #071426 58% 63%, transparent 63% 70%, #071426 70% 74%, transparent 74% 82%, #071426 82% 87%, transparent 87% 94%, #071426 94%),
    linear-gradient(180deg, transparent 34%, rgba(6, 18, 39, .8) 100%);
  clip-path: polygon(0 100%, 0 31%, 4% 31%, 4% 18%, 8% 18%, 8% 47%, 12% 47%, 12% 28%, 15% 28%, 15% 9%, 21% 9%, 21% 46%, 26% 46%, 26% 22%, 31% 22%, 31% 38%, 35% 38%, 35% 14%, 46% 14%, 46% 51%, 51% 51%, 51% 27%, 58% 27%, 58% 8%, 63% 8%, 63% 42%, 70% 42%, 70% 19%, 74% 19%, 74% 47%, 82% 47%, 82% 26%, 87% 26%, 87% 13%, 94% 13%, 94% 35%, 100% 35%, 100% 100%);
}
.neon-grid {
  position: absolute;
  left: -20%; right: -20%; bottom: -12%;
  height: 55vh;
  background:
    linear-gradient(rgba(83, 228, 255, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 228, 255, .14) 1px, transparent 1px);
  background-size: 7vw 7vw;
  transform: perspective(300px) rotateX(66deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(180deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
  opacity: .5;
}
.neon-sign {
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 48px);
  letter-spacing: .3em;
  color: rgba(255, 112, 203, .7);
  text-shadow: 0 0 10px rgba(255, 88, 193, .7), 0 0 38px rgba(255, 88, 193, .4);
  opacity: .38;
  writing-mode: vertical-rl;
  animation: neon-flicker 8s infinite;
}
.neon-sign.n1 { left: 7%; top: 28%; }
.neon-sign.n2 { right: 9%; top: 19%; color: rgba(104, 242, 255, .68); text-shadow: 0 0 10px rgba(74, 230, 255, .6), 0 0 32px rgba(74, 230, 255, .35); animation-delay: -3s; }

.planet {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #e6f1ff, #839cdd 26%, #324a85 54%, #0a1430 75%);
  box-shadow: inset -18px -15px 40px rgba(0, 0, 0, .55), 0 0 50px rgba(107, 144, 255, .18);
  opacity: .55;
}
.planet.p1 { width: 14vw; height: 14vw; right: 8%; top: 24%; animation: planet-float 22s ease-in-out infinite alternate; }
.planet.p2 { width: 5vw; height: 5vw; left: 8%; bottom: 23%; opacity: .3; background: radial-gradient(circle at 35% 30%, #f0fffc, #7ad5cb 30%, #21555b 60%, #051418 80%); animation: planet-float 17s ease-in-out infinite alternate-reverse; }

.vortex {
  position: absolute;
  left: 50%; top: 48%;
  width: min(58vw, 800px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: .35;
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 5%, rgba(255, 205, 247, .11) 5.4% 5.8%, transparent 6.2% 10%);
  animation: vortex-spin 34s linear infinite;
  filter: blur(.5px);
}
.vortex::before, .vortex::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(164, 236, 255, .15);
  transform: rotate(46deg) scaleY(.5);
}
.vortex::after { inset: 25%; transform: rotate(-28deg) scaleY(.67); border-color: rgba(255, 186, 243, .18); }

/* ============================================================
   顶栏
   ============================================================ */
.hud {
  position: fixed;
  z-index: 45;
  left: 22px;
  right: 22px;
  top: 18px;
  max-width: 1720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 12px 40px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .18);
  animation: hud-in .8s var(--ease-spring) both;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 42px; height: 42px;
  position: relative;
  display: grid; place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .22), transparent 56%), var(--accent-soft);
  box-shadow: inset 0 0 20px rgba(var(--accent-rgb), .12), 0 0 28px rgba(var(--accent-rgb), .1);
}
.brand-mark i {
  position: absolute; inset: 5px;
  border: 1px dashed rgba(var(--accent-rgb), .30);
  border-radius: 50%;
  animation: rune-spin 26s linear infinite;
}
.brand-mark i:last-child { inset: 10px; border-style: solid; opacity: .45; animation-duration: 16s; animation-direction: reverse; }
.brand-mark b { font-family: var(--font-display); font-size: 18px; color: var(--accent); font-weight: 400; text-shadow: 0 0 14px rgba(var(--accent-rgb), .5); }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-family: var(--font-display); font-size: 19px; letter-spacing: .16em; font-weight: 600; white-space: nowrap; }
.brand-copy span { font-family: var(--font-num); font-size: 8.5px; letter-spacing: .22em; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.brand-copy em { font-style: normal; color: var(--accent); margin-left: 3px; }
.hud-chapter { text-align: center; min-width: 0; }
.hud-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .16em;
  white-space: nowrap;
}
.hud-eyebrow b { color: var(--accent); font-weight: 600; }
.hud-eyebrow i { width: 16px; height: 1px; background: var(--line-strong); }
.ver-dot {
  padding: 2px 6px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-num);
  letter-spacing: .04em;
}
.hud-chapter h1 {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: clamp(17px, 1.7vw, 23px);
  letter-spacing: .2em;
  font-weight: 500;
  text-indent: .2em;
  white-space: nowrap;
}
.hud-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.account-chip {
  display: flex; align-items: center; gap: 9px;
  min-width: 0;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(var(--accent-rgb), .045);
  color: var(--ink);
  transition: .25s var(--ease);
}
.account-chip:hover { border-color: var(--line-strong); background: var(--accent-soft); transform: translateY(-1px); }
.account-orb {
  width: 29px; height: 29px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), .25), rgba(var(--accent-rgb), .06));
  border: 1px solid rgba(var(--accent-rgb), .25);
  overflow: hidden;
}
.account-orb img { width: 100%; height: 100%; object-fit: cover; }
.account-orb i { font-style: normal; font-size: 14px; color: var(--accent); }
.account-copy { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.account-copy b { font-size: 11px; font-weight: 600; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { font-size: 8px; color: var(--muted); letter-spacing: .03em; white-space: nowrap; }
.tool-btn {
  display: flex; align-items: center; gap: 5px;
  height: 37px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: .22s var(--ease);
  white-space: nowrap;
}
.tool-btn:hover { color: var(--ink); border-color: var(--line); background: rgba(var(--accent-rgb), .06); transform: translateY(-1px); }
.tool-btn:active { transform: translateY(0); }
.tool-btn.square { width: 35px; padding: 0; justify-content: center; border-color: var(--line); }
.legacy-tool .tool-ico { color: #dabb7b; }
.legacy-tool:hover { color: var(--ink); border-color: rgba(218, 187, 123, .4); background: rgba(218, 187, 123, .1); }
.tool-ico { font-family: var(--font-display); font-size: 16px; color: currentColor; line-height: 1; }
.tool-label { font-size: 10px; letter-spacing: .08em; }
#btn-sound.off .tool-ico { opacity: .4; }
#btn-sound.off .tool-label { text-decoration: line-through; opacity: .6; }

/* ============================================================
   左境星轨
   ============================================================ */
.chapter-rail {
  position: fixed;
  z-index: 25;
  left: 20px;
  top: 112px;
  bottom: 108px;
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 0 12px;
  border: 1px solid var(--line);
  border-radius: 29px;
  background: var(--panel);
  box-shadow: 0 18px 40px var(--shadow-tint);
  animation: rail-in 1s .1s var(--ease-spring) both;
}
.rail-caption {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: .3em;
  color: var(--muted);
  opacity: .8;
  margin-bottom: 9px;
}
.rail-track { flex: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: center; position: relative; width: 100%; padding: 2px 0; }
.rail-track::before {
  content: "";
  position: absolute; top: 7px; bottom: 7px; left: 50%;
  width: 1px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--line-strong) 12%, var(--line-strong) 88%, transparent);
}
.rail-node {
  position: relative;
  z-index: 1;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--faint);
  font-family: var(--font-display);
  font-size: 10px;
  transition: .3s var(--ease);
}
.rail-node:hover { border-color: var(--line-strong); transform: scale(1.08); }
.rail-node.done { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); background: var(--accent-soft); }
.rail-node.done::after {
  content: "✦";
  position: absolute; right: -3px; top: -4px;
  font-size: 8px; color: var(--accent);
}
.rail-node.current {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .13), 0 0 24px rgba(var(--accent-rgb), .35);
}
.rail-node.current::before {
  content: "";
  position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), .36);
  animation: node-pulse 2.4s ease-out infinite;
}
.rail-node.locked { opacity: .4; }
.rail-tip {
  position: absolute; left: 42px; top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 10px;
  letter-spacing: .1em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .2s var(--ease);
}
.rail-node:hover .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }
.mini-rail { display: none; }

/* ============================================================
   主布局
   ============================================================ */
.layout {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1720px;
  height: 100vh;
  margin: 0 auto;
  padding: 104px 22px 106px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 16px;
  transition: opacity .32s var(--ease), filter .32s var(--ease), transform .32s var(--ease);
}
body:not([data-view="craft"]) .layout {
  opacity: 0;
  filter: blur(4px);
  transform: scale(.992);
  pointer-events: none;
}
body:not([data-view="craft"]) .chapter-rail { opacity: 0; visibility: hidden; pointer-events: none; }
.chapter-rail { transition: opacity .32s var(--ease), visibility .32s; }
.playfield { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px; }

/* ============================================================
   本境课题
   ============================================================ */
.quest {
  position: relative;
  flex: 0 0 auto;
  contain: layout paint;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 19px 22px 19px 25px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), .07), transparent 38%),
    var(--panel);
  box-shadow: 0 14px 40px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: panel-in .9s .18s var(--ease-spring) both;
}
.quest-aura {
  position: absolute;
  width: 300px; height: 300px;
  right: 18%; top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), .22), transparent 68%);
  pointer-events: none;
  filter: blur(12px);
}
.quest-main { position: relative; min-width: 0; }
.quest-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 9.5px;
  letter-spacing: .13em;
  color: var(--muted);
  white-space: nowrap;
}
.quest-index {
  color: var(--accent);
  padding: 3px 9px;
  border: 1px solid rgba(var(--accent-rgb), .24);
  border-radius: 99px;
  background: var(--accent-soft);
}
.quest-line { width: 22px; height: 1px; background: var(--line-strong); }
#quest-subtitle { overflow: hidden; text-overflow: ellipsis; }
.quest h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.18;
}
.quest-story {
  margin-top: 5px;
  max-width: 670px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
  text-wrap: pretty;
  letter-spacing: .025em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quest-progress { margin-top: 12px; max-width: 370px; }
.progress-meta {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .08em;
  margin-bottom: 5px;
}
.progress-meta b { color: var(--ink); font-family: var(--font-num); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
.progress-bar {
  position: relative;
  height: 4px;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), .13);
  overflow: hidden;
}
.progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .24), transparent);
  transform: translateX(-100%);
  animation: progress-sheen 3.4s ease-in-out infinite;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(var(--accent-rgb), .5);
  transition: width .7s var(--ease-spring);
}
.quest-action {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 184px;
}
.quest-action-note {
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: .06em;
  transition: .3s;
}
.quest-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 176px;
  height: 42px;
  padding: 0 17px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 45%),
    linear-gradient(120deg, var(--accent), var(--accent-2));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 45%),
    linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--accent-2)));
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), .22), inset 0 1px 0 rgba(255, 255, 255, .35);
  font-size: 12px;
  letter-spacing: .08em;
  font-weight: 600;
  transition: .25s var(--ease);
}
.quest-btn i { font-style: normal; font-family: var(--font-display); font-size: 14px; opacity: .78; transition: .3s; }
.quest-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 13px 32px rgba(var(--accent-rgb), .34), inset 0 1px 0 rgba(255, 255, 255, .4); }
.quest-btn:hover:not(:disabled) i { transform: rotate(45deg) scale(1.15); }
.quest-btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.quest-btn:disabled {
  cursor: default;
  color: var(--muted);
  background: rgba(var(--accent-rgb), .06);
  border-color: var(--line);
  box-shadow: none;
}
.quest-action.ready .quest-btn {
  animation: ready-pulse 2.6s ease-in-out infinite;
}
.quest-action.exam .quest-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .23), transparent 45%),
    linear-gradient(120deg, #d7aa4f, #ffdf8a 45%, #c88332);
  color: #2e1d08;
  border-color: rgba(255, 226, 158, .7);
  box-shadow: 0 0 0 5px rgba(230, 188, 100, .10), 0 12px 34px rgba(202, 142, 35, .28);
  animation: exam-glow 2.4s ease-in-out infinite;
}
.quest-action.complete .quest-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 42%),
    linear-gradient(120deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  animation: none;
}
.quest-lock { font-size: 8.5px; color: var(--faint); letter-spacing: .05em; }
.quest-action.ready .quest-lock,
.quest-action.exam .quest-lock,
.quest-action.complete .quest-lock { opacity: 0; height: 0; overflow: hidden; }

/* ============================================================
   合成台
   ============================================================ */
.workspace-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 16px 48px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .13);
  animation: panel-in .95s .26s var(--ease-spring) both;
}
.ws-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
}
.ws-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-glyph {
  width: 27px; height: 27px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 13px;
  background: var(--accent-soft);
}
.ws-heading h3 { font-family: var(--font-display); font-size: 14px; letter-spacing: .16em; font-weight: 500; }
.ws-heading p { color: var(--muted); font-size: 9.5px; letter-spacing: .04em; margin-top: 2px; }
.ws-tools { display: flex; align-items: center; gap: 4px; }
.chip-counter { color: var(--faint); font-size: 9px; letter-spacing: .06em; margin-right: 5px; white-space: nowrap; }
.ghost-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(var(--accent-rgb), .025);
  font-size: 10px;
  letter-spacing: .06em;
  transition: .22s var(--ease);
  white-space: nowrap;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--accent-soft); transform: translateY(-1px); }
.ghost-btn.round { width: 32px; padding: 0; justify-content: center; }
.ws-head .ghost-btn { height: 27px; padding: 0 9px; font-size: 9px; }
.workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 11px;
  border-radius: 22px;
  border: 1px solid rgba(var(--accent-rgb), .09);
  background:
    radial-gradient(60% 70% at 50% 48%, rgba(var(--accent-rgb), .075), transparent 78%),
    linear-gradient(160deg, rgba(255, 255, 255, .03), transparent 45%),
    rgba(2, 13, 20, .10);
  overflow: hidden;
  touch-action: none;
  transition: border-color .3s, background .3s;
}
body[data-theme="light"] .workspace { background: rgba(255, 255, 255, .18); }
.workspace.drag-over { border-color: rgba(var(--accent-rgb), .32); background-color: rgba(var(--accent-rgb), .06); }
.workspace-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), .055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 80% at 50% 50%, #000, transparent 88%);
  -webkit-mask-image: radial-gradient(75% 80% at 50% 50%, #000, transparent 88%);
  pointer-events: none;
}
.workspace-rings {
  position: absolute;
  z-index: 1;
  left: 50%; top: 50%;
  width: min(46vh, 380px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .6;
}
.ws-scene-art {
  position: absolute;
  inset: -8%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: .52;
  filter: saturate(.9);
  mask-image: radial-gradient(80% 85% at 50% 50%, #000 24%, transparent 92%);
  -webkit-mask-image: radial-gradient(80% 85% at 50% 50%, #000 24%, transparent 92%);
}
.ws-emblem {
  position: absolute;
  z-index: 1;
  right: -1.5%;
  bottom: -7%;
  width: min(39%, 480px);
  aspect-ratio: 1.38;
  color: var(--accent);
  opacity: .30;
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), .25));
  transition: color .8s var(--ease), opacity .8s var(--ease);
}
.ws-emblem svg { width: 100%; height: 100%; display: block; overflow: visible; }
body[data-world="origin"] .ws-emblem { opacity: .36; }
body[data-world="tide"] .ws-emblem { opacity: .34; }
body[data-world="verdant"] .ws-emblem { opacity: .34; }
body[data-world="ember"] .ws-emblem { opacity: .36; }
body[data-world="skylife"] .ws-emblem { opacity: .34; }
body[data-world="gears"] .ws-emblem { opacity: .38; }
body[data-world="myth"] .ws-emblem { opacity: .36; }
body[data-world="neon"] .ws-emblem { opacity: .38; }
body[data-world="star"] .ws-emblem { opacity: .38; }
body[data-world="genesis"] .ws-emblem { opacity: .4; }
.workspace-rings i {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), .10);
}
.workspace-rings i:nth-child(2) { inset: 16%; border-style: dashed; animation: rune-spin 90s linear infinite; }
.workspace-rings i:nth-child(3) { inset: 33%; border-color: rgba(var(--accent-rgb), .07); }
.ws-empty {
  position: absolute;
  z-index: 2;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  padding: 20px;
  text-align: center;
  transition: opacity .35s, transform .35s;
  pointer-events: none;
}
.ws-empty.hidden { opacity: 0; transform: translate(-50%, -46%); }
.empty-sigil {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), .22);
  background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .15), transparent 60%), var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 28px rgba(var(--accent-rgb), .1);
  animation: sigil-float 5s ease-in-out infinite;
}
.empty-sigil span { font-family: var(--font-display); font-size: 24px; font-weight: 300; }
.empty-title { font-family: var(--font-display); font-size: clamp(15px, 1.5vw, 18px); letter-spacing: .12em; color: var(--ink); }
.empty-sub { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .03em; }
.empty-actions { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; color: var(--faint); font-size: 8.5px; letter-spacing: .04em; }
.empty-actions i { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.ws-dropcue {
  position: absolute;
  z-index: 5;
  left: 50%; bottom: 18px;
  transform: translate(-50%, 8px);
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), .25);
  background: var(--panel-strong);
  color: var(--accent);
  font-size: 9px;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
  transition: .25s var(--ease);
  white-space: nowrap;
}
.ws-dropcue.show { opacity: 1; transform: translate(-50%, 0); }
.ws-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 7px;
  padding: 10px 19px 11px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .02em;
}
.ws-foot b { color: var(--muted); font-weight: 500; }
.ws-foot-sep { opacity: .5; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 16px; height: 16px;
  margin: 0 1px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(var(--accent-rgb), .04);
  color: var(--muted);
  font: 9px var(--font-ui);
}

/* ============================================================
   元素卡片质感
   ============================================================ */
.el-card {
  --c1: #2e5a72;
  --c2: #173747;
  --c3: #0a1f2a;
  --glow: rgba(128, 215, 255, .45);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  aspect-ratio: .94;
  padding: 7px 5px 6px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, .25);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .22), transparent 28%),
    radial-gradient(120% 110% at 18% 0%, var(--c1), var(--c2) 54%, var(--c3) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -9px 20px rgba(0, 0, 0, .24),
    0 6px 14px rgba(0, 0, 0, .22),
    0 0 0 1px rgba(0, 0, 0, .09);
  overflow: hidden;
  transform: translateZ(0);
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease), filter .3s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}
.el-card::before {
  content: "";
  position: absolute;
  inset: -55% -25% auto;
  height: 92%;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 255, 255, .44), transparent 56%);
  transform: rotate(-9deg);
  pointer-events: none;
  transition: transform .55s var(--ease), opacity .3s;
  opacity: .7;
}
.el-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  background-size: 110px 110px;
  opacity: .07;
  pointer-events: none;
}
.ws-chip .el-card::after, .drag-ghost .el-card::after { mix-blend-mode: overlay; opacity: .12; }
.el-card:hover {
  transform: translateY(-4px) rotateX(2deg) rotateZ(-.4deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -9px 20px rgba(0, 0, 0, .22),
    0 13px 28px rgba(0, 0, 0, .28),
    0 0 24px var(--glow);
}
.el-card:hover::before { transform: rotate(-9deg) translateY(8%); opacity: .95; }
.el-card:active { cursor: grabbing; transform: scale(.97); }
.el-emoji {
  position: relative;
  z-index: 1;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(24px, 2.5vw, 33px);
  line-height: 1.05;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .32));
  transform: translateZ(8px);
  pointer-events: none;
}
.el-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: .08em;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  pointer-events: none;
}
.el-rarity {
  position: absolute;
  z-index: 2;
  left: 7px;
  bottom: 5px;
  display: flex;
  gap: 2px;
  opacity: .72;
  pointer-events: none;
}
.el-rarity i {
  width: 2.5px; height: 2.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 4px rgba(255, 255, 255, .55);
}
.el-new {
  position: absolute;
  z-index: 3;
  right: 6px; top: 6px;
  padding: 2px 5px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-num);
  font-size: 6.5px;
  letter-spacing: .07em;
  font-weight: 700;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .24);
  pointer-events: none;
}
.el-final {
  border-color: rgba(255, 226, 151, .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 -10px 24px rgba(0, 0, 0, .25),
    0 0 0 1px rgba(255, 219, 128, .22),
    0 8px 28px rgba(255, 198, 83, .22);
}
.el-final::before {
  background: radial-gradient(ellipse at 50% 8%, rgba(255, 240, 182, .7), transparent 58%);
}
.el-final .el-name { color: #fff3c9; }
.el-final .el-emoji { filter: drop-shadow(0 0 12px rgba(255, 218, 123, .65)) drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
.el-final-badge {
  position: absolute;
  z-index: 3;
  right: 5px; top: 5px;
  font-family: var(--font-display);
  color: #ffe9a4;
  font-size: 8px;
  letter-spacing: .04em;
  text-shadow: 0 0 10px rgba(255, 212, 116, .7);
}
.el-seed {
  position: absolute;
  z-index: 3;
  right: 6px; bottom: 5px;
  color: rgba(255, 255, 255, .48);
  font-size: 6px;
  letter-spacing: .03em;
}
.el-locked {
  background: rgba(255, 255, 255, .04);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  cursor: default;
  color: var(--faint);
}
.el-locked::before, .el-locked::after { display: none; }
.el-locked .el-emoji { filter: grayscale(1); opacity: .2; }
.el-locked .el-name { color: var(--faint); font-family: var(--font-ui); letter-spacing: .12em; }
.el-locked:hover { transform: none; box-shadow: none; }

/* 合成台上的卡片 */
.ws-chip {
  position: absolute;
  z-index: 3;
  width: 82px;
  transform: translate(-50%, -50%);
  touch-action: none;
  animation: card-land .42s var(--ease-spring) both;
}
/* 合成产物：生成时带一次弹出，不再有从卡堆里“飞出来”的落位动画 */
.ws-chip.pop-in { animation: chip-pop .34s var(--ease-spring) both; }
.ws-chip.pop-in .el-card::before { animation: card-sheen .9s var(--ease) .06s both; }
.ws-chip .el-card { cursor: grab; }
.ws-chip.is-dragging { opacity: 0; pointer-events: none; }
.ws-chip.is-selected .el-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -9px 20px rgba(0, 0, 0, .22),
    0 0 0 2px var(--accent),
    0 0 30px rgba(var(--accent-rgb), .48);
  transform: translateY(-3px) scale(1.03);
}
.ws-chip.is-target .el-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 0 0 2px var(--accent-2),
    0 0 40px rgba(var(--accent-rgb), .65);
  transform: scale(1.13) rotate(2deg);
}
.ws-chip.is-merging { animation: chip-merge .42s var(--ease) both; pointer-events: none; }
.ws-chip.is-failing { animation: chip-shake .42s var(--ease) both; }
.ws-chip.is-moving { transition: left .45s var(--ease-spring), top .45s var(--ease-spring); }
.lib-card.dragging { visibility: hidden; opacity: 0; pointer-events: none; }
/* 拖拽开始瞬间：原卡立刻变淡并交出点击，避免万一残留一张“半透明原卡” */
.lib-card.drag-from, .ws-chip.drag-from {
  pointer-events: none !important;
  opacity: .35 !important;
  filter: saturate(.4) !important;
}
.lib-card.hint-pulse { animation: hint-pulse 1.2s ease-in-out 4; }
.wiki-card.hint-pulse { animation: hint-pulse 1.2s ease-in-out 4; }
.drag-ghost {
  position: fixed;
  z-index: 500;
  left: 0;
  top: 0;
  width: var(--gw, 84px);
  pointer-events: none;
  transform: translate3d(0, 0, 0) rotate(2deg) scale(1.03);
  transform-origin: center;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .38));
  will-change: transform;
  opacity: 1;
}
.drag-ghost .el-card { transform: none; }
.drag-ghost .el-card::before { opacity: 1; }
body.is-dragging .world-decor *,
body.is-dragging .ws-scene-art *,
body.is-dragging .ws-emblem *,
body.is-dragging .world-orb {
  animation-play-state: paused !important;
}
body.is-dragging .el-card { cursor: grabbing; }
body:not([data-view="craft"]) .world-decor *,
body:not([data-view="craft"]) .ws-scene-art *,
body:not([data-view="craft"]) .ws-emblem *,
body:not([data-view="craft"]) .world-orb,
body:not([data-view="craft"]) .world-haze {
  animation-play-state: paused !important;
}

/* ============================================================
   元素匣
   ============================================================ */
.library-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 16px 48px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .13);
  animation: panel-in .95s .34s var(--ease-spring) both;
}
.lib-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 15px 16px 10px;
}
.lib-title { display: flex; align-items: center; gap: 9px; }
.lib-glyph {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}
.lib-title h3 { font-family: var(--font-display); font-size: 15px; letter-spacing: .15em; font-weight: 500; }
.lib-title p { color: var(--muted); font-size: 9px; margin-top: 2px; letter-spacing: .03em; }
.lib-tabs {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(var(--accent-rgb), .03);
}
.lib-tabs button {
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: .05em;
  transition: .2s;
  white-space: nowrap;
}
.lib-tabs button.active { color: var(--accent-ink); background: var(--accent); box-shadow: 0 2px 8px rgba(var(--accent-rgb), .2); }
.lib-search-wrap {
  flex: 0 0 auto;
  position: relative;
  display: flex; align-items: center;
  margin: 0 15px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 10, 16, .09);
  transition: .25s;
}
body[data-world="origin"] .lib-search-wrap { background: rgba(255, 255, 255, .30); }
.lib-search-wrap:focus-within { border-color: rgba(var(--accent-rgb), .42); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .06); }
.search-glyph { position: absolute; left: 10px; top: 50%; transform: translateY(-52%); color: var(--faint); font-size: 14px; pointer-events: none; }
.search-input {
  width: 100%;
  height: 33px;
  padding: 0 30px 0 29px;
  background: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: .03em;
}
.search-input::placeholder { color: var(--faint); }
.search-clear {
  position: absolute; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
}
.search-clear:hover { color: var(--ink); background: var(--accent-soft); }
.lib-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 13px 12px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.lib-scroll::-webkit-scrollbar { width: 5px; }
.lib-scroll::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 99px; }
.lib-scroll, .workspace { -webkit-overflow-scrolling: touch; }
@media (pointer: coarse) {
  .lib-card, .ws-chip, .el-card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .lib-card:active { transform: translateY(-1px) scale(.965); }
  .ws-chip { touch-action: none; }
}
.lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; align-content: start; }
.lib-card { border-radius: 15px; padding: 6px 4px 5px; gap: 3px; }
.lib-card .el-emoji { font-size: clamp(23px, 2.3vw, 30px); }
.lib-card .el-name { font-size: 9.5px; }
.lib-empty { padding: 36px 10px; text-align: center; color: var(--faint); font-size: 10px; }
.lib-empty span { display: block; font-size: 24px; margin-bottom: 8px; opacity: .5; }
.lib-foot {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .04em;
}
.lib-foot b { color: var(--muted); font-weight: 500; }
.lib-gift { color: var(--accent); }

/* ============================================================
   底部界面坞
   ============================================================ */
.dock {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--panel-strong);
  box-shadow: 0 18px 50px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: dock-in 1s .42s var(--ease-spring) both;
}
.dock-item {
  position: relative;
  width: 69px;
  height: 47px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 17px;
  color: var(--muted);
  transition: .22s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.dock-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; transition: .22s; }
.dock-item span { font-size: 8.5px; letter-spacing: .1em; }
.dock-item:hover { color: var(--ink); background: rgba(var(--accent-rgb), .06); }
.dock-item.is-active { color: var(--accent); background: var(--accent-soft); }
.dock-item.is-active svg { transform: translateY(-1px); filter: drop-shadow(0 0 7px rgba(var(--accent-rgb), .35)); }
.dock-badge {
  position: absolute;
  top: 4px; right: 15px;
  min-width: 13px;
  padding: 1px 3px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-num);
  font-size: 6.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}
.dock-lock {
  position: absolute;
  top: 4px; right: 11px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel-strong);
  color: var(--faint);
  font-size: 6.5px;
  font-weight: 500;
  line-height: 1.4;
}
.dock-lock.unlocked { display: none; }

/* ============================================================
   页面视图
   ============================================================ */
.page-view {
  position: fixed;
  inset: 0;
  z-index: 35;
  padding: 98px 22px 99px 96px;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, rgba(2, 8, 14, .12), rgba(2, 8, 14, .3));
  animation: page-in .35s var(--ease) both;
}
.page-panel {
  width: 100%;
  max-width: 1320px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.page-head {
  flex: 0 0 auto;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px;
  padding: 22px 26px 17px;
  border-bottom: 1px solid var(--line);
}
.page-kicker { display: block; font-family: var(--font-num); font-size: 8px; letter-spacing: .3em; color: var(--accent); margin-bottom: 4px; }
.page-title h2 { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; letter-spacing: .12em; line-height: 1.15; }
.page-title p { color: var(--muted); font-size: 10.5px; margin-top: 5px; letter-spacing: .03em; }
.page-head-right { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.page-stat { text-align: right; display: flex; flex-direction: column; }
.page-stat b { font-family: var(--font-num); font-size: 18px; font-weight: 500; letter-spacing: .04em; color: var(--ink); }
.page-stat span { color: var(--faint); font-size: 8px; letter-spacing: .1em; margin-top: 1px; }
.page-search {
  display: flex; align-items: center; gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: rgba(var(--accent-rgb), .04);
}
.page-search span { color: var(--faint); font-size: 14px; }
.page-search input { width: 160px; border: 0; outline: 0; background: none; color: var(--ink); font-size: 10px; }
.page-search input::placeholder { color: var(--faint); }
.page-filter-row {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 11px 26px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.chip-tabs { display: flex; gap: 4px; flex-wrap: nowrap; }
.chip-tabs button {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 99px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: .2s;
}
.chip-tabs button:hover { color: var(--ink); border-color: var(--line); }
.chip-tabs button.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 3px 10px rgba(var(--accent-rgb), .18); }
.page-mini-tabs { padding: 2px; border: 1px solid var(--line); border-radius: 99px; }
.page-mini-tabs button.active { background: rgba(var(--accent-rgb), .15); color: var(--accent); border-color: transparent; box-shadow: none; }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 18px 26px 28px; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.page-scroll::-webkit-scrollbar { width: 6px; }
.page-scroll::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 99px; }

/* 图鉴 */
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 10px; }
.wiki-card { border-radius: 16px; }
.wiki-card.unknown { cursor: default; }
.wiki-card.unknown:hover { transform: none; }
.wiki-card.unknown .el-emoji { opacity: .15; filter: grayscale(1) blur(1px); }
.wiki-card.unknown .el-name { color: rgba(255, 255, 255, .4); font-size: 8.5px; }
.wiki-era {
  position: absolute;
  z-index: 2;
  left: 6px; top: 6px;
  padding: 1px 4px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .25);
  color: rgba(255, 255, 255, .6);
  font-family: var(--font-num);
  font-size: 6px;
  letter-spacing: .04em;
}
.wiki-card.unknown .wiki-era { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.wiki-group-title {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 2px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .16em;
}
.wiki-group-title::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* 成就 */
.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ach-card {
  position: relative;
  display: flex; gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), .025);
  overflow: hidden;
  transition: .25s var(--ease);
}
.ach-card:hover { border-color: var(--line-strong); background: rgba(var(--accent-rgb), .05); transform: translateY(-2px); }
.ach-medal {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, .05);
  font-size: 19px;
  filter: grayscale(1); opacity: .42;
  transition: .3s;
}
.ach-card.done .ach-medal {
  filter: none; opacity: 1;
  border-color: rgba(var(--accent-rgb), .35);
  background: var(--accent-soft);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), .12);
}
.ach-card.done { border-color: rgba(var(--accent-rgb), .22); background: linear-gradient(110deg, rgba(var(--accent-rgb), .08), transparent 60%); }
.ach-info { min-width: 0; flex: 1; }
.ach-top { display: flex; align-items: center; gap: 7px; }
.ach-top h4 { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: .07em; }
.ach-cat { color: var(--faint); font-size: 7px; letter-spacing: .08em; padding: 1px 5px; border: 1px solid var(--line); border-radius: 99px; }
.ach-card.done .ach-cat { color: var(--accent); border-color: rgba(var(--accent-rgb), .25); }
.ach-info p { margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
.ach-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ach-progress { flex: 1; height: 3px; border-radius: 99px; background: rgba(var(--accent-rgb), .09); overflow: hidden; }
.ach-progress i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .5s var(--ease); }
.ach-num { font-family: var(--font-num); font-size: 8px; color: var(--faint); letter-spacing: .03em; white-space: nowrap; }
.ach-card.done .ach-num { color: var(--accent); }
.ach-done-mark {
  position: absolute;
  right: 11px; top: 11px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  opacity: 0;
  transition: .3s;
}
.ach-card.done .ach-done-mark { opacity: 1; }

/* 排行榜 */
.rank-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; }
.rank-main { min-height: 0; display: flex; flex-direction: column; padding: 18px 26px 20px; }
.rank-head-row { display: grid; grid-template-columns: 54px 1fr 90px; gap: 10px; padding: 0 13px 8px; color: var(--faint); font-size: 8px; letter-spacing: .12em; }
.rank-head-row span:last-child { text-align: right; }
.rank-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.rank-row {
  display: grid;
  grid-template-columns: 54px 1fr 90px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 13px;
  border-top: 1px solid var(--line);
  transition: .2s;
}
.rank-row:hover { background: rgba(var(--accent-rgb), .04); }
.rank-row:last-child { border-bottom: 1px solid var(--line); }
.rank-no { font-family: var(--font-num); font-size: 16px; color: var(--faint); }
.rank-row.top1 .rank-no { color: #d9a842; }
.rank-row.top2 .rank-no { color: #9baab7; }
.rank-row.top3 .rank-no { color: #b67b53; }
.rank-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rank-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--accent-soft); }
.rank-avatar.fallback { display: grid; place-items: center; color: var(--accent); font-size: 12px; }
.rank-name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { text-align: right; font-family: var(--font-num); font-size: 15px; color: var(--ink); }
.rank-score small { font-family: var(--font-ui); font-size: 7px; color: var(--faint); margin-left: 3px; }
.rank-note { margin-top: 9px; color: var(--faint); font-size: 8px; line-height: 1.6; }
.rank-empty { padding: 46px 15px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.9; }
.rank-empty b { color: var(--ink); }
.rank-me {
  padding: 20px;
  border-left: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(var(--accent-rgb), .065), transparent 55%);
  overflow-y: auto;
}
.rank-me h3 { font-family: var(--font-display); font-size: 17px; letter-spacing: .1em; font-weight: 500; }
.rank-me p { color: var(--muted); font-size: 9px; line-height: 1.65; margin-top: 6px; }
.rank-me .me-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  margin-bottom: 12px;
  border: 1px solid var(--line-strong);
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 24px; color: var(--accent);
  overflow: hidden;
}
.rank-me .me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-me-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.rank-me-stat { padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0, 0, 0, .03); }
.rank-me-stat b { display: block; font-family: var(--font-num); font-size: 18px; font-weight: 500; }
.rank-me-stat span { color: var(--faint); font-size: 7.5px; letter-spacing: .05em; }
.rank-me .ghost-btn, .rank-me .primary-btn { width: 100%; margin-top: 8px; }
.rank-offline {
  margin: 0 26px 18px;
  padding: 11px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
  background: rgba(var(--accent-rgb), .03);
}

/* 主题 */
.theme-locked {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 18px 26px 24px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb), .09), transparent 57%),
    linear-gradient(140deg, rgba(255, 255, 255, .05), transparent 55%);
}
.theme-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(54vh, 540px);
  aspect-ratio: 1;
  border: 1px dashed rgba(var(--accent-rgb), .2);
  border-radius: 50%;
  animation: rune-spin 110s linear infinite;
  pointer-events: none;
}
.theme-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(36vh, 360px);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--accent-rgb), .12);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(var(--accent-rgb), .06) inset;
  pointer-events: none;
}
.theme-locked > * { position: relative; z-index: 1; }
.theme-lock-sigil {
  width: 70px; height: 70px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border: 1px solid rgba(var(--accent-rgb), .28);
  border-radius: 50%;
  color: var(--accent);
  font-size: 28px;
  background: radial-gradient(circle at 34% 27%, rgba(255, 255, 255, .18), transparent 55%), var(--accent-soft);
  box-shadow: 0 0 40px rgba(var(--accent-rgb), .12);
  animation: sigil-float 6s ease-in-out infinite;
}
.theme-locked h3 { font-family: var(--font-display); font-size: clamp(22px, 2.3vw, 28px); letter-spacing: .1em; font-weight: 500; }
.theme-locked p { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.theme-lock-bar { width: min(320px, 80%); height: 4px; margin: 18px auto 7px; border-radius: 99px; background: rgba(var(--accent-rgb), .12); overflow: hidden; }
.theme-lock-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .7s var(--ease); }
.theme-locked > span { color: var(--faint); font-size: 8.5px; letter-spacing: .06em; }
.theme-follow-actions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.theme-follow-actions .primary-btn, .theme-follow-actions .ghost-btn { height: 37px; }
.theme-follow-actions .ghost-btn[hidden] { display: none; }
.theme-follow-note { max-width: 440px; margin: 10px auto 0 !important; font-size: 8.5px !important; line-height: 1.7 !important; color: var(--faint) !important; letter-spacing: .02em; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.theme-card {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(0, 0, 0, .08);
  text-align: left;
  transition: .3s var(--ease);
}
.theme-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 16px 34px var(--shadow-tint); }
.theme-preview {
  position: relative;
  height: 104px;
  overflow: hidden;
  background: var(--theme-preview, linear-gradient(160deg, #325, #123));
}
.theme-preview::before {
  content: "";
  position: absolute;
  width: 72%; aspect-ratio: 1;
  top: -36%; right: -12%;
  border-radius: 50%;
  background: var(--theme-glow, radial-gradient(circle, rgba(255, 255, 255, .8), transparent 65%));
  filter: blur(2px);
}
.theme-preview::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(3, 9, 15, .45)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .04) 0 1px, transparent 1px 22px);
}
.theme-mini-cloud {
  position: absolute;
  left: 10%; bottom: 18%;
  width: 40%; height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  filter: blur(6px);
}
.theme-card-body { padding: 12px 14px 14px; }
.theme-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-card-top h4 { font-family: var(--font-display); font-size: 15px; font-weight: 500; letter-spacing: .08em; }
.theme-card-top span { font-family: var(--font-num); font-size: 8px; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
.theme-card-body p { color: var(--muted); font-size: 9px; margin-top: 4px; line-height: 1.5; }
.theme-check {
  position: absolute; right: 12px; top: 12px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(2, 8, 15, .25);
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transform: scale(.8);
  transition: .3s;
}
.theme-card.selected .theme-check { opacity: 1; transform: scale(1); }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .16), 0 16px 40px var(--shadow-tint); }
.theme-card.auto .theme-preview { background: linear-gradient(135deg, #77cdea, #315e83 40%, #172538 75%, #0c1622); }
.theme-card.auto .theme-preview::before { background: radial-gradient(circle, rgba(255, 245, 194, .8), transparent 68%); }
.theme-card.locked { opacity: .45; pointer-events: none; filter: grayscale(.55); cursor: not-allowed; }
.theme-unreached {
  position: absolute;
  z-index: 2;
  left: 12px; top: 12px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 99px;
  background: rgba(3, 8, 15, .45);
  color: rgba(255, 255, 255, .72);
  font-size: 8px;
  letter-spacing: .07em;
}
.theme-unreached:empty { display: none; }

/* ============================================================
   通用按钮 / 弹窗
   ============================================================ */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px;
  padding: 0 17px;
  border-radius: 99px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 45%),
    linear-gradient(120deg, var(--accent), var(--accent-2));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 45%),
    linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--accent-2)));
  color: var(--accent-ink);
  box-shadow: 0 7px 20px rgba(var(--accent-rgb), .23), inset 0 1px 0 rgba(255, 255, 255, .35);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  transition: .24s var(--ease);
  white-space: nowrap;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 27px rgba(var(--accent-rgb), .32), inset 0 1px 0 rgba(255, 255, 255, .4); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.small { height: 33px; padding: 0 13px; font-size: 9px; }
.primary-btn.wide { width: 100%; }
.primary-btn i { font-style: normal; font-family: var(--font-display); }
.danger-btn {
  height: 38px;
  padding: 0 17px;
  border-radius: 99px;
  border: 1px solid rgba(194, 74, 63, .36);
  background: rgba(194, 74, 63, .12);
  color: #e47c6e;
  font-size: 11px;
  letter-spacing: .06em;
  transition: .25s;
}
.danger-btn:hover:not(:disabled) { background: rgba(194, 74, 63, .2); }
.danger-btn:disabled { opacity: .55; cursor: not-allowed; }
.ghost-btn.wide { width: 100%; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: modal-in .3s var(--ease) both;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, .54);
  backdrop-filter: blur(15px) saturate(.9);
  -webkit-backdrop-filter: blur(15px) saturate(.9);
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px 29px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .09), transparent 36%),
    var(--panel-strong);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .3);
  backdrop-filter: blur(30px) saturate(1.3);
  -webkit-backdrop-filter: blur(30px) saturate(1.3);
  animation: modal-card-in .45s var(--ease-spring) both;
}
.modal-card::before {
  content: "";
  position: absolute; top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .55), transparent);
}
.modal-x {
  position: absolute;
  top: 12px; right: 14px;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition: .2s;
}
.modal-x:hover { color: var(--ink); background: var(--accent-soft); border-color: var(--line-strong); }
.modal-x.light { border-color: rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .6); }
.modal-eyebrow {
  text-align: center;
  font-family: var(--font-num);
  font-size: 8px;
  letter-spacing: .3em;
  color: var(--accent);
  margin-bottom: 9px;
}
.modal-card h2 { text-align: center; font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: .1em; }
.modal-card > p { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 10.5px; line-height: 1.8; }
.modal-actions { display: flex; gap: 9px; justify-content: stretch; margin-top: 20px; }
.modal-actions > * { flex: 1; }
.modal-footnote { display: block; margin-top: 13px; text-align: center; color: var(--faint); font-size: 8px; line-height: 1.6; letter-spacing: .02em; }

.bind-card { width: min(410px, 100%); padding-top: 34px; }
.bind-orbit {
  position: relative;
  width: 92px; height: 92px;
  margin: 0 auto 17px;
  display: grid; place-items: center;
}
.bind-orbit span {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .3), transparent 55%), var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), .3);
  color: var(--accent);
  font-size: 23px;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), .15);
}
.bind-orbit i {
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(var(--accent-rgb), .28);
  border-radius: 50%;
  animation: rune-spin 24s linear infinite;
}
.bind-orbit i:last-child { inset: 15px; border-style: solid; opacity: .46; animation-direction: reverse; animation-duration: 16s; }
.bind-features { display: flex; justify-content: center; gap: 7px; margin-top: 17px; }
.bind-features span {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .04em;
}
.bind-features i { font-style: normal; color: var(--accent); font-size: 10px; }

/* 账号 */
.account-card { width: min(460px, 100%); }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 15px 0 17px; }
.profile-avatar {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h2 { text-align: left; font-size: 20px; }
.profile-head p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.profile-stats div { padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(var(--accent-rgb), .025); text-align: center; }
.profile-stats b { display: block; font-family: var(--font-num); font-size: 18px; font-weight: 500; color: var(--ink); }
.profile-stats span { color: var(--faint); font-size: 7.5px; letter-spacing: .04em; }
.profile-cloud {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.65;
}
.profile-cloud b { color: var(--accent); font-weight: 500; }

/* 详情 */
.detail-card { width: min(480px, 100%); padding: 25px; }
.detail-hero { display: flex; align-items: center; gap: 17px; margin-bottom: 17px; }
.detail-emblem {
  width: 94px; height: 94px;
  flex: 0 0 auto;
  border-radius: 22px;
  display: grid; place-items: center;
  font-size: 43px;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 12px 28px rgba(0, 0, 0, .26);
  background: var(--emblem, linear-gradient(145deg, #315c7a, #10232f));
}
.detail-kicker { color: var(--accent); font-family: var(--font-num); font-size: 8px; letter-spacing: .25em; }
.detail-hero h2 { text-align: left; margin-top: 4px; font-size: 26px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.detail-meta span { padding: 2px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 7.5px; letter-spacing: .04em; }
.detail-desc { color: var(--muted); font-size: 10.5px; line-height: 1.85; margin-bottom: 15px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
.detail-section h4 { font-family: var(--font-display); font-size: 11px; font-weight: 500; letter-spacing: .12em; color: var(--muted); margin-bottom: 9px; }
.recipe-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.recipe-part { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(var(--accent-rgb), .03); font-size: 9px; }
.recipe-part i { font-style: normal; font-size: 14px; }
.recipe-plus, .recipe-eq { color: var(--faint); font-size: 10px; }
.recipe-result { color: var(--accent); border-color: rgba(var(--accent-rgb), .22); }
.detail-locked { color: var(--faint); font-size: 9.5px; line-height: 1.7; }
.detail-quote { margin-top: 15px; padding-left: 13px; border-left: 2px solid rgba(var(--accent-rgb), .3); color: var(--muted); font-family: var(--font-display); font-size: 11px; line-height: 1.8; letter-spacing: .04em; }

/* 考核 */
.exam-modal { z-index: 325; }
.exam-modal .modal-backdrop { background: rgba(4, 4, 9, .72); }
.exam-card {
  --exam-gold: #edc275;
  position: relative;
  width: min(470px, 100%);
  max-height: calc(100vh - 30px);
  overflow: auto;
  padding: 36px 30px 24px;
  text-align: center;
  color: #f8f1e6;
  border: 1px solid rgba(238, 198, 124, .32);
  border-radius: 28px;
  background:
    radial-gradient(70% 45% at 50% 5%, rgba(231, 184, 90, .18), transparent 65%),
    radial-gradient(50% 35% at 50% 100%, rgba(110, 64, 169, .22), transparent 68%),
    linear-gradient(160deg, #16131c, #0b0a13 60%, #090810);
  box-shadow: 0 0 0 1px rgba(255, 220, 156, .07), 0 40px 110px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .14);
  animation: exam-card-in .65s var(--ease-spring) both;
}
.exam-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  padding: 1px;
  background: conic-gradient(from 0deg, transparent 0 18%, rgba(255, 219, 148, .7) 25%, transparent 33%, transparent 62%, rgba(191, 139, 255, .55) 72%, transparent 82%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: border-rotate 8s linear infinite;
}
.exam-card::after {
  content: "";
  position: absolute; inset: 0; border-radius: 28px;
  background-image: radial-gradient(rgba(255, 237, 194, .26) .6px, transparent .8px);
  background-size: 27px 27px;
  opacity: .3;
  pointer-events: none;
  mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent 85%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent 85%);
}
.exam-rings { position: absolute; left: 50%; top: 47%; width: 330px; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; opacity: .5; }
.exam-rings i { position: absolute; inset: 0; border: 1px solid rgba(232, 196, 123, .35); border-radius: 50%; }
.exam-rings i:nth-child(1) { transform: rotateX(62deg) rotateZ(0); animation: exam-ring 12s linear infinite; }
.exam-rings i:nth-child(2) { inset: 15%; transform: rotateY(62deg) rotateZ(0); border-color: rgba(200, 160, 255, .26); animation: exam-ring 17s linear reverse infinite; }
.exam-rings i:nth-child(3) { inset: 30%; border-style: dashed; border-color: rgba(255, 228, 161, .3); animation: exam-ring 9s linear infinite; }
.exam-eyebrow { position: relative; z-index: 1; color: rgba(237, 194, 117, .7); font-family: var(--font-num); font-size: 8px; letter-spacing: .22em; }
.exam-small { position: relative; z-index: 1; margin-top: 25px; color: rgba(255, 238, 211, .52); font-size: 10px; letter-spacing: .28em; }
.exam-card h2 { position: relative; z-index: 1; margin-top: 8px; font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: .12em; line-height: 1.5; }
.exam-card h2 span { color: #ffe4a3; text-shadow: 0 0 26px rgba(255, 207, 113, .35); font-size: 38px; letter-spacing: .15em; }
.exam-element {
  position: relative;
  z-index: 1;
  width: 112px; height: 112px;
  margin: 14px auto 13px;
  display: grid; place-items: center;
  font-size: 53px;
  border-radius: 28px;
  border: 1px solid rgba(255, 220, 152, .32);
  background: radial-gradient(circle at 38% 26%, rgba(255, 255, 255, .2), transparent 52%), rgba(55, 40, 31, .46);
  box-shadow: 0 0 55px rgba(235, 185, 90, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
  animation: exam-element-float 5s ease-in-out infinite;
}
.exam-desc { position: relative; z-index: 1; width: 92%; margin: 0 auto; color: rgba(245, 232, 214, .68); font-size: 10.5px; line-height: 1.8; text-wrap: balance; }
.exam-clue { position: relative; z-index: 1; width: 82%; margin: 18px auto 0; padding: 12px; border: 1px solid rgba(238, 198, 124, .18); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.exam-clue-label { display: block; color: rgba(237, 199, 126, .55); font-size: 8px; letter-spacing: .18em; margin-bottom: 8px; }
.exam-ingredients { display: flex; align-items: center; justify-content: center; gap: 7px; }
.exam-ing { display: flex; align-items: center; gap: 4px; color: #f1dfc1; font-size: 10px; }
.exam-ing i { font-style: normal; font-size: 16px; }
.exam-ingredients .clue-x { color: rgba(255, 231, 190, .45); font-size: 10px; }
.exam-actions { position: relative; z-index: 1; display: flex; gap: 9px; margin-top: 19px; }
.exam-actions > * { flex: 1; }
.exam-actions .ghost-btn { border-color: rgba(238, 198, 124, .2); color: rgba(255, 235, 202, .64); }
.exam-actions .primary-btn {
  background: linear-gradient(120deg, #dfb262, #ffe4a1 50%, #ce9744);
  color: #2b1a06;
  border-color: rgba(255, 227, 164, .6);
  box-shadow: 0 8px 28px rgba(218, 159, 61, .25);
}
.exam-card .modal-footnote { color: rgba(255, 238, 211, .33); }

/* 最终完成 */
.finale-modal { z-index: 330; overflow: hidden; background: rgba(2, 4, 10, .73); backdrop-filter: blur(10px); }
.finale-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(230, 193, 115, .18), transparent 64%),
    radial-gradient(40% 40% at 50% 80%, rgba(123, 198, 255, .1), transparent 70%);
  animation: finale-bg-in 1.4s var(--ease) both;
}
.finale-rays {
  position: absolute; left: 50%; top: 48%;
  width: 1200px; height: 1200px;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 225, 167, .08) 0deg .4deg, transparent .4deg 12deg);
  mask-image: radial-gradient(circle, #000 0 22%, transparent 64%);
  -webkit-mask-image: radial-gradient(circle, #000 0 22%, transparent 64%);
  animation: finale-rays 60s linear infinite;
  opacity: .8;
}
.finale-card {
  position: relative;
  z-index: 1;
  width: min(450px, 100%);
  padding: 25px 28px 22px;
  text-align: center;
  border: 1px solid rgba(255, 223, 157, .24);
  border-radius: 28px;
  background:
    radial-gradient(65% 40% at 50% 0%, rgba(255, 216, 133, .16), transparent 60%),
    linear-gradient(160deg, rgba(30, 25, 31, .92), rgba(9, 9, 15, .92));
  box-shadow: 0 40px 110px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .15);
  animation: finale-card-in .8s var(--ease-spring) both;
}
.finale-kicker { color: rgba(234, 195, 120, .66); font-family: var(--font-num); font-size: 8px; letter-spacing: .22em; }
.finale-element {
  width: 114px; height: 114px;
  margin: 15px auto 12px;
  display: grid; place-items: center;
  border-radius: 30px;
  font-size: 57px;
  border: 1px solid rgba(255, 227, 164, .48);
  background: radial-gradient(circle at 36% 25%, rgba(255, 255, 255, .26), transparent 46%), linear-gradient(145deg, #6d502e, #241b13);
  box-shadow: 0 0 60px rgba(237, 190, 96, .28), inset 0 1px 0 rgba(255, 255, 255, .33);
  animation: finale-element-float 5s ease-in-out infinite;
}
.finale-over { color: rgba(255, 237, 199, .58); font-size: 9px; letter-spacing: .26em; }
.finale-card h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: .18em;
  color: #ffedc1;
  text-shadow: 0 0 35px rgba(255, 200, 96, .25);
}
.finale-desc { margin: 9px auto 0; width: 94%; color: rgba(255, 240, 217, .68); font-size: 10.5px; line-height: 1.8; text-wrap: balance; }
.finale-card blockquote {
  margin: 14px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid rgba(255, 222, 159, .14);
  color: rgba(255, 231, 187, .48);
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: .08em;
}
.finale-actions { display: flex; gap: 8px; margin-top: 18px; }
.finale-actions > * { flex: 1; }
.finale-actions .ghost-btn { border-color: rgba(255, 224, 160, .16); color: rgba(255, 235, 199, .65); }
.finale-actions .primary-btn {
  background: linear-gradient(120deg, #dcae59, #ffe4a0 55%, #d29a42);
  color: #2d1b05;
  border-color: rgba(255, 228, 166, .55);
  box-shadow: 0 9px 30px rgba(225, 166, 68, .25);
}
.finale-foot { margin-top: 12px; color: rgba(255, 237, 200, .32); font-size: 8px; letter-spacing: .1em; }

/* 重置 */
/* 前作时空门 */
.legacy-card {
  width: min(455px, 100%);
  overflow: hidden;
  background:
    radial-gradient(60% 42% at 50% 0%, rgba(216, 176, 95, .13), transparent 65%),
    var(--panel-strong);
}
.legacy-portal {
  position: relative;
  width: 124px;
  height: 124px;
  margin: 0 auto 17px;
  display: grid;
  place-items: center;
}
.legacy-portal::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 227, 164, .16), transparent 68%);
  filter: blur(5px);
}
.legacy-portal i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(224, 187, 112, .38);
  transform: rotateX(64deg) rotateZ(0);
  animation: legacy-orbit 6.5s linear infinite;
}
.legacy-portal i:nth-child(2) {
  inset: 17px;
  border-color: rgba(143, 209, 255, .3);
  transform: rotateY(62deg) rotateZ(0);
  animation-duration: 9s;
  animation-direction: reverse;
}
.legacy-portal span {
  position: relative;
  z-index: 1;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 21px;
  border: 1px solid rgba(255, 226, 166, .42);
  background: linear-gradient(145deg, rgba(255, 255, 255, .14), transparent 40%), rgba(70, 52, 27, .46);
  color: #ffe2a3;
  font-size: 32px;
  box-shadow: 0 0 30px rgba(226, 180, 94, .18), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: sigil-float 5s ease-in-out infinite;
}
.legacy-coordinate {
  margin: 13px auto 0;
  padding: 8px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 8.5px;
  letter-spacing: .04em;
  word-break: break-all;
}
.legacy-safe { margin-top: 11px !important; color: var(--faint) !important; font-size: 8.5px !important; line-height: 1.7 !important; }
.rift.legacy .rift-ring { border-color: rgba(232, 195, 125, .35); }
.rift.legacy .rift-ring.r2 { border-color: rgba(156, 216, 255, .3); }
.rift.legacy .rift-core {
  background: radial-gradient(circle, #fff 0 4%, rgba(255, 237, 191, .9) 9%, rgba(139, 101, 211, .42) 28%, transparent 67%);
}
.rift.legacy .rift-copy h2 { color: #ffe9be; text-shadow: 0 0 40px rgba(246, 195, 104, .4); }
.rift.legacy .rift-progress i { background: linear-gradient(90deg, #e7b868, #9ddfff); box-shadow: 0 0 12px #f3ce85; }
@keyframes legacy-orbit { to { transform: rotateX(64deg) rotateZ(360deg); } }

.reset-card { width: min(410px, 100%); }
.reset-glyph {
  width: 60px; height: 60px;
  margin: 0 auto 13px;
  display: grid; place-items: center;
  border: 1px solid rgba(194, 74, 63, .26);
  border-radius: 50%;
  color: #d77366;
  font-size: 28px;
  background: rgba(194, 74, 63, .08);
}
.reset-card > p b { color: #d77366; }
.help-card { width: min(570px, 100%); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.help-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--accent-rgb), .025); }
.help-grid b { display: block; font-family: var(--font-display); font-size: 12px; letter-spacing: .06em; margin-bottom: 4px; color: var(--accent); }
.help-grid p { color: var(--muted); font-size: 9px; line-height: 1.6; }

/* ============================================================
   时空乱流过场
   ============================================================ */
.rift {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #020307;
  animation: rift-in .6s var(--ease) both;
}
.rift.out { animation: rift-out .65s var(--ease) both; }
.rift-stars { position: absolute; inset: 0; }
.rift-star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: .5;
  animation: rift-star var(--d, 3s) linear infinite;
  animation-delay: var(--de, 0s);
}
.rift-speed {
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(159, 211, 255, .14) 0deg .12deg, transparent .12deg 3deg);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 12%, #000 45%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 12%, #000 45%, transparent 80%);
  animation: rift-speed 4s linear infinite;
  opacity: .7;
}
.rift-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: min(80vw, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(174, 216, 255, .24);
  transform: translate(-50%, -50%) rotateX(64deg) rotateZ(0);
  animation: rift-ring 3.3s linear infinite;
  box-shadow: 0 0 80px rgba(105, 172, 255, .08), inset 0 0 60px rgba(159, 132, 255, .06);
}
.rift-ring.r2 { width: min(60vw, 660px); border-color: rgba(255, 176, 237, .25); animation-duration: 2.5s; animation-direction: reverse; }
.rift-ring.r3 { width: min(42vw, 470px); border-color: rgba(255, 239, 181, .25); animation-duration: 1.9s; }
.rift-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 20vw; height: 20vw;
  min-width: 100px; min-height: 100px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 4%, rgba(194, 229, 255, .9) 9%, rgba(117, 92, 204, .45) 26%, transparent 66%);
  filter: blur(2px);
  animation: rift-core 2.2s ease-in-out infinite;
}
.rift-copy { position: relative; z-index: 2; text-align: center; color: #fff; animation: rift-copy 2.8s var(--ease) both; }
.rift-kicker { font-family: var(--font-num); font-size: 9px; letter-spacing: .4em; color: rgba(198, 228, 255, .58); }
.rift-copy h2 { margin-top: 9px; font-family: var(--font-display); font-size: clamp(34px, 5vw, 58px); font-weight: 500; letter-spacing: .25em; text-indent: .25em; text-shadow: 0 0 40px rgba(164, 211, 255, .35); }
.rift-copy p { margin-top: 12px; color: rgba(220, 237, 255, .64); font-size: 11px; letter-spacing: .16em; }
.rift-progress { position: absolute; z-index: 2; left: 50%; bottom: 13%; width: min(320px, 50vw); height: 2px; transform: translateX(-50%); background: rgba(255, 255, 255, .1); overflow: hidden; border-radius: 99px; }
.rift-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #75c8ff, #ffb5ef); box-shadow: 0 0 12px #aecbff; transition: width 2.4s linear; }

/* ============================================================
   提示 / 通知 / 特效层
   ============================================================ */
.toasts {
  position: fixed;
  z-index: 300;
  bottom: 91px;
  left: 96px;
  width: min(310px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), .08), transparent 50%),
    var(--panel-strong);
  box-shadow: 0 12px 30px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .2);
  pointer-events: auto;
  animation: toast-in .5s var(--ease-spring) both;
  transition: .3s var(--ease);
  overflow: hidden;
}
.toast.out { animation: toast-out .3s var(--ease) both; }
.toast-ico {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(var(--accent-rgb), .2);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
}
.toast-copy { min-width: 0; flex: 1; }
.toast-copy b { display: block; font-family: var(--font-display); font-size: 11.5px; font-weight: 500; letter-spacing: .06em; }
.toast-copy p { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.toast.x-accent { border-color: rgba(var(--accent-rgb), .32); }
.toast.x-ach .toast-ico { color: #e2b55e; border-color: rgba(226, 181, 94, .25); background: rgba(226, 181, 94, .1); }
.toast.x-hint .toast-ico { color: var(--accent); }
.toast.x-bad .toast-ico { color: #d77366; border-color: rgba(194, 74, 63, .25); background: rgba(194, 74, 63, .09); }
.toast-close { flex: 0 0 auto; color: var(--faint); font-size: 12px; padding: 0 1px; }
.toast-close:hover { color: var(--ink); }

#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#flash {
  position: fixed;
  inset: 0;
  z-index: 94;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  mix-blend-mode: screen;
}
#flash.fire { animation: flash-burst .55s var(--ease) both; }
#flash { --flash-alpha: .5; }
#screen-shake { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body.shake .hud,
body.shake .layout,
body.shake .chapter-rail { animation: screen-shake .42s var(--ease) both; }

.hint-card {
  position: fixed;
  z-index: 310;
  left: 50%;
  bottom: 94px;
  transform: translateX(-50%);
  width: min(430px, calc(100vw - 28px));
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  border-radius: 17px;
  background:
    linear-gradient(130deg, rgba(var(--accent-rgb), .13), transparent 55%),
    var(--panel-strong);
  box-shadow: 0 20px 50px var(--shadow-tint), inset 0 1px 0 rgba(255, 255, 255, .24);
  animation: hint-in .5s var(--ease-spring) both;
}
.hint-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hint-kicker { color: var(--accent); font-size: 8px; letter-spacing: .16em; }
.hint-close { color: var(--faint); font-size: 14px; }
.hint-body { display: flex; align-items: center; gap: 9px; margin-top: 8px; flex-wrap: wrap; }
.hint-ing { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 9.5px; background: rgba(0, 0, 0, .04); }
.hint-ing i { font-style: normal; font-size: 15px; }
.hint-op { color: var(--faint); font-size: 10px; }
.hint-result { color: var(--accent); border-color: rgba(var(--accent-rgb), .25); }
.hint-text { color: var(--muted); font-size: 9.5px; line-height: 1.6; margin-top: 7px; }

/* ============================================================
   动效
   ============================================================ */
@keyframes hud-in { from { opacity: 0; transform: translateY(-14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rail-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ghost-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-land { from { opacity: 0; transform: translate(-50%, -50%) scale(.7) rotate(-4deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } }
@keyframes chip-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.42); } 45% { opacity: 1; transform: translate(-50%, -50%) scale(1.14); } 70% { transform: translate(-50%, -50%) scale(.97); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes card-sheen { 0% { transform: rotate(-9deg) translateY(-30%); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(-9deg) translateY(22%); opacity: .55; } }
@keyframes chip-merge { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1); } 38% { opacity: 1; transform: translate(-50%, -50%) scale(1.16); filter: brightness(1.8); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(8deg); filter: brightness(2.4); } }
@keyframes chip-shake { 0%, 100% { transform: translate(-50%, -50%) rotate(0); } 20% { transform: translate(calc(-50% - 4px), -50%) rotate(-2deg); } 40% { transform: translate(calc(-50% + 4px), -50%) rotate(2deg); } 60% { transform: translate(calc(-50% - 3px), -50%) rotate(-1deg); } 80% { transform: translate(calc(-50% + 3px), -50%) rotate(1deg); } }
@keyframes hint-pulse { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.42), 0 6px 14px rgba(0,0,0,.22); } 45% { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 3px var(--accent), 0 0 32px rgba(var(--accent-rgb), .55); transform: translateY(-4px); } }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); opacity: .72; } 50% { transform: scale(1.035); opacity: .86; } }
@keyframes lava-breathe { 0%, 100% { transform: scale(1); opacity: .56; } 50% { transform: scale(1.06); opacity: .8; } }
@keyframes cloud-drift { from { transform: translateX(-4vw); } to { transform: translateX(14vw); } }
@keyframes bubble-rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: .6; } 80% { opacity: .45; } 100% { transform: translateY(-108vh) translateX(3vw); opacity: 0; } }
@keyframes ray-sway { from { opacity: .22; transform: rotate(7deg) scaleX(.9); } to { opacity: .48; transform: rotate(15deg) scaleX(1.1); } }
@keyframes tree-sway { from { transform: rotate(-.7deg) scaleX(1); } to { transform: rotate(.8deg) scaleX(1.02); } }
@keyframes ember-rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 8% { opacity: .9; } 100% { transform: translateY(-55vh) translateX(var(--dx, 2vw)); opacity: 0; } }
@keyframes island-float { from { transform: translateY(-7px) rotate(-.3deg); } to { transform: translateY(10px) rotate(.35deg); } }
@keyframes lantern-rise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 80% { opacity: .5; } 100% { transform: translateY(-64vh) translateX(var(--dx, 4vw)); opacity: 0; } }
@keyframes gear-spin { to { transform: rotate(360deg); } }
@keyframes rune-spin { to { transform: rotate(360deg); } }
@keyframes glyph-glow { 0%, 100% { opacity: .28; text-shadow: 0 0 10px rgba(255, 217, 153, .2); } 50% { opacity: .72; text-shadow: 0 0 22px rgba(255, 217, 153, .58); } }
@keyframes neon-flicker { 0%, 100% { opacity: .35; } 8% { opacity: .2; } 10% { opacity: .42; } 13% { opacity: .24; } 14% { opacity: .38; } 45% { opacity: .32; } 47% { opacity: .2; } 49% { opacity: .38; } }
@keyframes planet-float { from { transform: translateY(-10px) rotate(-2deg); } to { transform: translateY(14px) rotate(2deg); } }
@keyframes vortex-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes node-pulse { 0% { opacity: .7; transform: scale(.86); } 80% { opacity: 0; transform: scale(1.35); } 100% { opacity: 0; } }
@keyframes progress-sheen { 0%, 40% { transform: translateX(-120%); } 70%, 100% { transform: translateX(120%); } }
@keyframes ready-pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(var(--accent-rgb), .22), 0 0 0 0 rgba(var(--accent-rgb), .16); } 50% { box-shadow: 0 10px 30px rgba(var(--accent-rgb), .34), 0 0 0 7px rgba(var(--accent-rgb), 0); } }
@keyframes exam-glow { 0%, 100% { box-shadow: 0 0 0 5px rgba(230, 188, 100, .1), 0 12px 34px rgba(202, 142, 35, .25); } 50% { box-shadow: 0 0 0 9px rgba(230, 188, 100, .04), 0 16px 42px rgba(202, 142, 35, .36); } }
@keyframes sigil-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(-24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-18px) scale(.97); } }
@keyframes flash-burst { 0% { opacity: 0; } 12% { opacity: var(--flash-alpha, .5); } 100% { opacity: 0; } }
@keyframes screen-shake { 0%, 100% { transform: translate(0); } 14% { transform: translate(-5px, 3px) rotate(-.1deg); } 28% { transform: translate(5px, -3px) rotate(.1deg); } 42% { transform: translate(-3px, -2px); } 58% { transform: translate(3px, 2px); } 74% { transform: translate(-1px, 1px); } }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes exam-card-in { from { opacity: 0; transform: translateY(26px) scale(.91) rotateX(8deg); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes exam-ring { to { transform: rotate(360deg); } }
@keyframes exam-element-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes border-rotate { to { transform: rotate(360deg); } }
@keyframes finale-bg-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes finale-rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes finale-card-in { from { opacity: 0; transform: translateY(30px) scale(.9); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes finale-element-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
@keyframes rift-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rift-out { to { opacity: 0; filter: blur(12px); } }
@keyframes rift-ring { 0% { transform: translate(-50%, -50%) rotateX(64deg) rotateZ(0) scale(.9); opacity: .2; } 45% { opacity: .6; } 100% { transform: translate(-50%, -50%) rotateX(64deg) rotateZ(360deg) scale(1.12); opacity: .12; } }
@keyframes rift-speed { to { transform: rotate(360deg) scale(1.18); opacity: .35; } }
@keyframes rift-core { 0%, 100% { transform: translate(-50%, -50%) scale(.92); opacity: .7; } 50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; } }
@keyframes rift-copy { 0% { opacity: 0; transform: translateY(12px); letter-spacing: .4em; } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes rift-star { 0% { transform: translate(0, 0) scale(.5); opacity: 0; } 15% { opacity: .8; } 100% { transform: translate(var(--x, 20vw), var(--y, -30vh)) scale(1); opacity: 0; } }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1280px) {
  .hud { grid-template-columns: minmax(170px, 1fr) auto minmax(290px, 1fr); }
  .account-copy { display: none; }
  .account-chip { padding: 4px; }
  .layout { grid-template-columns: minmax(0, 1fr) 324px; padding-left: 92px; }
  .lib-grid { gap: 6px; }
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1060px) {
  .chapter-rail { display: none; }
  .layout { padding-left: 22px; grid-template-columns: minmax(0, 1fr) 320px; }
  .page-view { padding-left: 22px; }
  .mini-rail { display: flex; gap: 4px; position: absolute; left: 25px; bottom: 8px; }
  .mini-rail i { width: 12px; height: 2px; border-radius: 99px; background: var(--line-strong); }
  .mini-rail i.done { background: var(--accent); opacity: .55; }
  .mini-rail i.current { background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), .5); }
  .quest { padding-bottom: 24px; }
  .rank-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 880px) {
  html, body { overflow: auto; }
  body { min-height: 100%; }
  .hud {
    left: 12px; right: 12px; top: 10px;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 20px;
  }
  .brand-copy span { display: none; }
  .brand-copy strong { font-size: 15px; letter-spacing: .1em; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mark b { font-size: 14px; }
  .hud-chapter { text-align: left; }
  .hud-eyebrow { justify-content: flex-start; font-size: 8px; gap: 5px; }
  .ver-dot { display: none; }
  .hud-chapter h1 { font-size: 16px; letter-spacing: .14em; margin-top: 2px; }
  .tool-label { display: none; }
  .tool-btn { width: 33px; padding: 0; justify-content: center; }
  .tool-btn.square { display: none; }
  .hud-actions .legacy-tool { width: auto; padding: 0 7px; gap: 3px; }
  .hud-actions .legacy-tool .tool-label { display: inline; font-size: 8px; }
  .account-chip { padding: 3px; }
  .account-orb { width: 28px; height: 28px; }
  .layout {
    height: auto;
    min-height: 100vh;
    padding: 86px 12px 88px;
    display: flex;
    flex-direction: column;
    gap: 11px;
  }
  .playfield { flex: none; gap: 11px; }
  .quest { grid-template-columns: 1fr; gap: 14px; padding: 16px 17px 24px; border-radius: 24px; }
  .quest-action { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; min-width: 0; }
  .quest-action-note { flex: 1; }
  .quest-btn { min-width: 155px; width: auto; }
  .quest-lock { display: none; }
  .quest-progress { max-width: none; }
  .workspace-panel { min-height: 34vh; border-radius: 24px; }
  .ws-head { padding: 12px 14px; }
  .ws-heading p { display: none; }
  .workspace { min-height: 27vh; margin: 0 8px; border-radius: 18px; }
  .workspace-rings { width: min(40vh, 300px); }
  .ws-foot { padding: 9px 14px 10px; font-size: 8px; }
  .library-panel { height: 38vh; min-height: 250px; border-radius: 24px; }
  .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lib-card .el-emoji { font-size: 24px; }
  .ws-chip { width: 74px; }
  .dock { bottom: 9px; width: calc(100% - 24px); justify-content: space-between; border-radius: 20px; padding: 5px; }
  .dock-item { flex: 1; width: auto; height: 44px; }
  .dock-item svg { width: 17px; height: 17px; }
  .dock-badge { right: calc(50% - 25px); }
  .dock-lock { right: calc(50% - 26px); }
  .page-view {
    padding: 80px 12px 78px;
    overflow-y: auto;
    background: rgba(2, 8, 14, .25);
  }
  .page-panel { height: auto; min-height: calc(100vh - 158px); max-height: none; border-radius: 24px; }
  .page-view[data-page="wiki"] { overflow: hidden; }
  .page-view[data-page="wiki"] .page-panel {
    height: calc(100vh - 158px);
    height: calc(100dvh - 158px);
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .page-view[data-page="wiki"] .page-scroll { flex: 1; min-height: 0; }
  .page-view[data-page="wiki"] .page-filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .page-view[data-page="wiki"] .page-filter-row::-webkit-scrollbar { display: none; }
  .page-head { flex-wrap: wrap; align-items: flex-start; padding: 17px 17px 13px; gap: 12px; }
  .page-title h2 { font-size: 25px; }
  .page-head-right { width: 100%; justify-content: space-between; }
  .page-search input { width: min(45vw, 190px); }
  .page-filter-row { padding: 9px 17px; }
  /* 图鉴：面板自身不再撑高整页，改为内部滚动（手指可以滑动浏览） */
  .page-scroll { padding: 14px 17px 22px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .wiki-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .wiki-card { border-radius: 12px; padding: 5px 3px 4px; }
  .wiki-card .el-emoji { font-size: 20px; }
  .wiki-card .el-name { font-size: 8px; }
  .ach-grid { grid-template-columns: 1fr; }
  .rank-layout { grid-template-columns: 1fr; }
  .rank-main { padding: 14px 17px 16px; }
  .rank-me { border-left: 0; border-top: 1px solid var(--line); padding: 16px 17px; }
  .rank-head-row { grid-template-columns: 42px 1fr 74px; }
  .rank-row { grid-template-columns: 42px 1fr 74px; padding: 6px 6px; }
  .theme-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .theme-card { min-height: 160px; }
  .theme-card-body { padding: 10px 11px 12px; }
  .theme-preview { height: 82px; }
  .help-grid { grid-template-columns: 1fr; }
  .toasts { bottom: 76px; left: 12px; width: min(286px, calc(100vw - 24px)); }
  .hint-card { bottom: 84px; }
  .modal { padding: 12px; }
  .exam-card { padding: 28px 20px 20px; border-radius: 22px; }
  .exam-card h2 { font-size: 21px; }
  .exam-card h2 span { font-size: 30px; }
  .exam-element { width: 94px; height: 94px; font-size: 44px; }
  .exam-clue { width: 94%; }
  .finale-card { padding: 21px 19px 18px; border-radius: 22px; }
  .finale-card h2 { font-size: 30px; }
  .finale-element { width: 94px; height: 94px; font-size: 47px; }
  .modal-card { padding: 25px 19px 19px; border-radius: 22px; }
}

@media (max-width: 520px) {
  .hud { grid-template-columns: auto 1fr auto; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy { display: none; }
  .brand-mark { width: 31px; height: 31px; }
  .hud-actions { gap: 2px; }
  .account-orb { width: 26px; height: 26px; }
  .hud-chapter h1 { font-size: 14px; }
  .hud-eyebrow { font-size: 7px; }
  .quest { padding: 14px 15px 20px; gap: 10px; }
  .quest h2 { font-size: 18px; margin-top: 6px; }
  .quest-story { display: none; }
  .quest-kicker { font-size: 8px; flex-wrap: wrap; white-space: normal; }
  .quest-progress { margin-top: 9px; }
  .quest-action { gap: 8px; }
  .quest-action-note { font-size: 8px; }
  .quest-btn { min-width: 140px; height: 38px; font-size: 10.5px; }
  .ws-heading h3 { font-size: 13px; }
  .ws-foot { display: none; }
  .workspace-panel { min-height: 31vh; }
  .workspace { min-height: 24vh; }
  .lib-scroll { padding: 2px 8px 10px; }
  .lib-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .lib-card { border-radius: 10px; padding: 5px 2px 4px; gap: 1px; }
  .lib-card .el-emoji { font-size: 19px; }
  .lib-card .el-name { font-size: 7.5px; letter-spacing: 0; }
  .lib-card .el-rarity { display: none; }
  .dock-item span { font-size: 7.5px; }
  .page-mini-tabs { display: none; }
  .page-filter-row { overflow-x: auto; padding-bottom: 10px; }
  .lib-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .lib-card { border-radius: 9px; }
  .lib-card .el-emoji { font-size: 18px; }
  .wiki-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 5px; }
  .wiki-card .el-emoji { font-size: 18px; }
  .wiki-card .el-name { font-size: 7.5px; }
  .ws-chip { width: 64px; }
  .page-head-right { gap: 8px; }
  .page-stat b { font-size: 15px; }
  .theme-grid { grid-template-columns: 1fr; }
  .theme-card { display: grid; grid-template-columns: 110px 1fr; min-height: 90px; }
  .theme-preview { height: 100%; min-height: 90px; }
  .theme-card-body { align-self: center; }
  .theme-follow-actions { flex-direction: column; width: min(290px, 100%); }
  .theme-follow-actions > * { width: 100%; }
  .theme-follow-note { max-width: 290px; }
  .legacy-portal { width: 108px; height: 108px; }
  .legacy-portal span { width: 58px; height: 58px; font-size: 27px; }
  .hud-actions { gap: 0; }
  .tool-btn { width: 31px; }
  .rank-person .rank-avatar { width: 26px; height: 26px; }
  .toast { padding: 9px 10px; }
  .hint-card { padding: 12px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions > * { width: 100%; }
  .exam-actions, .finale-actions { flex-direction: column-reverse; }
  .exam-actions > *, .finale-actions > * { width: 100%; }
  .finale-card h2 { font-size: 27px; }
  .exam-card h2 span { font-size: 27px; }
  .finale-desc { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   触摸设备（手机 / 平板）
   ============================================================ */
@media (pointer: coarse) {
  /* 点卡即可放入，不需要长按拖拽 */
  .lib-card { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .lib-card::after {
    content: "点按放入";
    position: absolute;
    z-index: 3;
    right: 4px;
    top: 4px;
    padding: 1px 4px;
    border-radius: 99px;
    background: rgba(0, 0, 0, .3);
    color: rgba(255, 255, 255, .72);
    font-size: 6px;
    letter-spacing: .02em;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
  }
  .lib-card:active::after { opacity: 1; }
  /* 合成台卡片继续用手指移动，但不会误触页面滚动 */
  .workspace { touch-action: none; }
  /* 拖拽时不显示“松手 · 让它们相遇”的桌面提示，改为简短说明 */
  .ws-dropcue.show { font-size: 9px; }
}
