/* ==========================================================================
   声音魔法乐园 (Sound Magic Island) - 儿童友好童趣风格样式表
   ========================================================================== */

:root {
  /* 充满活力的童趣马卡龙多巴胺色彩系统 */
  --bg-gradient: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 35%, #fff1f2 70%, #fef3c7 100%);
  --sky-blue: #38bdf8;
  --bubble-pink: #f472b6;
  --sunny-yellow: #fbbf24;
  --mint-green: #34d399;
  --magic-purple: #a855f7;
  --coral-orange: #fb923c;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: #fed7aa;
  --text-dark: #334155;
  --text-muted: #64748b;
  --text-playful: #1e293b;

  --border-radius-pill: 9999px;
  --border-radius-card: 24px;
  --border-radius-btn: 18px;

  --shadow-soft: 0 10px 25px -5px rgba(245, 158, 11, 0.12), 0 8px 10px -6px rgba(99, 102, 241, 0.08);
  --shadow-float: 0 16px 36px -8px rgba(168, 85, 247, 0.18);
  --shadow-btn: 0 6px 14px rgba(0, 0, 0, 0.08), 0 3px 0 rgba(0, 0, 0, 0.15);
  --shadow-btn-pressed: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 全局重置与排版 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  font-family: 'Fredoka', 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* 背景漂浮动画元素（蓝天白云星星） */
.sky-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  font-size: 3.5rem;
  opacity: 0.55;
  filter: blur(0.5px);
  animation: floatCloud linear infinite;
}

.cloud-1 { top: 6%; left: -10%; animation-duration: 48s; }
.cloud-2 { top: 38%; left: -15%; animation-duration: 62s; animation-delay: -20s; font-size: 4.5rem; }
.cloud-3 { top: 72%; left: -10%; animation-duration: 54s; animation-delay: -10s; font-size: 3rem; }

@keyframes floatCloud {
  0% { transform: translateX(-10vw); }
  100% { transform: translateX(110vw); }
}

.floating-star, .floating-note {
  position: absolute;
  animation: starTwinkle 3s ease-in-out infinite alternate;
}

.star-1 { top: 12%; right: 18%; font-size: 1.8rem; animation-delay: 0.5s; }
.star-2 { top: 45%; left: 4%; font-size: 1.5rem; animation-delay: 1.2s; }
.star-3 { bottom: 15%; right: 8%; font-size: 2rem; animation-delay: 0.2s; }
.note-1 { top: 22%; left: 16%; font-size: 1.8rem; animation-delay: 1.8s; }
.note-2 { bottom: 25%; left: 22%; font-size: 1.6rem; animation-delay: 0.9s; }

@keyframes starTwinkle {
  0% { transform: translateY(0) scale(0.9) rotate(-10deg); opacity: 0.5; }
  100% { transform: translateY(-16px) scale(1.15) rotate(15deg); opacity: 0.95; }
}

/* 整体容器 */
.app-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 16px;
}

/* ==========================================================================
   顶部 Header 标题栏
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: var(--border-radius-card);
  border: 3px solid #ffedd5;
  box-shadow: var(--shadow-soft);
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2.8rem;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-icon:hover {
  transform: rotate(20deg) scale(1.2);
}

.main-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.sub-title {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* 魔法操作按钮 */
.magic-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--border-radius-btn);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.mic-btn {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #fff;
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35), 0 3px 0 #be123c;
}

.mic-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35), 0 3px 0 #047857;
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.secondary-btn {
  background: #ffffff;
  color: #475569;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-btn);
}

.secondary-btn:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.magic-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: var(--shadow-btn-pressed);
}

/* ==========================================================================
   主体两栏布局
   ========================================================================== */
.playground-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  flex: 1;
}

@media (max-width: 1040px) {
  .playground-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   左侧舞台展示区
   ========================================================================== */
.stage-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 模式选项卡 */
.mode-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: var(--border-radius-pill);
  border: 2px solid #e0e7ff;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-tab .tab-emoji {
  font-size: 1.25rem;
}

.mode-tab:hover {
  transform: translateY(-2px);
  border-color: #c7d2fe;
}

.mode-tab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px) scale(1.02);
}

/* 画布外壳 */
.canvas-wrapper {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #180d38 100%);
  border-radius: var(--border-radius-card);
  box-shadow: var(--shadow-float), inset 0 0 20px rgba(0, 0, 0, 0.5);
  border: 4px solid #fed7aa;
  min-height: 480px;
  height: 520px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sound-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 欢迎启动蒙层 */
.overlay-welcome {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-box {
  background: #ffffff;
  border-radius: 30px;
  padding: 32px 36px;
  max-width: 520px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 4px solid #fde047;
}

.welcome-avatar {
  font-size: 3.8rem;
  margin-bottom: 8px;
  animation: wobble 2s infinite ease-in-out;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg) scale(1.08); }
}

.welcome-box h2 {
  font-size: 1.6rem;
  color: #1e293b;
  margin-bottom: 8px;
}

.welcome-box p {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 16px;
}

.action-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.hint-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px dashed #cbd5e1;
}

.big-cta-btn {
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  color: white;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.4), 0 4px 0 #be123c;
  transition: transform 0.2s, box-shadow 0.2s;
}

.big-cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px rgba(244, 63, 94, 0.5), 0 4px 0 #be123c;
}

.big-cta-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.4);
}

.tip-small {
  font-size: 0.85rem !important;
  color: #94a3b8 !important;
  margin-top: 14px !important;
  margin-bottom: 0 !important;
}

/* 画布悬浮状态小标 */
.canvas-status-bar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.status-pill {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--border-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.freq-range-pill {
  background: rgba(30, 27, 75, 0.85);
  border: 1.5px solid #fde047;
  box-shadow: 0 4px 16px rgba(253, 224, 71, 0.25);
}

.freq-range-pill .pill-val {
  color: #38bdf8;
  font-size: 0.98rem;
  letter-spacing: 0.3px;
}

.mini-meter {
  width: 90px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #fbbf24, #f43f5e);
  transition: width 0.08s ease-out;
}

/* 画布下方调节栏 */
.stage-footer {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 12px 20px;
  border-radius: var(--border-radius-card);
  border: 2px solid #fed7aa;
  box-shadow: var(--shadow-soft);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.slider-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #334155;
}

.slider-control input[type="range"] {
  accent-color: #ec4899;
  cursor: pointer;
  width: 130px;
}

.slider-tag {
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.calibrate-mini-btn {
  background: #fef08a;
  border: 1.5px solid #facc15;
  color: #854d0e;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: all 0.2s;
}

.calibrate-mini-btn:hover {
  background: #fde047;
  transform: translateY(-1px);
}

.calibrate-mini-btn:active {
  transform: translateY(1px);
}

.color-theme-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.theme-dot:hover {
  transform: scale(1.2);
}

.theme-dot.active {
  transform: scale(1.25);
  outline: 3px solid #ec4899;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.4);
}

/* ==========================================================================
   右侧趣味仪表栏 (Sidebar)
   ========================================================================== */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-card);
  padding: 16px 18px;
  border: 2px solid #fed7aa;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-title-icon {
  font-size: 1.35rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.card-subtitle {
  font-size: 0.86rem;
  color: #64748b;
  margin-bottom: 10px;
}

/* 动物声音魔镜卡片 */
.animal-avatar-container {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.big-animal-emoji {
  font-size: 3.5rem;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  border-radius: 50%;
  border: 3px solid #fde047;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.big-animal-emoji.react {
  transform: scale(1.15) rotate(8deg);
}

.animal-speech-bubble {
  flex: 1;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.animal-speech-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #e2e8f0;
}

.animal-level-box {
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 16px;
}

.animal-name {
  font-weight: 700;
  font-size: 1rem;
  color: #4338ca;
}

.animal-desc {
  font-size: 0.84rem;
  color: #64748b;
}

/* 热气球冲天音量高度计 */
.balloon-visual {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 120px;
  background: linear-gradient(180deg, #c7d2fe 0%, #e0f2fe 50%, #dcfce7 100%);
  border-radius: 18px;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
  border: 2px solid #bae6fd;
}

.sky-altitude {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

.balloon-track {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  justify-content: center;
}

.balloon-item {
  position: absolute;
  bottom: 0%;
  font-size: 2.6rem;
  transition: bottom 0.12s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.balloon-tip {
  margin-top: 8px;
  font-size: 0.84rem;
  color: #64748b;
  text-align: center;
}

/* 声音生成实验室按钮网格 */
.sound-generators-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sound-gen-btn {
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 16px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sound-gen-btn:hover {
  background: #fff7ed;
  transform: translateY(-3px) scale(1.05);
  border-color: #fb923c;
}

.sound-gen-btn:active {
  transform: translateY(1px);
}

.gen-icon {
  font-size: 1.6rem;
}

.gen-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

/* 探险小任务列表 */
.quest-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.quest-item.completed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  font-weight: 600;
}

.quest-item.completed .quest-status {
  animation: bounceCelebration 0.6s ease;
}

@keyframes bounceCelebration {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}

/* ==========================================================================
   底部说明
   ========================================================================== */
.app-footer {
  text-align: center;
  margin-top: auto;
}

.footer-tips {
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 24px;
  border-radius: var(--border-radius-pill);
  font-size: 0.92rem;
  color: #475569;
  border: 2px dashed #fde047;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Toast 提示与弹窗
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--border-radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideToast 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast.reward {
  background: linear-gradient(135deg, #f59e0b, #ec4899);
}

@keyframes slideToast {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 截图弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: 28px;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 4px solid #fed7aa;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}

.modal-close:hover {
  color: #334155;
}

.snapshot-preview {
  width: 100%;
  border-radius: 18px;
  border: 3px solid #f1f5f9;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
}

.modal-tip {
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 18px;
}

.modal-footer {
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   🎹 彩虹钢琴对照尺与琴键跃动
   ========================================================================== */
.rainbow-piano-panel {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--border-radius-card);
  padding: 14px 20px 16px;
  border: 3px solid #fbcfe8;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.piano-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.piano-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.piano-icon {
  font-size: 1.4rem;
}

.piano-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
}

.piano-tip {
  font-size: 0.82rem;
  color: #64748b;
  margin-left: 6px;
}

.piano-active-note {
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: var(--border-radius-pill);
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.25);
  transition: all 0.2s ease;
}

.piano-keyboard-container {
  width: 100%;
  overflow-x: auto;
  padding: 6px 2px 10px;
}

.piano-keys {
  display: flex;
  position: relative;
  height: 96px;
  user-select: none;
  min-width: 600px;
  justify-content: space-between;
}

/* 钢琴白键 */
.piano-key.white-key {
  flex: 1;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 85%, #f1f5f9 100%);
  border: 2px solid #cbd5e1;
  border-radius: 0 0 10px 10px;
  margin: 0 2px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  box-shadow: 0 5px 0 #94a3b8, 0 8px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.08s ease;
  z-index: 1;
}

.piano-key.white-key:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fef3c7 100%);
}

.piano-key.white-key.active,
.piano-key.white-key:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #94a3b8, 0 2px 6px rgba(0, 0, 0, 0.15);
  background: var(--key-color, #f472b6) !important;
  color: #ffffff;
}

/* 钢琴黑键 */
.piano-key.black-key {
  position: absolute;
  width: 5.2%;
  height: 58%;
  background: linear-gradient(180deg, #334155 0%, #1e293b 85%, #0f172a 100%);
  border: 1.5px solid #0f172a;
  border-radius: 0 0 6px 6px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4px;
  box-shadow: 0 4px 0 #020617, 0 6px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.08s ease;
}

.piano-key.black-key.active,
.piano-key.black-key:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #020617;
  background: var(--key-color, #c084fc) !important;
}

.key-label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
}

.key-note {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.75;
  pointer-events: none;
}

.piano-key.black-key .key-note {
  font-size: 0.6rem;
  color: #e2e8f0;
}

.piano-key.white-key.active .key-note,
.piano-key.white-key.active .key-label,
.piano-key.black-key.active .key-note {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ==========================================================================
   🪞 声音哈哈镜录放变声器
   ========================================================================== */
.voice-changer-card {
  border-color: #fbcfe8;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(254, 242, 242, 0.92));
}

.card-header-titles {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fun-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #fff;
  border-radius: var(--border-radius-pill);
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.35);
  animation: pulseBadge 2s infinite ease-in-out;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.recorder-control-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 12px;
}

.record-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--border-radius-pill);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35), 0 2px 0 #b91c1c;
  transition: all 0.2s ease;
}

.record-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.record-btn.recording {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  animation: pulseRecording 1s infinite;
}

@keyframes pulseRecording {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.record-dot {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
}

.record-status-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  min-width: 80px;
  text-align: right;
}

/* 自由变调拖动条 */
.pitch-slider-box {
  background: #fff5f5;
  border: 1.5px dashed #fca5a5;
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.pitch-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.pitch-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #7f1d1d;
}

.pitch-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  padding: 1px 7px;
  border-radius: 8px;
}

.pitch-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pitch-icon-left, .pitch-icon-right {
  font-size: 0.75rem;
  font-weight: 700;
  color: #991b1b;
  white-space: nowrap;
}

.fun-pitch-slider {
  flex: 1;
  accent-color: #f43f5e;
  cursor: pointer;
  height: 6px;
}

.magic-play-slider-btn {
  background: linear-gradient(135deg, #f43f5e, #fb7185);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.magic-play-slider-btn:not(:disabled):hover {
  transform: scale(1.05);
}

.magic-play-slider-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.magic-group-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}

.voice-magic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 4px;
}

.voice-magic-grid::-webkit-scrollbar {
  width: 5px;
}
.voice-magic-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.voice-magic-grid::-webkit-scrollbar-thumb {
  background: #fca5a5;
  border-radius: 4px;
}

.magic-voice-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.magic-voice-btn:not(:disabled):hover {
  transform: translateY(-2px) scale(1.02);
  background: #fff7ed;
  border-color: #f97316;
}

.magic-voice-btn.playing {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(168, 85, 247, 0.35);
  animation: playingJiggle 0.6s ease infinite alternate;
}

@keyframes playingJiggle {
  from { transform: scale(1.02) rotate(-1deg); }
  to { transform: scale(1.04) rotate(1deg); }
}

.magic-voice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.magic-voice-btn.original-voice-btn {
  grid-column: span 2;
  justify-content: center;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.magic-voice-btn.original-voice-btn:not(:disabled):hover {
  background: #e2e8f0;
}

/* 🎪 欢闹拍拍即时音效板 */
.soundboard-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dashed #fed7aa;
}

.soundboard-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.soundboard-title-icon {
  font-size: 1.15rem;
}

.soundboard-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.soundboard-tip {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ea580c;
}

.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.soundboard-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.soundboard-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.25);
}

.soundboard-btn:active, .soundboard-btn.sfx-active {
  transform: scale(0.92);
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  border-color: transparent;
  color: #ffffff;
}

.sfx-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.sfx-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.soundboard-btn:hover .sfx-text {
  color: #0284c7;
}

.soundboard-btn.sfx-active .sfx-text {
  color: #ffffff;
}

/* ==========================================================================
   模式专属辅助悬浮控制/信息板
   ========================================================================== */
.mode-floating-banner {
  position: absolute;
  bottom: 16px;
  left: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 8px 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 10;
  pointer-events: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.banner-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.banner-val {
  color: #fbbf24;
  font-weight: 700;
}

.banner-btn {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--border-radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.banner-btn:hover {
  transform: scale(1.06);
}

