/* ===== CSS Variables ===== */
:root {
    --primary-color: #5c6bc0;
    --primary-light: #8e99f3;
    --primary-dark: #26418f;
    --secondary-color: #26a69a;
    --accent-color: #ff7043;
    --success-color: #66bb6a;
    --warning-color: #ffa726;
    --danger-color: #ef5350;
    --info-color: #42a5f5;

    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-dark: #263238;
    --text-primary: #2c3e50;
    --text-secondary: #607d8b;
    --text-light: #90a4ae;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

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

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.page-header h1 i {
    color: var(--primary-color);
}

.session-info {
    display: flex;
    gap: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.session-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-info i {
    color: var(--accent-color);
}

/* 玩家卡片样式 */
.player-card {
    background: linear-gradient(135deg, var(--primary-color), #7e57c2);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: var(--shadow-md);
}

.player-avatar {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 3px solid rgba(255,255,255,0.5);
}

.player-avatar.avatar-frame-gold {
    border: 4px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.player-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
}

.player-level i {
    color: #ffd700;
}

.player-stats {
    display: flex;
    gap: 24px;
}

.player-stat {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: var(--radius-md);
}

.player-stat span {
    font-weight: 700;
    font-size: 18px;
    margin: 0 4px;
}

@media (max-width: 768px) {
    .player-card {
        flex-direction: column;
        text-align: center;
    }
    
    .player-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Study Options ===== */
.study-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.option-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 32px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}

.option-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.option-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
}

.option-icon.new-words {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--success-color);
}

.option-icon.review {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--info-color);
}

.option-icon.mixed {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: var(--accent-color);
}

.option-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.option-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.word-count {
    display: inline-block;
    background: var(--bg-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== Quick Settings ===== */
.quick-settings {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.quick-settings h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    min-width: 100px;
    color: var(--text-secondary);
}

.setting-row select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.setting-row select:focus {
    border-color: var(--primary-color);
}

/* ===== Switch Toggle ===== */
.switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--text-light);
    transition: var(--transition);
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ===== Buttons ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn-large {
    padding: 18px 36px;
    font-size: 17px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-small.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-small.btn-secondary {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

/* ===== Review Schedule ===== */
.review-schedule {
    display: grid;
    gap: 20px;
    margin-bottom: 32px;
}

.schedule-day {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

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

.day-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.review-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar.large {
    height: 12px;
}

.progress-bar.small {
    height: 6px;
    width: 120px;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Wrong Words Page ===== */
.total-count {
    color: var(--text-secondary);
    font-size: 15px;
}

.wrong-words-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.wrong-words-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    min-height: 200px;
}

.wrong-word-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.wrong-word-item:last-child {
    border-bottom: none;
}

.wrong-word-item .word {
    font-weight: 600;
    font-size: 16px;
    min-width: 140px;
    color: var(--text-primary);
}

.wrong-word-item .meaning {
    flex: 1;
    color: var(--text-secondary);
    font-size: 14px;
}

.wrong-word-item .wrong-count {
    background: var(--danger-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wrong-word-item .actions {
    display: flex;
    gap: 8px;
}

.wrong-actions {
    display: flex;
    gap: 16px;
}

/* ===== Stats Page ===== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.total {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: var(--success-color);
}

.stat-icon.mastered {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--info-color);
}

.stat-icon.time {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: var(--accent-color);
}

.stat-icon.accuracy {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    color: var(--danger-color);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-chart,
.stats-heatmap {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stats-chart h3,
.stats-heatmap h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.stats-chart canvas {
    width: 100%;
    max-height: 300px;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 3px;
}

.heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--bg-primary);
}

.heatmap-cell.level-1 { background: #c8e6c9; }
.heatmap-cell.level-2 { background: #81c784; }
.heatmap-cell.level-3 { background: #4caf50; }
.heatmap-cell.level-4 { background: #2e7d32; }

/* ===== Vocabulary List ===== */
.vocabulary-list {
    margin-bottom: 32px;
}

.vocab-category h3 {
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.vocab-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.vocab-info {
    flex: 1;
}

.vocab-name {
    font-weight: 600;
    color: var(--text-primary);
}

.vocab-count {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.vocab-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Import Section ===== */
.import-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.import-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.import-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.import-area:hover {
    border-color: var(--primary-color);
    background: rgba(92, 107, 192, 0.05);
}

.import-area i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.import-area p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.import-area .hint {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== Vocabulary Overview ===== */
.vocab-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.vocab-stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.vocab-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.vocab-stat-icon.learned {
    background: linear-gradient(135deg, var(--success-color), #81c784);
}

.vocab-stat-icon.remaining {
    background: linear-gradient(135deg, var(--info-color), #64b5f6);
}

.vocab-stat-icon.progress {
    background: linear-gradient(135deg, var(--accent-color), #ff8a65);
}

.vocab-stat-info {
    flex: 1;
}

.vocab-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.vocab-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.vocab-progress-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.vocab-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.vocab-actions .btn-large {
    flex: 1;
    padding: 16px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .vocab-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .vocab-overview {
        grid-template-columns: 1fr;
    }
    
    .vocab-actions {
        flex-direction: column;
    }
}

/* ===== Settings Page ===== */
.settings-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.settings-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    color: var(--text-secondary);
}

.danger-zone {
    border: 1px solid var(--danger-color);
}

.danger-zone h3 {
    color: var(--danger-color);
}

input[type="range"] {
    width: 120px;
    accent-color: var(--primary-color);
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

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

@keyframes correctPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(76, 175, 80, 0.3); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
}

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

.study-mode {
    padding: 32px;
}

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

.progress-indicator {
    flex: 1;
    margin-right: 20px;
}

#current-progress {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--danger-color);
}

/* ===== Word Display ===== */
.word-display {
    text-align: center;
    margin-bottom: 32px;
}

.word-content {
    margin-bottom: 16px;
}

.word-text {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.word-phonetic {
    font-size: 20px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.word-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 22px;
    color: var(--primary-color);
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* ===== 选项按钮 ===== */
.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 15px;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(92, 107, 192, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option-btn:disabled {
    cursor: default;
}

.option-letter {
    width: 32px;
    height: 32px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* 答对时的动画效果 */
@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(102, 187, 106, 0.6); }
    100% { transform: scale(1); }
}

@keyframes correctGlow {
    0% { box-shadow: 0 0 0 rgba(102, 187, 106, 0); }
    50% { box-shadow: 0 0 30px rgba(102, 187, 106, 0.8); }
    100% { box-shadow: 0 0 0 rgba(102, 187, 106, 0); }
}

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

.option-btn.correct {
    border-color: var(--success-color);
    background: rgba(102, 187, 106, 0.2);
    animation: correctPulse 0.5s ease, correctGlow 0.8s ease;
}

.option-btn.correct .option-letter {
    background: var(--success-color);
    color: white;
}

.option-btn.wrong {
    border-color: var(--danger-color);
    background: rgba(239, 83, 80, 0.2);
    animation: wrongShake 0.5s ease;
}

.option-btn.wrong .option-letter {
    background: var(--danger-color);
    color: white;
}

/* 答对反馈增强 */
.feedback-correct {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    animation: correctPulse 0.5s ease;
    border: 2px solid var(--success-color);
    margin-bottom: 12px;
}

.feedback-wrong {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    animation: wrongShake 0.5s ease;
    border: 2px solid var(--danger-color);
    margin-bottom: 12px;
}

.feedback-correct i,
.feedback-wrong i {
    font-size: 20px;
    margin-right: 6px;
}

.feedback-correct p,
.feedback-wrong p {
    margin-top: 8px;
    font-size: 13px;
}

/* 连击显示增强 */
.combo-display {
    position: fixed;
    top: 10%;
    right: 5%;
    z-index: 1000;
    pointer-events: none;
}

.combo-text {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(255, 112, 67, 0.8);
    animation: comboPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.combo-label {
    font-size: 24px;
    color: var(--accent-color);
    text-align: center;
    margin-top: 8px;
    text-shadow: 0 0 10px rgba(255, 112, 67, 0.6);
}

/* 进度条增强 */
.study-progress-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 8px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.progress-track {
    flex: 1;
    height: 12px;
    background: linear-gradient(90deg, #e3f2fd, #bbdefb);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 50px;
    text-align: right;
}

/* 升级动画 */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.level-up-content {
    text-align: center;
    color: white;
    animation: levelUpPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes levelUpPop {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.level-up-title {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700, #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.level-up-stats {
    font-size: 24px;
    color: #e0e0e0;
}

.level-up-perk {
    font-size: 18px;
    color: #ffd700;
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.level-up-close {
    margin-top: 24px;
    padding: 12px 32px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}

.level-up-close:hover {
    transform: scale(1.05);
}

/* 奖励动画 */
.reward-popup {
    position: fixed;
    top: 10%;
    right: 5%;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    text-align: center;
    z-index: 1500;
    animation: rewardSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #ffd700;
    max-width: 200px;
}

@keyframes rewardSlideDown {
    0% { transform: translateY(-20px); opacity: 0; }
    50% { transform: translateY(5px); }
    100% { transform: translateY(0); opacity: 1; }
}

.reward-gold {
    font-size: 18px;
    font-weight: 700;
    color: #f57c00;
}

.reward-xp {
    font-size: 14px;
    color: var(--primary-color);
    margin-top: 4px;
}

.reward-combo {
    font-size: 12px;
    color: var(--accent-color);
    margin-top: 4px;
}

/* 浮动奖励文字 */
@keyframes floatUp {
    0% { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) translateY(-50px); opacity: 0; }
}

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

@media (max-width: 480px) {
    .options-container {
        grid-template-columns: 1fr;
    }
}

/* 例句样式 */
.question-example {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 16px;
    border-radius: var(--radius-md);
    font-style: italic;
    color: #1565c0;
    margin-bottom: 20px;
    font-size: 15px;
    border-left: 4px solid #42a5f5;
}

/* 选项区域 */
.options-area {
    margin-top: 16px;
}

/* ===== Word Details ===== */
.word-details {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 i {
    color: var(--primary-color);
}

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

.meaning-tag {
    background: var(--bg-secondary);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.mnemonics {
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-color);
}

.examples {
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
}

.examples p {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.examples p:before {
    content: '"';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.etymology {
    background: var(--bg-secondary);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
}

.etymology .root {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Complete Modal ===== */
.complete-modal {
    padding: 48px;
    text-align: center;
}

.complete-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--warning-color), #ff7043);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 48px;
    color: white;
    animation: bounce 1s infinite;
}

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

.complete-modal h2 {
    font-size: 32px;
    margin-bottom: 32px;
    color: var(--text-primary);
}

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

.complete-stat {
    text-align: center;
}

.complete-stat .value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.complete-stat .label {
    font-size: 14px;
    color: var(--text-secondary);
}

.complete-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .logo span,
    .sidebar .nav-item span,
    .sidebar .user-details {
        display: none;
    }

    .sidebar .logo {
        justify-content: center;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .sidebar .nav-item .badge {
        position: absolute;
        top: 4px;
        right: 4px;
        margin: 0;
        padding: 2px 6px;
        font-size: 10px;
    }

    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .study-options {
        grid-template-columns: 1fr;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }
 }

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

.pulse {
    animation: pulse 2s infinite;
}

/* 游戏奖励动画 */
@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(1);
    }
}

@keyframes comboPulse {
    0% {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0;
    }
}

/* 游戏状态栏 */
.game-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.game-stat {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.game-stat i {
    font-size: 16px;
}

/* 等级变化动画 */
@keyframes levelUp {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.level-up {
    animation: levelUp 0.6s ease-out;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}