@font-face {
  font-family: 'Fredoka';
  src: url('../vendor/fredoka-700.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 🌌 星夜潮玩主题 (Starlight Anime Pop - 契合二次元街拍立绘配色) */
  --bg-canvas: #131126;
  --bg-panel: #1d1936;
  --bg-card: #262147;
  --bg-card-hover: #322b5c;
  --bg-elevated: #3b336b;
  --border-subtle: rgba(192, 132, 252, 0.24);
  --border-strong: rgba(74, 222, 128, 0.55);

  --accent-pea: #4ade80;
  --accent-pea-dim: rgba(74, 222, 128, 0.16);
  --accent-sakura: #ff7eb6;
  --accent-sakura-dim: rgba(255, 126, 182, 0.18);
  --accent-amber: #facc15;
  --accent-amber-dim: rgba(250, 204, 21, 0.18);
  --accent-cyan: #38bdf8;
  --accent-cyan-dim: rgba(56, 189, 248, 0.18);
  --accent-coral: #fb7185;
  --accent-coral-dim: rgba(251, 113, 133, 0.18);

  --text-primary: #faf8ff;
  --text-secondary: #c9bfe6;
  --text-muted: #8e82b3;

  --hud-glass: rgba(29, 25, 54, 0.92);
  --shadow-card: 0 10px 28px rgba(8, 6, 20, 0.45);
  --shadow-3d: 0 4px 0 rgba(10, 8, 24, 0.65);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-sans: 'Fredoka', 'Yuanti SC', 'STYuanti-SC-Regular', 'YouYuan', 'PingFang SC', 'Hiragino Maru Gothic ProN', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fredoka', 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}

/* 🧋 奶油原宿主题 (Pastel Harajuku Light - 还原立绘阳光街角咖啡厅配色) */
:root[data-theme="harajuku"] {
  --bg-canvas: #faf5ff;
  --bg-panel: #ffffff;
  --bg-card: #f3ecff;
  --bg-card-hover: #e9ddff;
  --bg-elevated: #dfd0ff;
  --border-subtle: rgba(139, 92, 246, 0.24);
  --border-strong: rgba(124, 58, 237, 0.55);

  --accent-pea: #10b981;
  --accent-pea-dim: rgba(16, 185, 129, 0.14);
  --accent-sakura: #ec4899;
  --accent-sakura-dim: rgba(236, 72, 153, 0.14);
  --accent-amber: #d97706;
  --accent-amber-dim: rgba(245, 158, 11, 0.16);
  --accent-cyan: #0284c7;
  --accent-cyan-dim: rgba(2, 132, 199, 0.14);
  --accent-coral: #e11d48;
  --accent-coral-dim: rgba(225, 29, 72, 0.14);

  --text-primary: #231942;
  --text-secondary: #5e5082;
  --text-muted: #8b7db0;

  --hud-glass: rgba(255, 255, 255, 0.92);
  --shadow-card: 0 8px 24px rgba(109, 40, 217, 0.1);
  --shadow-3d: 0 4px 0 rgba(109, 40, 217, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.58;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 14% 12%, rgba(255, 126, 182, 0.13) 0%, transparent 36%),
    radial-gradient(circle at 86% 20%, rgba(56, 189, 248, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 75% 85%, rgba(74, 222, 128, 0.1) 0%, transparent 40%),
    radial-gradient(rgba(192, 132, 252, 0.14) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 26px 26px;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 18px 64px;
}

/* Top HUD Bar */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--hud-glass);
  backdrop-filter: blur(14px);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  position: sticky;
  top: 10px;
  z-index: 100;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pea-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #27533b, #163022);
  border: 2px solid var(--accent-pea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 16px rgba(88, 232, 119, 0.25);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rank-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-pea-dim);
  color: var(--accent-pea);
  border: 1px solid var(--border-strong);
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
}

.stat-chip .stat-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.98rem;
}

.stat-chip.pea .stat-val { color: var(--accent-pea); }
.stat-chip.amber .stat-val { color: var(--accent-amber); }
.stat-chip.cyan .stat-val { color: var(--accent-cyan); }
.stat-chip.coral .stat-val { color: var(--accent-coral); }

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-btn {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-pea);
  transform: translateY(-1px);
}

/* Main Navigation Tabs (变大 · 潮玩立体 · 动态发光) */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 22px;
}

.mode-tab {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(20, 16, 36, 0.7) 100%), var(--bg-panel);
  border: 2px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 16px 18px;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-tab:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(26, 20, 48, 0.85) 100%), var(--bg-panel);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mode-tab:active {
  transform: translateY(1px) scale(0.985);
}

/* 电脑端各模式专属高亮激活态 */
.mode-tab.pill-campaign.active {
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.18) 0%, rgba(6, 182, 212, 0.12) 100%), #151126;
  border-color: #34d399;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mode-tab.pill-campaign.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #34d399, #06b6d4);
  box-shadow: 0 0 12px #34d399;
}

.mode-tab.pill-labs.active {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18) 0%, rgba(168, 85, 247, 0.14) 100%), #151126;
  border-color: #38bdf8;
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mode-tab.pill-labs.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  box-shadow: 0 0 12px #38bdf8;
}

.mode-tab.pill-coding.active {
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.18) 0%, rgba(249, 115, 22, 0.14) 100%), #151126;
  border-color: #facc15;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mode-tab.pill-coding.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #facc15, #f97316);
  box-shadow: 0 0 12px #facc15;
}

.mode-tab.pill-syllabus.active {
  background: linear-gradient(145deg, rgba(244, 114, 182, 0.18) 0%, rgba(251, 113, 133, 0.14) 100%), #151126;
  border-color: #fb7185;
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.mode-tab.pill-syllabus.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f472b6, #fb7185);
  box-shadow: 0 0 12px #fb7185;
}

.mode-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.96rem;
  gap: 6px;
}

.mode-tab-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 200, 69, 0.15);
  color: var(--accent-amber);
  font-weight: 700;
  white-space: nowrap;
}

.mode-tab-desc {
  font-size: 0.77rem;
  color: var(--text-secondary);
}

/* WISC-IV Cognitive Profile Drawer */
.profile-drawer {
  background: linear-gradient(135deg, rgba(27, 48, 38, 0.96), rgba(19, 35, 27, 0.96));
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  display: none;
}

.profile-drawer.open {
  display: block;
  animation: popIn 0.2s ease-out;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.profile-card {
  background: rgba(12, 22, 17, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.profile-card h4 {
  font-size: 0.88rem;
  color: var(--accent-pea);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-card p {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Views */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.18s ease-out;
}

body.progress-identity-pending .mode-nav,
body.progress-identity-pending .mobile-mode-pills,
body.progress-identity-pending .mobile-bottom-nav,
body.progress-identity-pending .view-section {
  pointer-events: none;
}

body.progress-identity-pending .view-section.active {
  position: relative;
  min-height: 320px;
}

body.progress-identity-pending .view-section.active::after {
  content: "正在恢复学习进度…";
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  font-weight: 800;
  background: rgba(18, 20, 32, 0.82);
  backdrop-filter: blur(2px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Campaign Top & Chapters */
.campaign-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.revenge-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-coral-dim);
  border: 1.5px solid var(--accent-coral);
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.86rem;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
}

.chapter-card {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.16s ease;
}

.chapter-card:hover {
  border-color: var(--accent-pea);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.chapter-card.completed {
  border-color: var(--accent-pea);
  background: linear-gradient(160deg, rgba(88, 232, 119, 0.09), var(--bg-panel));
}

.chapter-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 3px 9px;
  border-radius: 6px;
  display: inline-block;
}

.chapter-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-top: 6px;
}

.chapter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kp-pill {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pea));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.btn-primary {
  background: var(--accent-pea);
  color: #07170d;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 9px 15px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-pea);
}

/* Battle Arena (Active Cloze / Char Matrix / Multi-blank / Sequence) */
.battle-arena {
  background: var(--bg-panel);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

.arena-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.combo-badge {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1.5px solid var(--accent-amber);
  transition: transform 0.15s ease;
}

.combo-badge.pulse {
  transform: scale(1.18);
}

.q-type-tag {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.anti-abcd-notice {
  font-size: 0.76rem;
  color: var(--accent-pea);
  background: rgba(88, 232, 119, 0.1);
  border: 1px solid rgba(88, 232, 119, 0.3);
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
}

.cipher-hint-box {
  background: rgba(255, 200, 69, 0.1);
  border-left: 4px solid var(--accent-amber);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.question-stem {
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.25);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.question-stem .hl {
  color: var(--accent-pea);
  background: var(--accent-pea-dim);
  padding: 1px 7px;
  border-radius: 6px;
  margin: 0 2px;
}

.question-stem .hl-amber {
  color: var(--accent-amber);
  background: var(--accent-amber-dim);
  padding: 1px 7px;
  border-radius: 6px;
  margin: 0 2px;
}

.inline-blank-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 2px 12px;
  margin: 0 4px;
  border-bottom: 3px solid var(--accent-amber);
  background: rgba(255, 200, 69, 0.14);
  color: var(--accent-amber);
  border-radius: 6px 6px 0 0;
  font-weight: 900;
  font-size: 1.15rem;
}

.inline-blank-slot.active-slot {
  background: rgba(88, 232, 119, 0.22);
  border-bottom-color: var(--accent-pea);
  color: var(--accent-pea);
  box-shadow: 0 0 12px rgba(88, 232, 119, 0.3);
}

/* Character Matrix Cloze Assembly (Zero-ABCD True Fill-in-the-blank) */
.cloze-work-area {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.char-slots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.char-box {
  width: 52px;
  height: 56px;
  border-radius: 12px;
  background: #0c1712;
  border: 2px dashed var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-pea);
  cursor: pointer;
  transition: all 0.12s ease;
}

.char-box.filled {
  border-style: solid;
  border-color: var(--accent-pea);
  background: rgba(88, 232, 119, 0.14);
  box-shadow: 0 4px 12px rgba(88, 232, 119, 0.2);
}

.char-box.wrong-shake {
  border-color: var(--accent-coral);
  background: rgba(255, 107, 107, 0.2);
  color: var(--accent-coral);
}

.char-matrix-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.char-tile {
  min-width: 50px;
  height: 50px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.char-tile:hover:not(:disabled) {
  background: var(--accent-pea);
  color: #06150c;
  border-color: var(--accent-pea);
  transform: translateY(-2px);
}

.char-tile:disabled {
  opacity: 0.22;
  transform: scale(0.94);
  cursor: default;
}

.direct-type-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  flex-wrap: wrap;
}

.direct-type-input {
  flex: 1;
  min-width: 200px;
  background: #0c1712;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

.direct-type-input:focus {
  border-color: var(--accent-pea);
  box-shadow: 0 0 0 3px rgba(88, 232, 119, 0.2);
}

/* Shuffled Word-Bank Tiles (No ABCD labels) */
.word-bank-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.word-tile-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
}

.word-tile-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-pea);
  transform: translateY(-2px);
}

.word-tile-btn.correct {
  background: rgba(88, 232, 119, 0.25);
  border-color: var(--accent-pea);
}

.word-tile-btn.wrong {
  background: rgba(255, 107, 107, 0.25);
  border-color: var(--accent-coral);
}

.word-tile-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

/* Sequence Ordering Question Style */
.seq-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  align-items: center;
}

.seq-chip {
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-cyan);
  color: var(--text-primary);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Feedback Drawer */
.feedback-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(19, 35, 27, 0.98);
  border: 2px solid var(--accent-pea);
  display: none;
}

.feedback-panel.show {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: popIn 0.16s ease-out;
  flex-wrap: wrap;
}

.feedback-panel.wrong-fb {
  border-color: var(--accent-coral);
}

.mnemonic-pill {
  display: inline-block;
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  font-weight: 800;
  font-size: 0.86rem;
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

/* Interactive Labs Section */
.lab-subnav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.lab-tab-btn {
  background: var(--bg-panel);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
}

.lab-tab-btn.active {
  background: var(--accent-pea-dim);
  color: var(--accent-pea);
  border-color: var(--accent-pea);
}

.lab-workspace {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.lab-stage {
  background: #09110d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  position: relative;
}

.lab-inspector {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.inspector-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-pea);
  margin-bottom: 6px;
}

.part-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.part-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.part-btn:hover, .part-btn.active {
  background: var(--accent-pea);
  color: #07150c;
  border-color: var(--accent-pea);
}

.part-btn.explored {
  border-color: var(--accent-cyan);
}

/* Speed Coding Mode (PSI=148) */
.coding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cipher-key-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.cipher-key-cell {
  background: var(--bg-panel);
  border: 2px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease;
}

.cipher-key-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent-pea);
}

.cipher-symbol {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.cipher-label {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--accent-pea);
}

/* 4-Page Complete Syllabus Radar & Interactive Write-In Self-Test */
.syllabus-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.syllabus-page-block {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.syllabus-page-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--accent-amber);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.kp-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 12px;
}

.kp-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kp-item-card.mastered {
  border-color: var(--accent-pea);
  background: linear-gradient(145deg, rgba(88, 232, 119, 0.09), var(--bg-card));
}

.kp-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kp-cat {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 2px 8px;
  border-radius: 6px;
}

.kp-check-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}

.kp-item-card.mastered .kp-check-btn {
  background: var(--accent-pea);
  color: #07150c;
  border-color: var(--accent-pea);
}

.kp-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.cloze-token {
  color: var(--accent-amber);
  font-weight: 800;
  background: rgba(255, 200, 69, 0.14);
  padding: 1px 6px;
  border-radius: 5px;
  border-bottom: 2px solid var(--accent-amber);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cloze-hidden .cloze-token:not(.revealed) {
  color: transparent;
  background: #2b4c3b;
  border-bottom-color: var(--accent-pea);
  user-select: none;
  position: relative;
}

.cloze-hidden .cloze-token:not(.revealed)::after {
  content: "✍️点击真默写";
  color: var(--accent-pea);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0 3px;
}

.cloze-token.verified-token {
  color: var(--accent-pea) !important;
  background: rgba(74, 222, 128, 0.16) !important;
  border-bottom-color: var(--accent-pea) !important;
}

.kp-mnemonic {
  font-size: 0.78rem;
  color: var(--accent-pea);
  background: rgba(88, 232, 119, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 2px;
}

/* Modal for Original Handout Viewer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 8, 0.86);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--bg-panel);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  text-align: center;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

svg.bio-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  overflow: visible;
}

.svg-hotspot {
  cursor: pointer;
  transition: all 0.15s ease;
}

.svg-hotspot:hover {
  filter: drop-shadow(0 0 8px rgba(88, 232, 119, 0.8));
}

.svg-hotspot.active-part {
  stroke: #ffc845 !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 0 10px rgba(255, 200, 69, 0.9));
}

@media (max-width: 860px) {
  .mode-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .lab-workspace {
    grid-template-columns: 1fr;
  }
  .cipher-key-table {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 第二轮优化：提示按钮 / 纠错标红 / 进度条 / 译码反馈 ===== */
button {
  touch-action: manipulation; /* 去掉触屏双击缩放延迟 */
  -webkit-tap-highlight-color: transparent;
}

.hint-toggle-btn {
  display: block;
  width: 100%;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px dashed var(--accent-amber);
  background: transparent;
  color: var(--accent-amber);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.hint-toggle-btn:disabled {
  opacity: 0.4;
}

.inline-blank-slot.wrong-slot {
  background: var(--accent-coral-dim);
  border-bottom-color: var(--accent-coral);
  color: var(--accent-coral);
  animation: shake 0.35s ease;
}

.char-box.wrong-shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.arena-progress {
  height: 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.arena-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pea));
  transition: width 0.3s ease;
}

button.cipher-key-cell {
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
  min-height: 84px;
}

.cipher-key-cell.reveal-correct {
  border-color: var(--accent-pea);
  background: rgba(88, 232, 119, 0.25);
}

.cipher-key-cell.reveal-wrong {
  border-color: var(--accent-coral);
  background: rgba(255, 107, 107, 0.25);
}

.coding-flash {
  min-height: 1.4em;
  margin-bottom: 10px;
  font-weight: 900;
  color: var(--accent-coral);
}

.coding-result {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== 手机优先：压缩顶栏，不再吸顶占屏 ===== */
@media (max-width: 640px) {
  .app-shell {
    padding: 8px 10px 48px;
  }
  .hud-bar {
    position: static;
    padding: 10px 12px;
    gap: 8px;
    border-radius: 14px;
  }
  .brand-sub,
  .rank-pill {
    display: none;
  }
  .pea-avatar {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .brand-title {
    font-size: 1rem;
  }
  .hud-stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .stat-chip {
    flex-direction: column;
    gap: 0;
    padding: 4px 2px;
    font-size: 0.68rem;
    text-align: center;
  }
  .hud-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .mode-nav {
    gap: 8px;
    margin: 10px 0 14px;
  }
  .mode-tab {
    padding: 10px 12px;
  }
  .mode-tab-desc,
  .mode-tab-tag {
    display: none;
  }
  .battle-arena {
    padding: 14px;
  }
  .question-stem {
    font-size: 1.05rem;
    padding: 12px 14px;
  }
  .char-box {
    width: 44px;
    height: 48px;
    font-size: 1.2rem;
  }
  .char-tile {
    min-width: 46px;
    height: 46px;
  }
  .word-tile-btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
  .chapters-grid,
  .kp-checklist {
    grid-template-columns: 1fr;
  }
  .lab-subnav,
  .page-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .lab-tab-btn {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .lab-workspace {
    padding: 12px;
  }
  .lab-stage {
    min-height: 0;
  }
  .anti-abcd-notice {
    display: none;
  }
}


/* ==========================================================================
   🎮 全身二次元角色换装、特工灵宠与班级风云榜样式 (Full-Body Anime Wardrobe & Leaderboard)
   ========================================================================== */

/* 顶部 HUD 角色头像与金币栏 */
.hud-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.hud-profile-btn:hover {
  border-color: var(--accent-pea);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.hud-avatar-wrapper {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent-pea);
  overflow: visible;
  background: #000;
  flex-shrink: 0;
}
.hud-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.hud-pet-badge {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
  animation: petBounce 2.5s infinite ease-in-out;
}
.hud-profile-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}
.hud-profile-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.hud-profile-tag {
  font-size: 0.68rem;
  color: var(--accent-amber);
  white-space: nowrap;
}

.stat-chip.coin {
  background: rgba(255, 200, 69, 0.12);
  border-color: rgba(255, 200, 69, 0.35);
  color: var(--accent-amber);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.stat-chip.coin:hover {
  transform: scale(1.05);
  border-color: var(--accent-amber);
}
.stat-chip.coin .stat-val {
  color: #ffd86b;
  font-weight: 900;
}

.gold-btn {
  background: linear-gradient(135deg, rgba(255, 200, 69, 0.2), rgba(255, 140, 0, 0.15));
  border-color: var(--accent-amber) !important;
  color: var(--accent-amber) !important;
  font-weight: 800;
}
.trophy-btn {
  background: linear-gradient(135deg, rgba(88, 232, 119, 0.15), rgba(60, 230, 204, 0.15));
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
  font-weight: 800;
}

/* 浮动加金币动效 */
.coin-fly-fx {
  position: fixed;
  z-index: 99999;
  font-weight: 900;
  font-size: 1.2rem;
  color: #ffd86b;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 2px 4px #000;
  pointer-events: none;
  animation: floatUpFade 1.2s forwards ease-out;
}
@keyframes floatUpFade {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 1; transform: translateY(-15px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.9); }
}

/* 换装与商城模态窗布局 */
.wardrobe-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  padding: 10px 0;
  max-width: 1000px;
  margin: 0 auto;
}

/* 全身二次元角色舞台 (Character Stage) */
.character-stage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.character-stage {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 480px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 30%, rgba(88, 232, 119, 0.12), rgba(12, 22, 17, 0.95)),
              linear-gradient(180deg, #13271d 0%, #0a140f 100%);
  border: 2px solid var(--border-strong);
  box-shadow: 0 12px 36px rgba(0,0,0,0.6), inset 0 0 20px rgba(88, 232, 119, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 舞台光束与底座光环 */
.stage-spotlight {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.stage-pedestal {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(88, 232, 119, 0.4) 0%, rgba(88, 232, 119, 0.05) 60%, transparent 80%);
  filter: blur(4px);
  pointer-events: none;
}

/* 全身立绘图像（768x1376 9:16 全身） */
.stage-character-img {
  width: auto;
  height: 94%;
  max-width: 95%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.7));
  animation: characterFloat 4s infinite ease-in-out;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
  pointer-events: none;
}
@keyframes characterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* 灵宠展示（立在角色脚边） */
.stage-pet-companion {
  position: absolute;
  right: 18px;
  bottom: 22px;
  width: 82px;
  height: 82px;
  z-index: 5;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
  animation: petBounce 2.8s infinite ease-in-out;
  pointer-events: none;
}
@keyframes petBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

/* 饰品 / 徽章角标 */
.stage-accessory-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-amber);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--accent-amber);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* 舞台底部角色名称卡 */
.stage-character-card {
  margin-top: 12px;
  width: 100%;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
}
.stage-character-name {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.stage-character-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* 换装面板与分类选项 */
.wardrobe-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* 性别切换与分类 Tab */
.gender-switch-bar {
  display: flex;
  gap: 10px;
}
.gender-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
}
.gender-btn.active {
  background: rgba(88, 232, 119, 0.15);
  border-color: var(--accent-pea);
  color: var(--accent-pea);
  box-shadow: 0 0 14px rgba(88, 232, 119, 0.2);
}

/* 商城分类标签 */
.category-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1.5px solid var(--border-subtle);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cat-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.cat-tab-btn.active {
  background: var(--bg-card-hover);
  color: var(--accent-pea);
}

/* 衣服专属二级风格分栏 (潮流街拍 / 青春学院 / 国风汉服) */
.outfit-series-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.series-pill-btn {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  touch-action: manipulation;
}
.series-pill-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}
.series-pill-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}
.item-series-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.item-series-badge.street { color: var(--accent-cyan); border-color: rgba(56, 189, 248, 0.35); }
.item-series-badge.campus { color: var(--accent-pea); border-color: rgba(74, 222, 128, 0.35); }
.item-series-badge.hanfu { color: #ff7eb6; border-color: rgba(255, 126, 182, 0.4); }

/* 道具物品网格 */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.item-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
}
.item-card:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 232, 119, 0.5);
  background: var(--bg-card-hover);
}
.item-card.selected {
  border-color: var(--accent-pea);
  background: rgba(88, 232, 119, 0.12);
  box-shadow: 0 0 16px rgba(88, 232, 119, 0.25);
}
.item-card.equipped-active::after {
  content: '✓ 穿戴中';
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent-pea);
  color: #07170d;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
}
.item-card-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 6px;
}
.item-card-pet-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 6px;
}
.item-card-icon {
  font-size: 2.2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.item-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.2;
}
.item-card-price {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-amber);
}
.item-card.locked .item-card-thumb,
.item-card.locked .item-card-pet-thumb {
  filter: grayscale(40%) opacity(0.85);
}

/* 商城底部购买与保存栏 */
.wardrobe-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 12px;
}
.wallet-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.wallet-info span.coins-num {
  font-size: 1.25rem;
  color: var(--accent-amber);
  font-weight: 900;
}
.action-btn-group {
  display: flex;
  gap: 10px;
}
.btn-save-outfit {
  background: var(--accent-pea);
  color: #07170d;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.btn-save-outfit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(88, 232, 119, 0.4);
}
.btn-buy-item {
  background: linear-gradient(135deg, #ffc845 0%, #ff9800 100%);
  color: #2b1d03;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.btn-buy-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 200, 69, 0.5);
}

/* ==========================================================================
   🏆 班级排行榜 (Leaderboard) 样式
   ========================================================================== */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.leaderboard-my-card {
  background: linear-gradient(135deg, rgba(88, 232, 119, 0.15), rgba(60, 230, 204, 0.1));
  border: 2px solid var(--accent-pea);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.leaderboard-my-rank {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-pea);
}
.leaderboard-scroll {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}
.rank-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.rank-card:hover {
  border-color: var(--accent-pea);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}
.rank-num {
  font-size: 1.25rem;
  font-weight: 900;
  min-width: 34px;
  text-align: center;
  color: var(--text-secondary);
}
.rank-card.top-1 .rank-num { color: #ffd700; font-size: 1.5rem; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.rank-card.top-2 .rank-num { color: #c0c0c0; font-size: 1.4rem; }
.rank-card.top-3 .rank-num { color: #cd7f32; font-size: 1.35rem; }

.rank-avatar-box {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
}
.rank-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.rank-pet-mini {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.rank-details {
  flex: 1;
  min-width: 0;
}
.rank-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.rank-nickname {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-outfit-tag {
  font-size: 0.7rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-secondary);
}
.rank-sub-stats {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.rank-score-pill {
  text-align: right;
  min-width: 80px;
}
.rank-score-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent-amber);
}
.rank-score-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   👥 同学特工名片弹窗 (Classmate Showcase Card)
   ========================================================================== */
.classmate-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 10px 0;
}
.classmate-stage {
  position: relative;
  width: 280px;
  height: 420px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 30%, rgba(88, 232, 119, 0.15), rgba(12, 22, 17, 0.98)),
              linear-gradient(180deg, #13271d 0%, #0a140f 100%);
  border: 2px solid var(--accent-pea);
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.classmate-stage img.stage-char {
  width: auto;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.7));
  animation: characterFloat 4s infinite ease-in-out;
}
.classmate-stage img.stage-pet {
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 74px;
  height: 74px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
  animation: petBounce 2.8s infinite ease-in-out;
}

/* ==========================================================================
   🔑 登录弹窗 (Login Modal)
   ========================================================================== */
.login-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto;
}
.auth-tabs-bar {
  display: flex;
  background: var(--bg-panel);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  touch-action: manipulation;
}
.auth-tab-btn:hover {
  color: var(--text-primary);
}
.auth-tab-btn.active {
  background: var(--accent-pea);
  color: #07170d;
  box-shadow: 0 2px 8px rgba(88, 232, 119, 0.3);
}
.quick-roster-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.roster-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
.roster-btn:hover, .roster-btn.active {
  border-color: var(--accent-pea);
  color: var(--accent-pea);
  background: var(--bg-card-hover);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.form-row label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-secondary);
}
.form-input {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-pea);
  background: var(--bg-card-hover);
}

/* 移动端与平板响应式适配 */
@media (max-width: 768px) {
  .wardrobe-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .character-stage {
    max-width: 260px;
    height: 380px;
  }
  .stage-pet-companion {
    width: 68px;
    height: 68px;
    right: 12px;
    bottom: 16px;
  }
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    max-height: 280px;
  }
  .item-card-thumb {
    width: 58px;
    height: 58px;
  }
  .item-card-pet-thumb {
    width: 52px;
    height: 52px;
  }
  .hud-stats {
    gap: 6px;
  }
}

/* Cell comparison is HTML so long descriptions wrap inside the card. */
.cells-comparison {
  width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
}

.cells-comparison h3 {
  margin-bottom: 10px;
  color: var(--accent-amber);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cells-comparison ul {
  display: grid;
  gap: 7px;
  list-style: none;
}

.cells-comparison li {
  position: relative;
  min-width: 0;
  padding-left: 1.05em;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cells-comparison li::before {
  position: absolute;
  left: 0;
  content: "•";
  color: var(--accent-pea);
}

.cells-comparison .cells-shared { color: var(--accent-cyan); }
.cells-comparison .cells-plant { color: var(--accent-pea); }
.cells-comparison .cells-energy { color: var(--accent-amber); }
.cells-comparison .cells-ciliate { color: var(--text-secondary); }

:root[data-theme="harajuku"] .cells-comparison .cells-shared { color: #0369a1; }
:root[data-theme="harajuku"] .cells-comparison .cells-plant { color: #047857; }
:root[data-theme="harajuku"] .cells-comparison .cells-energy { color: #92400e; }


/* ==========================================================================
   🌟 13-14岁青少年潮流二次元视觉升级 (Agent Hero Banner · 3D触感按键 · 原宿贴纸)
   ========================================================================== */

.agent-hero-banner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  background: linear-gradient(135deg, rgba(255, 126, 182, 0.14) 0%, rgba(192, 132, 252, 0.14) 50%, rgba(56, 189, 248, 0.14) 100%),
              var(--bg-panel);
  border: 2.5px solid var(--border-strong);
  border-radius: 24px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card), var(--shadow-3d);
  align-items: center;
  position: relative;
  overflow: hidden;
}

.agent-hero-stage {
  position: relative;
  width: 210px;
  height: 290px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 126, 182, 0.25), rgba(19, 17, 38, 0.92)),
              linear-gradient(180deg, #271f4a 0%, #141129 100%);
  border: 2.5px solid var(--accent-sakura);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
  margin: 0 auto;
}
.agent-hero-stage:hover {
  transform: scale(1.03) rotate(-1deg);
  border-color: var(--accent-pea);
}
.hero-char-img {
  height: 96%;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  animation: characterFloat 4s infinite ease-in-out;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
  z-index: 2;
}
.hero-pet-img {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 62px;
  height: 62px;
  z-index: 4;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55));
  animation: petBounce 2.6s infinite ease-in-out;
}
.hero-stage-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(19, 17, 38, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-sakura);
  z-index: 5;
}

.agent-hero-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.agent-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.agent-sticker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.sticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.sticker-pill.pink {
  background: var(--accent-sakura);
  color: #1f0814;
  box-shadow: 0 2px 0 rgba(0,0,0,0.28);
}
.sticker-pill.cyan {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1.5px solid var(--accent-cyan);
}

.agent-hero-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.agent-hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-pop {
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}
.btn-pop.pink {
  background: linear-gradient(135deg, #ff7eb6, #f43f5e);
  color: #fff;
  box-shadow: 0 4px 0 #9f1239;
}
.btn-pop.cyan {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  box-shadow: 0 4px 0 #1e3a8a;
}
.btn-pop.amber {
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #1e1303;
  box-shadow: 0 4px 0 #9a3412;
}
.btn-pop:hover {
  transform: translateY(-2px);
}
.btn-pop:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.agent-equip-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.equip-pill {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}
.equip-pill b {
  color: var(--text-primary);
}
.equip-pill:hover {
  border-color: var(--accent-sakura);
  transform: translateY(-1px);
}

.agent-xp-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
}
.xp-bar-track {
  height: 14px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #38bdf8, #ff7eb6);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* 3D 触感果冻按键升级 */
.btn-primary,
.word-tile-btn,
.char-tile,
.mode-tab {
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, border-color 0.2s ease;
}
.btn-primary {
  box-shadow: 0 4px 0 #15803d;
}
.btn-primary:active,
.word-tile-btn:active,
.char-tile:active {
  transform: translateY(2px) scale(0.98);
}

.chapter-card {
  border-width: 2px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}
.chapter-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-sakura);
}

/* 奶油原宿浅色主题下的细节微调 */
:root[data-theme="harajuku"] .character-stage,
:root[data-theme="harajuku"] .classmate-stage,
:root[data-theme="harajuku"] .agent-hero-stage {
  background: radial-gradient(circle at 50% 30%, rgba(255, 182, 219, 0.45), rgba(233, 213, 255, 0.9)),
              linear-gradient(180deg, #fce7f3 0%, #ede9fe 100%);
  border-color: #ec4899;
}
:root[data-theme="harajuku"] .modal-content {
  background: #ffffff;
  border: 2.5px solid #c084fc;
}
:root[data-theme="harajuku"] .xp-bar-track {
  background: #e9d5ff;
}

@media (max-width: 768px) {
  .agent-hero-banner {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
    text-align: center;
  }
  .agent-hero-stage {
    width: 190px;
    height: 260px;
  }
  .agent-hero-top {
    flex-direction: column;
    align-items: center;
  }
  .agent-sticker-row,
  .agent-hero-btns,
  .agent-equip-pills {
    justify-content: center;
  }
}

/* ==========================================================================
   🚀 6 大开源硬核学习游戏化升级样式 (Daily Quests · Typo Alert · 3-Star Mastery · Lab Dual View · Blitz Powerups)
   ========================================================================== */

/* 1. 每日特工 3 小件悬赏任务条 & 连续打卡 */
.daily-quests-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-strong);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.daily-quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.dq-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dq-title {
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--text-primary);
}

.dq-streak-pill {
  background: rgba(251, 146, 60, 0.16);
  color: #fb923c;
  border: 1.5px solid #fb923c;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.dq-chest-pill {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1.5px solid var(--accent-amber);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 900;
}

.dq-chest-pill.unlocked {
  background: var(--accent-pea-dim);
  color: var(--accent-pea);
  border-color: var(--accent-pea);
}

.daily-quests-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dq-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dq-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.dq-card.done {
  border-color: var(--accent-pea);
  background: linear-gradient(145deg, rgba(74, 222, 128, 0.12), var(--bg-card));
}

.dq-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.dq-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dq-reward {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--accent-amber);
  white-space: nowrap;
}

.dq-card.done .dq-reward {
  color: var(--accent-pea);
}

.dq-bar {
  height: 7px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 999px;
  overflow: hidden;
}

.dq-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-pea), var(--accent-cyan));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.dq-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 700;
}

/* 2. 中考高频错别字阅卷防坑警报框 */
.typo-trap-alert {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(244, 63, 94, 0.14);
  border: 1.5px solid var(--accent-coral);
  border-radius: 10px;
  color: var(--text-primary);
}

.typo-alert-title {
  font-size: 0.84rem;
  font-weight: 900;
  color: var(--accent-coral);
  margin-bottom: 4px;
}

.typo-alert-item {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary);
}

/* 3. 3星熟练度徽章 & 错题二次验证毕业横幅 */
.mastery-star-badge {
  font-size: 0.74rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  color: var(--accent-amber);
  border: 1px solid rgba(250, 204, 21, 0.45);
  white-space: nowrap;
}

.mastery-star-badge.s3 {
  background: rgba(74, 222, 128, 0.16);
  color: var(--accent-pea);
  border-color: var(--accent-pea);
}

.mastery-star-badge.rev {
  background: rgba(251, 113, 133, 0.16);
  color: var(--accent-coral);
  border-color: var(--accent-coral);
}

.rev-grad-banner {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
}

.rev-grad-banner.pass2 {
  background: rgba(74, 222, 128, 0.16);
  border-color: var(--accent-pea);
  color: var(--accent-pea);
}

/* 4. 结构解剖室双视图切换 & 考卷黑白原图舞台 */
.lab-stage-toolbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-orig-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exam-orig-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-amber);
  margin-bottom: 8px;
  text-align: center;
}

.exam-orig-img-wrap {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.exam-orig-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 340px;
  margin: 0 auto;
}

/* 5. 极速译码风暴倍率暴击与细胞膜护盾 */
.coding-mult-badge.m2 {
  border-color: #fb923c !important;
  color: #fb923c !important;
  background: rgba(251, 146, 60, 0.16) !important;
}

.coding-mult-badge.m3 {
  border-color: #f43f5e !important;
  color: #fda4af !important;
  background: rgba(244, 63, 94, 0.24) !important;
  animation: pulse 0.9s infinite alternate;
}

.coding-shield-badge {
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
  background: var(--accent-cyan-dim) !important;
}


/* ================= 多学科课程切换条 & 图片热点实验台（V2：V1 引擎通用化） ================= */
.course-switcher {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 2px solid var(--border-subtle, rgba(255,255,255,0.12));
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(20,16,36,0.7) 100%), var(--bg-panel);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}
.course-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.course-change-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.16s ease;
}
.course-change-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent-pea);
  transform: translateY(-1px);
}
.course-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.course-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 0.88rem;
  color: var(--text-secondary); background: transparent;
  border: 2px solid var(--border-subtle, rgba(255,255,255,0.18));
  transition: transform .12s ease, border-color .12s ease;
}
.course-chip:hover { transform: translateY(-1px); }
.course-chip.active {
  color: var(--text-primary); border-color: var(--course-accent, var(--accent-pea));
  background: color-mix(in srgb, var(--course-accent, var(--accent-pea)) 16%, transparent);
}
.course-chip-meta { font-size: 0.72rem; opacity: .75; font-family: var(--font-mono, monospace); }
.course-title-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; }
.course-status {
  font-size: 0.72rem; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  color: var(--accent-amber); border: 1px solid var(--accent-amber);
}

.img-lab-stage { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.img-lab-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: 14px; overflow: hidden; background: #fff; }
.img-lab-img { display: block; max-width: 100%; height: auto; max-height: 62vh; }
.img-hotspot {
  position: absolute; transform: translate(-50%, -50%);
  width: 32px; height: 32px; border-radius: 50%; padding: 0; line-height: 28px;
  font: 900 0.9rem/28px var(--font-sans, sans-serif); text-align: center; cursor: pointer;
  color: #1a1030; background: rgba(250, 204, 21, 0.92); border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.img-hotspot.explored { background: rgba(88, 232, 119, 0.95); }
.img-hotspot.active-part { outline: 3px solid var(--accent-coral, #fb7185); transform: translate(-50%, -50%) scale(1.15); }
.img-lab-caption { font-size: 0.78rem; color: var(--text-secondary); text-align: center; }

/* ================= V1.0 潮流首页门户：顶部特工栏 + 全身换装展台 + 年级/学科/阶段指挥舱 ================= */
.course-launcher {
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 12px 0 28px;
}
.course-launcher.open {
  display: flex;
}
body.launcher-open .mobile-mode-pills,
body.launcher-open .mode-nav,
body.launcher-open .view-section,
body.launcher-open .mobile-bottom-nav,
body.launcher-open .course-persistent-bar,
body.launcher-open #btn-global-home,
body.launcher-open #m-btn-home {
  display: none !important;
}

.course-persistent-bar {
  margin: 12px 0 6px;
}

.course-switcher {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.12), rgba(56, 189, 248, 0.12)), var(--bg-panel);
  border: 2px solid var(--course-accent, var(--accent-pea, #4ade80));
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.home-nav-btn {
  background: linear-gradient(135deg, #38bdf8, #4ade80) !important;
  color: #062e20 !important;
  border: 1.5px solid #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 3px 10px rgba(56, 189, 248, 0.35);
}
.home-nav-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px) !important;
}

.m-home-btn {
  background: linear-gradient(135deg, #38bdf8, #4ade80) !important;
  color: #062e20 !important;
  border-color: #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.launcher-hero-mount .agent-hero-banner,
.launcher-hero-mount .mobile-hero-card {
  margin-bottom: 0;
}

.launcher-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.11) 0%, rgba(56, 189, 248, 0.11) 50%, rgba(192, 132, 252, 0.11) 100%),
              var(--bg-panel);
  border: 2.5px solid var(--border-strong);
  border-radius: 24px;
  padding: 20px 22px;
  box-shadow: var(--shadow-card), var(--shadow-3d);
}

.launcher-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--border-subtle);
}
.launcher-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.launcher-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.25), rgba(56, 189, 248, 0.28));
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}
.launcher-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.launcher-title {
  font-size: 1.32rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.launcher-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 2px;
}

.launcher-resume {
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  font-size: 0.84rem;
  color: #131126;
  background: linear-gradient(135deg, #4ade80, #38bdf8);
  border: 2px solid #fff;
  box-shadow: 0 4px 0 rgba(15, 23, 42, 0.45), 0 6px 16px rgba(56, 189, 248, 0.3);
  transition: transform 0.14s ease;
  white-space: nowrap;
}
.launcher-resume:hover {
  transform: translateY(-2px);
}

.launcher-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.96rem;
  font-weight: 900;
  color: var(--accent-amber, #fbbf24);
}
.launcher-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(135deg, #facc15, #fb923c);
  color: #1a1030;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.4);
  flex-shrink: 0;
}
.launcher-step-hint {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: auto;
}

.launcher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.launcher-grade-grid,
.launcher-subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.launcher-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 18px;
  font: inherit;
  font-weight: 900;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  text-align: left;
  min-width: 0;
}
.launcher-chip:hover:not(.disabled) {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}
.launcher-chip.active {
  border-color: var(--course-accent, var(--accent-pea, #4ade80));
  background: linear-gradient(145deg, color-mix(in srgb, var(--course-accent, var(--accent-pea, #4ade80)) 22%, var(--bg-card)), var(--bg-card));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--course-accent, var(--accent-pea, #4ade80)) 55%, #000),
              0 6px 18px color-mix(in srgb, var(--course-accent, var(--accent-pea, #4ade80)) 24%, transparent);
}
.launcher-chip.subject-card.subj-biology.active {
  --course-accent: #4ade80;
}
.launcher-chip.subject-card.subj-geography.active {
  --course-accent: #38bdf8;
}
.launcher-chip.subject-card.subj-history.active {
  --course-accent: #fbbf24;
}

.l-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}
.l-chip-icon,
.launcher-chip-icon {
  font-size: 1.45rem;
  line-height: 1;
}
.l-chip-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.l-chip-badge.ready {
  background: rgba(74, 222, 128, 0.16);
  color: var(--accent-pea);
  border-color: rgba(74, 222, 128, 0.5);
}
:root[data-theme="harajuku"] .l-chip-badge.ready {
  background: #dcfce7;
  color: #15803d;
  border-color: #22c55e;
}
.l-chip-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-top: 2px;
}
.l-chip-sub,
.launcher-chip small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
}
.launcher-chip.soon {
  opacity: 0.78;
}
.launcher-chip.disabled {
  cursor: default;
}

/* 步骤 3：学期与阶段大卡片 */
.launcher-terms-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 12px;
  align-items: stretch;
}
.launcher-term {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.22);
  border: 1.5px solid var(--border-subtle);
  border-radius: 18px;
  padding: 12px;
}
:root[data-theme="harajuku"] .launcher-term {
  background: rgba(255, 255, 255, 0.65);
}
.launcher-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.launcher-term-name {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-primary);
}
.launcher-term-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.launcher-term-pill.ready {
  background: rgba(74, 222, 128, 0.16);
  color: var(--accent-pea);
  border: 1px solid var(--accent-pea);
}
:root[data-theme="harajuku"] .launcher-term-pill.ready {
  background: #dcfce7;
  color: #15803d;
}
.launcher-term-pill.soon {
  background: rgba(250, 204, 21, 0.14);
  color: var(--accent-amber);
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.launcher-chip.stage {
  width: 100%;
  gap: 10px;
  padding: 14px 16px;
  border-width: 2.5px;
  border-color: var(--course-accent, var(--accent-pea));
  background: linear-gradient(145deg, rgba(74, 222, 128, 0.14), rgba(56, 189, 248, 0.1)), var(--bg-card);
}
.stage-card-top {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 6px;
}
.stage-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
}
.stage-main-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7eb6, #c084fc);
  color: #fff;
}
.stage-course-name {
  font-size: 1.04rem;
  font-weight: 900;
  color: var(--text-primary);
}
.stage-status-tag {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--accent-amber);
  border: 1.5px solid var(--accent-amber);
  background: rgba(250, 204, 21, 0.12);
  white-space: nowrap;
}
.stage-features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.stage-feat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.stage-progress-panel {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 10px;
}
.stage-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.stage-star-count {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--accent-amber);
}
.stage-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.stage-cta-hint {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-cyan);
}
.stage-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 900;
  color: #131126;
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  box-shadow: 0 3px 0 #15803d;
  margin-left: auto;
}

.launcher-chip.stage-empty {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 14px;
  border-style: dashed;
}
.stage-empty-icon {
  font-size: 1.7rem;
  flex-shrink: 0;
}
.stage-empty-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.course-title-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.92rem; }
.course-change-btn {
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  font-size: 0.86rem;
  padding: 8px 18px;
  border-radius: 999px;
  color: #062e20;
  background: linear-gradient(135deg, #4ade80, #38bdf8);
  border: 2px solid #fff;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.4), 0 4px 14px rgba(56, 189, 248, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.course-change-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

@media (max-width: 767px) {
  .course-launcher { margin: 4px 0 20px; gap: 10px; }
  .launcher-card { padding: 14px 12px; border-radius: 18px; gap: 10px; }
  .launcher-logo { width: 38px; height: 38px; font-size: 1.3rem; border-radius: 11px; }
  .launcher-title { font-size: 1.05rem; }
  .launcher-sub { font-size: 0.72rem; }
  .launcher-resume { width: 100%; text-align: center; justify-content: center; font-size: 0.8rem; padding: 9px 12px; }
  .launcher-step { font-size: 0.86rem; margin-top: 2px; }
  .launcher-step-hint { font-size: 0.66rem; }
  .launcher-grade-grid,
  .launcher-subject-grid { gap: 7px; }
  .launcher-chip.grade-card,
  .launcher-chip.subject-card { padding: 9px 8px; border-radius: 13px; }
  .l-chip-icon, .launcher-chip-icon { font-size: 1.15rem; }
  .l-chip-badge { font-size: 0.58rem; padding: 1px 5px; }
  .l-chip-title { font-size: 0.88rem; }
  .l-chip-sub { font-size: 0.62rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .launcher-terms-grid { grid-template-columns: 1fr; gap: 10px; }
  .stage-cta-btn { width: 100%; text-align: center; }
}

/* 题图（课程题目附带的原卷插图）与图片热点的文字编号 */
.q-figure { margin: 8px 0 12px; text-align: center; }
.q-figure img { max-width: 100%; max-height: 38vh; border-radius: 12px; background: #fff; cursor: zoom-in; border: 2px solid var(--border-subtle, rgba(255,255,255,0.2)); }
.q-figure figcaption { font-size: 0.72rem; color: var(--text-secondary); margin-top: 4px; }
.img-hotspot { width: auto; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 15px; line-height: 26px; white-space: nowrap; font-size: 0.82rem; }

/* 图片热点实验台：窄屏时图片保持足够大，横向可滑动，编号不再挤在一起 */
.img-lab-stage { overflow-x: auto; align-items: flex-start; -webkit-overflow-scrolling: touch; }
.img-lab-wrap { width: max(100%, 640px); }
.img-lab-img { width: 100%; max-height: none; }
@media (min-width: 1000px) { .img-lab-wrap { width: 100%; } .img-lab-stage { align-items: center; } }
