/* ================================================================
   theme.css —— 视觉主题（对应桌面的 theme.py）
   配色、玻璃卡、发光按钮、页眉页脚，全部按原程序数值复刻。
   ================================================================ */

:root {
  /* 配色（theme.py 的 class C） */
  --night: #180d30;
  --night2: #2b164f;
  --deep: #5c2f9e;
  --purple: #8b5cf6;
  --lavender: #c4a9ff;
  --mist: #e8deff;
  --gold: #f6d365;
  --gold-deep: #d69e2e;
  --rose: #ff9ec8;
  --white: #ffffff;
  --ink: #3a2660;
  --ink-light: #76639e;
  --ok: #7ee7b8;
  --warn: #ffb078;

  /* 舞台尺寸（对应桌面 1440x880） */
  --stage-w: 1440px;
  --stage-h: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0518;
  color: var(--mist);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  display: block;
}

/* ---------------- 舞台：固定 1440x880，等比缩放适配任意屏幕 ---------------- */
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-w);
  height: var(--stage-h);
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transform-origin: center center;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
}

/* 背景层：星空 canvas + 粒子 canvas */
#bg-canvas, #fx-canvas, #mask-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#fx-canvas { pointer-events: none; }
#mask-canvas { pointer-events: none; z-index: 90; }

/* ---------------- 页面容器 ---------------- */
#pages { position: absolute; inset: 0; z-index: 10; }

.page {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity .5s ease;
}
.page.active { display: block; opacity: 1; }

/* ---------------- 通用：页眉 ---------------- */
.pg-header {
  position: absolute;
  left: 70px;
  top: 54px;
  z-index: 20;
}
.pg-num {
  display: inline-block;
  padding: 5px 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(196, 169, 255, .35);
  color: rgba(196, 169, 255, .85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
}
.pg-title {
  margin: 16px 0 0;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1.15;
  text-shadow: 0 0 18px rgba(139, 92, 246, .55), 0 0 4px rgba(139, 92, 246, .3);
}
.pg-sub {
  margin-top: 2px;
  font-size: 15px;
  letter-spacing: .6px;
  color: rgba(232, 222, 255, .72);
}
.pg-dots { margin-top: 20px; display: flex; gap: 14px; align-items: center; height: 10px; }
.pg-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(232, 222, 255, .3);
}
.pg-dot.on {
  width: 8.4px; height: 8.4px;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(246, 211, 101, .85);
}

/* ---------------- 通用：页脚 ---------------- */
.pg-footer {
  position: absolute;
  left: 70px;
  bottom: 34px;
  z-index: 20;
  font-size: 12px;
  letter-spacing: .5px;
  color: rgba(196, 169, 255, .42);
}

/* ---------------- 通用：玻璃卡 ---------------- */
.glass {
  position: relative;
  background: linear-gradient(135deg, rgba(232, 222, 255, .19), rgba(120, 70, 200, .07));
  border: 1.2px solid rgba(232, 222, 255, .3);
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(6, 2, 16, .5), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.glass-light {
  background: linear-gradient(180deg, rgba(255, 253, 255, .9), rgba(241, 234, 255, .88));
  border: 1.1px solid rgba(139, 92, 246, .24);
  border-radius: 22px;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(70, 30, 130, .14), inset 0 1px 0 rgba(255, 255, 255, .7);
}

/* ---------------- 通用：发光按钮 ---------------- */
.btn {
  position: absolute;
  border: none;
  border-radius: 26px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
  overflow: hidden;
  z-index: 30;
}
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.4); }
.btn .sub {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.2px;
  opacity: .72;
  margin-top: 2px;
}
.btn-gold {
  color: var(--night);
  background: linear-gradient(180deg, #ffe9a8, #e2aa3c);
  box-shadow: 0 0 26px rgba(246, 211, 101, .35), 0 10px 26px rgba(0, 0, 0, .3),
              inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 0 42px rgba(246, 211, 101, .6), 0 10px 26px rgba(0, 0, 0, .3),
              inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-violet {
  color: var(--mist);
  background: linear-gradient(180deg, #a37bff, #5c2f9e);
  box-shadow: 0 0 24px rgba(139, 92, 246, .3), 0 10px 26px rgba(0, 0, 0, .3),
              inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-violet:hover:not(:disabled) {
  box-shadow: 0 0 40px rgba(139, 92, 246, .55), 0 10px 26px rgba(0, 0, 0, .3);
}
.btn-ghost {
  color: var(--mist);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(139, 92, 246, .16));
  border: 1.3px solid rgba(196, 169, 255, .5);
}
.btn-ghost:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, .19), rgba(139, 92, 246, .32));
  border-color: rgba(196, 169, 255, .9);
}
.btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 52px;
  left: -80px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .22),
                              rgba(255, 255, 255, 0));
  transform: skewX(-18deg);
  animation: sweep 3.4s linear infinite;
}
.btn-ghost::after { display: none; }
@keyframes sweep { 0% { left: -80px; } 100% { left: 110%; } }

/* 次级胶囊按钮 */
.linkbtn {
  position: absolute;
  border: 1.1px solid rgba(196, 169, 255, .3);
  background: rgba(255, 255, 255, .05);
  color: rgba(196, 169, 255, .85);
  border-radius: 16px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
  z-index: 30;
}
.linkbtn:hover { background: rgba(255, 255, 255, .15); border-color: rgba(196, 169, 255, .75); }
.linkbtn.gold { color: var(--gold); border-color: rgba(246, 211, 101, .45); }
.linkbtn.gold:hover { border-color: rgba(246, 211, 101, .9); }

/* ---------------- 通用：输入胶囊 ---------------- */
.input-pill {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 253, 255, .94);
  border-radius: 40px;
  padding: 0 22px;
  z-index: 25;
}
.input-pill .ico { color: rgba(139, 92, 246, .65); font-size: 20px; flex: 0 0 auto; }
.input-pill input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 18px;
  font-family: inherit;
  padding: 0;
}
.input-pill input::placeholder { color: rgba(118, 99, 158, .55); }

/* ---------------- 音乐胶囊（右下角 HUD） ----------------
#music-hud {
  position: absolute;
  right: 26px;
  bottom: 20px;
  width: 286px;
  height: 44px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(232, 222, 255, .15), rgba(120, 70, 200, .07));
  border: 1.2px solid rgba(232, 222, 255, .26);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  z-index: 60;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#music-hud .eq { display: flex; gap: 3.5px; align-items: center; height: 100%; flex: 0 0 auto; }
#music-hud .eq i {
  display: block;
  width: 2.8px;
  border-radius: 1.4px;
  background: rgba(246, 211, 101, .9);
  height: 5px;
}
#music-hud .eq.play i { animation: eqb .9s ease-in-out infinite; }
#music-hud .eq i:nth-child(2) { animation-delay: .1s; }
#music-hud .eq i:nth-child(3) { animation-delay: .2s; }
#music-hud .eq i:nth-child(4) { animation-delay: .3s; }
@keyframes eqb { 0%, 100% { height: 5px; } 50% { height: 17px; } }
#music-hud .info { flex: 1; min-width: 0; }
#music-hud .nm {
  font-size: 12px;
  font-weight: 500;
  color: rgba(232, 222, 255, .92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#music-hud .bar {
  margin-top: 4px;
  height: 3px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
#music-hud .bar i { display: block; height: 100%; width: 0; background: rgba(246, 211, 101, .85); }
#music-hud .idx { font-size: 12px; font-weight: 600; color: rgba(246, 211, 101, .92); flex: 0 0 auto; }

/* ---------------- Toast ---------------- */
#toast {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(14px);
  padding: 12px 26px;
  border-radius: 26px;
  background: rgba(20, 8, 42, .93);
  border: 1.2px solid rgba(246, 211, 101, .45);
  color: var(--mist);
  font-size: 15px;
  letter-spacing: .5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 120;
  white-space: nowrap;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 帮助层 ----------------
#help {
  position: absolute;
  inset: 0;
  background: rgba(8, 3, 18, .82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 130;
}
#help.show { display: flex; }
#help .box { width: 520px; }
#help h3 {
  text-align: center;
  color: var(--gold);
  font-size: 26px;
  letter-spacing: 4px;
  margin: 0 0 34px;
  text-shadow: 0 0 14px rgba(246, 211, 101, .6);
}
#help .row { display: flex; align-items: center; height: 44px; }
#help .k {
  width: 150px; text-align: right; padding-right: 30px;
  font-size: 16px; font-weight: 600; color: var(--mist);
}
#help .d { font-size: 15px; color: rgba(196, 169, 255, .85); }
#help .tip {
  text-align: center; margin-top: 26px;
  font-size: 12px; color: rgba(196, 169, 255, .5);
}

/* ---------------- 转场幕布 ----------------
#mask-canvas { z-index: 90; }

/* 页面级小工具类 */
.hidden { display: none !important; }
