/* ================================
   声印采集页面样式 v5.0
   艺学堂·音鉴 — 10 个 Phaser 音乐小游戏
   改动：删除 7 关麦克风录音样式，
   新增 #phaserContainer / 10 关进度条 / 总结区(人格预览+六维分)
   ================================ */

/* 所有 CSS 变量已迁移至 design-system.css */

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

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--color-primary-bg) 0%, var(--color-bg) 100%);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

.soundprint-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px 100px;
}

/* ── 头部 ── */
.soundprint-header {
  text-align: center;
  padding: 36px 0 24px;
  position: relative;
}
.soundprint-header.compact-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg, #FAFAFA);
  padding: 12px 0 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.brand-icon { font-size: var(--text-3xl); }
.brand-name {
  font-size: var(--text-2xl);
  font-weight: bold;
  color: var(--color-primary);
  letter-spacing: 2px;
}
.compact-nav .brand-icon,
.compact-nav .brand-name { display: none; }
.header-title {
  font-size: var(--text-xl);
  font-weight: bold;
  color: var(--color-text);
  margin-top: var(--space-md);
}
.compact-nav .header-title {
  font-size: var(--text-sm);
  margin-top: 0;
  display: inline;
}
.header-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: 6px;
}
.compact-nav .header-subtitle { display: none; }
.btn-header-reset {
  position: absolute;
  top: 36px;
  right: 0;
  font-size: 13px;
  color: var(--color-text-tertiary);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}
.compact-nav .btn-header-reset {
  position: static;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 12px;
  vertical-align: middle;
}
.btn-header-reset:hover {
  color: var(--color-danger, #e53935);
  border-color: var(--color-danger, #e53935);
  background: #fff;
}
@media (max-width: 767px) {
  .btn-header-reset {
    position: static;
    display: inline-block;
    margin: 14px 0 0;
  }
}

/* ── 顶部状态文字 ── */
.sg-status-bar {
  text-align: center;
  padding: 4px 0 8px;
  margin-bottom: 4px;
}
.compact-nav .sg-status-bar {
  display: inline;
  padding: 0;
  margin: 0 8px 0 0;
  font-size: var(--text-xs);
}
.sg-status-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}
.sg-status-text.active {
  color: var(--color-primary);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   Phaser 游戏容器
   ═══════════════════════════════════════ */

.phaser-area {
  position: relative;
  margin: 8px 0 16px;
}
#phaserContainer {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  background: var(--color-primary-bg, #FFF8F0);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease;
}
#phaserContainer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.phaser-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--color-primary-bg, #FFF8F0);
  border-radius: var(--radius-lg, 16px);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  z-index: 5;
}
.phaser-loading-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(241,141,36,0.25);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spSpin 0.9s linear infinite;
}
@keyframes spSpin {
  to { transform: rotate(360deg); }
}

/* ── 10 关进度条 ── */
.phaser-progress {
  margin: 12px 0 20px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-sm);
}
.compact-nav .phaser-progress {
  margin: 6px auto 0;
  padding: 6px 12px 4px;
  max-width: 320px;
}
.compact-nav .pp-label { font-size: 10px; margin-top: 4px; }
.compact-nav .pp-dot { width: 10px; height: 10px; }
.compact-nav .pp-dot.active { box-shadow: 0 0 0 3px rgba(241,141,36,0.2); }
.pp-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.pp-dot {
  position: relative;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  transition: all 0.3s ease;
}
.pp-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(241, 141, 36, 0.2);
  transform: scale(1.15);
}
.pp-dot.done {
  background: var(--color-green, #27ae60);
}
.pp-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-green, #27ae60));
  border-radius: 2px;
  transition: width 0.4s ease;
  z-index: 1;
}
.pp-label {
  text-align: center;
  margin-top: 10px;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════
   欢迎卡片 — 非遮罩内嵌卡片（置于 phaserContainer 内部层叠）
   ================================ */
.welcome-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg, #FFF8F0);
  border-radius: var(--radius-lg, 16px);
  animation: welcomeFadeIn 0.3s ease-out;
}
@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes welcomeCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-card {
  max-width: 340px;
  width: min(340px, calc(100% - 48px));
  background: var(--color-surface);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(241, 141, 36, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: welcomeCardIn 0.4s ease-out 0.1s both;
}

.welcome-visual {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #ffb340 50%, #ff6b35 100%);
  box-shadow: 0 6px 24px rgba(241, 141, 36, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcome-note {
  position: absolute;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.15);
  animation: noteFloat3s 3s ease-in-out infinite;
}
.note-1 { font-size: 32px; left: 50%; top: 50%; transform: translate(-50%, -50%); animation-delay: 0s; }
.note-2 { font-size: 20px; left: 18%; top: 22%; animation-delay: 0.8s; opacity: 0.85; }
.note-3 { font-size: 18px; right: 16%; bottom: 20%; animation-delay: 1.6s; opacity: 0.7; }
@keyframes noteFloat3s {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -55%) scale(1.08); }
}
@keyframes noteFloat2s {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.1); }
}
@keyframes noteFloat1s {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.note-2 { animation-name: noteFloat2s; }
.note-3 { animation-name: noteFloat1s; }

.welcome-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-text, #333);
  margin-bottom: 8px;
}
.welcome-desc {
  font-size: 14px;
  color: var(--color-text-secondary, #666);
  margin-bottom: 20px;
  line-height: 1.6;
}
.welcome-tasks {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 8px;
  background: linear-gradient(135deg, var(--color-primary-bg), var(--color-primary-surface));
  border-radius: 12px;
}
.welcome-task-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-secondary, #666);
  white-space: nowrap;
}
.welcome-task-arrow {
  font-size: 11px;
  color: var(--color-text-tertiary, #999);
  margin: 0 2px;
}
.welcome-hint {
  font-size: 13px;
  color: var(--color-text-tertiary, #999);
  margin-bottom: 24px;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.welcome-btn-primary {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(241, 141, 36, 0.3);
}
.welcome-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241, 141, 36, 0.4);
}
.welcome-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(241, 141, 36, 0.3);
}
.welcome-btn-skip {
  background: none;
  border: none;
  color: var(--color-text-tertiary, #999);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.2s ease;
}
.welcome-btn-skip:hover {
  color: var(--color-text-secondary, #666);
}
.welcome-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-out;
}

/* ── 欢迎卡消除动画（完成后切换到 phaser-game 模式） ── */
.welcome-overlay.fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
@media (max-width: 380px) {
  .welcome-card { padding: 28px 20px 24px; border-radius: 16px; }
  .welcome-visual { width: 64px; height: 64px; margin-bottom: 16px; }
  .welcome-note.note-1 { font-size: 26px; }
  .welcome-note.note-2 { font-size: 16px; }
  .welcome-note.note-3 { font-size: 14px; }
  .welcome-title { font-size: 18px; }
  .welcome-desc { font-size: 13px; }
  .welcome-task-item { font-size: 11px; }
  .welcome-btn-primary { height: 44px; font-size: 15px; }
}
@media (max-width: 320px) {
  .welcome-tasks { gap: 4px; padding: 10px 6px; }
  .welcome-task-item { font-size: 10px; }
  .welcome-task-arrow { font-size: 10px; }
}

/* ═══════════════════════════════════════
   AI 重测弹窗
   ================================ */
.retest-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn .3s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.retest-dialog {
  background: var(--color-surface);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  animation: dialogIn .35s ease;
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.retest-dialog-header {
  padding: 20px 24px 12px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.retest-dialog-header h3 {
  font-size: 20px;
  color: var(--color-text);
}
.retest-dialog-header p {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}
.retest-dialog-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.retest-dialog-body::-webkit-scrollbar { width: 4px; }
.retest-dialog-body::-webkit-scrollbar-thumb { background: var(--color-border-light); border-radius: 2px; }

.retest-bubble-ai {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: bubbleIn .25s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.retest-ai-avatar {
  font-size: 28px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.retest-ai-content {
  background: var(--color-blue-bg);
  padding: 12px 16px;
  border-radius: 12px;
  border-top-left-radius: 4px;
  max-width: 85%;
}
.retest-ai-content p {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
}
.retest-bubble-user {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-end;
  animation: bubbleIn .25s ease;
}
.retest-user-content {
  background: var(--color-primary-surface);
  padding: 10px 16px;
  border-radius: 12px;
  border-top-right-radius: 4px;
  max-width: 80%;
}
.retest-user-content p {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
}
.retest-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-left: 46px;
}
.retest-option {
  padding: 10px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.5;
}
.retest-option:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}
.retest-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-surface);
  color: var(--color-primary);
  font-weight: bold;
}
.retest-text-input {
  padding-left: 46px;
  margin-top: 6px;
  animation: bubbleIn .25s ease;
}
.retest-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
  transition: border-color .2s;
}
.retest-input:focus { border-color: var(--color-primary); }
.retest-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--color-text);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .2s;
}
.retest-textarea:focus { border-color: var(--color-primary); }
.retest-dialog-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
}
.retest-btn-skip {
  flex: 1;
  padding: 12px 0;
  min-height: 44px;
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text-tertiary);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.retest-btn-skip:hover { border-color: var(--color-border); color: var(--color-text-secondary); }
.retest-btn-submit {
  flex: 2;
  padding: 12px 0;
  min-height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 12px rgba(241,141,36,.25);
}
.retest-btn-submit:hover { background: var(--color-primary-dark); }
.retest-btn-submit:disabled {
  background: var(--color-border);
  box-shadow: none;
  cursor: not-allowed;
}
.retest-user-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ═══════════════════════════════════════
   任务总结区（10 关完成 + 人格预览 + 六维分）
   ================================ */
.task-summary {
  margin-bottom: 24px;
  animation: fadeSlideIn .5s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.summary-header {
  text-align: center;
  margin-bottom: 20px;
}
.summary-header h2 {
  font-size: 22px;
  color: var(--color-text);
}
.summary-header p {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}
.summary-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 人格预览卡 */
.sp-persona-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  padding: 18px 20px;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm);
}
.sp-persona-badge {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: var(--color-primary);
}
.sp-persona-P { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.sp-persona-R { background: linear-gradient(135deg, #F18D24, #d87a1a); }
.sp-persona-B { background: linear-gradient(135deg, #2f9e9e, #1f6f6f); }
.sp-persona-E { background: linear-gradient(135deg, #ec4899, #be185d); }
.sp-persona-info { flex: 1; min-width: 0; }
.sp-persona-title {
  font-size: 17px;
  font-weight: bold;
  color: var(--color-text);
}
.sp-persona-desc {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 4px;
  line-height: 1.5;
}

/* 六维分条 */
.sp-dim-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-surface);
  padding: 18px 20px;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm);
}
.sp-dim-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sp-dim-label {
  flex: 0 0 56px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.sp-dim-track {
  flex: 1;
  height: 10px;
  background: var(--color-border);
  border-radius: 5px;
  overflow: hidden;
}
.sp-dim-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-green, #27ae60));
  transition: width 0.6s ease;
}
.sp-dim-value {
  flex: 0 0 28px;
  text-align: right;
  font-size: 14px;
  font-weight: bold;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.summary-retest-badge {
  text-align: center;
  margin-top: 16px;
  padding: 12px;
  background: var(--color-blue-bg);
  border-radius: 10px;
  font-size: 14px;
  color: var(--color-blue);
  cursor: pointer;
  user-select: none;
  transition: all .2s;
}
.summary-retest-badge:hover {
  background: var(--color-blue-surface, #dbeafe);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59,130,246,.15);
}
.summary-retest-badge:active { transform: translateY(0); }

.summary-guide {
  text-align: center;
  margin-top: 24px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--color-primary-bg, #fff7ed), var(--color-surface));
  border: 1px solid var(--color-primary-light, #fde68a);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.summary-guide:hover {
  border-color: var(--color-primary, #f18d24);
  box-shadow: 0 4px 14px rgba(241, 141, 36, 0.18);
  transform: translateY(-1px);
}
.summary-guide:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(241, 141, 36, 0.15);
}
.summary-guide-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.summary-guide-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   底部操作栏 & 提交按钮
   ================================ */
.bottom-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg) var(--space-xl);
}
.btn-submit-all {
  flex: 0 1 360px;
  width: auto;
  max-width: 360px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  font-size: var(--text-lg);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(241, 141, 36, 0.35);
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}
.btn-restart-all {
  flex: 0 0 auto;
  padding: 14px 24px;
  border: 1.5px solid var(--color-border, #ddd);
  border-radius: var(--radius-full);
  background: var(--color-surface, #fff);
  color: var(--color-text-secondary, #666);
  font-size: var(--text-lg);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.btn-restart-all:hover { background: #f5f5f5; color: #333; border-color: #ccc; }
.btn-restart-all:active { transform: scale(0.98); }
.btn-submit-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241, 141, 36, 0.4);
}
.btn-submit-all:active { transform: translateY(0) scale(0.98); }

/* ═══════════════════════════════════════
   Toast
   ================================ */
.sp-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.sp-toast.show { opacity: 1; }
.sp-toast.success { background: var(--color-green); }
.sp-toast.error   { background: var(--color-red); }
.sp-toast.info    { background: var(--color-blue); }

/* ═══════════════════════════════════════
   重启二次确认浮层
   ================================ */
.sp-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
}
.sp-pause-card, .sp-confirm-card {
  max-width: 340px;
  width: min(340px, calc(100% - 48px));
  background: var(--color-surface, #fff);
  border-radius: 20px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(241, 141, 36, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: welcomeCardIn 0.3s ease-out both;
}
.sp-pause-title, .sp-confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text, #222);
  margin: 0 0 8px;
}
.sp-pause-sub, .sp-confirm-sub {
  font-size: 13px;
  color: var(--color-text-secondary, #666);
  line-height: 1.6;
  margin: 0 0 20px;
}
.sp-pause-actions, .sp-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-btn-primary, .sp-btn-secondary, .sp-btn-danger {
  height: 46px;
  border: none;
  border-radius: 23px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sp-btn-primary {
  background: linear-gradient(135deg, var(--color-primary, #F18D24), var(--color-primary-light, #FAC775));
  color: #fff;
}
.sp-btn-secondary {
  background: none;
  border: 1px solid var(--color-border, #ddd);
  color: var(--color-text-secondary, #666);
}
.sp-btn-danger {
  background: linear-gradient(135deg, #E24B4A, #A32D2D);
  color: #fff;
}
.sp-btn-primary:hover, .sp-btn-danger:hover { transform: translateY(-1px); }
.sp-btn-primary:hover { box-shadow: 0 6px 20px rgba(241, 141, 36, 0.4); }
.sp-btn-danger:hover { box-shadow: 0 6px 20px rgba(226, 75, 74, 0.4); }

/* ═══════════════════════════════════════
   Game-Mode：游戏进行时，隐藏外围 UI
   ================================ */
body.game-mode .global-footer,
body.game-mode .navbar,
body.game-mode .cookie-consent,
body.game-mode .voice-selector,
body.game-mode .teacher-helper,
body.game-mode .sg-main-nav { display: none !important; }

.game-mode .soundprint-container {
  padding-bottom: 20px;
}

.game-mode .phaser-area {
  margin-top: 0;
}

.game-mode .bottom-actions {
  display: none !important;
}

/* ── 通关弹窗（TADA 弹窗） ── */
.level-complete-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border-radius: var(--radius-lg, 16px);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  animation: tadaPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}
@keyframes tadaPopIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  70% { transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.level-complete-toast .tada-stars {
  font-size: 28px;
  line-height: 1;
}
.level-complete-toast .tada-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text, #1a1a1a);
}
.level-complete-toast .tada-sub {
  font-size: 11px;
  color: var(--color-text-tertiary, #999);
}

/* ── 关卡切换动画（容器过渡） ── */
#phaserContainer.level-transition {
  animation: levelSlideOut 0.35s ease-in forwards;
}
#phaserContainer.level-transition-in {
  animation: levelSlideIn 0.35s ease-out both;
}
@keyframes levelSlideOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.92) translateY(-8px); }
}
@keyframes levelSlideIn {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── game-done 模式：总结内容替换 Phaser 容器 ── */
body.game-done .phaser-area #phaserContainer {
  background: var(--color-surface, #fff);
  aspect-ratio: auto;
  min-height: auto;
  padding: 0;
  overflow: visible;
  box-shadow: none;
}
body.game-done .phaser-area #phaserContainer canvas {
  display: none !important;
}
body.game-done #taskSummary {
  display: block !important;
}

/* ═══════════════════════════════════════
   响应式
   ================================ */
@media (max-width: 767px) {
  .soundprint-container { padding: 0 var(--space-sm, 12px) 90px; }
  .soundprint-header { padding: 24px 0 16px; }
  .brand-name { font-size: 20px; letter-spacing: 1px; }
  .brand-icon { font-size: 26px; }
  .header-title { font-size: 17px; }
  .header-subtitle { font-size: 12px; }
  .pp-dot { width: 12px; height: 12px; }
  .btn-submit-all { max-width: 100%; font-size: var(--text-base); padding: 12px 20px; }
  .bottom-actions { padding: var(--space-sm) var(--space-md) var(--space-lg); }
  .sp-persona-card { padding: 16px; gap: 12px; }
  .sp-persona-badge { width: 48px; height: 48px; font-size: 22px; }
  .sp-persona-title { font-size: 15px; }
  .sp-dim-list { padding: 16px; }
  .summary-header h2 { font-size: 19px; }
  .retest-dialog-overlay { padding: 12px; }
  .retest-dialog { max-width: 95vw; max-height: 90vh; border-radius: 12px; }
  .retest-dialog-header { padding: 16px 18px 10px; }
  .retest-dialog-header h3 { font-size: 18px; }
  .retest-dialog-body { padding: 14px 16px; max-height: 340px; }
  .retest-options { padding-left: 0; }
  .retest-option { min-height: 44px; padding: 12px 14px; font-size: 13px; }
  .retest-text-input { padding-left: 0; }
  .retest-ai-content { max-width: 90%; }
  .retest-ai-content p { font-size: 13px; }
  .retest-bubble-ai { gap: 6px; }
  .retest-btn-skip { min-height: 44px; font-size: 13px; }
  .retest-btn-submit { min-height: 44px; font-size: 14px; }
}

/* ═══════════════════════════════════════
   AI 画中画解读卡（蒙版 + 画中画）— 报告页升级包 T02
   ═══════════════════════════════════════ */
.ai-pip {
  position: relative;
  margin: var(--space-md) 0;
  padding: var(--sp-20, 20px);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-bg, #FFF8F0) 0%, #fff 100%);
  border: 1px solid rgba(241, 141, 36, 0.18);
  box-shadow: var(--shadow-sm);
}
.ai-pip__mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(241, 141, 36, 0.10), transparent 45%),
    radial-gradient(circle at 88% 86%, rgba(241, 141, 36, 0.08), transparent 42%);
  pointer-events: none;
  z-index: 0;
}
.ai-pip__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  animation: aiPipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes aiPipIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-pip__decoration {
  position: absolute;
  top: -24px;
  right: -24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 141, 36, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.ai-pip__headline {
  font-size: var(--text-base, 15px);
  font-weight: 600;
  color: var(--color-text, #1A1A1A);
  line-height: 1.6;
}
.ai-pip__body {
  position: relative;
  z-index: 1;
}
.ai-pip__detail {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary, #666);
}
.ai-pip__detail summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-primary, #F18D24);
  padding: var(--sp-4, 4px) 0;
  -webkit-tap-highlight-color: transparent;
}
.ai-pip__detail summary::-webkit-details-marker {
  color: var(--color-primary, #F18D24);
}
.ai-pip__detail[open] summary {
  margin-bottom: var(--sp-8, 8px);
}
.ai-pip__detail-body {
  font-size: var(--text-sm, 14px);
  color: var(--color-text-secondary, #666);
  line-height: 1.7;
  margin-top: var(--sp-4, 4px);
}
.ai-pip__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  font-size: var(--text-xs, 12px);
  font-weight: 600;
  color: #fff;
  background: var(--gradient-brand, linear-gradient(135deg, #F18D24 0%, #F59E0B 100%));
  border-radius: var(--radius-full, 999px);
  box-shadow: 0 2px 8px rgba(241, 141, 36, 0.25);
}

/* ── Primary CTA（高对比，收尾提交始终可见）— 报告页升级包 T02 ── */
.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 28px;
  font-size: var(--text-base, 15px);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #F18D24 0%, #F59E0B 100%);
  border: none;
  border-radius: var(--radius-full, 999px);
  box-shadow: 0 4px 16px rgba(241, 141, 36, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}
.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241, 141, 36, 0.4);
}
.cta-primary:active {
  transform: translateY(0) scale(0.98);
}
.cta-primary:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════
   完成弹窗 — 与后续题目页 af-set-transition 完全统一
   ═══════════════════════════════════════════ */
.sp-complete-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 210;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sp-complete-overlay.show {
  display: flex;
  animation: sp-fade-in 0.25s ease-out;
}
@keyframes sp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.sp-complete-card {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 16px);
  padding: 40px 32px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: sp-slide-up 0.3s ease-out;
}
@keyframes sp-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.sp-complete-icon {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 14px;
}
.sp-complete-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 10px;
}
.sp-complete-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}
.sp-complete-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-full, 999px);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #d87a1a) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(241,141,36,0.35);
  transition: all 0.2s ease;
}
.sp-complete-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(241,141,36,0.4);
}
.sp-complete-btn:disabled {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark, #d87a1a) 100%);
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(241,141,36,0.25);
  cursor: wait;
}
.sp-complete-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: -8px 0 18px;
  line-height: 1.6;
  text-align: center;
}

/* ── 自适应：平板与笔记本区间铺满（手机端 ≤767px 不受影响）──
   soundprint-container 默认 max-width:600px，逐级放宽。
   注意：#phaserContainer 游戏画布 max-width:480px 保持不动，
   避免破坏 Phaser 点击坐标映射；外层容器加宽后画布自动居中，
   视觉上即可铺满。 */
@media (min-width: 768px)  { .soundprint-container { max-width: 720px; } }
@media (min-width: 1024px) { .soundprint-container { max-width: 880px; } }

/* 全屏自适应铺满（问题6）：新增 min-width 覆盖，仅扩大容器，不动旧 max-width/手机端块 */
@media (min-width: 1280px) { .soundprint-container { max-width: 1180px; } }
@media (min-width: 1680px) { .soundprint-container { max-width: 1340px; } }
