/* ==== css/main.css ==== */
:root {
  --color-primary: #58CC02;
  --color-primary-dark: #46A302;
  --color-primary-light: #7CE032;
  --color-secondary: #FF9A76;
  --color-secondary-dark: #FF7E67;
  --color-accent-purple: #9C27B0;
  --color-accent-blue: #3B82F6;
  --color-accent-orange: #F59E0B;
  --color-accent-red: #EF4444;
  --color-accent-green: #10B981;
  
  --color-bg: #F7F7F7;
  --color-bg-card: #FFFFFF;
  --color-text-primary: #1F2937;
  --color-text-secondary: #6B7280;
  --color-text-muted: #9CA3AF;
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;
  
  --gradient-primary: linear-gradient(135deg, #58CC02 0%, #46A302 100%);
  --gradient-secondary: linear-gradient(135deg, #FF9A76 0%, #FF7E67 100%);
  --gradient-purple: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  --gradient-gold: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-xl: 0 8px 32px rgba(0,0,0,0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  --max-width: 420px;
  --tab-bar-height: 60px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  color: var(--color-text-primary);
  background: var(--color-bg);
}

button {
  font-family: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  background: none;
}

.app-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-bg-card);
}

.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: calc(var(--tab-bar-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: #fff;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  gap: 2px;
}

.tab-item .tab-icon {
  font-size: 22px;
  opacity: 0.5;
  transition: opacity var(--transition-normal);
}

.tab-item .tab-text {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
  transition: color var(--transition-normal);
}

.tab-item.active .tab-icon {
  opacity: 1;
}

.tab-item.active .tab-text {
  color: var(--color-primary);
  font-weight: 600;
}

.page-enter {
  animation: pageEnter 0.3s ease-out;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes floatUp {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.page-section {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.page-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.page-header-title {
  flex: 1;
  text-align: center;
}

.page-header-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.page-header-title p {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.back-btn:active {
  transform: scale(0.95);
}

.placeholder-right {
  width: 36px;
}

.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-secondary {
  background: white;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-secondary:active {
  background: var(--color-border-light);
}

.progress-bar {
  height: 8px;
  background: var(--color-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar-fill.primary {
  background: var(--gradient-primary);
}

.progress-bar-fill.purple {
  background: var(--gradient-purple);
}

.progress-bar-fill.gold {
  background: var(--gradient-gold);
}

.text-gradient-green {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Optimizations */
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: contain;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

.app-content::-webkit-scrollbar {
  display: none;
}

.app-content {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (max-width: 375px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .app-container {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
}

/* ==== css/components.css ==== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gradient-primary);
  color: #fff;
  gap: 12px;
}

.status-level {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.level-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: bold;
}

.level-num {
  font-size: 18px;
  font-weight: 700;
}

.level-info {
  flex: 1;
  min-width: 0;
}

.level-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.xp-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
  overflow: hidden;
  min-width: 50px;
}

.xp-fill {
  height: 100%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.xp-text {
  font-size: 10px;
  opacity: 0.9;
  white-space: nowrap;
}

.status-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.stat-icon {
  font-size: 14px;
}

.stat-value {
  min-width: 16px;
  text-align: center;
}

.mascot-container {
  text-align: center;
  padding: 20px 16px;
}

.mascot-emoji {
  font-size: 64px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  display: inline-block;
}

.mascot-emoji:hover {
  transform: scale(1.1);
}

.mascot-message {
  background: #f0f9ff;
  color: #0369a1;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  display: inline-block;
  position: relative;
}

.mascot-message::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #f0f9ff;
}

.lesson-map {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.unit-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0 8px;
  gap: 4px;
  overflow-x: auto;
  flex-shrink: 0;
}

.unit-tab {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.unit-tab.active {
  border-bottom-width: 3px;
  border-bottom-style: solid;
}

.unit-tab.active .unit-tab-title {
  font-weight: 600;
  color: #333;
}

.unit-tab-title {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  display: block;
}

.unit-tab-sub {
  font-size: 11px;
  color: #999;
  display: block;
  margin-top: 2px;
}

.lesson-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

.lessons-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 400px;
  margin: 0 auto;
}

.lesson-node {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
  position: relative;
}

.lesson-node:not(.lesson-locked) {
  cursor: pointer;
}

.lesson-node:not(.lesson-locked):active {
  transform: scale(0.98);
}

.lesson-node.lesson-locked {
  opacity: 0.6;
}

.lesson-node.lesson-completed {
  opacity: 0.85;
}

.lesson-node.lesson-current {
  box-shadow: 0 4px 16px rgba(88, 204, 2, 0.3);
  animation: lessonPulse 2s ease-in-out infinite;
}

@keyframes lessonPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(88, 204, 2, 0.3); }
  50% { box-shadow: 0 6px 24px rgba(88, 204, 2, 0.5); }
}

.lesson-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  color: #fff;
}

.lesson-locked .lesson-icon {
  background: #ccc !important;
}

.lesson-info {
  flex: 1;
  min-width: 0;
}

.lesson-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.lesson-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #888;
}

.lesson-meta span {
  display: flex;
  align-items: center;
  gap: 2px;
}

.xp-toast-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 200;
}

.xp-toast {
  position: absolute;
  bottom: 30%;
  font-size: 20px;
  font-weight: 700;
  color: #FFD700;
  text-shadow: 0 2px 8px rgba(255,180,0,0.5), 0 0 4px rgba(255,255,255,0.8);
  opacity: 0;
  transform: translateY(0);
  z-index: 200;
  white-space: nowrap;
  padding: 6px 14px;
  background: rgba(255,255,255,0.9);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(255,180,0,0.2);
}

.xp-toast-float {
  animation: xpFloatUp 1.5s ease-out forwards;
}

.xp-toast-fade {
  opacity: 0 !important;
  transition: opacity 0.3s ease;
}

@keyframes xpFloatUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  15% {
    opacity: 1;
    transform: translateY(-10px) scale(1.1);
  }
  30% {
    opacity: 1;
    transform: translateY(-30px) scale(1);
  }
  100% {
    opacity: 0.8;
    transform: translateY(-100px) scale(1);
  }
}

.combo-bar {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 150;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.combo-bar.combo-hidden {
  opacity: 0;
  transform: translateX(60px) scale(0.8);
  pointer-events: none;
}

.combo-bar.combo-show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.combo-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #666 0%, #444 100%);
  color: #fff;
  padding: 8px 16px;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-weight: 700;
}

.combo-bar-inner.combo-fire {
  background: linear-gradient(135deg, #FF6B35 0%, #FF4444 100%);
  box-shadow: 0 4px 20px rgba(255,107,53,0.5);
}

.combo-bar-inner.combo-diamond {
  background: linear-gradient(135deg, #9C27B0 0%, #673AB7 100%);
  box-shadow: 0 4px 20px rgba(156,39,176,0.5);
}

.combo-icon {
  font-size: 22px;
}

.combo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.combo-count {
  font-size: 22px;
  font-weight: 800;
}

.combo-label {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 500;
}

.combo-bump {
  animation: comboBump 0.3s ease;
}

@keyframes comboBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.badge-modal-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.badge-modal-hidden {
  opacity: 0;
  pointer-events: none;
}

.badge-modal-show {
  opacity: 1;
  pointer-events: auto;
}

.badge-modal-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.badge-modal-content {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px 24px;
  width: 280px;
  max-width: 90%;
  text-align: center;
  z-index: 1;
  pointer-events: auto;
}

.badge-pop-in {
  animation: badgePopIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badgePopIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.badge-unlock-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
}

.badge-icon-big {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(255,215,0,0.4);
}

.badge-emoji {
  font-size: 50px;
}

.badge-name {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.badge-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

.badge-claim-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.badge-claim-btn:active {
  transform: scale(0.96);
}

.custom-dialog-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.custom-dialog-hidden {
  opacity: 0;
  pointer-events: none;
}

.custom-dialog-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}

.custom-dialog-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 20px;
  width: 280px;
  max-width: 86%;
  text-align: center;
  z-index: 1;
  pointer-events: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.custom-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.custom-dialog-message {
  font-size: 15px;
  color: #555;
  margin-bottom: 20px;
  line-height: 1.5;
}

.custom-dialog-buttons {
  display: flex;
  gap: 10px;
}

.custom-dialog-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.custom-dialog-confirm {
  background: var(--gradient-primary);
  color: #fff;
}

.custom-dialog-cancel {
  background: #f0f0f0;
  color: #555;
}

.custom-dialog-btn:active {
  transform: scale(0.96);
}

.badge-wall {
  width: 100%;
  padding: 20px 16px;
}

.badge-wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.badge-wall-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.badge-wall-progress {
  background: #f5f5f5;
  padding: 6px 14px;
  border-radius: 16px;
}

.badge-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 12px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.badge-item:active {
  transform: scale(0.95);
}

.badge-item-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.badge-item.badge-unlocked .badge-item-icon {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.badge-item.badge-locked .badge-item-icon {
  opacity: 0.6;
  background: #e0e0e0;
}

.badge-item-emoji {
  font-size: 28px;
}

.badge-item-name {
  font-size: 11px;
  color: #666;
  text-align: center;
  line-height: 1.3;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-item.badge-locked .badge-item-name {
  color: #aaa;
}

.badge-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.badge-detail-hidden {
  opacity: 0;
  pointer-events: none;
}

.badge-detail-show {
  opacity: 1;
  pointer-events: auto;
}

.badge-detail-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.badge-detail-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: 260px;
  max-width: 90%;
  text-align: center;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

.badge-detail-hidden .badge-detail-content {
  transform: scale(0.8);
  opacity: 0;
}

.badge-detail-show .badge-detail-content {
  transform: scale(1);
  opacity: 1;
  animation: badgePopIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.badge-detail-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.badge-detail-emoji {
  font-size: 40px;
}

.badge-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.badge-detail-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

.badge-detail-status {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-block;
}

.badge-detail-status.status-unlocked {
  background: #E8F5E9;
  color: #4CAF50;
}

.badge-detail-status.status-locked {
  background: #F5F5F5;
  color: #999;
}

.badge-detail-close {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #f5f5f5;
  color: #666;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.badge-detail-close:active {
  background: #eee;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: bounceIn 0.5s ease;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.modal-icon-big {
  font-size: 64px;
  margin-bottom: 16px;
}

.modal-rewards {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.modal-reward-item {
  text-align: center;
}

.modal-reward-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.modal-reward-value {
  font-size: 20px;
  font-weight: 700;
}

.modal-reward-value.gold {
  color: #f59e0b;
}

.modal-reward-value.purple {
  color: #8b5cf6;
}

.modal-reward-value.red {
  color: #ef4444;
}

.modal-reward-label {
  font-size: 12px;
  color: #6b7280;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.1s;
}

.modal-btn:active {
  transform: scale(0.96);
}

.modal-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.modal-btn.secondary {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  font-weight: 500;
}

/* ==== css/pages.css ==== */
.home-page {
  min-height: 100%;
  background: var(--color-bg);
}

.home-page .spacer {
  height: 20px;
}

.daily-bonus-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.daily-bonus-content {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: bonusBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bonusBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.daily-bonus-gift {
  font-size: 64px;
  margin-bottom: 16px;
  animation: giftShake 0.5s ease 0.3s;
}

@keyframes giftShake {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-10deg); }
  40%, 80% { transform: rotate(10deg); }
}

.daily-bonus-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.daily-bonus-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.daily-bonus-rewards {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.daily-bonus-reward-item {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: rewardItemPop 0.5s ease forwards;
}

.daily-bonus-reward-item:nth-child(1) { animation-delay: 0.5s; }
.daily-bonus-reward-item:nth-child(2) { animation-delay: 0.65s; }
.daily-bonus-reward-item:nth-child(3) { animation-delay: 0.8s; }

@keyframes rewardItemPop {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.daily-bonus-reward-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.daily-bonus-reward-value {
  font-size: 20px;
  font-weight: 700;
}

.daily-bonus-reward-value.gold { color: #f59e0b; }
.daily-bonus-reward-value.purple { color: #8b5cf6; }
.daily-bonus-reward-value.red { color: #ef4444; }

.daily-bonus-reward-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.daily-bonus-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s ease;
  opacity: 0;
  animation: btnFadeIn 0.3s ease 1s forwards;
}

@keyframes btnFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.daily-bonus-btn:active {
  transform: scale(0.96);
}

.daily-bonus-btn.claimed {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.coin-fly {
  position: fixed;
  font-size: 24px;
  pointer-events: none;
  z-index: 10001;
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.category-page-header {
  padding: 20px 16px 12px;
}

.category-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.category-page-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.category-list {
  padding: 0 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.category-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.category-item:hover {
  transform: translateY(-2px);
}

.category-item-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.category-item-icon.gradient-0 { background: linear-gradient(135deg,#a7f3d0,#6ee7b7); }
.category-item-icon.gradient-1 { background: linear-gradient(135deg,#bfdbfe,#93c5fd); }
.category-item-icon.gradient-2 { background: linear-gradient(135deg,#fde68a,#fcd34d); }
.category-item-icon.gradient-3 { background: linear-gradient(135deg,#fbcfe8,#f9a8d4); }
.category-item-icon.gradient-4 { background: linear-gradient(135deg,#ddd6fe,#c4b5fd); }
.category-item-icon.gradient-5 { background: linear-gradient(135deg,#fed7aa,#fdba74); }

.category-item-info {
  flex: 1;
  min-width: 0;
}

.category-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.category-item-progress-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.category-item-progress-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
}

.category-item-progress-fill {
  height: 100%;
  border-radius: 3px;
}

.category-item-arrow {
  color: #9ca3af;
  font-size: 24px;
  flex-shrink: 0;
}

.grid-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.grid-page-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.grid-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.grid-page-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.grid-container {
  padding: 0 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card-item {
  background: white;
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform 0.2s;
}

.card-item:hover {
  transform: scale(1.05);
}

.card-status-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.card-status-dot.unlearned { background: #d1d5db; }
.card-status-dot.learned { background: #60a5fa; }
.card-status-dot.mastered { background: #34d399; }
.card-status-dot.wrong { background: #f87171; }

.card-char {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.card-emoji {
  font-size: 24px;
  margin-bottom: 4px;
}

.card-pinyin {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.card-status-label {
  font-size: 10px;
  margin-top: 4px;
}

.card-status-label.unlearned { color: #d1d5db; }
.card-status-label.learned { color: #60a5fa; }
.card-status-label.mastered { color: #34d399; }
.card-status-label.wrong { color: #f87171; }

.detail-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 80px;
}

.detail-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.detail-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.detail-char-card {
  padding: 0 16px;
  margin-bottom: 16px;
}

.detail-char-inner {
  background: var(--gradient-purple);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.detail-char-bg-circle-1 {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.detail-char-bg-circle-2 {
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.detail-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
  margin-bottom: 16px;
  position: relative;
}

.detail-char-display {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.detail-char-box {
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255,255,255,0.3);
  position: relative;
}

.detail-char-hline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.2);
}

.detail-char-vline {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.2);
}

.detail-char-diagonal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.detail-char-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  font-weight: 700;
}

.detail-pinyin {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-tone {
  font-size: 12px;
  opacity: 0.8;
}

.detail-action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.detail-btn {
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
}

.detail-btn.audio {
  background: rgba(255,255,255,0.2);
  color: white;
  transition: all 0.2s ease;
}

.detail-btn.audio:active {
  transform: scale(0.95);
}

.detail-btn.audio.playing {
  animation: audioPulse 1s ease infinite;
  background: rgba(255,255,255,0.4);
}

@keyframes audioPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.detail-origin-animation {
  text-align: center;
  margin-bottom: 16px;
}

.origin-evolution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.origin-stage {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: #f9fafb;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.5s ease;
}

.origin-stage.show {
  opacity: 1;
  transform: scale(1);
}

.origin-arrow {
  font-size: 18px;
  color: #d1d5db;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.origin-arrow.show {
  opacity: 1;
}

.origin-stage.old {
  background: #fef3c7;
}

.origin-stage.middle {
  background: #dbeafe;
}

.origin-stage.modern {
  background: #d1fae5;
}

.origin-label {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.origin-label-item {
  font-size: 11px;
  color: var(--color-text-secondary);
  width: 60px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

.origin-label-item.show {
  opacity: 1;
  transform: translateY(0);
}

.origin-play-btn {
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--gradient-purple);
  color: white;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.origin-play-btn:active {
  transform: scale(0.95);
}

.detail-char-char {
  transition: transform 0.3s ease;
}

.detail-char-char.animate {
  animation: charPop 0.5s ease;
}

@keyframes charPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.detail-learn-success {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.detail-learn-success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.detail-learn-success-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.detail-learn-success-reward {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.detail-learn-success-btn {
  padding: 10px 24px;
  border-radius: 12px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  animation: fadeIn 0.3s ease;
}

.detail-btn.learn {
  background: rgba(255,255,255,0.9);
  color: #667eea;
  font-weight: 600;
}

.detail-btn.learn.learned {
  background: rgba(255,255,255,0.3);
  opacity: 0.7;
  color: white;
}

.detail-info-section {
  padding: 16px;
}

.detail-info-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.detail-info-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-word-tag {
  background: #f0f9ff;
  color: #0369a1;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.detail-synonym-tag {
  background: #dcfce7;
  color: #166534;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.detail-antonym-tag {
  background: #fee2e2;
  color: #991b1b;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.detail-sentence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-sentence-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.detail-sentence-num {
  background: #e0e7ff;
  color: #4338ca;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}

.detail-sentence-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
}

.detail-origin-glyph {
  text-align: center;
  font-size: 48px;
  margin-bottom: 8px;
}

.detail-origin-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.6;
}

.detail-story-emoji {
  text-align: center;
  font-size: 40px;
  margin-bottom: 8px;
}

.detail-story-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.6;
}

.detail-stroke-order {
  font-size: 14px;
  color: #374151;
  text-align: center;
  background: #f9fafb;
  padding: 12px;
  border-radius: 12px;
}

.detail-riddle-question {
  font-size: 14px;
  color: #374151;
  margin-bottom: 12px;
  line-height: 1.6;
}

.detail-riddle-answer {
  background: #fef3c7;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.detail-riddle-answer-text {
  font-size: 13px;
  color: #92400e;
}

.detail-riddle-hint {
  font-size: 12px;
  color: #a16207;
  margin-top: 4px;
}

.detail-riddle-btn {
  width: 100%;
  background: #fef3c7;
  color: #92400e;
  border: none;
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.detail-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-nav-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: white;
}

.detail-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-nav-btn.next {
  background: var(--gradient-purple);
  color: white;
  border: none;
}

.detail-nav-count {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.exercise-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.exercise-page-header {
  padding: 20px 16px 12px;
}

.exercise-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.exercise-page-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.exercise-stats-card {
  padding: 0 16px 16px;
}

.exercise-stats-inner {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.exercise-mastered-count {
  text-align: center;
  margin-bottom: 16px;
}

.exercise-mastered-num {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.exercise-mastered-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.exercise-stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.exercise-stat-item .num {
  font-size: 18px;
  font-weight: 600;
}

.exercise-stat-item.learned .num { color: #3b82f6; }
.exercise-stat-item.wrong .num { color: #ef4444; }
.exercise-stat-item.rate .num { color: #10b981; }

.exercise-stat-item .label {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.exercise-daily-card {
  padding: 0 16px 16px;
}

.exercise-daily-inner {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.exercise-daily-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exercise-daily-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.exercise-daily-streak {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.exercise-goal-item {
  margin-bottom: 12px;
}

.exercise-goal-item:last-child {
  margin-bottom: 0;
}

.exercise-goal-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.exercise-modes-section {
  padding: 0 16px;
}

.exercise-modes-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exercise-modes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.mode-card:hover {
  transform: translateX(4px);
}

.mode-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.mode-card-icon.orange { background: linear-gradient(135deg,#fed7aa,#fdba74); }
.mode-card-icon.green { background: linear-gradient(135deg,#a7f3d0,#6ee7b7); }
.mode-card-icon.purple { background: linear-gradient(135deg,#ddd6fe,#c4b5fd); }
.mode-card-icon.blue { background: linear-gradient(135deg,#bfdbfe,#93c5fd); }

.mode-card-info {
  flex: 1;
}

.mode-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.mode-card-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.mode-card-arrow {
  color: #9ca3af;
  font-size: 20px;
}

.exercise-tip {
  padding: 16px;
}

.exercise-tip-inner {
  background: #fef3c7;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-tip-icon {
  font-size: 18px;
}

.exercise-tip-text {
  font-size: 13px;
  color: #92400e;
}

.quiz-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.quiz-header {
  padding: 16px;
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.quiz-progress-info {
  flex: 1;
}

.quiz-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.quiz-progress-label span {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.quiz-combo-wrap {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.quiz-question {
  padding: 0 16px 24px;
  text-align: center;
}

.quiz-question-label {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.quiz-question-text {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 24px;
}

.quiz-options-wrap {
  padding: 0 16px;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quiz-option {
  background: white;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  border: 3px solid transparent;
  transition: all 0.2s;
}

.quiz-option:hover {
  transform: scale(1.05);
}

.quiz-option:active {
  transform: scale(0.95);
}

.quiz-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  animation: correctPulse 0.5s ease;
}

.quiz-option.wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
  animation: shake 0.5s ease;
}

.quiz-option.disabled {
  pointer-events: none;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.quiz-hearts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quiz-heart {
  font-size: 16px;
  transition: all 0.3s ease;
}

.quiz-heart.lost {
  animation: heartBreak 0.5s ease forwards;
}

@keyframes heartBreak {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); }
  100% { transform: scale(0.8); opacity: 0.3; }
}

.quiz-xp-float {
  position: absolute;
  font-size: 18px;
  font-weight: 700;
  color: #f59e0b;
  pointer-events: none;
  z-index: 100;
  animation: xpFloatUp 1.2s ease-out forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes xpFloatUp {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1);
  }
}

.quiz-progress-animate {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-result-rewards {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quiz-reward-item {
  text-align: center;
  animation: rewardPopIn 0.5s ease backwards;
}

.quiz-reward-item:nth-child(1) { animation-delay: 0.1s; }
.quiz-reward-item:nth-child(2) { animation-delay: 0.2s; }
.quiz-reward-item:nth-child(3) { animation-delay: 0.3s; }
.quiz-reward-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes rewardPopIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.quiz-reward-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.quiz-reward-value {
  font-size: 20px;
  font-weight: 700;
}

.quiz-reward-value.gold { color: #f59e0b; }
.quiz-reward-value.purple { color: #8b5cf6; }
.quiz-reward-value.green { color: #10b981; }
.quiz-reward-value.red { color: #ef4444; }

.quiz-reward-label {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.quiz-result-emoji-bounce {
  animation: emojiBounce 1s ease;
}

@keyframes emojiBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.quiz-progress-bar-container {
  position: relative;
}

.quiz-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient-purple);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.quiz-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.quiz-result {
  min-height: 100%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.quiz-result-card {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.quiz-result-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}

.quiz-result-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.quiz-result-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.quiz-result-stats {
  background: #f9fafb;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.quiz-result-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.quiz-result-stat .num {
  font-size: 28px;
  font-weight: 700;
}

.quiz-result-stat.correct .num { color: #10b981; }
.quiz-result-stat.wrong .num { color: #ef4444; }
.quiz-result-stat.accuracy .num { color: #667eea; }

.quiz-result-stat .label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.quiz-result-actions {
  display: flex;
  gap: 12px;
}

.pinyin-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.pinyin-page-header {
  padding: 20px 16px 12px;
}

.pinyin-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.pinyin-page-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.pinyin-tabs-wrap {
  padding: 0 16px 16px;
}

.pinyin-tabs {
  display: flex;
  background: #e5e7eb;
  border-radius: 12px;
  padding: 4px;
}

.pinyin-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-text-secondary);
}

.pinyin-tab.active {
  background: white;
  color: var(--color-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pinyin-grid-wrap {
  padding: 0 16px;
}

.pinyin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pinyin-card {
  background: white;
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.pinyin-card:hover {
  transform: scale(1.05);
}

.pinyin-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0 auto 8px;
}

.pinyin-card-icon.gradient-0 { background: linear-gradient(135deg,#a7f3d0,#6ee7b7); }
.pinyin-card-icon.gradient-1 { background: linear-gradient(135deg,#bfdbfe,#93c5fd); }
.pinyin-card-icon.gradient-2 { background: linear-gradient(135deg,#fde68a,#fcd34d); }
.pinyin-card-icon.gradient-3 { background: linear-gradient(135deg,#fbcfe8,#f9a8d4); }
.pinyin-card-icon.gradient-4 { background: linear-gradient(135deg,#ddd6fe,#c4b5fd); }
.pinyin-card-icon.gradient-5 { background: linear-gradient(135deg,#fed7aa,#fdba74); }

.pinyin-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.pinyin-tip {
  padding: 16px;
}

.pinyin-tip-inner {
  background: #dbeafe;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pinyin-tip-icon {
  font-size: 18px;
}

.pinyin-tip-text {
  font-size: 13px;
  color: #1e40af;
}

.storybook-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.storybook-header {
  padding: 20px 16px 12px;
}

.storybook-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.storybook-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.storybook-grid-wrap {
  padding: 0 16px;
}

.storybook-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.book-item {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

.book-item:hover {
  transform: translateY(-4px);
}

.book-cover {
  aspect-ratio: 3/4;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-cover-content {
  text-align: center;
  color: white;
  padding: 16px;
}

.book-cover-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.book-cover-title {
  font-size: 16px;
  font-weight: 600;
}

.book-difficulty {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
}

.book-difficulty.L1 { background: #d1fae5; color: #065f46; }
.book-difficulty.L2 { background: #fef3c7; color: #92400e; }
.book-difficulty.L3 { background: #fed7aa; color: #9a3412; }

.book-info {
  padding: 12px;
}

.book-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.book-meta {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.storybook-reader-page {
  min-height: 100%;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

.reader-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.reader-title {
  flex: 1;
  text-align: center;
}

.reader-book-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.reader-book-source {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.reader-content {
  flex: 1;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
}

.reader-page {
  flex: 1;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.reader-illustration {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg,#a8edea 0%,#fed6e3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-illustration-emoji {
  font-size: 64px;
  text-align: center;
}

.reader-text-wrap {
  padding: 20px;
  flex: 1;
}

.reader-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  line-height: 1.8;
  margin-bottom: 16px;
}

.reader-chars-section {
  border-top: 1px dashed #e5e7eb;
  padding-top: 12px;
}

.reader-chars-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.reader-chars-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reader-char-tag {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0f9ff;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
}

.reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.reader-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.reader-nav-btn:disabled {
  opacity: 0.5;
}

.reader-play-btn {
  padding: 12px 24px;
  border-radius: 20px;
  border: none;
  background: var(--gradient-purple);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reader-page-num {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.progress-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.progress-hero {
  background: var(--gradient-purple);
  padding: 24px 16px 40px;
  color: white;
  border-radius: 0 0 32px 32px;
}

.progress-hero-title {
  text-align: center;
  margin-bottom: 20px;
}

.progress-hero-title h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.progress-hero-title p {
  font-size: 13px;
  opacity: 0.8;
}

.progress-level-card {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.progress-level-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.progress-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.progress-level-info {
  flex: 1;
}

.progress-level-num {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.progress-level-title {
  font-size: 12px;
  opacity: 0.8;
}

.progress-xp-text {
  font-size: 11px;
  opacity: 0.8;
  text-align: right;
  margin-top: 6px;
}

.progress-stats-row {
  padding: 0 16px;
  margin-top: -24px;
}

.progress-stats-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.progress-stat-col {
  padding: 0 8px;
}

.progress-stat-col.middle {
  border-left: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
}

.progress-stat-label {
  font-size: 12px;
  margin-bottom: 4px;
}

.progress-stat-label.hearts { color: #ef4444; }
.progress-stat-label.coins { color: #f59e0b; }
.progress-stat-label.streak { color: #10b981; }

.progress-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.progress-info-section {
  padding: 16px;
}

.progress-info-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.progress-info-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.progress-mini-stat {
  padding: 12px 8px;
  border-radius: 12px;
}

.progress-mini-stat.blue { background: #f0f9ff; }
.progress-mini-stat.green { background: #dcfce7; }
.progress-mini-stat.red { background: #fee2e2; }
.progress-mini-stat.gold { background: #fef3c7; }

.progress-mini-stat .num {
  font-size: 18px;
  font-weight: 700;
}

.progress-mini-stat.blue .num { color: #0369a1; }
.progress-mini-stat.green .num { color: #166534; }
.progress-mini-stat.red .num { color: #991b1b; }
.progress-mini-stat.gold .num { color: #92400e; }

.progress-mini-stat .label {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.progress-streak-display {
  text-align: center;
  padding: 16px 0;
}

.progress-streak-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.progress-streak-num {
  font-size: 32px;
  font-weight: 700;
  color: #f59e0b;
}

.progress-streak-label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.progress-badge-section {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.store-entry {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s;
}

.store-entry:hover {
  transform: translateX(4px);
}

.store-entry-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.store-entry-info {
  flex: 1;
}

.store-entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.store-entry-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.store-entry-arrow {
  color: #9ca3af;
  font-size: 20px;
}

.store-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.store-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.store-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.store-coins-card {
  padding: 0 16px 16px;
}

.store-coins-inner {
  background: var(--gradient-gold);
  border-radius: 20px;
  padding: 20px;
  color: white;
  text-align: center;
}

.store-coins-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.store-coins-amount {
  font-size: 40px;
  font-weight: 700;
}

.store-coins-tip {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

.store-items-section {
  padding: 0 16px;
}

.store-items-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.store-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.store-item-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg,#fef3c7,#fcd34d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.store-item-info {
  flex: 1;
}

.store-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.store-item-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.store-item-right {
  text-align: right;
}

.store-item-price {
  font-size: 16px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 6px;
}

.store-item-buy-btn {
  padding: 6px 14px;
  border-radius: 12px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--gradient-purple);
  color: white;
}

.store-item-buy-btn:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.store-footer-tip {
  padding: 20px 16px;
  text-align: center;
}

.store-footer-tip span {
  font-size: 12px;
  color: #9ca3af;
}

.speak-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.speak-header {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}

.speak-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.speak-progress-wrap {
  padding: 0 16px 12px;
}

.speak-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.speak-practice-card {
  padding: 0 16px 20px;
  text-align: center;
}

.speak-practice-inner {
  background: var(--gradient-purple);
  border-radius: 24px;
  padding: 32px 24px;
  color: white;
  margin-bottom: 16px;
}

.speak-char {
  font-size: 64px;
  font-weight: 700;
  margin-bottom: 8px;
}

.speak-pinyin {
  font-size: 20px;
  margin-bottom: 16px;
}

.speak-play-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.speak-wave-card {
  padding: 0 16px 16px;
}

.speak-wave-inner {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
}

.speak-wave-label {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.speak-wave-container {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.speak-wave-placeholder {
  color: #9ca3af;
  font-size: 13px;
}

.wave-bar {
  width: 6px;
  background: var(--gradient-purple);
  border-radius: 3px;
  transition: height 0.1s ease;
  height: 20%;
}

.speak-mic-section {
  text-align: center;
  padding: 20px 16px;
}

.speak-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s;
  background: var(--gradient-purple);
  color: white;
}

.speak-mic-btn.recording {
  background: linear-gradient(135deg,#ef4444,#dc2626);
  animation: pulse 1s infinite;
}

.speak-mic-hint {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 12px;
}

.speak-result-card {
  padding: 0 16px;
}

.speak-result-inner {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 3px solid;
}

.speak-result-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.speak-result-score {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.speak-result-text {
  font-size: 14px;
  margin-bottom: 16px;
}

.speak-next-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--gradient-purple);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.speak-complete {
  min-height: 100%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.speak-complete-card {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.speak-complete-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}

.speak-complete-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.speak-complete-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.speak-complete-rewards {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.speak-reward-item {
  text-align: center;
}

.speak-reward-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.speak-reward-value {
  font-size: 28px;
  font-weight: 700;
}

.speak-reward-value.purple { color: #8b5cf6; }
.speak-reward-value.gold { color: #f59e0b; }

.speak-complete-actions {
  display: flex;
  gap: 12px;
}

/* Progress Page New Styles */
.progress-header {
  background: var(--gradient-purple);
  padding: 24px 16px 40px;
  color: white;
  border-radius: 0 0 32px 32px;
}

.progress-header-text {
  text-align: center;
  margin-bottom: 20px;
}

.progress-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.progress-subtitle {
  font-size: 13px;
  opacity: 0.8;
}

.progress-bar.white {
  background: rgba(255,255,255,0.2);
}

.progress-level-xp {
  font-size: 11px;
  opacity: 0.8;
  text-align: right;
  margin-top: 6px;
}

.progress-content {
  padding: 0 16px;
  margin-top: -24px;
}

.progress-stats-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 12px;
}

.progress-stats-card .progress-stat-item {
  flex: 1;
}

.progress-stat-divider {
  width: 1px;
  height: 32px;
  background: #f3f4f6;
}

.progress-stat-label {
  font-size: 12px;
  margin-bottom: 4px;
}

.progress-stat-label.hearts { color: #ef4444; }
.progress-stat-label.coins { color: #f59e0b; }
.progress-stat-label.streak { color: #10b981; }

.progress-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.progress-section-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.progress-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.progress-stat-tile {
  padding: 12px 8px;
  border-radius: 12px;
}

.progress-stat-tile.blue { background: #f0f9ff; }
.progress-stat-tile.green { background: #dcfce7; }
.progress-stat-tile.red { background: #fee2e2; }
.progress-stat-tile.orange { background: #fef3c7; }

.progress-tile-num {
  font-size: 18px;
  font-weight: 700;
}

.progress-stat-tile.blue .progress-tile-num { color: #0369a1; }
.progress-stat-tile.green .progress-tile-num { color: #166534; }
.progress-stat-tile.red .progress-tile-num { color: #991b1b; }
.progress-stat-tile.orange .progress-tile-num { color: #92400e; }

.progress-tile-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.progress-streak-display {
  text-align: center;
  padding: 16px 0;
}

.progress-streak-emoji {
  font-size: 56px;
  margin-bottom: 8px;
}

.progress-streak-num {
  font-size: 32px;
  font-weight: 700;
  color: #f59e0b;
}

.progress-streak-unit {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.progress-menu-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s;
}

.progress-menu-item:active {
  transform: scale(0.98);
}

.progress-menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.progress-menu-icon.store {
  background: var(--gradient-gold);
}

.progress-menu-info {
  flex: 1;
}

.progress-menu-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.progress-menu-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.progress-menu-arrow {
  color: #9ca3af;
  font-size: 20px;
}

/* Store Page Styles */
.store-page {
  min-height: 100%;
  background: var(--color-bg);
  padding-bottom: 20px;
}

.store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: white;
}

.store-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.placeholder-right {
  width: 40px;
}

.store-coins-card {
  padding: 0 16px;
  margin-bottom: 16px;
}

.store-coins-inner {
  background: var(--gradient-gold);
  border-radius: 16px;
  padding: 20px;
  color: white;
  text-align: center;
}

.store-coins-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.store-coins-amount {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.store-coins-tip {
  font-size: 12px;
  opacity: 0.8;
}

.store-items-section {
  padding: 0 16px;
}

.store-items-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.store-item {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.store-item:active {
  transform: scale(0.98);
}

.store-item-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.store-item-info {
  flex: 1;
}

.store-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.store-item-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.store-item-right {
  text-align: right;
  flex-shrink: 0;
}

.store-item-price {
  font-size: 14px;
  font-weight: 600;
  color: #f59e0b;
  margin-bottom: 8px;
}

.store-item-buy-btn {
  padding: 6px 16px;
  border: none;
  border-radius: 20px;
  background: var(--gradient-gold);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.store-item-buy-btn:active {
  transform: scale(0.95);
}

.store-item-buy-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.8;
}

.store-footer-tip {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Modal Styles */
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: 280px;
  max-width: 90%;
  text-align: center;
  z-index: 1;
  animation: badgePopIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-icon-big {
  font-size: 64px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.modal-btn:active {
  transform: scale(0.97);
}

.modal-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.modal-btn.secondary {
  background: #f3f4f6;
  color: var(--color-text-secondary);
}

.speak-practice-container {
  padding: 16px;
  max-width: 400px;
  margin: 0 auto;
}

.speak-card {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
}

.speak-char-display {
  font-size: 72px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.1;
}

.speak-pinyin-display {
  font-size: 22px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.speak-play-btn {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

.speak-record-area {
  text-align: center;
  margin-bottom: 20px;
}

.speak-record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58CC02, #45a301);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(88,204,2,0.4);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.speak-record-btn:active {
  transform: scale(0.95);
}

.speak-record-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 20px rgba(239,68,68,0.5);
  animation: speakPulse 1s infinite;
}

@keyframes speakPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(239,68,68,0.4); }
  50% { box-shadow: 0 4px 28px rgba(239,68,68,0.7); }
}

.speak-result-area {
  margin-bottom: 12px;
}

.speak-score-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.speak-score-emoji {
  font-size: 48px;
  margin-bottom: 4px;
}

.speak-score-number {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
}

.speak-score-label {
  font-size: 16px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.speak-score-stars {
  font-size: 24px;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.speak-score-msg {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 16px;
}

.speak-score-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.speak-action-btn {
  flex: 1;
  padding: 12px 16px !important;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.speak-retry-btn {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.speak-next-btn {
  background: #58CC02 !important;
  color: #fff !important;
}

.speak-tip {
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  padding: 8px;
}

.speak-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

