* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft Yahei", sans-serif; background: #f0f2f5; color: #333; }
.app-body { padding-bottom: 40px; min-height: 100vh; }

@media screen and (max-width: 480px) {
    .word { font-size: 28px !important; word-break: break-all; }
    .quiz-area { padding: 16px 12px !important; margin-bottom: 12px !important; }
    .options-area { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
    .option-btn { padding: 14px 10px !important; font-size: 14px !important; }
    .fill-area { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; padding: 12px; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); z-index: 100; }
    .quiz-area { padding-bottom: 100px !important; }
    .container { padding: 12px 8px !important; }
    .progress-text { margin-bottom: 12px !important; }
    .card-front { margin-bottom: 16px !important; min-height: 60px !important; }
    .phonetic { font-size: 13px !important; margin-top: 6px !important; }
    .pos { font-size: 10px !important; padding: 1px 6px !important; }
    .meaning { font-size: 13px !important; padding: 4px 10px !important; margin-top: 6px !important; }
    .feedback { margin-top: 16px !important; }
    .answer-reveal { font-size: 14px !important; padding: 10px !important; margin-bottom: 12px !important; }
    .btn-quality { padding: 6px 12px !important; font-size: 12px !important; }
    .stat-card { padding: 16px 12px !important; }
    .stat-num { font-size: 24px !important; }
    .stat-label { font-size: 12px !important; }
    .btn-large { padding: 16px !important; }
    .btn-text { font-size: 16px !important; }
    .section-title { font-size: 16px !important; margin: 20px 0 12px !important; }
    .unit-card-horizontal { width: 120px !important; padding: 10px !important; }
    .unit-num-circle { width: 24px !important; height: 24px !important; font-size: 12px !important; }
    .unit-name-short { font-size: 12px !important; }
    .unit-stage { font-size: 10px !important; }
    .stage-intro { padding: 30px 16px !important; }
    .stage-intro h2 { font-size: 20px !important; }
    .stage-intro p { font-size: 14px !important; }
    .intro-icon { font-size: 48px !important; }
    .letter-btn { width: 36px !important; height: 36px !important; font-size: 16px !important; }
    .blank-char { font-size: 24px !important; min-width: 28px !important; height: 36px !important; }
    .fill-input { width: 32px !important; height: 36px !important; font-size: 20px !important; }
}

.app-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.nav-link { color: #ff4757; text-decoration: none; font-size: 14px; font-weight: 500; }

.container { max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.section-title { font-size: 18px; font-weight: 600; margin: 32px 0 16px; }

.auth-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #4a90d9, #00b4d8); }
.auth-card { background: #fff; width: 90%; max-width: 380px; border-radius: 20px; padding: 40px 30px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); }
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h1 { font-size: 24px; color: #4a90d9; }
.auth-header p { font-size: 14px; color: #888; margin-top: 8px; }
.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; font-size: 14px; color: #555; margin-bottom: 8px; }
.auth-form input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; outline: none; transition: border 0.2s; }
.auth-form input:focus { border-color: #4a90d9; }
.btn-auth { width: 100%; padding: 14px; background: #4a90d9; color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.auth-tip { margin-top: 30px; padding-top: 20px; border-top: 1px dashed #eee; font-size: 12px; color: #999; text-align: center; line-height: 1.6; }
.quotation-card { background: linear-gradient(135deg, #f8f9fa, #e9ecef); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; text-align: center; }
.quotation-text { font-size: 14px; color: #333; font-style: italic; line-height: 1.6; margin-bottom: 8px; }
.quotation-source { font-size: 12px; color: #888; }

.progress-bar { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4a90d9, #00b4d8); border-radius: 3px; transition: width 0.3s; }
.progress-text { text-align: center; font-size: 12px; color: #888; margin-bottom: 30px; }

.quiz-area { background: #fff; border-radius: 20px; padding: 40px 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.card-front { text-align: center; margin-bottom: 32px; min-height: 120px; display: flex; flex-direction: column; justify-content: center; }
.word-container { display: flex; align-items: center; justify-content: center; gap: 12px; }
.word { font-size: 32px; font-weight: 700; color: #2c3e50; }
.speak-btn { background: #e8f0fe; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.speak-btn:active { transform: scale(0.9); background: #4a90d9; }
.phonetic { font-size: 16px; color: #888; margin-top: 12px; }
.pos { display: inline-block; background: #e8f0fe; color: #4a90d9; padding: 2px 12px; border-radius: 12px; font-size: 12px; margin-top: 8px; }

.options-area { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-btn { padding: 16px; font-size: 15px; border: 2px solid #eee; border-radius: 12px; background: #fff; cursor: pointer; transition: all 0.2s; }
.option-btn:active { transform: scale(0.98); }
.option-btn.correct { border-color: #2ecc71; background: #e8f8f0; color: #27ae60; font-weight: 600; }
.option-btn.wrong { border-color: #e74c3c; background: #fdedec; color: #c0392b; }

.feedback { margin-top: 32px; text-align: center; animation: slideIn 0.3s ease-out; }
.answer-reveal { font-size: 18px; margin-bottom: 20px; padding: 16px; background: #f8f9fa; border-radius: 10px; color: #333; }
.quality-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-quality { padding: 10px 20px; border: none; border-radius: 20px; font-size: 14px; cursor: pointer; font-weight: 500; }
.btn-again { background: #ffeaa7; color: #d35400; }
.btn-hard { background: #fab1a0; color: #c0392b; }
.btn-good { background: #dfe6e9; color: #2d3436; }
.btn-easy { background: #b2dfdb; color: #00695c; }

.complete-area { text-align: center; padding: 60px 20px; background: #fff; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.complete-icon { font-size: 60px; margin-bottom: 16px; }
.btn-primary { display: inline-block; padding: 12px 32px; background: #4a90d9; color: #fff; text-decoration: none; border-radius: 10px; font-weight: 600; margin-top: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #fff; padding: 24px 16px; border-radius: 16px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.stat-card .stat-num { font-size: 28px; font-weight: 700; color: #2c3e50; }
.stat-card .stat-label { font-size: 12px; color: #888; margin-top: 4px; }
.stat-card.highlight .stat-num { color: #e67e22; }
.stat-card.success .stat-num { color: #27ae60; }
.stat-card.danger .stat-num { color: #e74c3c; }
.stat-card.warning .stat-num { color: #f39c12; }

.table-container { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 16px; background: #f8f9fa; text-align: left; font-size: 13px; color: #666; font-weight: 600; }
.data-table td { padding: 12px 16px; border-top: 1px solid #f0f0f0; font-size: 14px; }
.word-cell { font-weight: 600; color: #2c3e50; }
.wrong-badge { background: #ff4757; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.empty-data { text-align: center; color: #999; padding: 40px 0; }

.book-selector { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.selector-label { font-size: 16px; font-weight: 600; color: #2c3e50; }
.book-select { padding: 8px 16px; font-size: 16px; border: 2px solid #ddd; border-radius: 10px; background: #fff; outline: none; }
.book-select:focus { border-color: #4a90d9; }

.current-unit { text-align: center; margin-bottom: 24px; }
.unit-label { font-size: 16px; color: #666; }
.unit-name { font-size: 16px; font-weight: 600; color: #4a90d9; }

.action-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.btn-large { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 16px; text-decoration: none; color: #fff; }
.btn-primary.btn-large { background: linear-gradient(135deg, #4a90d9, #00b4d8); }
.btn-secondary.btn-large { background: #fff; color: #4a90d9; border: 2px solid #4a90d9; }
.btn-danger.btn-large { background: #e74c3c; color: #fff; border: 2px solid #e74c3c; }
.btn-icon { font-size: 32px; }
.btn-text { font-size: 18px; font-weight: 600; flex: 1; }
.btn-sub { font-size: 13px; opacity: 0.8; }

.study-guide { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.guide-title { font-size: 16px; font-weight: 600; color: #2c3e50; margin-bottom: 16px; }
.guide-steps { display: flex; flex-direction: column; gap: 12px; }
.guide-step { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #f8f9fa; }
.guide-step.active { background: #e8f0fe; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: #4a90d9; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.guide-step.active .step-num { background: #4a90d9; }
.step-name { font-size: 14px; font-weight: 600; color: #2c3e50; }
.step-desc { font-size: 12px; color: #888; }
.guide-note { text-align: center; margin-top: 16px; font-size: 12px; color: #999; }

.unit-section { margin-bottom: 20px; }
.unit-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.unit-scroll::-webkit-scrollbar { display: none; }
.unit-card-horizontal { flex-shrink: 0; width: 140px; background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer; position: relative; transition: all 0.2s; border: 2px solid transparent; }
.unit-card-horizontal:active { transform: scale(0.95); }
.unit-card-horizontal.unit-current { border-color: #4a90d9; background: #e8f0fe; }
.unit-num-circle { width: 28px; height: 28px; border-radius: 50%; background: #ddd; color: #888; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.unit-card-horizontal.unit-current .unit-num-circle { background: #4a90d9; color: #fff; }
.unit-info { display: flex; flex-direction: column; gap: 2px; }
.unit-name-short { font-size: 13px; font-weight: 600; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-stage { font-size: 11px; color: #888; }
.unit-current-dot { position: absolute; top: -4px; right: -4px; width: 12px; height: 12px; border-radius: 50%; background: #4a90d9; border: 2px solid #fff; }

.meaning { font-size: 16px; color: #666; margin-top: 12px; padding: 8px 16px; background: #f8f9fa; border-radius: 8px; }

.stage-intro { text-align: center; padding: 40px 20px; }
.intro-icon { font-size: 64px; margin-bottom: 20px; animation: bounce 1s infinite; }
.stage-intro h2 { font-size: 24px; font-weight: 700; color: #2c3e50; margin-bottom: 12px; }
.stage-intro p { font-size: 15px; color: #666; line-height: 1.6; margin-bottom: 32px; }

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

.spell-area, .fill-area { text-align: center; margin-top: 20px; }
.blanks-row { display: flex; justify-content: center; gap: 2px; margin-bottom: 20px; flex-wrap: wrap; padding: 0 4px; }
.blank-char { font-size: 26px; font-weight: 700; color: #2c3e50; min-width: 26px; height: 36px; display: flex; align-items: center; justify-content: center; border-bottom: 2px solid #ddd; }
.blank-empty { color: #999; cursor: pointer; border-bottom-color: #4a90d9; }
.selected-blank { background: #e8f0fe; border-radius: 4px; }
.wrong-char { color: #e74c3c; }

.letter-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.letter-btn { width: 40px; height: 40px; font-size: 18px; font-weight: 600; background: #f0f2f5; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.letter-btn:active { background: #4a90d9; color: #fff; }
.used-letter { opacity: 0.5; cursor: not-allowed; }

.fill-input { width: 36px; height: 40px; font-size: 24px; font-weight: 700; text-align: center; border: 2px solid #ddd; border-radius: 6px; outline: none; }
.fill-input:focus { border-color: #4a90d9; }
.fill-input.wrong-input { border-color: #e74c3c; background: #fdedec; }
.fill-char { font-size: 24px; font-weight: 700; color: #2c3e50; min-width: 32px; height: 40px; display: flex; align-items: center; justify-content: center; }
.input-area { display: flex; justify-content: center; gap: 4px; margin-bottom: 20px; }

.spell-submit-btn { width: 100%; padding: 14px; font-size: 16px; }

.chart-container { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); margin-top: 20px; }
.chart-title { font-size: 16px; font-weight: 600; color: #2c3e50; margin-bottom: 16px; }

.synonym-badge { display: inline-block; font-size: 12px; color: #888; background: #f0f2f5; padding: 2px 8px; border-radius: 6px; margin-left: 8px; }

.sentence-display { background: linear-gradient(135deg, #f0f7ff, #e6f0ff); border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 8px; }
.sentence-text { font-size: 18px; color: #2c3e50; line-height: 1.6; margin-bottom: 12px; font-weight: 500; }
.sentence-text .blank { display: inline-block; min-width: 80px; border-bottom: 3px solid #4a90d9; margin: 0 4px; color: #4a90d9; font-weight: 700; }
.sentence-translation { font-size: 14px; color: #666; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

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