/* 阿丘学英语 - 设计系统优化版 */
:root {
  --primary-50: #FDF8F0; --primary-100: #F9EDDB; --primary-200: #F2D9B3;
  --primary-300: #E8C080; --primary-400: #D4A05A; --primary-500: #8B6914;
  --primary-600: #6B4F12; --accent-400: #FFAB91; --accent-500: #FF7043;
  --accent-600: #E64A19; --success-400: #AED581; --success-500: #7CB342;
  --success-600: #558B2F; --danger-500: #E53935;
  --weather-sunny: #FFD54F;
  --bg-gradient: linear-gradient(135deg, var(--primary-50) 0%, #FFF0F5 30%, #E8F5E9 70%, var(--primary-100) 100%);
  --text-primary: #3E2723; --text-secondary: #5D4037; --text-muted: #8D6E63;
  --shadow-sm: 0 2px 8px rgba(139,105,20,0.08);
  --shadow-md: 0 4px 16px rgba(139,105,20,0.12);
  --shadow-lg: 0 8px 32px rgba(139,105,20,0.16);
  --shadow-glow: 0 0 20px rgba(255,112,67,0.3);
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px; --radius-xl: 32px; --radius-full: 9999px;
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg-gradient); min-height: 100vh; color: var(--text-primary); overflow-x: hidden; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.9; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes bounce-in { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.home { max-width: 480px; margin: 0 auto; padding: var(--space-lg); padding-bottom: 100px; }
.app-header { text-align: center; padding: var(--space-xl) 0; animation: slide-up 0.6s ease-out; }
.app-icon { width: 100px; height: 100px; border-radius: var(--radius-xl); object-fit: cover; box-shadow: var(--shadow-lg); margin-bottom: var(--space-md); animation: float 3s ease-in-out infinite; }
.app-title { font-size: 28px; font-weight: 800; color: var(--primary-600); margin-bottom: var(--space-xs); letter-spacing: -0.5px; }
.app-subtitle { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: var(--space-xs); }
.stars-card { background: white; border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-md); display: flex; align-items: center; gap: var(--space-lg); margin-bottom: var(--space-xl); animation: slide-up 0.6s ease-out 0.1s both; position: relative; overflow: hidden; }
.stars-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent-500), var(--weather-sunny), var(--accent-500)); background-size: 200% 100%; animation: shimmer 3s linear infinite; }
.stars-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--weather-sunny), var(--accent-500)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 32px; box-shadow: var(--shadow-sm); }
.stars-count { font-size: 36px; font-weight: 800; color: var(--accent-600); line-height: 1; }
.stars-label { font-size: 14px; color: var(--text-muted); margin-top: var(--space-xs); }
.unit-card { background: white; border-radius: var(--radius-xl); padding: var(--space-xl); box-shadow: var(--shadow-md); cursor: pointer; transition: all 0.3s ease; animation: slide-up 0.6s ease-out 0.2s both; }
.unit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.unit-badge { display: inline-flex; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-md); background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: white; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; margin-bottom: var(--space-md); }
.unit-title { font-size: 22px; font-weight: 700; margin-bottom: var(--space-xs); }
.unit-desc { font-size: 14px; color: var(--text-muted); margin-bottom: var(--space-lg); }
.word-cloud { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.word-chip { padding: var(--space-sm) var(--space-md); background: var(--primary-50); border-radius: var(--radius-full); font-size: 13px; display: flex; align-items: center; gap: var(--space-xs); transition: all 0.2s; }
.word-chip:hover { background: var(--primary-100); transform: scale(1.05); }
.progress-container { background: var(--primary-100); border-radius: var(--radius-full); height: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--success-500), var(--success-400)); border-radius: var(--radius-full); transition: width 0.8s ease-out; position: relative; }
.progress-fill::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 2s linear infinite; }
.learn-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-md) var(--space-lg); background: white; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10; }
.back-btn { width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--primary-50); border: none; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.back-btn:hover { background: var(--primary-100); transform: scale(1.1); }
.header-stars { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--primary-50); border-radius: var(--radius-full); font-size: 16px; font-weight: 600; color: var(--accent-600); }
.learn-content { max-width: 480px; margin: 0 auto; padding: var(--space-lg); padding-bottom: 120px; }
.word-card { background: white; border-radius: var(--radius-xl); padding: var(--space-2xl) var(--space-xl); text-align: center; box-shadow: var(--shadow-md); margin-bottom: var(--space-xl); animation: bounce-in 0.5s ease-out; }
.weather-icon { font-size: 80px; margin-bottom: var(--space-lg); display: block; animation: float 2s ease-in-out infinite; }
.word-english { font-size: 52px; font-weight: 800; color: var(--primary-600); letter-spacing: -1px; margin-bottom: var(--space-sm); }
.word-phonetic { font-size: 18px; color: var(--text-muted); font-family: Georgia, serif; margin-bottom: var(--space-sm); }
.word-chinese { font-size: 26px; font-weight: 600; }
.aqiu-tip { display: flex; align-items: flex-start; gap: var(--space-md); padding: var(--space-lg); background: linear-gradient(135deg, var(--primary-50), #FFF0F5); border-radius: var(--radius-lg); margin-bottom: var(--space-xl); border-left: 4px solid var(--accent-500); }
.aqiu-avatar { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.aqiu-name { font-weight: 700; color: var(--accent-600); margin-bottom: var(--space-xs); display: flex; align-items: center; gap: var(--space-xs); }
.aqiu-name::before { content: ''; width: 8px; height: 8px; background: var(--accent-500); border-radius: 50%; }
.aqiu-text { font-size: 15px; line-height: 1.7; color: var(--text-secondary); }
.speak-btn { width: 100%; padding: var(--space-lg); background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: white; border: none; border-radius: var(--radius-lg); font-size: 17px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: var(--space-md); margin-bottom: var(--space-xl); box-shadow: var(--shadow-md); transition: all 0.3s; position: relative; overflow: hidden; }
.speak-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transition: left 0.5s; }
.speak-btn:hover::before { left: 100%; }
.speak-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.speak-btn .icon { font-size: 24px; }
.rhyme-card { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); border-radius: var(--radius-xl); padding: var(--space-xl); margin-bottom: var(--space-xl); position: relative; overflow: hidden; }
.rhyme-title { font-size: 15px; font-weight: 700; color: #1565C0; margin-bottom: var(--space-md); }
.rhyme-content { font-size: 17px; line-height: 1.9; color: #1565C0; text-align: center; font-weight: 500; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-xl); }
.action-btn { padding: var(--space-xl) var(--space-md); border-radius: var(--radius-lg); border: none; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); transition: all 0.3s; }
.action-btn:active { transform: scale(0.96); }
.action-btn .icon { font-size: 36px; }
.action-btn .sub { font-size: 11px; opacity: 0.8; font-weight: 500; }
.action-btn.read { background: linear-gradient(135deg, var(--success-500), var(--success-600)); color: white; box-shadow: var(--shadow-sm); }
.action-btn.quiz { background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: white; box-shadow: var(--shadow-sm); }
.word-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-sm); }
.word-nav-btn { width: 48px; height: 48px; border-radius: var(--radius-md); border: 2px solid var(--primary-200); background: white; font-size: 24px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.word-nav-btn:hover { border-color: var(--primary-400); transform: scale(1.1); }
.word-nav-btn.active { background: var(--primary-500); border-color: var(--primary-500); color: white; transform: scale(1.1); box-shadow: var(--shadow-sm); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; padding: var(--space-md) var(--space-xl) env(safe-area-inset-bottom, var(--space-lg)); display: flex; justify-content: space-around; box-shadow: 0 -4px 20px rgba(0,0,0,0.08); z-index: 100; }
.nav-btn { background: none; border: none; font-size: 11px; color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); padding: var(--space-sm); border-radius: var(--radius-md); transition: all 0.2s; }
.nav-btn .icon { font-size: 24px; }
.nav-btn:hover { color: var(--primary-500); background: var(--primary-50); }
.nav-btn.active { color: var(--accent-500); }
.achievements-page { max-width: 480px; margin: 0 auto; padding: var(--space-lg); }
.achievements-header { text-align: center; padding: var(--space-xl) 0; }
.big-star-display { width: 140px; height: 140px; margin: 0 auto var(--space-lg); background: linear-gradient(135deg, var(--weather-sunny), var(--accent-500)); border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 72px; box-shadow: var(--shadow-lg); animation: pulse 2s ease-in-out infinite; }
.big-star-num { font-size: 64px; font-weight: 800; color: white; }
.big-star-label { font-size: 16px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }
.badges-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.badge-card { background: white; border-radius: var(--radius-lg); padding: var(--space-lg) var(--space-md); text-align: center; box-shadow: var(--shadow-sm); transition: all 0.3s; }
.badge-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-icon { font-size: 48px; margin-bottom: var(--space-sm); }
.badge-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; padding: var(--space-lg); }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: var(--radius-xl); padding: var(--space-2xl); width: 100%; max-width: 380px; text-align: center; animation: bounce-in 0.3s ease-out; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: var(--space-xl); }
.modal-word { font-size: 42px; font-weight: 800; color: var(--primary-600); margin-bottom: var(--space-xl); }
.record-btn { width: 88px; height: 88px; border-radius: 50%; background: linear-gradient(135deg, var(--danger-500), #C62828); border: none; color: white; font-size: 36px; cursor: pointer; margin-bottom: var(--space-lg); transition: all 0.3s; box-shadow: var(--shadow-md); }
.record-btn:hover { transform: scale(1.1); }
.record-btn.recording { animation: pulse 1s infinite; background: linear-gradient(135deg, var(--success-500), var(--success-600)); }
.record-hint { font-size: 14px; color: var(--text-muted); }
.modal-result { padding: var(--space-md); border-radius: var(--radius-md); margin-top: var(--space-lg); font-size: 15px; display: none; }
.modal-result.good { background: #E8F5E9; color: #2E7D32; display: block; }
.modal-result.ok { background: #FFF3E0; color: #E65100; display: block; }
.modal-result.bad { background: #FFEBEE; color: #C62828; display: block; }
.modal-close { margin-top: var(--space-lg); padding: var(--space-md) var(--space-xl); background: var(--primary-100); border: none; border-radius: var(--radius-md); font-size: 15px; cursor: pointer; }
.quiz-timer { font-size: 48px; font-weight: 800; color: var(--accent-600); margin-bottom: var(--space-lg); }
.quiz-timer.warning { color: var(--danger-500); animation: pulse 0.5s infinite; }
.quiz-input { width: 100%; padding: var(--space-lg); font-size: 24px; text-align: center; border: 3px solid var(--primary-200); border-radius: var(--radius-lg); margin-bottom: var(--space-lg); outline: none; }
.quiz-input:focus { border-color: var(--accent-500); }
.quiz-submit { width: 100%; padding: var(--space-lg); background: linear-gradient(135deg, var(--accent-500), var(--accent-600)); color: white; border: none; border-radius: var(--radius-lg); font-size: 17px; font-weight: 600; cursor: pointer; margin-bottom: var(--space-md); }
.result-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 300; align-items: center; justify-content: center; flex-direction: column; }
.result-overlay.show { display: flex; animation: bounce-in 0.3s ease-out; }
.result-overlay.success { background: rgba(124,179,66,0.97); }
.result-overlay.fail { background: rgba(255,112,67,0.97); }
.result-emoji { font-size: 120px; }
.result-text { color: white; font-size: 28px; font-weight: 700; margin-top: var(--space-lg); }
.result-stars { color: var(--weather-sunny); font-size: 40px; font-weight: 800; margin-top: var(--space-md); }
.page { display: none; }
.page.active { display: block; }
