/* ========== 基础设置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #FF69B4;
  --primary-dark: #FF1493;
  --secondary: #FFD700;
  --success: #32CD32;
  --bg-gradient: linear-gradient(135deg, #FFE4F0 0%, #E8F4FF 50%, #FFF0F5 100%);
  --card-shadow: 0 8px 32px rgba(255, 105, 180, 0.2);
  --text-dark: #4A4A4A;
  --text-light: #888;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-dark);
}

/* ========== 粒子效果容器 ========== */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.particle {
  position: absolute;
  font-size: 24px;
  animation: fall 3s linear forwards;
  opacity: 0;
}

@keyframes fall {
  0% {
    opacity: 1;
    transform: translateY(-50px) rotate(0deg) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateY(0) rotate(36deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(360deg) scale(0.5);
  }
}

/* ========== 头部 ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(255, 105, 180, 0.1);
}

.app-title {
  font-size: 1.3rem;
  font-weight: bold;
  background: linear-gradient(45deg, #FF69B4, #FFD700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  animation: pulse 2s infinite;
}

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

.star-icon {
  font-size: 1.2rem;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== 主内容区 ========== */
#main-content {
  padding-top: 70px;
  padding-bottom: 90px;
  min-height: 100vh;
}

.page {
  display: none;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* ========== 欢迎区域 ========== */
.welcome-section {
  text-align: center;
  padding: 20px 0;
}

.welcome-title {
  font-size: 2rem;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #FF69B4, #9370DB, #00CED1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rainbow 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes rainbow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.wave {
  display: inline-block;
  animation: wave 1s ease infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-20deg); }
}

.welcome-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* ========== 菜单卡片 ========== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px 0;
}

.menu-card {
  background: white;
  border-radius: 24px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.menu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.menu-card:active {
  transform: scale(0.95);
}

.menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(255, 105, 180, 0.3);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.card-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
}

.card-explore::before { background: linear-gradient(90deg, #FF6B6B, #FFE66D); }
.card-math::before { background: linear-gradient(90deg, #4ECDC4, #44CF74); }
.card-english::before { background: linear-gradient(90deg, #A78BFA, #818CF8); }
.card-chinese::before { background: linear-gradient(90deg, #F472B6, #FB7185); }
.card-timer::before { background: linear-gradient(90deg, #FFD93D, #FF9F43); }
.card-profile::before { background: linear-gradient(90deg, #45B7D1, #4ECDC4); }

/* ========== 进度条 ========== */
.daily-progress {
  background: white;
  border-radius: 20px;
  padding: 20px;
  margin-top: 10px;
  box-shadow: var(--card-shadow);
}

.daily-progress h3 {
  margin-bottom: 12px;
  color: var(--text-dark);
}

.progress-bar {
  height: 16px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700, #FF69B4, #9370DB);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  border-radius: 10px;
  transition: width 0.5s ease;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-text {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ========== 页面头部 ========== */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.btn-back {
  background: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.btn-back:active {
  transform: scale(0.95);
}

/* ========== 视频分类标签 ========== */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 0 15px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid #eee;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  min-width: 60px;
}

.category-tab:active {
  transform: scale(0.95);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.tab-icon {
  font-size: 1.3rem;
}

.tab-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.category-info {
  margin-bottom: 15px;
}

.category-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

/* ========== 视频网格 ========== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* 视频加载状态 */
.video-loading,
.video-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.video-loading .loading-icon,
.video-error .error-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
  animation: bounce 1s ease infinite;
}

.video-error .error-icon {
  animation: none;
}

.video-loading p,
.video-error p {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.btn-retry {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
}

.video-card {
  background: white;
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--category-color, linear-gradient(90deg, var(--primary), var(--secondary)));
}

.video-card:active {
  transform: scale(0.95);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 105, 180, 0.25);
}

.video-thumb {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.video-card-title {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-light);
}

.video-card-meta span {
  display: flex;
  align-items: center;
  gap: 2px;
}

.video-card p {
  font-weight: 500;
  color: var(--text-dark);
}

/* ========== 视频详情弹窗 ========== */
.video-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.video-detail-modal.hidden {
  display: none;
}

.video-detail-content {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.video-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f5f5f5;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-light);
}

.video-detail-close:active {
  transform: scale(0.95);
  background: #eee;
}

.video-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-right: 40px;
}

.video-detail-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.video-detail-title-area {
  flex: 1;
}

.video-detail-title-area h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 4px;
}

.detail-title-zh {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 600;
}

.video-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-tag {
  background: #f5f5f5;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-dark);
}

.video-detail-section {
  margin-bottom: 16px;
}

.video-detail-section h4 {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.video-detail-section p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: linear-gradient(135deg, #E8F4FF, #FFE4F0);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  color: var(--primary-dark);
}

.parent-tip {
  background: #FFF9E6;
  padding: 12px;
  border-radius: 12px;
  border-left: 4px solid #FFD700;
}

.parent-tip h4 {
  color: #B8860B;
}

.parent-tip p {
  color: #8B7500;
}

.btn-play-video {
  width: 100%;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
  transition: all 0.3s;
}

.btn-play-video:active {
  transform: scale(0.98);
}

/* ========== 视频播放器弹窗 ========== */
.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-modal.hidden {
  display: none;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  background: black;
  border-radius: 16px;
  overflow: hidden;
}

.video-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.video-close:hover {
  background: white;
  transform: scale(1.1);
}

#video-player {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 比例 (9/16 = 0.5625) */
}

#video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.video-overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  color: white;
}

.overlay-emoji {
  font-size: 4rem;
  animation: bounce 1s ease infinite;
}

.overlay-content p {
  font-size: 1.5rem;
  margin: 20px 0;
}

/* ========== 游戏区域 ========== */
.game-area {
  background: white;
  border-radius: 24px;
  padding: 30px 20px;
  box-shadow: var(--card-shadow);
}

/* 数学题 */
.math-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 30px;
  color: var(--text-dark);
}

.answer-box {
  background: linear-gradient(135deg, #FFE4F0, #E8F4FF);
  padding: 10px 25px;
  border-radius: 15px;
  color: var(--primary);
}

/* 答案选项 */
.answer-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.option-btn {
  background: linear-gradient(135deg, #f8f8f8, #fff);
  border: 3px solid #eee;
  padding: 20px;
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.option-btn:active {
  transform: scale(0.95);
}

.option-btn.correct {
  background: linear-gradient(135deg, #32CD32, #90EE90);
  border-color: #32CD32;
  color: white;
  animation: correctPop 0.5s ease;
}

.option-btn.wrong {
  background: linear-gradient(135deg, #FF6B6B, #FFA07A);
  border-color: #FF6B6B;
  color: white;
  animation: shake 0.5s ease;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

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

.math-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed #eee;
  color: var(--text-light);
}

/* 英语学习 */
.word-display {
  text-align: center;
  margin-bottom: 30px;
}

.word-image {
  font-size: 5rem;
  margin-bottom: 15px;
  animation: bounce 2s ease infinite;
}

.word-text {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 15px;
}

.btn-sound {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
  transition: all 0.3s;
}

.btn-sound:active {
  transform: scale(0.95);
}

.question-text {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 15px;
}

/* 中文学习 */
.character-display {
  text-align: center;
  margin-bottom: 30px;
}

.big-character {
  font-size: 6rem;
  font-weight: bold;
  color: var(--text-dark);
  text-shadow: 3px 3px 0 #FFE4F0;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.pinyin {
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 10px;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s;
}

.nav-item.active {
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

.nav-item.active .nav-icon {
  transform: scale(1.2);
}

.nav-item.active .nav-label {
  color: var(--primary);
  font-weight: bold;
}

.nav-icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.nav-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ========== 奖励弹窗 ========== */
.reward-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.reward-popup.hidden {
  display: none;
}

.reward-content {
  background: white;
  border-radius: 30px;
  padding: 40px;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

@keyframes popIn {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.reward-stars {
  font-size: 3rem;
  animation: starDance 1s ease infinite;
}

@keyframes starDance {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  50% { transform: scale(1.2) rotate(0deg); }
  75% { transform: scale(1.1) rotate(5deg); }
}

.reward-title {
  font-size: 2rem;
  color: var(--primary);
  margin: 15px 0;
  background: linear-gradient(45deg, #FF69B4, #FFD700, #FF69B4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: rainbow 1s ease infinite;
}

.reward-message {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 20px;
}

#reward-points {
  font-weight: bold;
  color: var(--secondary);
  font-size: 1.5rem;
}

.btn-continue, .btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  padding: 15px 40px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
  transition: all 0.3s;
}

.btn-continue:active, .btn-primary:active {
  transform: scale(0.95);
}

/* ========== 通用隐藏类 ========== */
.hidden {
  display: none !important;
}

/* ========== 倒计时页面 ========== */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.timer-display {
  margin-bottom: 30px;
}

.timer-circle {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: #f0f0f0;
  stroke-width: 12;
}

.timer-progress {
  fill: none;
  stroke: url(#timer-gradient);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
  stroke: linear-gradient(135deg, #FF69B4, #FFD700);
  stroke: #FF69B4;
}

.timer-circle.warning .timer-progress {
  stroke: #FF6B6B;
  animation: pulse-warning 0.5s ease infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.timer-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
  color: var(--text-dark);
  z-index: 1;
}

.timer-minutes, .timer-seconds {
  min-width: 60px;
  text-align: center;
}

.timer-colon {
  animation: blink 1s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.timer-emoji {
  position: absolute;
  bottom: 35px;
  font-size: 2rem;
  animation: bounce 2s ease infinite;
}

.timer-setup {
  background: white;
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 350px;
  box-shadow: var(--card-shadow);
}

.timer-hint {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 16px;
  font-size: 1rem;
}

.time-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.time-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border: 3px solid #eee;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.time-btn:active {
  transform: scale(0.95);
}

.time-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

.time-num {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
}

/* ========== 日历菜单卡片 ========== */
.card-calendar::before { background: linear-gradient(90deg, #45B7D1, #96CEB4); }

/* ========== 日历页面 ========== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.calendar-header h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
  min-width: 140px;
  text-align: center;
}

.calendar-nav-btn {
  background: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s;
  color: var(--primary);
}

.calendar-nav-btn:active {
  transform: scale(0.95);
}

/* 月度统计 */
.calendar-stats {
  display: flex;
  justify-content: space-around;
  background: white;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
}

.time-unit {
  font-size: 0.75rem;
  color: var(--text-light);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.btn-start-timer {
  width: 100%;
  background: linear-gradient(135deg, #32CD32, #90EE90);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(50, 205, 50, 0.4);
  transition: all 0.3s;
}

.btn-start-timer:active {
  transform: scale(0.98);
}

.timer-controls {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.timer-control-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.stat-class .stat-value { color: #4ECDC4; }
.stat-play .stat-value { color: #FF6B6B; }
.stat-holiday .stat-value { color: #45B7D1; }

/* 日历容器 */
.calendar-container {
  background: white;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #f5f5f5;
  margin-bottom: 10px;
}

.calendar-weekdays span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.calendar-weekdays span:first-child,
.calendar-weekdays span:last-child {
  color: #FF6B6B;
}

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

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.calendar-day:hover {
  background: #f5f5f5;
}

.calendar-day.other-month {
  color: #ddd;
}

.calendar-day.today {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.calendar-day.selected {
  background: linear-gradient(135deg, #FFE4F0, #E8F4FF);
  border: 2px solid var(--primary);
}

.calendar-day.today.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.calendar-day.weekend {
  color: #FF6B6B;
}

.calendar-day.weekend.other-month {
  color: #ffcdd2;
}

/* 日期下方的事件标记 */
.day-dots {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 4px;
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.day-dot.class { background: #4ECDC4; }
.day-dot.outing { background: #FF6B6B; }
.day-dot.holiday { background: #45B7D1; }
.day-dot.study { background: #9370DB; }

/* 当天事件列表 */
.day-events {
  background: white;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}

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

.day-events-header h4 {
  color: var(--text-dark);
  font-size: 1.1rem;
}

.btn-add-event {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.timer-control-btn:active {
  transform: scale(0.95);
}

.btn-pause {
  background: linear-gradient(135deg, #FFD93D, #FFA500);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4);
}

.btn-stop {
  background: linear-gradient(135deg, #FF6B6B, #FF4757);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.timer-message {
  margin-top: 24px;
  text-align: center;
}

.timer-message p {
  color: var(--text-light);
  font-size: 1rem;
}

.btn-add-event:active {
  transform: scale(0.95);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-events {
  text-align: center;
  color: var(--text-light);
  padding: 20px;
  font-size: 0.95rem;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f8f8;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.event-item:active {
  transform: scale(0.98);
}

.event-item:hover {
  background: #f0f0f0;
}

.event-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.event-icon.class { background: linear-gradient(135deg, #E0F7FA, #B2EBF2); }
.event-icon.outing { background: linear-gradient(135deg, #FFEBEE, #FFCDD2); }
.event-icon.holiday { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.event-icon.study { background: linear-gradient(135deg, #F3E5F5, #E1BEE7); }

.event-info {
  flex: 1;
}

.event-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.event-time {
  font-size: 0.8rem;
  color: var(--text-light);
}

.event-mood {
  font-size: 1.5rem;
}

/* ========== 事件弹窗 ========== */
.event-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
}

/* 倒计时结束弹窗 */
.timer-finish-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.timer-finish-modal.hidden {
  display: none;
}

.timer-finish-content {
  background: white;
  border-radius: 30px;
  padding: 40px;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 320px;
}

.finish-emoji {
  font-size: 5rem;
  animation: shake 0.5s ease infinite;
}

.finish-title {
  font-size: 2rem;
  color: var(--primary);
  margin: 15px 0;
}

.finish-message {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.6;
}

.finish-animation {
  font-size: 2rem;
  margin-bottom: 20px;
}

.finish-animation span {
  display: inline-block;
  animation: bounce 1s ease infinite;
}

.finish-animation span:nth-child(2) {
  animation-delay: 0.2s;
}

.finish-animation span:nth-child(3) {
  animation-delay: 0.4s;
}

.btn-finish-ok {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  padding: 16px 32px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
  transition: all 0.3s;
}

.btn-finish-ok:active {
  transform: scale(0.95);
}

/* event-modal z-index adjustment */
.event-modal {
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.event-modal.hidden {
  display: none;
}

.event-modal-content {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  position: relative;
}

.event-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f5f5f5;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-light);
}

.event-modal-close:active {
  transform: scale(0.95);
  background: #eee;
}

.event-modal-title {
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

/* 事件类型选择器 */
.event-type-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.event-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 2px solid #eee;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.event-type-btn:active {
  transform: scale(0.95);
}

.event-type-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

.event-type-btn .type-icon {
  font-size: 1.5rem;
}

.event-type-btn .type-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* ========== 个人信息页面 ========== */
.profile-container {
  max-width: 400px;
  margin: 0 auto;
}

.profile-avatar-section {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
  border: 4px solid white;
  background: linear-gradient(135deg, #FFE4F0, #E8F4FF);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--primary);
}

.avatar-placeholder span:first-child {
  font-size: 2.5rem;
}

.avatar-hint {
  font-size: 0.7rem;
  margin-top: 4px;
  color: var(--text-light);
}

.avatar-edit-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 3px solid white;
}

.profile-form {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-dark);
}

.label-icon {
  font-size: 1.2rem;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 3px solid #eee;
  border-radius: 14px;
  font-size: 1rem;
  color: var(--text-dark);
  transition: all 0.3s;
  background: #fafafa;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.1);
}

.form-input::placeholder {
  color: #ccc;
}

.age-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #fafafa;
  border-radius: 14px;
  padding: 10px;
}

.age-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.age-btn:active {
  transform: scale(0.9);
}

.age-display {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--primary);
  min-width: 50px;
  text-align: center;
}

.age-unit {
  font-size: 1.2rem;
  color: var(--text-light);
}

.hobbies-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hobby-tag {
  padding: 10px 16px;
  border: 2px solid #eee;
  border-radius: 20px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.hobby-tag:active {
  transform: scale(0.95);
}

.hobby-tag.active {
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.2);
}

.btn-save-profile {
  width: 100%;
  background: linear-gradient(135deg, #4ECDC4, #44CF74);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
  transition: all 0.3s;
  margin-top: 10px;
}

.btn-save-profile:active {
  transform: scale(0.98);
}

/* 照片选项弹窗 */
.photo-options-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.photo-options-modal.hidden {
  display: none;
}

.photo-options-content {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

.photo-options-content h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.photo-options-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.photo-option-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border: 2px solid #eee;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.photo-option-btn:active {
  transform: scale(0.95);
  background: #f5f5f5;
}

.option-icon {
  font-size: 2rem;
}

.photo-cancel-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #f5f5f5;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.photo-cancel-btn:active {
  background: #eee;
}

/* 事件表单 */
.event-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input[type="text"],
.form-group textarea {
  padding: 12px 16px;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 80px;
  resize: none;
}

/* 课程类型选择 */
.class-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-type-btn {
  padding: 8px 12px;
  border-radius: 20px;
  border: 2px solid #eee;
  background: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.class-type-btn:active {
  transform: scale(0.95);
}

.class-type-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

/* 时间输入 */
.time-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-inputs input[type="time"] {
  padding: 10px 14px;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 1rem;
  flex: 1;
}

.time-inputs input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
}

.time-inputs span {
  color: var(--text-light);
}

/* 重复选择 */
.repeat-selector {
  display: flex;
  gap: 8px;
}

.repeat-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid #eee;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.repeat-btn:active {
  transform: scale(0.95);
}

.repeat-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

/* 提交按钮 */
.btn-submit-event {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
  transition: all 0.3s;
  margin-top: 8px;
}

.btn-submit-event:active {
  transform: scale(0.98);
}

/* 隐藏/显示课外班专属字段 */
.class-only {
  display: none;
}

.show-class-fields .class-only {
  display: flex;
}

/* ========== 事件详情弹窗 ========== */
.event-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.event-detail-icon {
  font-size: 3rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #E0F7FA, #B2EBF2);
}

.event-detail-info h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.event-detail-info p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.event-detail-date {
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  padding: 8px;
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
  border-radius: 12px;
  margin-bottom: 20px;
}

.event-detail-note {
  margin-bottom: 20px;
}

.event-detail-note h4 {
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.event-detail-note p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 心情选择器 */
.event-mood-section {
  background: #FAFAFA;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.event-mood-section h4 {
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.mood-selector {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
}

.mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.mood-btn:active {
  transform: scale(0.95);
}

.mood-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #FFE4F0, #FFF0F5);
}

.mood-emoji {
  font-size: 2rem;
}

.mood-text {
  font-size: 0.7rem;
  color: var(--text-light);
}

.feeling-input {
  margin-bottom: 16px;
}

.feeling-input label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.feeling-input textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 0.95rem;
  min-height: 70px;
  resize: none;
}

.feeling-input textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-save-mood {
  width: 100%;
  background: linear-gradient(135deg, #4ECDC4, #45B7D1);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-save-mood:active {
  transform: scale(0.98);
}

/* 已保存心情显示 */
.saved-mood-display {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.saved-mood-display h4 {
  color: #2E7D32;
  margin-bottom: 12px;
  text-align: center;
}

.saved-mood-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 12px;
  border-radius: 12px;
}

.saved-mood-emoji {
  font-size: 2.5rem;
}

.saved-mood-feeling {
  flex: 1;
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 事件操作按钮 */
.event-actions {
  display: flex;
  justify-content: center;
}

.btn-delete-event {
  background: #FFEBEE;
  color: #F44336;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-delete-event:active {
  transform: scale(0.95);
  background: #FFCDD2;
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .answer-options {
    grid-template-columns: repeat(4, 1fr);
  }

  .timer-circle {
    width: 280px;
    height: 280px;
  }

  .timer-text {
    font-size: 4rem;
  }

  .calendar-grid {
    gap: 8px;
  }

  .calendar-day {
    font-size: 1.1rem;
  }

  .event-type-selector {
    gap: 12px;
  }
}

/* 7个导航项时的样式调整 */
.bottom-nav {
  padding: 0 8px;
}

.nav-item {
  padding: 6px 8px;
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-label {
  font-size: 0.7rem;
}

/* ========== 数据管理 ========== */
.data-management {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-top: 20px;
}

.data-management-title {
  text-align: center;
  color: var(--text-dark);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.data-btns {
  display: flex;
  gap: 12px;
}

.btn-export,
.btn-import {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-export {
  background: linear-gradient(135deg, #45B7D1, #4ECDC4);
  color: white;
  box-shadow: 0 4px 15px rgba(69, 183, 209, 0.4);
}

.btn-import {
  background: linear-gradient(135deg, #FF9F43, #FFD93D);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
}

.btn-export:active,
.btn-import:active {
  transform: scale(0.95);
}

.btn-export .btn-icon,
.btn-import .btn-icon {
  font-size: 1.5rem;
}

.data-warning {
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-top: 16px;
}

/* 导入确认弹窗 */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-modal.hidden {
  display: none;
}

.confirm-modal-content {
  background: white;
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  animation: popIn 0.3s ease;
  max-width: 320px;
  width: 100%;
}

.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.confirm-title {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.confirm-message {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-btns {
  display: flex;
  gap: 12px;
}

.btn-confirm-cancel,
.btn-confirm-ok {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-confirm-cancel {
  background: #f5f5f5;
  color: var(--text-light);
}

.btn-confirm-cancel:active {
  background: #eee;
}

.btn-confirm-ok {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.btn-confirm-ok:active {
  transform: scale(0.95);
}

/* ========== 科学探索模块 ========== */

/* 科学卡片渐变色 */
.card-science::before { background: linear-gradient(90deg, #4CAF50, #8BC34A); }

/* 主题选择界面 */
.science-themes {
  padding: 10px 0;
}

.science-intro {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 20px;
  font-weight: 600;
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.theme-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
}

.theme-card.animal::before { background: linear-gradient(180deg, #FF9800, #FFB74D); }
.theme-card.plant::before { background: linear-gradient(180deg, #4CAF50, #81C784); }
.theme-card.nature::before { background: linear-gradient(180deg, #2196F3, #64B5F6); }

.theme-card:active {
  transform: scale(0.98);
}

.theme-card:hover {
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(76, 175, 80, 0.25);
}

.theme-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.theme-info {
  flex: 1;
}

.theme-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.theme-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.theme-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.theme-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.theme-progress-text {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  text-align: right;
}

/* 答题界面 */
.science-quiz {
  padding: 10px 0;
}

.quiz-progress {
  margin-bottom: 20px;
}

.quiz-progress-text {
  display: block;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.quiz-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.quiz-question-area {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 20px;
  text-align: center;
}

.quiz-image {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.quiz-question-box {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-radius: 16px;
  padding: 16px;
}

.quiz-question {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.quiz-hint {
  font-size: 0.95rem;
  color: #558B2F;
  font-style: italic;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  background: white;
  border: 3px solid #E8F5E9;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.quiz-option-btn:active {
  transform: scale(0.95);
}

.quiz-option-btn:hover {
  border-color: #4CAF50;
  background: #F1F8E9;
}

.quiz-option-btn .option-emoji {
  font-size: 1.5rem;
}

.quiz-option-btn .option-text {
  font-weight: 600;
  color: var(--text-dark);
}

.quiz-option-btn.correct {
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  border-color: #4CAF50;
  color: white;
  animation: correctPop 0.5s ease;
}

.quiz-option-btn.correct .option-text {
  color: white;
}

.quiz-option-btn.wrong {
  background: linear-gradient(135deg, #FF5722, #FF8A65);
  border-color: #FF5722;
  color: white;
  animation: shake 0.5s ease;
}

.quiz-option-btn.wrong .option-text {
  color: white;
}

.btn-back-themes {
  width: 100%;
  background: #f5f5f5;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-back-themes:active {
  background: #eee;
}

/* 科学答题反馈弹窗 */
.science-feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.science-feedback-modal.hidden {
  display: none;
}

.science-feedback-content {
  background: white;
  border-radius: 30px;
  padding: 32px;
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 340px;
  width: 100%;
}

.feedback-icon {
  font-size: 4rem;
  margin-bottom: 12px;
}

.feedback-icon.correct {
  animation: starDance 1s ease infinite;
}

.feedback-icon.wrong {
  animation: none;
}

.feedback-title {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.feedback-title.correct {
  color: #4CAF50;
}

.feedback-title.wrong {
  color: #FF5722;
}

.feedback-answer {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.feedback-knowledge {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid #FFC107;
}

.feedback-knowledge h4 {
  color: #F57F17;
  margin-bottom: 8px;
  font-size: 1rem;
}

.feedback-knowledge p {
  color: #795548;
  font-size: 0.95rem;
  line-height: 1.6;
}

.feedback-points {
  font-size: 1.2rem;
  font-weight: bold;
  color: #4CAF50;
  margin-bottom: 20px;
}

.feedback-points.hidden {
  display: none;
}

.btn-continue-science {
  width: 100%;
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transition: all 0.3s;
}

.btn-continue-science:active {
  transform: scale(0.98);
}

/* 科学主题完成弹窗 */
.science-complete-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.science-complete-modal.hidden {
  display: none;
}

.science-complete-content {
  background: white;
  border-radius: 30px;
  padding: 40px;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 340px;
  width: 100%;
}

.complete-stars {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: starDance 1s ease infinite;
}

.complete-title {
  font-size: 2rem;
  color: #4CAF50;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #4CAF50, #8BC34A, #CDDC39);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 20px;
}

.complete-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.complete-stat .stat-num {
  font-size: 2.5rem;
  font-weight: bold;
  color: #4CAF50;
}

.complete-stat .stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.complete-bonus {
  font-size: 1.3rem;
  font-weight: bold;
  color: #FF9800;
  margin-bottom: 24px;
  padding: 12px;
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border-radius: 12px;
}

.btn-back-themes-complete {
  width: 100%;
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  border: none;
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transition: all 0.3s;
}

.btn-back-themes-complete:active {
  transform: scale(0.98);
}

/* ========== 睡眠音乐模块 ========== */

/* 睡眠音乐卡片渐变色 */
.card-sleep-music::before { background: linear-gradient(90deg, #9370DB, #7B68EE); }

/* 播放器区域 */
.sleep-music-player {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 24px;
  padding: 30px 20px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 52, 96, 0.4);
}

/* 唱片容器 */
.player-disc-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* 唱片 */
.player-disc {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 50%, #2d2d44 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 0 8px #1a1a2e,
    0 0 0 10px rgba(147, 112, 219, 0.3),
    0 10px 30px rgba(0, 0, 0, 0.5);
}

.player-disc::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.03) 4px,
    transparent 5px
  );
}

.player-disc.playing {
  animation: disc-spin 8s linear infinite;
}

@keyframes disc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.disc-center {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9370DB, #7B68EE);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(147, 112, 219, 0.5);
}

/* 播放器信息 */
.player-info {
  margin-bottom: 20px;
}

.player-song-name {
  color: white;
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.player-song-duration {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* 播放器控制按钮 */
.player-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.player-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-play-music {
  background: linear-gradient(135deg, #9370DB, #7B68EE);
  color: white;
  box-shadow: 0 6px 20px rgba(147, 112, 219, 0.5);
}

.btn-play-music:hover:not(:disabled) {
  box-shadow: 0 8px 25px rgba(147, 112, 219, 0.6);
}

.btn-stop-music {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.btn-stop-music:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

/* 定时器显示 */
.sleep-timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  display: inline-flex;
}

.sleep-timer-display .timer-icon {
  font-size: 1rem;
}

.sleep-timer-display .timer-remaining {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 600;
  font-family: monospace;
}

/* 定时器选项区域 */
.sleep-timer-section {
  background: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}

.section-title {
  color: var(--text-dark);
  font-size: 1rem;
  margin-bottom: 16px;
}

.sleep-timer-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.sleep-timer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid #eee;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 60px;
}

.sleep-timer-btn:active {
  transform: scale(0.95);
}

.sleep-timer-btn.active {
  border-color: #9370DB;
  background: linear-gradient(135deg, #F3E5F5, #EDE7F6);
}

.sleep-timer-btn .timer-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-dark);
}

.sleep-timer-btn .timer-unit {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* 音乐列表区域 */
.sleep-music-list {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.music-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fafafa;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.music-card:active {
  transform: scale(0.98);
}

.music-card:hover {
  background: #f5f5f5;
}

.music-card.active {
  border-color: #9370DB;
  background: linear-gradient(135deg, #F3E5F5, #EDE7F6);
}

.music-card.playing {
  border-color: #9370DB;
  background: linear-gradient(135deg, #F3E5F5, #EDE7F6);
}

.music-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.music-card-icon.christmas { background: linear-gradient(135deg, #FFEBEE, #FFCDD2); }
.music-card-icon.relax { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }
.music-card-icon.whitenoise { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.music-card-icon.orchestra { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); }

.music-card-info {
  flex: 1;
}

.music-card-name {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  font-size: 1rem;
}

.music-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.music-card-status {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.music-card-status .equalizer {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 20px;
}

.music-card-status .equalizer span {
  width: 3px;
  background: #9370DB;
  border-radius: 2px;
  animation: equalizer 0.6s ease-in-out infinite;
}

.music-card-status .equalizer span:nth-child(1) { animation-delay: 0s; }
.music-card-status .equalizer span:nth-child(2) { animation-delay: 0.2s; }
.music-card-status .equalizer span:nth-child(3) { animation-delay: 0.4s; }

@keyframes equalizer {
  0%, 100% { height: 5px; }
  50% { height: 15px; }
}

/* 响应式调整 */
@media (min-width: 768px) {
  .player-disc {
    width: 180px;
    height: 180px;
  }

  .disc-center {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .player-btn {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }

  .sleep-timer-btn {
    padding: 14px 20px;
    min-width: 70px;
  }
}

/* ========== 拼图游戏模块 ========== */

/* 拼图卡片渐变色 */
.card-puzzle::before { background: linear-gradient(90deg, #9B59B6, #E91E63); }

/* 拼图选择界面 */
.puzzle-select {
  padding: 10px 0;
}

.puzzle-section {
  background: white;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.puzzle-section-title {
  color: var(--text-dark);
  font-size: 1.1rem;
  margin-bottom: 16px;
  text-align: center;
}

/* 难度选择器 */
.difficulty-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 3px solid #eee;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 90px;
}

.difficulty-btn:active {
  transform: scale(0.95);
}

.difficulty-btn.active {
  border-color: #9B59B6;
  background: linear-gradient(135deg, #F3E5F5, #FCE4EC);
}

.difficulty-icon {
  font-size: 1.2rem;
}

.difficulty-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.difficulty-pieces {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* 主题选择器 */
.theme-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid #eee;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 70px;
}

.theme-btn:active {
  transform: scale(0.95);
}

.theme-btn.active {
  border-color: #E91E63;
  background: linear-gradient(135deg, #FCE4EC, #F8BBD9);
}

.theme-icon {
  font-size: 1.8rem;
}

.theme-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* 图片选择器 */
.image-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.image-btn {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  border: 3px solid #eee;
  background: #f5f5f5;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.image-btn:active {
  transform: scale(0.95);
}

.image-btn.active {
  border-color: #9B59B6;
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.3);
}

.image-name-overlay {
  font-size: 0.7rem;
  color: white;
  font-weight: 600;
  background: rgba(0,0,0,0.6);
  padding: 4px 8px;
  border-radius: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 自定义图片搜索 */
.custom-image-search {
  grid-column: 1 / -1;
}

.search-input-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.image-search-input {
  flex: 1;
  padding: 14px 16px;
  border: 3px solid #eee;
  border-radius: 14px;
  font-size: 1rem;
  transition: all 0.3s;
}

.image-search-input:focus {
  outline: none;
  border-color: #9B59B6;
  box-shadow: 0 0 0 4px rgba(155, 89, 182, 0.1);
}

.search-btn {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.search-btn:active {
  transform: scale(0.95);
}

.search-results {
  min-height: 100px;
}

.search-hint,
.search-loading,
.search-result-hint,
.search-tip {
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
  padding: 10px 0;
}

.search-loading {
  animation: pulse 1s ease infinite;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 12px 0;
}

.search-result-btn {
  aspect-ratio: 1;
  border: 3px solid #eee;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  background-color: #f5f5f5;
  cursor: pointer;
  transition: all 0.3s;
}

.search-result-btn:hover {
  border-color: #9B59B6;
  transform: scale(1.02);
}

.search-result-btn:active {
  transform: scale(0.95);
}

.search-tip {
  font-size: 0.85rem;
  color: #888;
}

/* 图片碎片样式 */
.puzzle-piece.image-piece {
  background-size: cover;
  background-position: center;
  border: 2px solid #9B59B6;
}

.placed-piece.image-piece {
  background-size: cover;
  background-position: center;
}

/* 拼图游戏界面 */
.puzzle-game {
  padding: 10px 0;
}

.puzzle-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.puzzle-control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.8rem;
  color: var(--text-dark);
}

.puzzle-control-btn:active {
  transform: scale(0.95);
  background: #eee;
}

.puzzle-control-btn span:first-child {
  font-size: 1.2rem;
}

.puzzle-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #9B59B6;
  font-family: monospace;
}

/* 原图参考 */
.puzzle-reference {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.reference-image {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.reference-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* 拼图板容器 */
.puzzle-board-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.puzzle-board {
  display: grid;
  gap: 4px;
  background: white;
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--card-shadow);
}

/* 动态设置grid列数 */
.puzzle-board.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  width: 200px;
  height: 200px;
}

.puzzle-board.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  width: 240px;
  height: 240px;
}

.puzzle-board.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  width: 280px;
  height: 280px;
}

/* 拼图槽位 */
.puzzle-slot {
  background: linear-gradient(135deg, #FCE4EC, #F8BBD9);
  border: 2px dashed #E91E63;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
}

.puzzle-slot.drag-over {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-color: #4CAF50;
  transform: scale(1.05);
}

.puzzle-slot.filled {
  background: white;
  border: 2px solid #4CAF50;
}

.puzzle-slot.correct {
  animation: slotCorrect 0.5s ease;
}

@keyframes slotCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 槽位中的碎片 */
.puzzle-slot .placed-piece {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 6px;
}

/* 碎片区容器 */
.puzzle-pieces-container {
  background: white;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.pieces-hint {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.puzzle-pieces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 80px;
}

/* 碎片样式 */
.puzzle-piece {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
  border: 2px solid #9B59B6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: grab;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
  user-select: none;
  touch-action: none;
}

.puzzle-piece:active {
  cursor: grabbing;
}

.puzzle-piece.dragging {
  opacity: 0.8;
  transform: scale(1.1);
  z-index: 1000;
  box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
}

.puzzle-piece.wrong {
  animation: pieceWrong 0.5s ease;
}

@keyframes pieceWrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-10px); }
  80% { transform: translateX(10px); }
}

/* 返回选择按钮 */
.btn-back-select {
  width: 100%;
  background: #f5f5f5;
  border: none;
  padding: 14px;
  border-radius: 14px;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.3s;
}

.btn-back-select:active {
  background: #eee;
}

/* 拼图完成弹窗 */
.puzzle-complete-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.puzzle-complete-modal.hidden {
  display: none;
}

.puzzle-complete-content {
  background: white;
  border-radius: 30px;
  padding: 32px;
  text-align: center;
  animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 320px;
  width: 100%;
}

.complete-celebration {
  font-size: 4rem;
  animation: bounce 1s ease infinite;
  margin-bottom: 12px;
}

.puzzle-complete-title {
  font-size: 1.8rem;
  background: linear-gradient(45deg, #9B59B6, #E91E63);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.puzzle-complete-image {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

.puzzle-complete-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 24px;
}

.complete-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.complete-stat-item .stat-icon {
  font-size: 1.2rem;
}

.complete-stat-item .stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #9B59B6;
}

.complete-stat-item .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.puzzle-complete-buttons {
  display: flex;
  gap: 12px;
}

.btn-puzzle-again,
.btn-puzzle-new {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-puzzle-again {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  color: white;
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.btn-puzzle-again:active {
  transform: scale(0.95);
}

.btn-puzzle-new {
  background: #f5f5f5;
  color: var(--text-dark);
}

.btn-puzzle-new:active {
  background: #eee;
}

/* 拼图提示弹窗 */
.puzzle-hint-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.puzzle-hint-modal.hidden {
  display: none;
}

.puzzle-hint-content {
  background: white;
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  animation: popIn 0.3s ease;
  max-width: 280px;
  width: 100%;
  position: relative;
}

.puzzle-hint-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f5f5f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text-light);
}

.puzzle-hint-close:active {
  transform: scale(0.95);
  background: #eee;
}

.puzzle-hint-content h3 {
  color: var(--text-dark);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.puzzle-hint-image {
  font-size: 8rem;
  margin-bottom: 12px;
}

.puzzle-hint-name {
  font-size: 1.2rem;
  color: #9B59B6;
  font-weight: 600;
}

/* 响应式调整 */
@media (min-width: 768px) {
  .difficulty-selector {
    gap: 20px;
  }

  .difficulty-btn {
    padding: 20px 28px;
    min-width: 110px;
  }

  .image-selector {
    grid-template-columns: repeat(6, 1fr);
  }

  .puzzle-board.grid-2 {
    width: 240px;
    height: 240px;
  }

  .puzzle-board.grid-3 {
    width: 300px;
    height: 300px;
  }

  .puzzle-board.grid-4 {
    width: 360px;
    height: 360px;
  }

  .puzzle-piece {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
}
