/* ===== 全局重置 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ===== 设计令牌 ===== */
:root {
  --bg-primary:    #111111;
  --bg-card:       #1e1e1e;
  --bg-sheet:      #1a1a1a;
  --bg-speed-opt:  #252525;
  --bg-dark:       #0d0d0d;
  --divider:       #2a2a2a;
  --accent:        #FF8C1A;
  --accent-dim:    rgba(255,140,26,0.3);
  --text-1:        #ffffff;
  --text-2:        #dddddd;
  --text-3:        #888888;
  --text-4:        #666666;
  --text-5:        #555555;
  --text-muted:    #444444;
  --font: -apple-system, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans CN", sans-serif;
  --radius-phone: 48px;
  --radius-card:  16px;
  --radius-btn:   9999px;
}

/* ===== Body & 设备外框 ===== */
body {
  font-family: var(--font);
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 32px 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.device-frame {
  width: 644px;
  height: 1512px;
  background: var(--bg-primary);
  border-radius: var(--radius-phone);
  box-shadow:
    0 0 0 4px var(--divider),
    0 0 0 6px var(--bg-primary),
    0 40px 120px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* ===== 页面系统 ===== */
.page {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.page.active { display: flex; }

/* ===== 状态栏 (Figma: 56px, padding 0 24px) ===== */
.status-bar {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  flex-shrink: 0;
}
.status-bar.dark-bg { background: var(--bg-dark); }
/* 时间文字: 22px bold */
.status-time { color: var(--text-1); font-size: 22px; font-weight: 700; line-height: 33px; }
/* 右侧图标区: 18px icons, gap 8px */
.status-icons { display: flex; align-items: center; gap: 8px; color: var(--text-1); font-size: 18px; }
.status-icons svg { width: 18px; height: 18px; fill: var(--text-1); }

/* ===== 导航栏 ===== */
.nav-bar {
  height: 84px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.nav-bar.with-border { border-bottom: 1px solid var(--divider); }
/* 标题区双行 */
.nav-title {
  color: var(--text-1);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}
.nav-subtitle {
  display: block;
  color: var(--text-3);
  font-size: 22px;
  font-weight: 400;
  line-height: 33px;
}
.nav-title-main {
  display: block;
  color: var(--text-1);
  font-size: 26px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 返回/更多按钮: 36px */
.nav-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.nav-btn svg { width: 36px; height: 36px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.grey svg { stroke: var(--text-3); }
.nav-spacer { width: 36px; flex-shrink: 0; }

/* ===== Home Indicator (Figma: 32px, bar 140×5px #444) ===== */
.home-indicator {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-primary);
}
.home-indicator-bar {
  width: 140px;
  height: 5px;
  background: #444444;
  border-radius: var(--radius-btn);
}

/* ============================================================
   PAGE 1 - SPLASH
   ============================================================ */
#splashPage { background: var(--bg-primary); }
.splash-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Icon: 120×120px, rounded 28px, shadow */
.splash-icon {
  width: 120px;
  height: 120px;
  background: var(--accent);
  border-radius: 28px;
  box-shadow: 0 8px 32px var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.splash-icon svg { width: 56px; height: 56px; fill: #fff; }
/* Title: 32px bold white */
.splash-title { color: var(--text-1); font-size: 32px; font-weight: 700; text-align: center; line-height: 48px; }
/* Subtitle: 24px #666 */
.splash-sub { color: var(--text-4); font-size: 24px; text-align: center; margin-top: 6px; line-height: 36px; }
/* Dots: 10px, gap 10px */
.splash-dots { display: flex; gap: 10px; margin-top: 36px; }
.splash-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); opacity: 0.35; }
.splash-dot.on { opacity: 1; }

/* ============================================================
   PAGE 2 - SELECT VERSION
   ============================================================ */
.version-list { flex: 1; overflow-y: auto; padding: 8px 0 120px; }
/* Each item: 88px height */
.version-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 24px;
  height: 88px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  text-align: left;
  gap: 16px;
  position: relative;
}
.version-item.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.version-item-text { flex: 1; }
.version-item-name { color: var(--text-2); font-size: 24px; font-weight: 500; }
.version-item.selected .version-item-name { color: var(--accent); font-weight: 700; }
.version-item-tag { color: var(--text-4); font-size: 20px; margin-top: 4px; }
.version-check { color: var(--accent); font-size: 24px; display: none; }
.version-item.selected .version-check { display: block; }

/* ============================================================
   PAGE 3 - SELECT GRADE
   ============================================================ */
.grade-tabs-row {
  display: flex;
  gap: 10px;
  padding: 14px 24px 12px;
  overflow-x: auto;
  flex-shrink: 0;
}
.grade-tabs-row::-webkit-scrollbar { display: none; }
.grade-tab {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-3);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font);
}
.grade-tab.active { background: var(--accent); color: #fff; }
.volume-section { flex: 1; overflow-y: auto; padding: 8px 24px 120px; }
.volume-section-label { color: var(--text-4); font-size: 20px; margin-bottom: 14px; padding-top: 8px; }
.volume-card {
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 14px;
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}
.volume-card.selected { background: var(--accent); }
.volume-card.unselected { background: var(--bg-card); }
.volume-card-title { font-size: 26px; font-weight: 700; }
.volume-card.selected .volume-card-title { color: #fff; }
.volume-card.unselected .volume-card-title { color: var(--text-2); }
.volume-card-sub { font-size: 20px; margin-top: 6px; }
.volume-card.selected .volume-card-sub { color: rgba(255,255,255,0.85); }
.volume-card.unselected .volume-card-sub { color: var(--text-4); }

/* Confirm button */
.confirm-btn-area {
  position: absolute;
  bottom: 32px;
  left: 24px;
  right: 24px;
}
.confirm-btn {
  width: 100%;
  height: 72px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
}
.confirm-btn:active { opacity: 0.85; }

/* ============================================================
   PAGE 4 - TABLE OF CONTENTS
   ============================================================ */
/* TOC nav: 84px, border-bottom */
#lessonListPage .nav-bar { height: 84px; border-bottom: 1px solid var(--divider); }

/* Now playing bar: 78px, rounded 18px, left 24px */
.now-playing-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 18px;
  margin: 12px 24px 0;
  padding: 0 21px;
  height: 78px;
  flex-shrink: 0;
  cursor: pointer;
}
/* Orange circle icon: 44px */
.now-playing-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.now-playing-icon svg { width: 22px; height: 22px; fill: #fff; }
/* Text: 24px medium #ff8c1a */
.now-playing-text { color: var(--accent); font-size: 24px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing-arrow { color: var(--text-4); font-size: 24px; width: 24px; height: 24px; }

.toc-list { flex: 1; overflow-y: auto; padding: 0 0 16px; }

/* Unit header: 22px bold #ff8c1a, height 65px, pt 22px pb 10px px 32px */
.toc-unit-header {
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  padding: 22px 32px 10px;
  height: 65px;
  display: flex;
  align-items: flex-end;
}

/* TOC item: 75px, padding 0 28px, rounded 16px, margin 0 16px, gap 10px */
.toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  height: 75px;
  border-radius: 16px;
  margin: 0 16px;
  cursor: pointer;
  user-select: none;
}
.toc-item:active { background: var(--bg-card); }
.toc-item.playing { background: var(--bg-card); }

/* Number: 24px #666, width 40px */
.toc-item-num { color: var(--text-4); font-size: 24px; width: 40px; text-align: left; flex-shrink: 0; line-height: 36px; }
.toc-item.playing .toc-item-num { display: none; }

/* Wave animation bars: 40px container */
.toc-wave { display: none; width: 40px; align-items: flex-end; gap: 3px; height: 22px; flex-shrink: 0; }
.toc-item.playing .toc-wave { display: flex; }
.toc-wave-bar { background: var(--accent); border-radius: 3px; width: 4px; }
.toc-wave-bar:nth-child(1) { height: 8px; animation: wave 0.8s ease-in-out infinite 0s; }
.toc-wave-bar:nth-child(2) { height: 16px; animation: wave 0.8s ease-in-out infinite 0.2s; }
.toc-wave-bar:nth-child(3) { height: 12px; animation: wave 0.8s ease-in-out infinite 0.4s; }
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.4); }
}

/* Title: 26px #ddd, playing: #ff8c1a bold */
.toc-item-title { color: var(--text-2); font-size: 26px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 39px; }
.toc-item.playing .toc-item-title { color: var(--accent); font-weight: 700; }

/* Duration: 22px #555 */
.toc-item-time { color: var(--text-5); font-size: 22px; flex-shrink: 0; line-height: 33px; }
.toc-item-heart { color: var(--accent); font-size: 20px; flex-shrink: 0; margin-left: 4px; width: 20px; }
.toc-item-heart.off { color: var(--text-5); }

/* ============================================================
   PAGE 5/6 - PLAYER
   ============================================================ */
#playerPage { overflow: hidden; }

/* Player header: 105px, padding 0 24px */
.player-header {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 105px;
  flex-shrink: 0;
}
.player-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  min-width: 0;
}
/* Subtitle: 22px #888 */
.player-header-sub { color: var(--text-3); font-size: 22px; line-height: 33px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
/* Title: 28px bold white */
.player-header-title { color: var(--text-1); font-size: 28px; font-weight: 700; line-height: 42px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

/* Mode switch row: 45px, padding 0 32px, gap 8px */
.player-mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
  height: 45px;
  flex-shrink: 0;
}
.player-mode-icon { color: var(--accent); width: 22px; height: 22px; flex-shrink: 0; }
.player-mode-icon svg { width: 22px; height: 22px; fill: var(--accent); }
/* "阅读": 22px medium #ff8c1a */
.player-mode-label { color: var(--accent); font-size: 22px; font-weight: 500; flex: 1; }
/* Big subtitle button */
.player-large-subtitle-btn {
  background: none;
  border: none;
  color: var(--text-4);
  font-size: 20px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}
.player-large-subtitle-btn svg { width: 22px; height: 22px; fill: var(--text-4); }

/* Lyrics area: padding top 14px, horizontal 32px, gap 20px */
.lyrics-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 32px 0;
  scroll-behavior: smooth;
}
.lyrics-area::-webkit-scrollbar { width: 4px; }
.lyrics-area::-webkit-scrollbar-thumb { background: #333; border-radius: 999px; }

/* Lyric lines: 26px, line-height ~1.85 (48px), margin-bottom 20px */
.lyric-line {
  font-size: 26px;
  line-height: 1.85;
  margin-bottom: 20px;
  transition: color 0.3s;
}
.lyric-line.dim { color: var(--text-5); }       /* #555 past */
.lyric-line.normal { color: #cccccc; }           /* #ccc future */
.lyric-line.highlight { color: var(--accent); font-weight: 700; } /* #ff8c1a current */

/* ===== Audio Controls: total 273px ===== */
.audio-controls {
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-card);
  flex-shrink: 0;
  height: 273px;
  position: relative;
  padding: 0 28px;
}

/* Progress row: at top 16px, height 30px */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0;
  position: absolute;
  top: 16px;
  left: 28px;
  right: 28px;
  height: 30px;
}
/* Time labels: 20px #666 */
.progress-time { color: var(--text-4); font-size: 20px; line-height: 30px; flex-shrink: 0; width: 62px; }
.progress-time.end { text-align: right; }
/* Track: 5px height, bg #2a2a2a, fill #ff8c1a */
.progress-track {
  flex: 1;
  height: 5px;
  background: var(--divider);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  align-self: center;
  margin: 0 4px;
}
.progress-fill {
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  pointer-events: none;
  transition: width 0.5s linear;
}

/* Controls main: at top 64px, height 88px */
.controls-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 64px;
  left: 28px;
  right: 28px;
  height: 88px;
}
.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-3);
}
/* Loop icon: 32px */
.ctrl-btn.loop svg { width: 32px; height: 32px; fill: var(--text-3); stroke: none; }
.ctrl-btn.loop.active svg { fill: var(--accent); }
/* Prev/Next: 44px */
.ctrl-btn.sm svg { width: 44px; height: 44px; fill: var(--text-3); }

/* Play btn: 88px circle, orange */
.play-btn {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 4px 20px var(--accent-dim);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.play-btn:active { transform: scale(0.94); }
/* Play icon: 38px white */
.play-btn svg { width: 38px; height: 38px; fill: #fff; }

/* Speed badge: 72×45px, bg #222, rounded 10px, text 22px bold #ccc */
.speed-badge {
  background: #222222;
  border-radius: 10px;
  width: 72px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #cccccc;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bottom actions: at top 176px, height 60px, px 50.75px */
.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 176px;
  left: 28px;
  right: 28px;
  height: 60px;
  padding: 0 22px;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  position: relative;
  padding: 0;
}
/* Icons: 28px */
.action-btn svg { width: 28px; height: 28px; fill: var(--text-5); }
.action-btn.active svg { fill: var(--accent); }
/* Labels: 18px #555 */
.action-label { color: var(--text-5); font-size: 18px; line-height: 27px; }
.action-badge-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 999px;
  position: absolute;
  top: -2px; right: -2px;
}

/* ============================================================
   BOTTOM SHEETS (Pages 7 & 8)
   ============================================================ */
.sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
}
.sheet-overlay.active { display: flex; }
.sheet {
  background: var(--bg-sheet);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 36px;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
/* Sheet title: 26px bold */
.sheet-title { color: var(--text-1); font-size: 26px; font-weight: 700; }
.sheet-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 30px;
  cursor: pointer;
  line-height: 1;
  font-family: var(--font);
  padding: 0;
}

/* Speed grid: 3 cols */
.speed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.speed-opt {
  background: var(--bg-speed-opt);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s;
}
.speed-opt.active { background: var(--accent); color: #fff; }
.speed-opt:active { opacity: 0.8; }

/* Timer sheet */
.timer-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 18px;
}
.timer-toggle-label { color: var(--text-2); font-size: 24px; font-weight: 500; }
.timer-toggle-sub { color: var(--text-4); font-size: 20px; margin-top: 4px; }
.toggle-switch {
  width: 56px; height: 30px;
  background: var(--text-muted);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--accent); }
.toggle-knob {
  width: 26px; height: 26px;
  background: #fff;
  border-radius: 999px;
  position: absolute;
  top: 2px; left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle-switch.on .toggle-knob { transform: translateX(26px); }
.timer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.timer-opt {
  background: var(--bg-speed-opt);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  border: none;
  text-align: left;
  font-family: var(--font);
  transition: background 0.15s;
}
.timer-opt.active { background: var(--accent); }
.timer-opt-title { font-size: 22px; font-weight: 700; }
.timer-opt.active .timer-opt-title { color: #fff; }
.timer-opt.inactive .timer-opt-title { color: var(--text-3); }
.timer-opt-sub { color: var(--text-4); font-size: 18px; margin-top: 4px; }
.timer-opt.active .timer-opt-sub { color: rgba(255,255,255,0.8); }

/* ============================================================
   PAGE 9 - LARGE SUBTITLE
   ============================================================ */
#bigLyricsPage { background: var(--bg-dark); }
#bigLyricsPage .status-bar { background: var(--bg-dark); }
#bigLyricsPage .home-indicator { background: var(--bg-dark); }
.big-lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  flex-shrink: 0;
  background: var(--bg-dark);
}
.big-lyrics-title { color: var(--text-3); font-size: 24px; text-align: center; flex: 1; }
.big-lyrics-close {
  background: none;
  border: none;
  color: var(--text-4);
  font-size: 30px;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
}
.big-lyrics-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 0;
  background: var(--bg-dark);
  scroll-behavior: smooth;
}
.big-lyrics-area::-webkit-scrollbar { width: 4px; }
.big-lyrics-area::-webkit-scrollbar-thumb { background: #333; border-radius: 999px; }
/* Big lyric: 28px, line-height 1.9, margin-bottom 24px */
.big-lyric-line {
  font-size: 28px;
  line-height: 1.9;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.big-lyric-line.dim { color: #333; }
.big-lyric-line.normal { color: #cccccc; }
.big-lyric-line.highlight { color: var(--accent); font-weight: 700; }
.big-lyrics-controls {
  background: var(--bg-primary);
  border-top: 1px solid var(--bg-card);
  padding: 16px 28px 8px;
  flex-shrink: 0;
}
.big-lyrics-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  height: 30px;
}
/* Big lyrics play controls: 3 buttons centered, gap 48px */
.big-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  height: 72px;
}
/* Big ctrl buttons: 44px prev/next, 72px play circle */
.big-ctrl-row .ctrl-btn svg { width: 44px; height: 44px; fill: var(--text-3); }
.big-ctrl-row .play-btn {
  width: 72px;
  height: 72px;
  box-shadow: 0 4px 16px var(--accent-dim);
}
.big-ctrl-row .play-btn svg { width: 32px; height: 32px; }

/* ============================================================
   TOAST & SNACKBAR
   ============================================================ */
#toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(40,40,40,0.95);
  color: var(--text-1);
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 22px;
  font-family: var(--font);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

#snackbar {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(40,40,40,0.96);
  color: var(--text-1);
  padding: 16px 28px;
  border-radius: 14px;
  font-size: 22px;
  font-family: var(--font);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
#snackbar.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   RESPONSIVE: full-screen on real mobile devices
   ============================================================ */
@media (max-width: 680px) {
  html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body {
    display: block;
    padding: 0;
    background: var(--bg-primary);
  }

  .device-frame {
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
  }

  /* 用 transform scale 按比例缩放整个 644px 设计到手机屏幕宽度 */
  .device-frame {
    width: 644px !important;
    height: 1512px !important;
    transform-origin: top left;
    transform: scale(calc(100vw / 644));
    border-radius: 0;
    box-shadow: none;
  }

  body {
    height: calc(1512px * (100vw / 644));
    overflow: hidden;
  }
}
