/* ============ Tokens ============ */
:root {
  --bg: #07081a;
  --bg-2: #0d0f26;
  --surface: rgba(22, 25, 58, .62);
  --surface-solid: #14173a;
  --line: rgba(150, 156, 255, .16);
  --line-strong: rgba(150, 156, 255, .34);
  --text: #e8eaff;
  --muted: #9aa2cf;
  --heading: #ffffff;
  --violet: #8b8cff;
  --cyan: #5ee7df;
  --coral: #ff8a6b;
  --grad: linear-gradient(100deg, #8b8cff 0%, #5ee7df 50%, #ffb26b 100%);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Space Grotesk", "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --star: 232, 234, 255;
  --star-link: 139, 140, 255;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f1e8;
  --bg-2: #ece6d8;
  --surface: rgba(255, 252, 245, .78);
  --surface-solid: #fffcf5;
  --line: rgba(40, 36, 80, .12);
  --line-strong: rgba(40, 36, 80, .26);
  --text: #23213a;
  --muted: #625f7c;
  --heading: #121026;
  --violet: #5b4ee6;
  --cyan: #0e9c94;
  --coral: #e0603f;
  --grad: linear-gradient(100deg, #5b4ee6 0%, #0e9c94 55%, #d9822b 100%);
  --shadow: 0 30px 60px -34px rgba(40, 30, 80, .35);
  --star: 60, 52, 120;
  --star-link: 91, 78, 230;
  color-scheme: light;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { color: var(--heading); line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
kbd {
  font-family: var(--mono); font-size: .72em; padding: .1em .45em; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
}
.mono { font-family: var(--mono); }
.small { font-size: .82rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--violet); color: #fff; transition: top .2s; }
.skip:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--violet) 45%, transparent); }
.shell { width: min(1200px, 100% - 32px); margin-inline: auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); display: inline-flex; align-items: center; gap: .55em; }

/* ============ Progress & cursor glow ============ */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; }
.progress span { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--violet) 18%, transparent), transparent 62%);
  transition: opacity .4s; will-change: transform;
}
body.has-pointer .cursor-glow { opacity: 1; }

/* ============ Nav ============ */
.nav {
  position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 50;
  width: min(1200px, 100% - 24px); display: flex; align-items: center; gap: 16px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 62%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: transform .45s var(--ease), box-shadow .3s;
}
.nav.is-hidden { transform: translate(-50%, -140%); }
.nav.is-scrolled { box-shadow: var(--shadow); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad); color: #0a0b1e; font-weight: 900; font-size: .95rem;
}
.logo-text em { font-style: normal; color: var(--muted); font-weight: 500; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 999px; font-size: .92rem; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--heading); background: var(--surface); }
.nav-actions { display: flex; gap: 6px; align-items: center; }
.cmd-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: border-color .2s, color .2s;
}
.cmd-btn:hover { border-color: var(--line-strong); color: var(--text); }
.cmd-btn svg, .icon-btn svg, .search-inline svg, .palette-input svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); transition: transform .3s var(--ease), border-color .2s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: rotate(-12deg); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

/* ============ Buttons ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 500; white-space: nowrap; transition: transform .25s var(--ease), border-color .2s, box-shadow .3s;
  backdrop-filter: blur(8px);
}
.btn:hover { border-color: var(--violet); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-primary { border: 0; background: var(--grad); color: #0a0b1e; font-weight: 700; box-shadow: 0 10px 40px -10px color-mix(in srgb, var(--violet) 70%, transparent); }
.btn-primary:hover { box-shadow: 0 16px 50px -8px color-mix(in srgb, var(--cyan) 60%, transparent); }
.btn-sm { height: 40px; padding: 0 16px; font-size: .9rem; }

/* ============ Hero ============ */
.hero { position: relative; min-height: min(100svh, 920px); display: grid; align-items: center; overflow: hidden; isolation: isolate; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1;
  background: linear-gradient(transparent, var(--bg));
}
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: .8; }

/* 首屏插画：沿用原站的看板图，左侧压暗保证文字可读，随鼠标和滚动轻微视差 */
.hero-art {
  position: absolute; inset: 0 0 0 34%; z-index: -3; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(0deg, transparent 0%, #000 30%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 38%), linear-gradient(0deg, transparent 0%, #000 30%);
  mask-composite: intersect;
}
.hero-art picture, .hero-art img { width: 100%; height: 100%; }
.hero-art img {
  object-fit: cover; object-position: 22% 30%;
  transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px + var(--sy, 0) * 1px), 0) scale(1.08);
  transition: transform .6s var(--ease), opacity 1.2s var(--ease);
  animation: artIn 1.6s var(--ease) both;
}
@keyframes artIn { from { opacity: 0; transform: scale(1.16); } }
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 40%, transparent) 0%, color-mix(in srgb, var(--bg) 10%, transparent) 55%, color-mix(in srgb, var(--bg) 35%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, transparent 22%);
}
:root[data-theme="light"] .hero-art img { filter: saturate(.85) brightness(1.06); }
.hero::before {
  content: ""; position: absolute; inset: -20%; z-index: -4;
  background:
    radial-gradient(40% 35% at 20% 30%, color-mix(in srgb, var(--violet) 30%, transparent), transparent 70%),
    radial-gradient(35% 30% at 80% 60%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 70%),
    radial-gradient(30% 25% at 60% 15%, color-mix(in srgb, var(--coral) 14%, transparent), transparent 70%);
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(6deg) scale(1.05); } }
.hero-inner { width: min(1200px, 100% - 32px); margin-inline: auto; padding: 120px 0 90px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-title {
  margin: 22px 0 22px; font-size: clamp(3rem, 10vw, 8.4rem); font-weight: 900; letter-spacing: -.045em; line-height: .98;
}
.hero-title .ch { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(6deg); filter: blur(8px); animation: rise .9s var(--ease) forwards; }
.hero-title .ch.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.hero-sub { max-width: 640px; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); }
.typer { color: var(--heading); font-weight: 700; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -.18em; background: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
/* BGM 按钮 */
.bgm { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.bgm-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); backdrop-filter: blur(10px); font-size: .9rem;
  transition: border-color .2s;
}
.bgm-btn:hover { border-color: var(--cyan); }
.bgm-note { font-size: .84rem; color: var(--muted); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 16px; height: 14px; }
.eq i { flex: 1; height: 30%; border-radius: 1px; background: var(--cyan); transition: height .3s; }
.bgm-on .eq i { animation: eq 1s ease-in-out infinite; }
.bgm-on .eq i:nth-child(2) { animation-delay: -.3s; }
.bgm-on .eq i:nth-child(3) { animation-delay: -.6s; }
.bgm-on .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* 迷你播放器 */
.mini-player {
  position: fixed; left: calc(16px + env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45;
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface-solid) 86%, transparent); backdrop-filter: blur(14px);
  box-shadow: var(--shadow); text-align: left;
  transform: translateY(160%); opacity: 0; transition: transform .5s var(--ease), opacity .4s, border-color .2s;
}
.mini-player.is-shown { transform: none; opacity: 1; }
.mini-player:hover { border-color: var(--cyan); }
.disc {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  background: radial-gradient(circle, var(--surface-solid) 0 14%, transparent 15%), url("../assets/hero-banner-sm.webp") 58% 28% / 260% auto;
  box-shadow: 0 0 0 2px var(--line-strong);
  animation: spin 8s linear infinite; animation-play-state: paused;
}
.bgm-on .disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.mini-text { display: grid; line-height: 1.2; }
.mini-text strong { font-size: .86rem; color: var(--heading); }
.mini-text small { font-size: .74rem; color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 56px 0 0; }
.stat {
  min-width: 140px; padding: 16px 20px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface); backdrop-filter: blur(12px);
}
.stat dt { font-size: .8rem; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: 2rem; font-weight: 700; color: var(--heading); font-variant-numeric: tabular-nums; }
.scroll-hint { position: absolute; left: 50%; bottom: 28px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid var(--line-strong); border-radius: 14px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--cyan); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ============ Marquee ============ */
.marquee { position: relative; overflow: hidden; padding: 18px 0; border-block: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; gap: 40px; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-size: clamp(1.1rem, 2.6vw, 1.6rem); font-weight: 700; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 40px; }
.marquee-track span::after { content: "✦"; color: var(--violet); font-size: .8em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { position: relative; padding: clamp(80px, 12vw, 140px) 0 0; z-index: 1; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px 40px; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 900; margin-top: 10px; }
.sec-desc { max-width: 420px; color: var(--muted); }

/* reveal */
/* 只做位移，不隐藏内容：未滚动到时内容依然可见 */
.js .reveal:not(.is-in) { transform: translateY(28px); }
.reveal { transition: transform .9s var(--ease); }

/* spotlight surface (mouse-tracked glow) */
.spot { position: relative; overflow: hidden; }
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent, var(--violet)) 22%, transparent), transparent 45%);
}
.spot:hover::before { opacity: 1; }
.spot > * { position: relative; z-index: 1; }

/* ============ Arcade bento ============ */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 210px; gap: 16px; }
.game {
  --accent: var(--violet);
  position: relative; grid-column: span 2; grid-row: span 2; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; isolation: isolate;
  transform-style: preserve-3d; transition: border-color .3s, box-shadow .4s var(--ease);
}
.game:nth-child(1) { grid-column: span 4; }
.game:nth-child(2) { grid-column: span 2; }
.game:nth-child(3), .game:nth-child(4), .game:nth-child(5) { grid-column: span 2; }
.game:nth-child(6) { grid-column: span 3; }
.game:nth-child(7) { grid-column: span 3; }
.game:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.game-media { position: absolute; inset: 0; z-index: -2; }
.game-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.9); }
.game:hover .game-media img { transform: scale(1.14); filter: saturate(1.15); }
.game::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 8, 26, 0) 25%, rgba(7, 8, 26, .55) 55%, rgba(7, 8, 26, .94) 100%);
}
.game-body { position: absolute; inset: auto 0 0 0; padding: 22px; color: #fff; transform: translateZ(40px); }
.game-top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 8px; transform: translateZ(30px); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .74rem; font-weight: 500;
  background: rgba(7, 8, 26, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.game h3 { color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 900; }
.game:nth-child(1) h3 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.game p { margin-top: 6px; font-size: .92rem; color: rgba(255, 255, 255, .78); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-actions { display: flex; gap: 8px; margin-top: 14px; opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.game:hover .game-actions, .game:focus-within .game-actions { opacity: 1; transform: none; }
.play {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: .88rem; font-weight: 700;
  background: var(--accent); color: #0a0b1e; border: 0;
}
.play-ghost { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .24); backdrop-filter: blur(6px); }
.glare { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .16), transparent 40%); }
.game:hover .glare { opacity: 1; }

/* ============ Library ============ */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.chip { position: relative; z-index: 1; border: 0; background: none; padding: 8px 14px; border-radius: 999px; font-size: .9rem; color: var(--muted); transition: color .25s; }
.chip[aria-selected="true"] { color: var(--heading); }
.chip .n { font-family: var(--mono); font-size: .72rem; opacity: .65; margin-left: 4px; }
.chip-pill { position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 999px; background: color-mix(in srgb, var(--violet) 28%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 50%, transparent); pointer-events: none; transition: transform .45s var(--ease), width .45s var(--ease), height .45s var(--ease); }
.chip { flex: 0 0 auto; white-space: nowrap; }
.toolbar-right { display: flex; gap: 8px; flex: 1 1 280px; min-width: 0; justify-content: flex-end; }
.search-inline { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; max-width: 340px; height: 46px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: border-color .2s; }
.search-inline:focus-within { border-color: var(--violet); }
.search-inline input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font: inherit; }
.sort-btn { height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; white-space: nowrap; }
.sort-btn:hover { color: var(--text); border-color: var(--line-strong); }
.lib-count { font-size: .8rem; color: var(--muted); margin: 0 4px 18px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card {
  --accent: var(--violet);
  display: flex; flex-direction: column; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  backdrop-filter: blur(10px); overflow: hidden; cursor: pointer; transition: transform .4s var(--ease), border-color .3s, opacity .35s;
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card-cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-cover img { transform: scale(1.06); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.type-tag::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.card h3 { font-size: 1.12rem; font-weight: 700; }
.card p { font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { font-size: .74rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: none; font-family: inherit; }
button.tag:hover { color: var(--heading); border-color: var(--violet); }
mark { background: color-mix(in srgb, var(--cyan) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.card.enter { animation: cardIn .5s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.empty { padding: 60px 0; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 16px; }

/* ============ Now ============ */
.now-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.panel { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 28px; backdrop-filter: blur(12px); }
.panel h3 { font-size: 1.5rem; font-weight: 700; margin: 12px 0 14px; }
.panel p + p { margin-top: 12px; }
.panel-about { grid-column: span 7; display: flex; flex-direction: column; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.jump button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); font-size: .9rem; transition: border-color .2s, transform .3s var(--ease); }
.jump button:hover { border-color: var(--violet); transform: translateY(-2px); }
.jump .n { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.panel-focus { grid-column: span 5; }
.panel-timeline { grid-column: span 6; }
.panel-heat { grid-column: span 6; }
.focus-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.focus-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 40%, transparent); font-weight: 500; transition: transform .3s var(--ease), border-color .3s; }
.focus-list li:hover { transform: translateX(6px); border-color: var(--violet); }
.focus-list .bar { flex: 0 0 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.focus-list .bar i { display: block; height: 100%; width: var(--w); background: var(--grad); border-radius: inherit; transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; }
.panel.is-in .focus-list .bar i { transform: scaleX(1); }
.timeline { list-style: none; margin: 18px 0 0; padding: 0 0 0 18px; border-left: 1px dashed var(--line-strong); display: grid; gap: 16px; }
.timeline li { position: relative; cursor: pointer; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent, var(--violet)); }
.timeline time { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.timeline strong { display: block; font-weight: 500; transition: color .2s; }
.timeline li:hover strong { color: var(--cyan); }
.heat-title { font-size: 1.15rem !important; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; margin: 6px 0 12px; overflow-x: auto; padding-bottom: 4px; }
.heatmap i { width: 100%; min-width: 12px; aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.heatmap i[data-l="1"] { background: color-mix(in srgb, var(--violet) 55%, transparent); }
.heatmap i[data-l="2"] { background: var(--violet); }
.heatmap i[data-l="3"] { background: var(--cyan); box-shadow: 0 0 10px color-mix(in srgb, var(--cyan) 60%, transparent); }

/* ============ Gallery ============ */
.g-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shelf {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 150px;
  padding: 24px 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left;
  backdrop-filter: blur(10px); transition: border-color .3s, background-color .3s, transform .4s var(--ease);
}
.shelf:hover { transform: translateY(-3px); }
.shelf[aria-selected="true"] { border-color: color-mix(in srgb, var(--violet) 70%, transparent); background: color-mix(in srgb, var(--violet) 14%, var(--surface)); }
.shelf-text { display: grid; gap: 6px; min-width: 0; }
.shelf-text strong { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; color: var(--heading); line-height: 1.1; }
.fan { position: relative; flex: 0 0 150px; height: 110px; }
.fan-card {
  position: absolute; top: 50%; left: 50%; width: 76px; height: 100px; margin: -50px 0 0 -38px; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--surface-solid); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
  transform: translateX(calc((var(--i) - 1) * 34px)) rotate(calc((var(--i) - 1) * 10deg)); transition: transform .5s var(--ease);
}
.fan-card:nth-child(1) { z-index: 3; } .fan-card:nth-child(2) { z-index: 2; }
.fan-card img { width: 100%; height: 100%; object-fit: cover; }
.shelf:hover .fan-card { transform: translateX(calc((var(--i) - 1) * 44px)) rotate(calc((var(--i) - 1) * 14deg)) translateY(-4px); }
.fan-empty { --i: 1; display: grid; place-items: center; background: color-mix(in srgb, var(--violet) 18%, transparent); border-style: dashed; border-color: var(--line-strong); color: var(--muted); font-size: 1.6rem; }

.g-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 18px; min-height: 24px; }
.g-albums { display: flex; flex-wrap: wrap; gap: 8px; }
.album-chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: .88rem; color: var(--muted); transition: all .2s; }
.album-chip:hover { color: var(--heading); border-color: var(--line-strong); }
.album-chip[aria-pressed="true"] { color: var(--bg); background: var(--heading); border-color: var(--heading); }
.album-chip .n { margin-left: 6px; font-family: var(--mono); font-size: .72rem; opacity: .7; }
.g-count { font-size: .8rem; color: var(--muted); margin-left: auto; }

/* 按行排列的瀑布流：列数和每张图占几行由 gallery.js 根据宽高比计算，阅读顺序从左到右 */
.masonry { --gap: 14px; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); grid-auto-rows: 2px; column-gap: var(--gap); align-items: stretch; }
.g-tile {
  position: relative; display: block; width: 100%; margin: 0 0 var(--gap); padding: 0; border: 0; border-radius: 16px; overflow: hidden;
  background: var(--c); cursor: zoom-in; isolation: isolate; aspect-ratio: var(--ar);
}
.masonry.is-laid .g-tile { aspect-ratio: auto; }
.g-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.02); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.g-tile img.is-loaded { opacity: 1; transform: none; }
.g-tile:hover img.is-loaded { transform: scale(1.05); }
.g-tile:focus-visible { outline-offset: 2px; }
.g-flag { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 999px; font-size: .68rem; background: rgba(7, 8, 26, .6); color: #fff; backdrop-filter: blur(6px); }
.g-info {
  position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 28px 14px 12px; text-align: left; color: #fff;
  background: linear-gradient(transparent, rgba(7, 8, 26, .85)); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s var(--ease);
}
.g-info strong { font-size: .95rem; }
.g-info small { font-size: .7rem; color: rgba(255, 255, 255, .75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-tile:hover .g-info, .g-tile:focus-visible .g-info { opacity: 1; transform: none; }
.g-empty { display: grid; justify-items: center; gap: 8px; padding: 60px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; color: var(--muted); }
.g-empty strong { font-size: 1.2rem; color: var(--heading); }
.g-more { display: flex; justify-content: center; margin-top: 10px; }

/* ============ Outro & footer ============ */
.outro { padding: clamp(100px, 16vw, 200px) 16px; text-align: center; }
.outro-text { font-size: clamp(2.6rem, 9vw, 7rem); font-weight: 900; line-height: 1.02; letter-spacing: -.04em; color: var(--heading); }
.outro-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px max(16px, calc((100% - 1200px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* ============ Drawer ============ */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer-backdrop, .palette-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 16, .55); backdrop-filter: blur(6px); animation: fade .3s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); overflow-y: auto;
  background: var(--surface-solid); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  animation: slideIn .5s var(--ease);
}
.drawer.is-closing .drawer-panel { animation: slideOut .35s var(--ease) forwards; }
.drawer.is-closing .drawer-backdrop { animation: fade .3s reverse forwards; }
@keyframes slideIn { from { transform: translateX(100%); } }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }
.drawer-close { position: absolute; top: 16px; right: 16px; z-index: 2; background: rgba(7, 8, 26, .5); color: #fff; border-color: rgba(255, 255, 255, .2); }
.d-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.d-cover.portrait { aspect-ratio: 4 / 4; }
.d-cover img { width: 100%; height: 100%; object-fit: cover; }
.d-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 50%, var(--surface-solid)); }
.d-content { padding: 4px 28px 40px; display: grid; gap: 18px; }
.d-content h2 { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 900; }
.d-content p { color: var(--muted); }
.d-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0; }
.d-facts div { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.d-facts dt { font-size: .74rem; color: var(--muted); font-family: var(--mono); }
.d-facts dd { margin: 2px 0 0; font-weight: 500; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.d-nav { display: flex; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.d-nav button { border: 0; background: none; color: var(--muted); text-align: left; padding: 0; max-width: 48%; }
.d-nav button:last-child { text-align: right; }
.d-nav button:hover { color: var(--heading); }
.d-nav small { display: block; font-family: var(--mono); font-size: .72rem; }

/* ============ Palette ============ */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.palette-box {
  position: relative; width: min(640px, 100%); border-radius: 20px; overflow: hidden;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .6);
  animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.97); } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font: inherit; font-size: 1.05rem; }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: min(420px, 55vh); overflow-y: auto; }
.palette-group { padding: 10px 10px 4px; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.palette-item[aria-selected="true"] { background: color-mix(in srgb, var(--violet) 20%, transparent); }
.palette-item .pi-icon { flex: 0 0 38px; height: 38px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--bg-2); font-size: 1.1rem; }
.palette-item .pi-icon img { width: 100%; height: 100%; object-fit: cover; }
.palette-item .pi-text { flex: 1; min-width: 0; }
.palette-item .pi-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .pi-sub { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .pi-kind { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.palette-empty { padding: 30px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .74rem; color: var(--muted); }
.palette-foot kbd { margin-right: 2px; }

/* ============ Lightbox ============ */
.lightbox { position: fixed; inset: 0; z-index: 95; display: grid; grid-template-columns: minmax(0, 1fr) 380px; background: #05060f; animation: fade .3s; }
.lightbox.no-panel { grid-template-columns: minmax(0, 1fr); }
.lightbox.no-panel .lb-panel { display: none; }
.lb-stage { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 0; background-size: 0 0; background-color: var(--c, #05060f); }
.lb-stage::before { content: ""; position: absolute; inset: -60px; background: inherit; background-size: cover; background-position: center; filter: blur(50px) brightness(.35) saturate(1.2); }
.lb-stage img { position: relative; z-index: 1; max-width: calc(100% - 140px); max-height: calc(100vh - 110px); width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); opacity: 0; transform: scale(.98); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.lb-stage img.is-loaded { opacity: 1; transform: none; }
.lb-spinner { position: absolute; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #5ee7df; animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none; }
.lightbox.is-loading .lb-spinner { opacity: 1; }
.lb-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 16px; }
.lb-counter { color: rgba(255, 255, 255, .7); font-size: .82rem; }
.lb-tools { display: flex; gap: 8px; }
.lb-prev, .lb-next { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lightbox .icon-btn { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); font-weight: 700; }
.lightbox [data-lb-info][aria-pressed="true"] { background: rgba(94, 231, 223, .2); border-color: #5ee7df; }
.lb-panel { overflow-y: auto; padding: 72px 26px 30px; background: var(--surface-solid); border-left: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; gap: 14px; }
.lb-panel h3 { font-size: 1.5rem; font-weight: 900; }
.lb-caption { color: var(--text); }
.lb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.lb-facts div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); min-width: 0; }
.lb-facts dt { font-size: .7rem; color: var(--muted); font-family: var(--mono); }
.lb-facts dd { margin: 2px 0 0; font-size: .88rem; font-weight: 500; overflow-wrap: anywhere; }
.lb-prompt, .lb-neg { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lb-prompt-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: .74rem; color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; }
.lb-copy { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; font-size: .74rem; color: var(--text); letter-spacing: 0; text-transform: none; }
.lb-copy:hover { border-color: var(--cyan); }
.lb-panel pre { margin: 0; padding: 10px 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--text); }
.lb-neg summary { padding: 8px 12px; cursor: pointer; font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.lb-panel .btn { align-self: flex-start; margin-top: auto; }

/* ============ Toast ============ */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 140%); padding: 12px 18px; border-radius: 999px; background: var(--heading); color: var(--bg); font-weight: 500; font-size: .92rem; transition: transform .4s var(--ease), visibility 0s .4s; pointer-events: none; visibility: hidden; }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .4s var(--ease); }

/* ============ Responsive ============ */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 230px; }
  .game, .game:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .game:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .panel-about, .panel-focus, .panel-timeline, .panel-heat { grid-column: span 12; }
}
@media (max-width: 760px) {
  .g-shelves { grid-template-columns: 1fr; gap: 10px; }
  .shelf { min-height: 0; padding: 18px; }
  .fan { flex-basis: 110px; height: 84px; }
  .fan-card { width: 56px; height: 74px; margin: -37px 0 0 -28px; }
  .masonry { --gap: 8px; }
  .g-tile { border-radius: 12px; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-panel { max-height: 46vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)); border-left: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; }
  .lb-stage img { max-width: calc(100% - 24px); max-height: calc(100% - 90px); }
  .lb-prev, .lb-next { top: auto; bottom: 14px; transform: none; }
  .nav-links { display: none; }
  .nav { gap: 8px; }
  .nav-actions { margin-left: auto; }
  .cmd-btn kbd, .only-desktop { display: none; }
  .cmd-label { display: none; }
  .cmd-btn { width: 40px; padding: 0; justify-content: center; }
  .hero-inner { padding-top: 110px; }
  .hero-art { inset: 0; -webkit-mask-image: none; mask-image: none; }
  .hero-art img { object-position: 30% 30%; }
  .hero-art::after { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 50%, transparent) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 45%, var(--bg) 100%); }
  .mini-text { display: none; }
  .mini-player { padding: 6px 10px 6px 6px; }
  .stats { gap: 10px; }
  .stat { min-width: 0; flex: 1 1 40%; padding: 12px 14px; }
  .stat dd { font-size: 1.6rem; }
  .game-actions { opacity: 1; transform: none; }
  .toolbar-right { flex-basis: 100%; }
  .search-inline { max-width: none; }
  /* 手机：一行横向滑动，不换行 */
  .chips { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding-inline: 12px; }
  .chips::-webkit-scrollbar { display: none; }
  .toolbar > .chips { flex: 1 1 100%; min-width: 0; }
  .panel { padding: 22px; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; grid-auto-rows: 260px; }
  .game:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .game:nth-child(1) { grid-row: span 1; }
  .footer { flex-direction: column; }
  .palette { padding-top: 8vh; }
  .palette-foot { display: none; }
  .lib-grid { grid-template-columns: 1fr; gap: 10px; }
  .card { flex-direction: row; align-items: stretch; }
  .card:hover { transform: none; }
  .card-cover { flex: 0 0 96px; aspect-ratio: auto; }
  .card-body { padding: 12px 14px; gap: 6px; }
  .card h3 { font-size: 1rem; }
  .card p { -webkit-line-clamp: 2; font-size: .84rem; }
  .card .tags { display: none; }
}
@media (hover: none) { .cursor-glow { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal:not(.is-in) { transform: none; }
  .hero-title .ch { opacity: 1; transform: none; filter: none; }
}
