:root {
  --font: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC",
  "Alibaba PuHuiTi", "Inter", -apple-system, BlinkMacSystemFont,
  system-ui, sans-serif;
  --mono: "JetBrains Mono", "Geist Mono", "SF Mono", ui-monospace, monospace;
  --bg: #fbfcf8;
  --card: #ffffff;
  --ink: #23334a;
  --muted: #7d8ba1;
  --line: #d9e3ee;
  --line-2: #c3d2e4;
  --blue: #2f6fd6;
  --blue-deep: #1f4e9e;
  --blue-tint: #eaf2fd;
  --green: #3aa06e;
  --green-tint: #e6f5ec;
  --pink: #f080a8;
  --pink-tint: #fdeef4;
  --wash: #f0f6ff;
  --hard-blue: 6px 6px 0 rgba(47, 111, 214, .12);
  --hard-pink: 6px 6px 0 rgba(240, 128, 168, .16);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(47, 111, 214, .05) 1px, transparent 1.5px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  overflow: hidden;
}
::selection { background: rgba(240, 128, 168, .25); }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }
button { font-family: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
img { display: block; }
.menubar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  height: 48px;
  padding: 0 22px;
  background: var(--card);
  border-bottom: 2px solid var(--blue);
}
.mb-brand { display: flex; align-items: center; font-size: 14px; font-weight: 700; font-style: italic; color: var(--blue-deep); letter-spacing: .06em; }
.mb-nav { display: flex; gap: 6px; flex: 1; }
.mbtn {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 13px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  transition: color .15s, border-color .15s, background .15s;
}
.mbtn:hover { color: var(--ink); background: var(--wash); }
.mbtn.active {
  color: var(--blue-deep);
  background: var(--blue-tint);
  border-color: var(--blue);
}
.main {
  position: absolute; inset: 0;
  top: 48px; bottom: 0;
  overflow-y: auto;
  padding: 26px 30px 34px;
}
.view { display: none; }
.view.active { display: block; }
.view-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 8px;
}
.view-head h2 { font-size: 17px; font-weight: 700; }
.view-head h2::first-letter { color: var(--pink); }
#view-shelf { height: 100%; display: none; }
#view-shelf.active { display: flex; flex-direction: column; }
/* 封面墙 */
#shelf-zone {
  flex: 1; position: relative;
  margin: 0 -30px;
  cursor: grab;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
#shelf-zone.dragging { cursor: grabbing; }
.home-screen {
  position: relative;
  height: calc(100vh - 74px);
  display: flex; align-items: center; justify-content: center;
}
.home-question {
  font-size: clamp(44px, 9vw, 76px);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink);
}
.home-question .q { color: var(--pink); }
.home-hint {
  position: absolute; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 15px; color: var(--muted);
  animation: hint-bob 2.2s ease-in-out infinite;
}
/* 主页两屏 */
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 9px); }
}
.home-answer {
  font-size: clamp(30px, 6vw, 56px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}
.home-answer.revealed { opacity: 1; transform: none; }
.home-answer .w { color: var(--pink); }
#shelf-viewport { position: absolute; inset: 0; overflow: hidden; }
#shelf-strip { position: absolute; left: 0; top: 0; will-change: transform; }
.wall-card {
  position: absolute;
  border-radius: 10px; overflow: hidden;
  background: var(--card);
  border: 2px solid var(--line-2);
  box-shadow: 4px 4px 0 rgba(47, 111, 214, .10);
  cursor: pointer;
}
.wall-card:hover {
  border-color: var(--blue);
  box-shadow: 6px 6px 0 rgba(240, 128, 168, .28);
  z-index: 2;
}
.wall-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease;
}
.wall-card:hover img { transform: scale(1.06); }
.wc-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 22px; color: rgba(47, 111, 214, .28);
  background: linear-gradient(135deg, var(--blue-tint), var(--pink-tint));
}
.wc-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(transparent, rgba(20, 30, 45, .74));
  pointer-events: none;
}
.wc-name {
  position: absolute; left: 8px; right: 8px; bottom: 6px;
  font-size: 11px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
/* 播放屏 */
#stage {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
#stage.open { opacity: 1; pointer-events: auto; }
#stage-bg {
  position: absolute; inset: -50px; z-index: -1;
  background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.3) brightness(1.06);
  opacity: .45;
  transform: scale(1.12);
}
#stage-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(251, 252, 248, .4);
}
.stage-x { position: absolute; top: 14px; right: 16px; font-size: 15px; }
.stage-inner {
  position: relative; width: 100%; max-width: 900px;
  display: flex; align-items: center; justify-content: center; gap: 44px;
  transform: scale(.97) translateY(10px);
  transition: transform .3s ease;
}
#stage.open .stage-inner { transform: none; }
.photo-frame {
  position: relative; flex: none;
  width: clamp(220px, 32vw, 320px); aspect-ratio: 1 / 1;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--blue);
  border-radius: 8px;
  box-shadow: 10px 10px 0 rgba(240, 128, 168, .3);
}
.frame-cover { width: 100%; height: 100%; overflow: hidden; border-radius: 4px; background: var(--blue-tint); background-size: cover; background-position: center; }
.stage-side { flex: 1 1 auto; max-width: 440px; min-width: 0; }
.stage-side h3 { font-size: 19px; font-weight: 700; color: var(--ink); }
.stage-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stage-lyric {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  border-left: 4px solid var(--pink);
  padding-left: 12px;
  margin: 14px 0 18px; min-height: 1.5em;
}
#stage-player { margin-bottom: 10px; }
#stage-player iframe { width: 100%; border: 0; display: block; }
.song-embed {
  border: 2px solid var(--blue); border-radius: 12px;
  background: var(--card);
  padding: 8px 10px 10px;
}
.song-embed iframe { height: 96px; border-radius: 8px; }
.vip-badge {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .06em; color: #fff;
  background: var(--gold); border-radius: 4px; padding: 1px 5px;
}
.vip-note {
  border: 2px dashed var(--pink); border-radius: 12px;
  background: var(--pink-tint);
  padding: 14px 16px; font-size: 12.5px; color: var(--ink); line-height: 2;
}
.vip-note a {
  color: var(--blue-deep); font-weight: 700; text-decoration: none;
  border-bottom: 2px solid var(--blue); margin-right: 10px;
}
.vip-note a:hover { color: var(--pink); border-color: var(--pink); }
.import-btn { margin-left: auto; }
.local-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .06em; color: #fff;
  background: var(--green); border-radius: 4px; padding: 1px 5px;
}
.audio-embed {
  border: 2px solid var(--green); border-radius: 12px;
  background: var(--card);
  padding: 8px 10px;
}
.audio-embed audio { width: 100%; display: block; }
.alt-wrap { margin-top: 12px; }
.alt-embed {
  position: relative;
  border: 2px solid var(--line-2); border-radius: 10px;
  overflow: hidden; background: var(--card);
}
.alt-embed iframe { width: 100%; height: 152px; border: 0; display: block; }
.alt-tag {
  position: absolute; top: 6px; left: 8px; z-index: 2;
  font-family: var(--mono); font-size: 9px;
  color: #fff; background: rgba(35, 51, 74, .55);
  border-radius: 4px; padding: 1px 6px;
}
.link-btn {
  display: inline-flex; padding: 8px 18px;
  border: 2px solid var(--green); border-radius: 8px;
  color: var(--green); font-size: 13px; text-decoration: none;
  transition: background .15s, color .15s;
}
.link-btn:hover { background: var(--green); color: #fff; }
@media (max-width: 720px) {
  .menubar { gap: 12px; padding: 10px 14px; }
  .mb-user { display: none; }
  .main { padding: 16px 16px 24px; }
  #shelf-zone { margin: 0 -16px; }
  .stage-inner { flex-direction: column; gap: 18px; }
  .stage-side { max-width: 100%; }
  .photo-frame { width: min(64vw, 240px); }
}
@media (prefers-reduced-motion: reduce) {
  #stage, .stage-inner, .term-panel, .sc-inner, .x-row, .sb-btn { transition: none !important; }
}
