:root {
  color-scheme: dark;
  --zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --en: "DIN Alternate", "Avenir Next Condensed", "SF Pro Display", ui-sans-serif, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body[data-theme="assault"] {
  --base: #0B1015; --dark: #0E141A; --plate: #192531; --line: #414646; --metal: #B8A887;
  --muted: #BFBEB2; --accent: #EF7D2E; --bright: #EF7D2E; --ion: #00F0A0;
}
body[data-theme="recon"] {
  --base: #090F18; --dark: #0B131D; --plate: #152436; --line: #38495E; --metal: #9FB8D4;
  --muted: #B2C6D8; --accent: #00D4FF; --bright: #00D4FF; --ion: #6C8CFF;
}
body[data-theme="support"] {
  --base: #091314; --dark: #0B1718; --plate: #14272A; --line: #3C5353; --metal: #B4D8CF;
  --muted: #BDD6D6; --accent: #1EE6A8; --bright: #1EE6A8; --ion: #F5B942;
}
body[data-theme="engineer"] {
  --base: #0E1115; --dark: #11151A; --plate: #20262E; --line: #494B4C; --metal: #C4BBA8;
  --muted: #C5C7C2; --accent: #F0A030; --bright: #F0A030; --ion: #38BDF8;
}
body[data-theme="cosmic"] {
  --base: #090C12; --dark: #101720; --plate: #1B2737; --line: #3A4958; --metal: #DFE7F2;
  --muted: #B4C4D4; --accent: #E6B85C; --bright: #E03A2E; --ion: #55AEFF;
}
body[data-theme="red-gold"] {
  --base: #0D0908; --dark: #17100E; --plate: #261B15; --line: #4D3B2C; --metal: #EBD08C;
  --muted: #C9B8A3; --accent: #F2C14E; --bright: #D92B2B; --ion: #FF9F43;
}
body[data-theme="jungle-ops"] {
  --base: #090E0B; --dark: #101913; --plate: #18261C; --line: #384B3C; --metal: #C7C3A4;
  --muted: #A6B5A7; --accent: #D98E32; --bright: #C84B2A; --ion: #4ADE80;
}
body[data-theme="ink-jade"] {
  --base: #0A0C0E; --dark: #12171B; --plate: #1A2228; --line: #3A464E; --metal: #E5EAE6;
  --muted: #ACB8B5; --accent: #D9B978; --bright: #D63B3B; --ion: #2CEAA3;
}
body[data-theme="crimson-ark"] {
  --base: #10080C; --dark: #1B0D14; --plate: #29141E; --line: #4F2B3B; --metal: #F0DCE4;
  --muted: #C9B0BA; --accent: #FF5C77; --bright: #E61E4D; --ion: #FF9E7D;
}
body[data-theme="noir-volt"] {
  --base: #090C12; --dark: #111722; --plate: #1A2332; --line: #39485C; --metal: #D8E4F2;
  --muted: #A8B8CC; --accent: #7DD3FC; --bright: #F43F5E; --ion: #38BDF8;
}
body[data-theme="storm-violet"] {
  --base: #0A0914; --dark: #131124; --plate: #1D1B38; --line: #423D6E; --metal: #D6DDF5;
  --muted: #B0AED6; --accent: #C084FC; --bright: #7C3AED; --ion: #60A5FA;
}
body[data-theme="neon-rose"] {
  --base: #0E0912; --dark: #181020; --plate: #261630; --line: #4D325E; --metal: #F2DDF5;
  --muted: #C4AFCC; --accent: #FF66B3; --bright: #FF2A6D; --ion: #2CE5D9;
}
body[data-theme="cryo-lab"] {
  --base: #081016; --dark: #0F1B24; --plate: #182A38; --line: #354F61; --metal: #E4F1FA;
  --muted: #A9C5D6; --accent: #7CCBFF; --bright: #F59E0B; --ion: #38E8D8;
}
body[data-theme="desert-vinyl"] {
  --base: #110B08; --dark: #1C130E; --plate: #2A1B14; --line: #52382A; --metal: #E2C39B;
  --muted: #C4AB97; --accent: #F59E0B; --bright: #DC2626; --ion: #FB923C;
}
body[data-theme="molten-forge"] {
  --base: #110907; --dark: #1E100C; --plate: #2C1610; --line: #593226; --metal: #E5C2A3;
  --muted: #C7A697; --accent: #FF7B29; --bright: #EF4444; --ion: #FBBF24;
}
body {
  --deck: var(--base); --panel: var(--plate); --jet: var(--ion);
  --soft-accent: color-mix(in srgb, var(--accent) 15%, transparent);
  --soft-ion: color-mix(in srgb, var(--ion) 13%, transparent);
  font-family: var(--zh); color: #edf4fa; background-color: var(--base);
}
button { appearance: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .63; }
button, .brand, .micro, .card-serial { -webkit-user-select: none; user-select: none; }
svg { display: block; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
rt { display: none; }
ruby { ruby-align: center; ruby-position: over; }
.pinyin-on rt { display: ruby-text; font: 520 .49em/1 var(--zh); letter-spacing: 0; text-align: center; }
.starfield { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.app-shell { position: relative; min-height: 100svh; overflow-x: clip; }
.app-shell::before {
  content: ""; z-index: -1; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 34% 50%, var(--soft-ion), transparent 49%),
              radial-gradient(ellipse at 91% 0%, color-mix(in srgb,var(--bright) 19%,transparent), transparent 37%);
  opacity: .56;
}
.masthead {
  position: relative; border-bottom: 1px solid var(--line);
  background: linear-gradient(105deg, var(--dark), color-mix(in srgb, var(--deck) 88%, transparent));
}
.masthead::after {
  content: ""; position: absolute; bottom: -1px; left: 0; width: 27%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .65;
}
.masthead-inner {
  width: min(1320px, calc(100% - 72px)); min-height: 76px; margin: auto;
  display: flex; align-items: center; gap: clamp(14px, 2.2vw, 36px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; white-space: nowrap; }
.brand-crest {
  width: 45px; height: 44px; display: grid; place-items: center; color: var(--accent);
  background: linear-gradient(140deg, var(--soft-accent), transparent 70%);
  clip-path: polygon(0 0, 100% 0, 100% 71%, 50% 100%, 0 71%);
}
.brand-crest .icon { width: 44px; height: 44px; }
.brand strong { display: block; font-size: 19px; font-weight: 780; line-height: 1.24; letter-spacing: .035em; }
.brand strong b { font: 900 23px/.95 var(--en); letter-spacing: .015em; }
.brand small { display: flex; align-items: center; gap: 5px; font: 650 9px/1.5 var(--en); letter-spacing: .17em; color: var(--muted); }
.brand small i { width: 11px; height: 1px; background: var(--accent); }
.edition-switcher {
  display: flex; align-items: stretch; width: clamp(334px,31vw,408px); height: 48px; padding: 4px; background: #070e17c7;
  border: 1px solid var(--line); border-radius: 8px; flex-shrink: 0;
}
.edition-btn, .view-controls button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 650; color: var(--muted); background: transparent;
  border: 1px solid transparent; transition: background .28s, border-color .28s, color .28s;
}
.edition-btn { min-height: 34px; padding: 4px 13px; border-radius: 5px; }
.edition-btn .icon, .edition-btn .official-icon { width: 17px; height: 17px; }
.edition-btn[aria-pressed="true"] .official-icon { filter: brightness(.28); }
.edition-btn[aria-pressed="true"] { color: var(--deck); background: var(--ion); border-color: var(--ion); }
body[data-rarity="UR+"] .edition-btn[aria-pressed="true"] { color: #381a20; background: linear-gradient(120deg,#c9945d,#f2d6a0 60%,#d19e70); border-color: #e6c18a; box-shadow: inset 0 -2px #a84c49; }
.view-controls { display: flex; gap: 5px; align-items: center; }
.view-controls button { border-radius: 5px; padding: 6px 8px; min-height: 35px; font-size: 12px; gap: 5px; }
.view-controls .icon { width: 16px; height: 16px; }
.view-controls button[aria-pressed="true"] { color: var(--ion); background: var(--soft-ion); border-color: color-mix(in srgb,var(--ion) 32%, transparent); }
.pinyin-mark { font: 700 17px/.9 var(--en); }
.pinyin-on .edition-btn { line-height: 1.85; }

.edition-options { display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column; align-items: stretch; gap: 3px; flex: 1; min-width: 0; }
.edition-options[data-count="3"] { grid-template-columns: minmax(0,.82fr) repeat(2,minmax(0,1.09fr)); }
.edition-options .edition-btn { min-width: 0; padding-inline: 5px; gap: 4px; }
.edition-options[data-count="3"] .icon, .edition-options[data-count="3"] .official-icon { display: none; }
.edition-options small { font: 750 .8em/1 var(--en); white-space: pre; }
.archive-badge { display: flex; flex: 1; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 650; color: var(--metal); }
.archive-badge .official-icon { width: 23px; height: 23px; }
.official-icon { display: block; flex: none; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 1.5px #02070bd6); }
[hidden] { display: none !important; }

.roster-bar { margin-bottom: clamp(17px,2.1vw,28px); padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.roster-toolbar, .class-filters, .roster-pager { display: flex; align-items: center; }
.roster-toolbar { justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.class-filters { gap: 6px; min-width: 0; }
.filter-pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 5px 12px; min-height: 34px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-pill small { font: 650 11px var(--en); }
.filter-pill[data-filter="red"] { border-color: #8e6147; color: #f0cd94; background: linear-gradient(125deg,#321a22,#211c1b); }
.filter-pill[data-filter="red"][aria-pressed="true"] { color: #ffe4a6; border-color: #ddb778; background: linear-gradient(118deg,#58232d,#322322); }
.filter-pill .icon { width: 16px; height: 16px; }
.chip-rarity { position: absolute; top: 3px; right: 3px; padding: 1px 3px; border: 1px solid #966d4e; border-radius: 2px; color: #ffe3a0; background: linear-gradient(110deg,#3d1924,#352820); font: 800 8px/1.1 var(--en); }
.roster-chip:has(.chip-rarity) { min-width: 132px; }
.filter-pill .official-icon { width: 18px; height: 18px; }
.filter-pill[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--soft-accent); }
.roster-pager { gap: 5px; flex-shrink: 0; }
.roster-pager output { font: 750 13px/1 var(--en); font-variant-numeric: tabular-nums; letter-spacing: .10em; color: var(--metal); margin-inline-end: 8px; }
.roster-pager button { display: grid; place-items: center; width: 36px; height: 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--plate); font: 600 18px/1 var(--en); }
.roster-strip { display: flex; gap: 7px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding: 4px 3px 7px; scroll-padding-inline: 3px; }
.roster-chip { position: relative; display: grid; grid-template-columns: 44px auto; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 112px; height: 55px; padding: 3px 11px 3px 4px; text-align: left; border: 1px solid var(--line); border-radius: 4px; color: #e4ecf1; background: color-mix(in srgb,var(--plate) 66%,var(--base)); }
.roster-chip .avatar { width: 44px; height: 45px; object-fit: cover; border-radius: 2px; clip-path: polygon(0 0,100% 0,100% 86%,86% 100%,0 100%); }
.chip-text { display: grid; align-content: center; gap: 2px; }
.chip-text small { font: 700 9px/1 var(--en); letter-spacing: .11em; color: var(--muted); }
.chip-text strong { font-size: 15px; line-height: 1.35; }
.roster-chip::after { content: ""; position: absolute; bottom: -1px; right: 7px; width: 13px; height: 2px; background: var(--class-accent); }
.roster-chip[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(110deg,var(--plate),var(--soft-accent)); }
.roster-chip[aria-pressed="true"] small { color: var(--accent); }
.roster-chip:focus-visible { outline-offset: 1px; }
.pinyin-on .chip-text { gap: 4px; }
.pinyin-on .chip-text strong { line-height: 1.65; }
h1 small { font: italic 800 .59em/1 var(--en); letter-spacing: .04em; color: var(--metal); }
.pinyin-on h1 rt { font-size: .48em; }


.collection { width: min(1196px, calc(100% - 80px)); margin: 0 auto; padding: clamp(16px, 2.3vh, 25px) 0 28px; }
.exhibit-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.eyebrow, .micro { font: 650 10px/1.25 var(--en); letter-spacing: .15em; }
.eyebrow { color: var(--muted); display: flex; align-items: center; gap: 10px; font-family: var(--zh); font-size: 11px; font-weight: 620; }
.eyebrow [lang] { font-family: var(--en); font-size: 10px; letter-spacing: .18em; }
.slashes { width: 18px; height: 9px; transform: skewX(-26deg); background: repeating-linear-gradient(90deg,var(--accent) 0 3px, transparent 3px 6px); }
.type-divider { width: 1px; height: 9px; background: var(--line); }
h1 { margin-top: 6px; font-size: clamp(28px, 2.6vw, 41px); font-weight: 850; line-height: 1.22; letter-spacing: .035em; }
.edition-caption { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .07em; margin-bottom: 3px; }
.edition-caption i { border: 1px solid var(--accent); width: 9px; height: 9px; transform: rotate(45deg); box-shadow: inset 0 0 0 2px var(--base); background: var(--accent); }
.exhibit-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(310px, 27vw, 338px); align-items: start; gap: clamp(20px, 2.4vw, 34px); }
.display-bay { min-width: 0; }
.display-field { position: relative; display: grid; place-items: center; min-height: 626px; isolation: isolate; }
.field-decoration {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(ellipse at 48% 47%, color-mix(in srgb, var(--jet) 11%, transparent), transparent 65%),
              linear-gradient(135deg, color-mix(in srgb, var(--panel) 54%, transparent), transparent 62%);
  border: 1px solid color-mix(in srgb, var(--line) 54%, transparent);
}
.field-decoration::before {
  content: ""; position: absolute; inset: 0; opacity: .46;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size: 42px 42px; mask-image: radial-gradient(ellipse at 50% 60%,transparent 30%, #0008);
}
.orbit-map { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ion); opacity: .45; }
.bay-word {
  position: absolute; top: 19%; left: 50%; translate: -50% 0; color: transparent;
  font: italic 900 clamp(92px, 12.5vw, 190px)/1 var(--en); letter-spacing: .01em;
  -webkit-text-stroke: 1px color-mix(in srgb,var(--metal) 15%, transparent); white-space: nowrap;
}
.floor-glow {
  position: absolute; width: 69%; height: 8%; left: 15.5%; bottom: -1.5%;
  background: radial-gradient(ellipse, color-mix(in srgb,var(--jet) 30%, transparent), transparent 68%); filter: blur(7px);
}
.field-corner { position: absolute; width: 18px; height: 18px; border: 0 solid color-mix(in srgb,var(--ion) 60%,var(--line)); }
.field-corner.nw { top: 0; left: 0; border-width: 2px 0 0 2px; }
.field-corner.ne { top: 0; right: 0; border-width: 2px 2px 0 0; }
.field-corner.sw { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.field-corner.se { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.stage-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 1px 0; color: var(--muted); }
.edition-note { max-width: 56ch; font-size: 12px; line-height: 1.65; }
.stage-caption .gesture-hint { flex: none; }
.card-serial { display: flex; align-items: center; gap: 7px; font: 650 10px/1.4 var(--en); letter-spacing: .12em; }
.card-serial i { width: 17px; height: 9px; background: repeating-linear-gradient(90deg,var(--accent) 0 1px,transparent 1px 3px,var(--accent) 3px 5px,transparent 5px 7px); }
.gesture-hint { display: inline-flex; align-items: center; gap: .22em; font-size: 11px; }
.gesture-hint .icon { width: 13px; height: 13px; margin-right: 3px; color: var(--ion); }
.touch-hint { display: none; }
@media (pointer: coarse) { .mouse-hint { display: none; } .touch-hint { display: inline; } }

/* Only the tilt and the flipper carry 3D transforms. Clipping and blending belong to each face. */
.card-stage {
  width: min(410px, 88vw); aspect-ratio: 5 / 7; perspective: 1400px;
  position: relative; container-type: inline-size; touch-action: pan-y pinch-zoom; isolation: auto;
  --rx: 0deg; --ry: 0deg; --px: 42%; --py: 32%; --drift: 0px;
}
.card-stage::before {
  content: ""; position: absolute; inset: 3% 3% 0; border-radius: 6%; pointer-events: none;
  box-shadow: 0 16px 31px 7px #020711a8, 0 0 32px var(--soft-ion);
}
.card-tilt, .card-flipper { position: absolute; inset: 0; transform-style: preserve-3d; }
.card-tilt { transform: translateY(var(--drift)) rotateX(var(--rx)) rotateY(var(--ry)); }
.card-flipper { transform: rotateY(0deg); transition: transform .72s cubic-bezier(0.22, 1, 0.36, 1); }
.card-flipper.is-flipped { transform: rotateY(180deg); }
.card-face, .face-well {
  --shape: polygon(var(--notch) 0,calc(100% - var(--notch)) 0,100% var(--notch),100% calc(100% - var(--notch)),calc(100% - var(--notch)) 100%,var(--notch) 100%,0 calc(100% - var(--notch)),0 var(--notch));
}
.card-face {
  --notch: 4cqw;
  position: absolute; inset: 0; clip-path: var(--shape); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  color: #f0f7fc; cursor: pointer; user-select: none; -webkit-user-select: none;
  background: repeating-linear-gradient(116deg,#ffffff22 0 .45px,transparent .6px 2px),
    linear-gradient(129deg,#ffecd6 0%,color-mix(in srgb,var(--bright) 45%,#485565) 4%,var(--metal) 11%,var(--plate) 25%,
      color-mix(in srgb,var(--metal) 70%,var(--plate)) 41%,color-mix(in srgb,var(--accent) 55%,#f4ecdf) 49%,var(--plate) 57%,var(--metal) 74%,var(--plate) 89%,var(--accent));
}
.card-face-front { transform: rotateY(0deg) translateZ(.4px); }
.card-face-back { transform: rotateY(180deg) translateZ(.4px); }
.card-face[inert] { pointer-events: none; }
/* Each physical unit is 1/400 of a card. The metal and security plates are
   drawn with the same tooling paths as the print master, underneath live type. */
.face-well {
  position: absolute; inset: 2cqw; --notch: 2.625cqw; clip-path: var(--shape); isolation: isolate;
  overflow: clip; background: var(--deck);
}
.hardware, .edge-sheen, .art-stack, .art-stack img, .art-vignette, .foil, .security-film, .card-vfx-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.hardware { z-index: 4; }
.edge-sheen { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .card-stage[data-rarity="UR+"] .edge-sheen {
    display: block; z-index: 5; border: 1.65cqw solid transparent; clip-path: var(--shape);
    background: linear-gradient(var(--foil-angle,119deg),transparent 40%,#ffd98090 48%,#fff5cd 49%,#cb334467 51%,transparent 56%);
    background-size: 220% 190%; background-position: var(--px) var(--py); mix-blend-mode: screen; opacity: .46;
    mask: linear-gradient(#000 0 0) border-box, linear-gradient(#000 0 0) padding-box; mask-composite: exclude;
  }
}
.art-stack img { object-fit: cover; }
.art-vignette { background: linear-gradient(180deg,#07101940,transparent 16% 53%,#06101928 66%,#08101977 72%,var(--deck)); }
.foil-spectrum {
  background: linear-gradient(var(--foil-angle,119deg),transparent 18%,#51dcd866 27%,#ba97d84c 29%,transparent 34% 50%,#f6deb456 55%,#86cce54f 58%,transparent 64%);
  background-position: var(--px) var(--py); background-size: 210% 190%; mix-blend-mode: color-dodge; opacity: .43;
  mask-image: radial-gradient(ellipse at 50% 36%,transparent 18%,#0002 46%,#000 85%);
}
.foil-mesh { color: var(--metal); opacity: .19; mix-blend-mode: soft-light; mask-image: linear-gradient(110deg,#000,transparent 20% 84%,#000); }
.foil-glint {
  background: radial-gradient(ellipse at var(--px) var(--py),#fff6,transparent 33%); opacity: .24; mix-blend-mode: screen;
  mask-image: linear-gradient(135deg,#000,transparent 26% 74%,#000);
}
@media (prefers-reduced-motion: no-preference) {
  .card-stage[data-tracking="true"] .foil-glint { opacity: .46; }
}
.front-header { position: absolute; top: 2.6cqw; left: 3cqw; right: 3cqw; display: flex; justify-content: space-between; align-items: flex-start; gap: 1cqw; }
.unit-tab {
  display: inline-flex; align-items: center; gap: 1.05cqw; max-width: calc(100% - 21cqw);
  padding: .8cqw 2.4cqw .8cqw 1cqw; color: #eff4f4; font-size: 2.75cqw; font-weight: 690; line-height: 1.5;
  background: linear-gradient(116deg,#172027ee,#081016ed 67%,#26303ce8); backdrop-filter: blur(7px);
  border-left: .5cqw solid var(--ion); box-shadow: inset 0 .22cqw #f3fbff70,inset 0 -.3cqw #010608;
  clip-path: polygon(0 0,100% 0,100% calc(100% - 1.8cqw),calc(100% - 1.8cqw) 100%,0 100%);
}
.unit-tab > span:not(.icon-socket) { min-width: 0; }
.unit-tab em { color: var(--muted); font-style: normal; }
.pinyin-on .unit-tab { padding-top: 2cqw; padding-bottom: 1cqw; }
.unit-led { flex: none; width: .68cqw; height: .68cqw; border-radius: 50%; background: var(--ion); box-shadow: 0 0 1.1cqw var(--ion); }
@media (prefers-reduced-motion: no-preference) {
  .unit-led { animation: unit-light 4.8s ease-in-out infinite alternate; }
  @keyframes unit-light { from { opacity: .76; } to { opacity: 1; } }
}
.icon-socket, .avatar-medallion {
  --socket-shape: polygon(22% 0,78% 0,100% 22%,100% 78%,78% 100%,22% 100%,0 78%,0 22%);
  display: grid; place-items: center; position: relative; flex: none; width: 5.7cqw; height: 5.7cqw; clip-path: var(--socket-shape);
  background: linear-gradient(140deg,#f3faf5,var(--metal) 22%,var(--line) 38%,#14232a 63%,var(--ion) 90%,#182534);
}
.icon-socket::before { content: ""; position: absolute; inset: .28cqw; clip-path: var(--socket-shape);
  background: radial-gradient(ellipse at 65% 100%,var(--soft-ion),transparent 65%),#0a1119; }
.icon-socket .official-icon { position: relative; width: 75%; height: 75%; filter: drop-shadow(0 0 .35cqw var(--soft-ion)); }
.tier-pill, #dossierSkin {
  flex: none; padding: .38cqw 1.05cqw; border: .18cqw solid #c4975c; border-radius: 2cqw;
  background: linear-gradient(115deg,#452027,#32151d); color: #ffe3a2; font-size: 2.25cqw; font-weight: 680; white-space: nowrap;
}
.pinyin-on .tier-pill { line-height: 1.7; }
.rarity-ticket {
  --seal: linear-gradient(128deg,#958677,#dfd7c8 21%,#fff7dd 39%,#c2b099 55%,#e0dbcb 74%,#968b76);
  position: relative; isolation: isolate; display: grid; justify-items: center; align-content: center;
  width: 16cqw; height: 10.6cqw; flex: none; padding: .7cqw 1.45cqw; color: #30291f; background: #d3c7b2;
  clip-path: polygon(13% 0,100% 0,100% 75%,83% 100%,0 100%,0 21%);
}
.rarity-ticket::before, .rarity-ticket::after { content: ""; position: absolute; z-index: -1; clip-path: inherit; }
.rarity-ticket::before { inset: .26cqw; background: #635241; }
.rarity-ticket::after { inset: .54cqw; background: repeating-radial-gradient(ellipse at 10% 118%,transparent 0 .62cqw,#3f31332d .66cqw .78cqw,transparent .82cqw 1.1cqw),var(--seal); }
.rarity-ticket strong { font: italic 900 6.05cqw/.96 var(--en); letter-spacing: -.055em; }
.rarity-ticket small { margin-top: .5cqw; font: 800 1.82cqw/1 var(--en); letter-spacing: .12em; }
[data-rarity="UR+"] .rarity-ticket {
  --seal: linear-gradient(118deg,#611e29,#a3413b 12%,#e6b16a 28%,#fff0bd 48%,#d3995b 68%,#9f4138 92%,#e4b075);
  background: #ffe0a2; color: #401922; filter: drop-shadow(0 0 1cqw #cc70485a);
}
.skin-signature {
  position: absolute; left: 3.25cqw; bottom: calc(29.5% + 2.1cqw); display: grid; gap: .38cqw;
  width: max-content; max-width: 88%; padding: 1.05cqw 2.4cqw 1cqw 1.8cqw;
  background: linear-gradient(100deg,#0b1119e8,#10131ad1 75%,#10131a00); border-left: .46cqw solid #efcc86;
}
.skin-signature strong { font-size: 3.75cqw; line-height: 1.22; color: #fff3d4; letter-spacing: .08em; }
.pinyin-on .skin-signature strong { line-height: 1.72; }
.skin-signature small { font: 700 1.84cqw/1.1 var(--en); letter-spacing: .17em; color: #e6ce9c; }
.nameplate {
  position: absolute; inset: auto 0 0; height: 29.5%; padding: 1.65cqw 3.25cqw 1cqw;
  display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 7.9cqw 10cqw 4cqw; gap: .6cqw;
  background: repeating-linear-gradient(45deg,#d9e7ef07 0 .29cqw,transparent .32cqw .79cqw),
    repeating-linear-gradient(-45deg,#0003 0 .38cqw,transparent .4cqw .84cqw),
    linear-gradient(112deg,color-mix(in srgb,var(--plate) 96%,transparent),#081017f7 59%,var(--dark));
  backdrop-filter: blur(6px); box-shadow: inset 0 .22cqw #e4ecf1ac,0 -1cqw 2cqw #04080e6b;
}
.nameplate::before { content: ""; position: absolute; top: 0; left: 0; width: 78%; height: .92cqw;
  clip-path: polygon(0 0,100% 0,96% 40%,34% 40%,32% 100%,0 100%); background: linear-gradient(100deg,var(--metal),var(--accent) 32%,#fff9d1 58%,var(--line)); }
.nameplate::after { content: ""; position: absolute; left: 2cqw; right: 2cqw; top: .65cqw; height: .95cqw;
  background: radial-gradient(circle at .5cqw 50%,#fff9e3 0 .2cqw,#27313c .3cqw .45cqw,transparent .48cqw),
    radial-gradient(circle at calc(100% - .5cqw) 50%,#fff9e3 0 .2cqw,#27313c .3cqw .45cqw,transparent .48cqw); }
.plate-watermark { position: absolute; right: 1.8cqw; top: 1.3cqw; width: 19cqw; height: 17cqw; object-fit: contain; opacity: .065; pointer-events: none; }
.nameplate > :not(.plate-watermark) { position: relative; }
.plate-heading { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 2.5cqw; min-width: 0; }
.plate-heading h2, .dossier-header h2 { margin: 0; color: #f0f5f8; font-weight: 900; }
.plate-heading h2 { font-size: 9.1cqw; line-height: 1.08; white-space: nowrap; }
[data-codename-len="3"] .plate-heading h2 { font-size: 7.8cqw; }
.name-lines { display: grid; gap: .5cqw; min-width: 0; }
.front-identity { display: flex; align-items: baseline; gap: 1.65cqw; min-width: 0; }
.front-identity b { flex: none; font: 800 4.1cqw/1 var(--en); letter-spacing: .02em; }
#plateRealName { min-width: 0; font-size: 3cqw; font-weight: 650; line-height: 1.3; }
[data-long-name="true"] #plateRealName { font-size: 2.65cqw; }
#plateMotto { color: var(--accent); font-weight: 650; font-size: 2.84cqw; line-height: 1.3; }
.pinyin-on .plate-heading h2 { font-size: 7.3cqw; line-height: 1.6; }
.pinyin-on [data-codename-len="3"] .plate-heading h2 { font-size: 6.85cqw; }
.pinyin-on .plate-heading h2 rt, .pinyin-on .dossier-header h2 rt { color: var(--muted); font-weight: 550; }
.pinyin-on #plateRealName, .pinyin-on #plateMotto { line-height: 1.72; }
.star-meters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 5.8cqw; padding-block: .2cqw; border-block: .15cqw solid #c3d7e342; }
.meter { display: flex; align-items: center; justify-content: space-between; gap: 1cqw; font: 650 2.75cqw/1.1 var(--zh); color: #dae8f0; }
.stars { display: flex; gap: .42cqw; }
.crystal { width: 3.03cqw; height: 3.03cqw; --facet-light: #fff2c9; --facet-mid: var(--accent); --facet-dark: color-mix(in srgb,var(--accent) 50%,#36231e); --facet-edge: var(--accent); }
.crystal.empty { --facet-light: #546372; --facet-mid: #2e3b48; --facet-dark: #111a22; --facet-edge: #87949b; }
.front-skills, .back-skills { display: grid; gap: 1cqw; min-width: 0; min-height: 0; }
.front-skills { grid-template-columns: repeat(3,minmax(0,1fr)); }
.front-skills button, .back-skills button {
  position: relative; min-width: 0; min-height: 0; color: #f0f5f8; border: .2cqw solid var(--line); border-radius: .7cqw;
  box-shadow: inset .18cqw .26cqw #e4eef123,inset -.22cqw -.42cqw #02060bc9;
  background: linear-gradient(134deg,var(--plate),var(--dark) 64%,#060b11);
}
.front-skills button[aria-pressed="true"], .back-skills button[aria-pressed="true"] { border-color: color-mix(in srgb,var(--ion) 64%,var(--line)); }
.front-skills button[aria-pressed="true"]::after, .back-skills button[aria-pressed="true"]::after { content: ""; position: absolute; right: .6cqw; top: .45cqw; width: 1.8cqw; height: .45cqw; background: var(--ion); transform: skewX(-32deg); }
.front-skills button { display: grid; grid-template-columns: 5.55cqw minmax(0,1fr); align-items: center; column-gap: .7cqw; padding: .35cqw .8cqw; font: 700 2.95cqw/1.27 var(--zh); }
.front-skills .icon-socket { width: 5.55cqw; height: 5.55cqw; }
.skill-name, .back-skills strong { min-width: 0; overflow-wrap: anywhere; }
.skill-phrase { display: inline-block; white-space: nowrap; }
.front-skills [data-long-skill="true"] { font-size: 2.73cqw; }
.pinyin-on .front-skills button { font-size: 2.64cqw; line-height: 1.68; }
.pinyin-on .front-skills [data-long-skill="true"] { font-size: 2.51cqw; }
.plate-footer, .dossier-footer { display: flex; align-items: center; justify-content: space-between; gap: 1cqw; min-width: 0; }
.nameplate .card-serial { color: var(--metal); font-size: 1.95cqw; line-height: 1.1; letter-spacing: .06em; }
.nameplate .card-serial i { width: 5cqw; height: 1.8cqw; }
.flip-cue { display: inline-flex; align-items: center; gap: .65cqw; padding: 0; color: var(--accent); background: transparent; border: 0; white-space: nowrap; font-size: 2.65cqw; font-weight: 650; line-height: 1.36; }
.flip-cue .icon { width: 3.12cqw; height: 3.12cqw; }
.back-well { background: radial-gradient(ellipse at 88% 7%,var(--soft-ion),transparent 50%),linear-gradient(140deg,var(--plate),var(--base) 57%,var(--dark)); }
.back-mesh { color: var(--ion); opacity: .075; }
.back-well .foil-spectrum, .back-well .foil-glint { opacity: .14; }
.dossier {
  position: absolute; inset: 0; padding: 3cqw 3.25cqw 2.25cqw; display: grid; grid-template-columns: minmax(0,1fr);
  grid-template-rows: 18cqw 10.8cqw 26.4cqw minmax(0,1fr) 10.2cqw 6cqw; gap: 1.4cqw;
}
.pinyin-on .dossier { grid-template-rows: 18.8cqw 11.2cqw 30.7cqw minmax(0,1fr) 12.4cqw 6cqw; gap: 1.1cqw; }
.dossier > *, .dossier-id, .dossier-header h2, .dossier-identity { min-width: 0; min-height: 0; }
.dossier-header { display: grid; grid-template-columns: 11.5cqw minmax(0,1fr) 18cqw; grid-template-rows: minmax(0,1fr) 5.1cqw; align-items: center; column-gap: 1.75cqw; }
.avatar-medallion { width: 11.5cqw; height: 11.5cqw; background: repeating-linear-gradient(101deg,#c8d3d51f 0 .19cqw,transparent .24cqw .63cqw),linear-gradient(135deg,#fff5d8,#83939c 30%,#25313c 47%,#bacbd3 75%,#455263); }
.avatar-medallion img { display: block; width: 90%; height: 90%; object-fit: cover; clip-path: var(--socket-shape); border: .25cqw solid #101820; }
.dossier-id { display: grid; align-self: stretch; align-content: center; gap: .7cqw; }
.docket { display: flex; align-items: center; gap: 1cqw; color: var(--accent); font-size: 1.96cqw; line-height: 1.2; letter-spacing: .10em; }
.docket i, .panel-heading .micro i { display: inline-block; width: 2.7cqw; height: .54cqw; transform: skew(-25deg); background: var(--accent); }
.dossier-header h2 { display: flex; align-items: baseline; gap: 1.5cqw; font-size: 7.65cqw; line-height: 1.08; white-space: nowrap; }
.dossier-header h2 b { font: italic 800 4.65cqw/1 var(--en); color: var(--metal); }
[data-codename-len="3"] .dossier-header h2 { font-size: 7.1cqw; }
.pinyin-on .dossier-header h2 { font-size: 6.15cqw; line-height: 1.52; }
.pinyin-on [data-codename-len="3"] .dossier-header h2 { font-size: 6cqw; }
.rarity-ticket.with-class { display: grid; width: 18cqw; height: 11cqw; grid-template-columns: 3.8cqw 1fr; column-gap: .35cqw; align-items: center; }
.with-class .official-icon { grid-row: span 2; width: 3.8cqw; height: 4.5cqw; filter: brightness(.27); }
.with-class strong { font-size: 5.45cqw; }
.with-class small { grid-column: 2; font-size: 1.58cqw; }
.dossier-identity { grid-column: 1/-1; display: flex; justify-content: space-between; align-items: center; gap: 1cqw; }
#identityLine { color: #d9e5e9; font-size: 2.85cqw; line-height: 1.4; min-width: 0; }
.pinyin-on #identityLine { font-size: 2.7cqw; line-height: 1.72; }
#dossierSkin { line-height: 1.2; padding-block: .15cqw; }
.pinyin-on #dossierSkin { line-height: 1.65; }
.bio-strip { display: grid; grid-template-columns: minmax(0,16fr) minmax(0,17.5fr) minmax(0,21fr) minmax(0,19fr) minmax(0,26.5fr); gap: .65cqw; font-variant-numeric: tabular-nums; }
.bio-strip > div { position: relative; min-width: 0; display: grid; align-content: center; gap: .35cqw; padding: .4cqw .98cqw;
  background: linear-gradient(160deg,var(--base),var(--plate)); border: .16cqw solid var(--line); box-shadow: inset 0 .63cqw .75cqw #02070c70; }
.bio-strip > div::before { content: ""; position: absolute; width: 2.5cqw; height: .36cqw; top: 0; left: .95cqw; background: var(--ion); }
.bio-strip dt { font-size: 2.42cqw; line-height: 1.28; color: var(--muted); }
.bio-strip dd { font: 700 2.85cqw/1.3 var(--en),var(--zh); white-space: nowrap; }
.pinyin-on .bio-strip dt { font-size: 2.25cqw; line-height: 1.66; }
.pinyin-on .bio-strip dd { font-size: 2.56cqw; line-height: 1.66; }
.dossier h3 { font-size: 3.35cqw; font-weight: 750; line-height: 1.35; }
.story-section, .dossier-quote { position: relative; border-left: .5cqw solid var(--ion); }
.story-section { display: grid; align-content: center; gap: .65cqw; padding: 1.1cqw 2.2cqw; background: linear-gradient(105deg,var(--soft-ion),#ffffff04),var(--dark); box-shadow: inset 0 .3cqw .75cqw #0005; }
.story-section::after, .dossier-quote::after { content: ""; position: absolute; inset: .45cqw; pointer-events: none;
  background: linear-gradient(var(--line),var(--line)) right top/2.5cqw .24cqw,linear-gradient(var(--line),var(--line)) right top/.24cqw 2cqw,
    linear-gradient(var(--line),var(--line)) left bottom/2.5cqw .24cqw,linear-gradient(var(--line),var(--line)) left bottom/.24cqw 2cqw; background-repeat: no-repeat; }
.story-section h3 { display: flex; align-items: center; gap: 1.35cqw; }
.story-section h3 .icon { width: 3.75cqw; height: 3.75cqw; color: var(--ion); }
.story-section p { color: #e5ecee; font-size: 3.04cqw; line-height: 1.49; overflow-wrap: anywhere; }
.pinyin-on .story-section p { font-size: 2.88cqw; line-height: 1.73; }
.dossier-analysis { display: grid; grid-template-columns: minmax(0,37fr) minmax(0,56fr); gap: 1.8cqw; min-height: 0; }
.radar-block, .back-skills-block { display: grid; grid-template-rows: 5.6cqw minmax(0,1fr); min-width: 0; min-height: 0; }
.radar-block { grid-template-rows: 5.6cqw minmax(0,1fr) 5.8cqw; }
.dossier-analysis h3 { border-top: .18cqw solid var(--line); padding-top: .55cqw; }
.radar-chart { align-self: center; width: 100%; height: 100%; min-height: 0; }
.radar-chart text { fill: #eaf3f8; font: 620 11.6px var(--zh); }
.radar-chart .radar-number { fill: var(--ion); font: 800 12.6px var(--en); }
.radar-chart .grid-ring { fill: none; stroke: color-mix(in srgb,var(--ion) 45%,transparent); stroke-width: .8; }
.radar-chart .radar-axis { stroke: var(--ion); stroke-opacity: .3; stroke-width: .8; }
.radar-chart .radar-area { stroke: var(--ion); stroke-width: 1.65; fill: var(--soft-ion); }
.radar-chart .radar-dot { fill: var(--accent); stroke: var(--base); stroke-width: .8; }
.overall-score { align-self: stretch; justify-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 1.4cqw;
  padding: 0 2cqw; border-radius: .8cqw; border: .18cqw solid var(--line); color: var(--metal); background: linear-gradient(115deg,var(--plate),var(--dark));
  font: 650 2.65cqw/1.65 var(--zh); }
.overall-score b { color: var(--ion); font: 800 3.15cqw/1 var(--en); }
.back-skills { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); }
.back-skills button { display: grid; grid-template-columns: minmax(0,1fr); align-content: center; gap: .45cqw; text-align: left; padding: .6cqw 1.05cqw; }
.skill-top { display: flex; align-items: center; justify-content: space-between; gap: .45cqw; }
.skill-top em { padding: .28cqw .68cqw; border: .16cqw solid var(--line); border-radius: 2cqw; color: var(--metal); background: var(--base); font: 650 2.1cqw/1.16 var(--zh); white-space: nowrap; }
.back-skills strong { font-size: 2.9cqw; line-height: 1.3; }
.back-skills [data-long-skill="true"] strong { font-size: 2.72cqw; }
.back-skills small { color: var(--muted); font-size: 2.4cqw; line-height: 1.3; }
.pinyin-on .back-skills .icon-socket { width: 4.9cqw; height: 4.9cqw; }
.pinyin-on .back-skills strong { font-size: 2.65cqw; line-height: 1.68; }
.pinyin-on .back-skills [data-long-skill="true"] strong { font-size: 2.55cqw; }
.dossier-quote { margin: 0; display: flex; flex-wrap: wrap; align-content: center; padding: .65cqw 2cqw; background: var(--soft-accent); border-color: var(--bright); color: #f4e3bf; font-size: 2.95cqw; font-weight: 650; line-height: 1.42; }
.dossier-quote > span { min-width: 0; overflow-wrap: anywhere; }
.pinyin-on .dossier-quote { font-size: 2.84cqw; line-height: 1.72; }
.dossier-footer { border-top: .16cqw solid var(--line); padding-top: .7cqw; }
.footer-serial { font: 650 1.82cqw/1.2 var(--en); letter-spacing: .025em; color: var(--metal); }
.collector-stamp { display: flex; align-items: center; gap: .7cqw; height: 4.95cqw; padding: .35cqw 1.1cqw; color: #142028;
  background: repeating-linear-gradient(122deg,#fff3 0 .15cqw,transparent .2cqw .6cqw),linear-gradient(112deg,var(--metal),#eee7c5 43%,#93c4c6 73%,var(--accent)); }
.collector-stamp .icon { width: 3.8cqw; height: 3.8cqw; }
.collector-stamp span { font: 850 1.48cqw/1.17 var(--en); letter-spacing: .065em; white-space: nowrap; }
.micro-barcode { width: 3.4cqw; height: 3.2cqw; background: repeating-linear-gradient(90deg,currentColor 0 .31cqw,transparent .31cqw .55cqw,currentColor .55cqw .7cqw,transparent .7cqw 1cqw); }
.control-panel {
  background: linear-gradient(135deg,color-mix(in srgb,var(--panel) 95%, transparent),color-mix(in srgb,var(--dark) 94%,transparent));
  -webkit-backdrop-filter: blur(11px); backdrop-filter: blur(11px);
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden; position: relative; box-shadow: 0 10px 24px #02081238;
}
.control-panel::before { content: ""; position: absolute; top: 0; left: 18px; width: 56px; height: 2px; background: var(--accent); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 19px 19px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.panel-heading .micro { display: flex; align-items: center; gap: 6px; color: var(--accent); line-height: 1; font-size: 9px; }
.panel-heading .micro i { width: 10px; height: 2px; }
.panel-heading h2 { font-size: 23px; margin-top: 5px; line-height: 1.3; letter-spacing: .035em; }
.intro-button, .speech-button { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; border-radius: 4px; padding: 4px 8px; font-size: 12px; font-weight: 650; }
.intro-button { color: var(--metal); background: #ffffff06; border: 1px solid var(--line); }
.intro-button .icon, .speech-button .icon { width: 15px; height: 15px; }
.lab-body { padding: 15px 18px 17px; }
.section-label { display: flex; align-items: center; gap: 10px; color: var(--metal); font-size: 13px; font-weight: 700; line-height: 1.4; letter-spacing: .045em; }
.section-label i { flex: 1; height: 1px; background: linear-gradient(90deg,var(--line),transparent); }
.section-label .icon { width: 13px; height: 13px; color: var(--muted); }
.skill-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 9px 0 12px; }
.skill-controls button {
  position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; min-width: 0; text-align: left; gap: 4px; width: 100%; min-height: 58px;
  padding: 5px 9px 7px; border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(105deg,#ffffff06,#030c141c); transition: background .2s, border-color .2s;
}
.skill-controls button[aria-pressed="true"] { border-color: color-mix(in srgb,var(--accent) 64%,var(--line)); background: linear-gradient(95deg,var(--soft-accent),transparent 95%); }
.skill-controls button[aria-pressed="true"]::before { content: ""; position: absolute; width: 2px; height: 42%; top: 29%; left: -1px; background: var(--accent); }
.skill-controls .official-icon { width: 28px; height: 28px; }
.skill-controls strong { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.skill-controls small { justify-self: end; font-size: 10px; line-height: 1.45; color: var(--muted); }
.skill-detail { margin: 0 0 14px; font-size: 13px; line-height: 1.65; }
.skill-detail h4 { margin: 0 0 4px; font-size: 14px; color: var(--metal); }
.voice-credit { margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.skill-mechanic { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.skill-detail blockquote { margin: 6px 0 0; color: var(--accent); font-size: 12px; }
.science-box {
  position: relative; padding: 12px 13px 10px; border: 1px solid color-mix(in srgb,var(--ion) 31%,var(--line));
  border-left: 3px solid var(--ion); border-radius: 3px 6px 6px 3px;
  background: linear-gradient(110deg,var(--soft-ion),color-mix(in srgb,var(--ion) 3%,transparent));
}
.science-heading { display: flex; align-items: center; gap: 6px; color: var(--ion); }
.science-heading .official-icon { width: 17px; height: 17px; }
.science-heading h3 { font-size: 14px; line-height: 1.4; }
#scienceFact { margin: 6px 0 4px; color: #e4f1f5; font-size: 14px; line-height: 1.64; }
.speech-button { min-height: 26px; padding: 1px 2px; border: 0; background: transparent; color: var(--ion); }
.export-controls { margin-top: 15px; }
.save-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 9px 0 7px; }
.save-row button, #printCard {
  display: flex; justify-content: center; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 3px; min-height: 35px; font-size: 11.5px; font-weight: 650; background: #ffffff05;
}
.save-row button .icon { width: 15px; height: 15px; }
.save-row small, #printCard small { font: 600 10px/1.2 var(--en); color: var(--muted); white-space: nowrap; }
#printCard { width: 100%; justify-content: flex-start; gap: 9px; min-height: 38px; padding-inline: 10px; color: var(--metal); background: linear-gradient(120deg,#ffffff0b,#ffffff03); font-size: 13px; }
#printCard .icon { width: 16px; height: 16px; }
#printCard .arrow { margin-left: auto; width: 13px; height: 13px; }
.pinyin-on .skill-controls strong, .pinyin-on #scienceFact, .pinyin-on .skill-detail, .pinyin-on .edition-note { line-height: 1.92; }
.status-message {
  position: fixed; left: 50%; bottom: max(18px,env(safe-area-inset-bottom)); z-index: 20; transform: translateX(-50%);
  color: #f0fbff; background: #102331f7; border-radius: 5px; font-size: 14px; text-align: center;
  width: max-content; max-width: 90vw; box-shadow: 0 4px 22px #0006; pointer-events: none;
}
.status-message:not(:empty) { padding: 9px 16px; border: 1px solid var(--line); }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(1.13); }
  .view-controls button:hover, .edition-btn[aria-pressed="false"]:hover { color: white; background-color: #ffffff0c; }
  .front-skills button:hover, .back-skills button:hover, .save-row button:hover, #printCard:hover { border-color: var(--ion); }
  .skill-controls button:hover { border-color: var(--accent); }
}
.front-header { transform: translate(var(--relief-x,0px),var(--relief-y,0px)); }
.card-vfx-layer { z-index: 8; overflow: hidden; }
.vfx-burst, .vfx-burst > i { position: absolute; pointer-events: none; }
.vfx-burst { inset: 0; overflow: hidden; }
.vfx-burst > i { display: block; opacity: 0; }
.fx-wave .wave, .fx-scan .sonar { left: 50%; top: 44%; width: 35%; aspect-ratio: 1; border: .65cqw solid var(--ion); border-radius: 50%; box-shadow: 0 0 1.8cqw var(--ion), inset 0 0 1cqw var(--ion); animation: pressure-ring .86s var(--delay) ease-out both; }
.fx-wave .wave:nth-child(odd) { border-color: var(--accent); }
@keyframes pressure-ring { 0% { opacity: .8; transform: translate(-50%,-50%) scale(.12); } 75% { opacity: .5; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(4); } }
.fx-boost .wake { width: .56%; height: 57%; left: var(--x); top: 3%; background: linear-gradient(transparent,#edf9ff 36%,var(--ion) 70%,transparent); box-shadow: 0 0 1.4cqw var(--ion); animation: slipstream .63s var(--delay) ease-out both; }
@keyframes slipstream { 0% { transform: translate(20%,-65%) rotate(32deg) scaleY(.5); } 22% { opacity: .9; } 100% { transform: translate(-150%,106%) rotate(32deg) scaleY(1.35); } }
.fx-blast .spark { width: .95%; height: 8%; left: 50%; top: 46%; background: linear-gradient(#fff,var(--accent),transparent); transform-origin: 50% 0; animation: sparks .66s var(--delay) ease-out both; }
@keyframes sparks { 0% { transform: rotate(var(--angle)) scaleY(.1); } 19% { opacity: .95; } 100% { transform: rotate(var(--angle)) translateY(36cqw) scaleY(.3); } }
.fx-scan .sweep { left: 8%; top: 18%; width: 84%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 10deg,transparent 71%,var(--soft-ion) 91%,var(--ion) 99%,transparent); animation: radar-sweep 1.18s linear both; }
.fx-scan .sonar { border-width: .28cqw; box-shadow: none; animation-duration: .85s; }
@keyframes radar-sweep { 8% { opacity: .65; } 85% { opacity: .5; } 100% { transform: rotate(310deg); } }
.fx-heal .mote { left: var(--x); top: var(--y); width: 2.8cqw; height: 2.8cqw; background: var(--ion); clip-path: polygon(34% 0,66% 0,66% 34%,100% 34%,100% 66%,66% 66%,66% 100%,34% 100%,34% 66%,0 66%,0 34%,34% 34%); animation: heal-rise .91s var(--delay) ease-out both; }
@keyframes heal-rise { 20% { opacity: .92; } 100% { transform: translate(1.5cqw,-23cqw) scale(.5); } }
.fx-cryo .crystal { width: 5.2%; height: 28%; left: 47.4%; bottom: 53%; transform-origin: 50% 100%; background: linear-gradient(0deg,var(--ion),#ebfdff); clip-path: polygon(48% 0,58% 27%,86% 16%,59% 37%,56% 52%,100% 36%,57% 63%,51% 100%,44% 64%,0 38%,44% 52%,42% 34%,14% 20%,42% 26%); animation: crystal-grow .9s var(--delay) ease-out both; }
@keyframes crystal-grow { 0% { transform: rotate(var(--angle)) scale(.08); } 31% { opacity: .91; } 100% { transform: rotate(var(--angle)) scale(1.21); } }
.fx-shield .hex { left: 50%; top: 45%; width: 44%; aspect-ratio: 1.13; background: var(--ion); clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%,25% 0,26% 3%,3.5% 50%,26% 97%,74% 97%,96.5% 50%,74% 3%,26% 3%); animation: shield-field .94s var(--delay) ease-out both; }
@keyframes shield-field { 0% { transform: translate(-50%,-50%) scale(.4); } 26% { opacity: .9; } 100% { transform: translate(-50%,-50%) scale(2.1); } }
.fx-drone .trail { left: var(--x); top: var(--y); width: 10%; height: .5cqw; background: linear-gradient(90deg,transparent,var(--ion)); transform-origin: right center; animation: drone-path .96s var(--delay) ease-in-out both; }
.trail::after { content: ""; position: absolute; right: 0; top: -.5cqw; width: 1.5cqw; height: 1.5cqw; border-radius: 50%; background: #e6fdff; box-shadow: 0 0 1.4cqw var(--ion); }
@keyframes drone-path { 0% { transform: translate(-9cqw,8cqw) rotate(-23deg); } 22% { opacity: .92; } 55% { opacity: .9; transform: translate(9cqw,-2cqw) rotate(-23deg); } 70% { opacity: .8; transform: translate(11cqw,-4cqw) rotate(-52deg); } 100% { transform: translate(19cqw,-20cqw) rotate(-52deg); } }
.print-sheet { display: none; }

@media (min-width: 961px) and (max-width: 1120px) {
  .masthead-inner { width: calc(100% - 40px); gap: 12px; }
  .collection { width: calc(100% - 48px); }
  .edition-btn { padding-inline: 8px; }
  .view-controls { gap: 1px; }
}
@media (max-width: 960px) {
  .masthead-inner { width: calc(100% - 36px); padding: 11px 0; min-height: 65px; }
  .collection { width: min(740px,calc(100% - 36px)); padding-top: 23px; }
  .exhibit-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .control-panel { width: min(100%,520px); justify-self: center; }
  .display-field { min-height: 0; padding-block: 21px; }
  .stage-caption { padding-top: 11px; }
  .exhibit-heading { margin-bottom: 15px; }
  .edition-btn { padding-inline: 9px; }
  .masthead-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
  .brand { grid-area: 1 / 1; }
  .view-controls { grid-area: 1 / 2; justify-content: flex-end; gap: 2px; }
  .edition-switcher { grid-area: 2 / 1 / 3 / -1; width: 100%; }
  .edition-btn { flex: 1; }
  .brand-crest { width: 36px; height: 35px; }
  .brand-crest .icon { width: 37px; height: 37px; }
}
@media (max-width: 620px) {
  .roster-bar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px; }
  .roster-toolbar { display: contents; }
  .class-filters { grid-column: 1/-1; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 3px; }
  .roster-strip { grid-area: 2/1; min-width: 0; }
  .filter-pill { flex-direction: column; gap: 1px; min-height: 42px; padding: 2px 1px; border-radius: 6px; font-size: 11px; }
  .filter-pill .official-icon { width: 15px; height: 15px; }
  .filter-pill small { font-size: 10px; }
  .roster-pager { grid-area: 2/2; display: grid; grid-template-columns: repeat(2,32px); justify-items: center; gap: 2px; }
  .roster-pager output { grid-column: span 2; margin: 0; font-size: 10px; }
  .roster-pager button { width: 32px; height: 29px; }
  .roster-chip { min-width: 104px; }
}
@media (max-width: 520px) {
  .masthead-inner { width: calc(100% - 24px); }
  .brand { gap: 5px; }
  .brand strong { font-size: 15px; }
  .brand strong b { font-size: 18px; }
  .brand small { font-size: 7px; letter-spacing: .10em; }
  .brand-crest, .brand-crest .icon { width: 30px; height: 31px; }
  .view-controls button { min-height: 33px; padding: 4px; font-size: 11px; gap: 3px; }
  .view-controls .icon { width: 14px; height: 14px; }
  .edition-btn { min-height: 33px; font-size: 12px; }
  .collection { width: calc(100% - 20px); padding: 20px 0; }
  .exhibit-heading { padding: 0 4px; gap: 5px; }
  h1 { font-size: 29px; }
  .eyebrow { font-size: 10px; gap: 6px; }
  .eyebrow [lang] { font-size: 8px; }
  .edition-caption { font-size: 10px; gap: 5px; letter-spacing: 0; }
  .edition-caption i { width: 7px; height: 7px; }
  .display-field { padding-block: 15px; }
  .stage-caption { padding-inline: 3px; gap: 5px; flex-wrap: wrap; }
  .edition-note { flex-basis: 100%; }
  .card-serial { font-size: 8px; letter-spacing: .05em; gap: 4px; }
  .card-serial i { width: 10px; }
  .gesture-hint { font-size: 10px; }
  .gesture-hint .icon { width: 11px; margin-right: 1px; }
  .lab-body { padding: 16px; }
  .skill-controls button { min-height: 53px; }
  .save-row button { min-height: 41px; }
  #printCard { min-height: 42px; }
}
@media (max-width: 350px) {
  .edition-options[data-count="3"] .edition-btn { font-size: 11px; gap: 1px; padding-inline: 2px; }
  #pinyinToggle .pinyin-mark { display: none; }
  .edition-btn { padding-inline: 4px; gap: 4px; }
  .gesture-hint { font-size: 9px; }
  .save-row button { gap: 3px; font-size: 11px; }
}
@media (max-width: 400px) {
  #autoToggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #autoToggle { min-width: 28px; }
  .brand { gap: 4px; }
  .brand strong { font-size: 13.5px; }
  .brand strong b { font-size: 16px; }
  .brand-crest, .brand-crest .icon { width: 25px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .card-flipper, .art-stack img, body { transition-duration: .01s; }
  .vfx-burst > i { animation: none !important; }
  .vfx-burst { background: radial-gradient(ellipse at 50% 50%,var(--soft-ion),transparent 62%); }
}
@page { size: A4 portrait; margin: 0; }
@media print {
  html, body { width: 210mm; height: 297mm; margin: 0; background: white; color-scheme: light; }
  body { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  body > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: grid; width: 210mm; height: 297mm; place-items: center; color: #182129; background: white; break-inside: avoid; }
  .print-block { width: 126mm; }
  .print-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4mm; font-size: 10pt; }
  .print-title span { font-size: 8pt; }
  .print-pair { display: flex; width: 126mm; height: 88mm; outline: .18mm dashed #56636c; outline-offset: .25mm; position: relative; }
  .print-pair img { display: block; flex: 0 0 63mm; width: 63mm; height: 88mm; object-fit: cover; }
  .fold-line { position: absolute; display: block; top: -1.5mm; bottom: -1.5mm; left: 63mm; border-left: .2mm dashed #858c91; }
  .print-block p { margin-top: 4mm; font-size: 8pt; line-height: 1.5; }
}
