/* ===== Word Exam - 英语单词考核 ===== */

:root {
    --wc-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    --wc-primary: #818cf8;
    --wc-primary-dark: #6366f1;
    --wc-know: #34d399;
    --wc-forgot: #f87171;
    --wc-vague: #fbbf24;
    --wc-card-bg: #1e293b;
    --wc-text: #e5e7eb;
    --wc-text-light: #9ca3af;
    --wc-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --wc-radius: 16px;
    --wc-border: #334155;
}

.wc-fullscreen {
    min-height: 100dvh;
    background: var(--wc-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--wc-text);
}

/* ===== Header ===== */

.wc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--wc-border);
    flex-shrink: 0;
    z-index: 10;
}

.wc-header .back-btn-wrap {
    position: relative;
    z-index: 2;
}

.wc-header .back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--wc-text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    transition: color 0.2s;
}

.wc-header .back-btn:hover {
    color: var(--wc-primary);
}

.wc-header .back-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    display: none;
}

.wc-title {
    font-size: 17px;
    font-weight: 600;
    color: #6b7280;
}

.wc-header-right {
    min-width: 60px;
    text-align: right;
}

.wc-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.wc-points-badge i {
    font-size: 13px;
}

/* ===== Screens ===== */

.wc-screen {
    display: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wc-screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== Home Screen ===== */

.wc-home-content {
    padding: 20px 16px;
    flex: 1;
}

.wc-points-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 20px;
    border-radius: var(--wc-radius);
    margin-bottom: 24px;
}

.wc-points-label {
    font-size: 13px;
    color: var(--wc-text-light);
    margin-bottom: 4px;
}

.wc-points-value {
    font-size: 36px;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1;
}

.wc-lottery-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.wc-lottery-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.wc-lottery-btn:active {
    transform: scale(0.96);
}

.wc-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--wc-text-light);
    margin-bottom: 12px;
}

.wc-grade-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.wc-grade-card {
    background: var(--wc-card-bg);
    border-radius: var(--wc-radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--wc-shadow);
    border: 1px solid var(--wc-border);
    position: relative;
    overflow: hidden;
}

.wc-grade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--wc-primary);
}

.wc-grade-card:active {
    transform: scale(0.97);
}

.wc-grade-card.completed {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.wc-grade-card.completed::after {
    content: '已完成';
    position: absolute;
    top: 10px;
    right: -24px;
    background: var(--wc-know);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 30px;
    transform: rotate(45deg);
}

.wc-grade-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--wc-text);
    margin-bottom: 6px;
}

.wc-grade-meta {
    font-size: 13px;
    color: var(--wc-text-light);
}

.wc-grade-progress {
    margin-top: 10px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.wc-grade-progress-fill {
    height: 100%;
    background: var(--wc-primary);
    border-radius: 3px;
    transition: width 0.3s;
}

/* ===== Units Screen ===== */

.wc-units-content {
    padding: 20px 16px;
    flex: 1;
}

.wc-unit-card {
    background: var(--wc-card-bg);
    border-radius: var(--wc-radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--wc-shadow);
    border: 1px solid var(--wc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-unit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-color: var(--wc-primary);
}

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

.wc-unit-card.completed {
    opacity: 0.55;
    cursor: default;
    border-color: var(--wc-border);
}

.wc-unit-card.completed:hover {
    transform: none;
    box-shadow: var(--wc-shadow);
    border-color: var(--wc-border);
}

.wc-unit-left {
    flex: 1;
}

.wc-unit-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--wc-text);
    margin-bottom: 4px;
}

.wc-unit-meta {
    font-size: 13px;
    color: var(--wc-text-light);
}

.wc-unit-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.wc-unit-progress-fill {
    height: 100%;
    background: var(--wc-know);
    border-radius: 3px;
    transition: width 0.3s;
}

.wc-unit-score {
    font-size: 12px;
    color: var(--wc-vague);
    margin-top: 4px;
}

.wc-unit-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wc-primary);
    flex-shrink: 0;
    margin-left: 12px;
}

.wc-unit-right .done {
    color: var(--wc-know);
}

/* ===== Exam Screen ===== */

.wc-exam-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    flex: 1;
}

.wc-exam-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 12px;
}

.wc-exam-score {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fbbf24;
    font-size: 18px;
    font-weight: 700;
}

.wc-exam-score i {
    font-size: 16px;
}

.wc-exam-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    color: var(--wc-text-light);
    font-size: 15px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.wc-exam-streak i {
    font-size: 14px;
}

.wc-exam-streak.hot {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.15);
    animation: streak-pulse 0.8s ease infinite;
}

.wc-exam-streak.fire {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    animation: streak-pulse 0.5s ease infinite;
}

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

.wc-progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.wc-progress-fill {
    height: 100%;
    background: var(--wc-primary);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.wc-progress-text {
    font-size: 13px;
    color: var(--wc-text-light);
    margin-bottom: 12px;
}

/* Question Area */
.wc-question-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    min-height: 120px;
}

.wc-question-word {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-align: center;
    word-break: break-word;
    animation: word-enter 0.3s ease;
}

@keyframes word-enter {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.wc-points-popup {
    position: absolute;
    bottom: 70%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.wc-points-popup.show {
    animation: points-fly 0.9s ease forwards;
}

@keyframes points-fly {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.7); }
    20% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(0.9); }
}

/* Choices */
.wc-choices {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}

.wc-choice-btn {
    width: 100%;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--wc-border);
    background: var(--wc-card-bg);
    color: var(--wc-text);
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.wc-choice-btn:hover {
    border-color: var(--wc-primary);
    background: rgba(129, 140, 248, 0.08);
}

.wc-choice-btn:active {
    transform: scale(0.97);
}

.wc-choice-btn.correct {
    background: rgba(52, 211, 153, 0.2);
    border-color: var(--wc-know);
    color: var(--wc-know);
    animation: choice-pop 0.25s ease;
}

.wc-choice-btn.wrong {
    background: rgba(248, 113, 113, 0.2);
    border-color: var(--wc-forgot);
    color: var(--wc-forgot);
    animation: choice-shake 0.3s ease;
}

.wc-choice-btn.disabled {
    pointer-events: none;
}

@keyframes choice-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

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

/* ===== Results Screen ===== */

.wc-results-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    text-align: center;
}

.wc-results-icon {
    font-size: 56px;
    color: #fbbf24;
    margin-bottom: 12px;
    animation: wc-bounce 0.6s ease;
}

@keyframes wc-bounce {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.wc-results-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--wc-text);
    margin-bottom: 24px;
}

.wc-results-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.wc-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    border-radius: 14px;
    min-width: 80px;
}

.wc-stat-item.correct {
    background: rgba(52, 211, 153, 0.15);
    color: var(--wc-know);
}

.wc-stat-item.wrong {
    background: rgba(248, 113, 113, 0.15);
    color: var(--wc-forgot);
}

.wc-stat-item.streak {
    background: rgba(251, 191, 36, 0.15);
    color: var(--wc-vague);
}

.wc-stat-num {
    font-size: 28px;
    font-weight: 700;
}

.wc-stat-label {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.wc-results-points-earned {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 28px;
    padding: 12px 24px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
}

.wc-results-actions {
    display: flex;
    gap: 12px;
}

.wc-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.wc-btn:active {
    transform: scale(0.96);
}

.wc-btn.primary {
    background: var(--wc-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.3);
}

.wc-btn.primary:hover {
    box-shadow: 0 6px 24px rgba(129, 140, 248, 0.4);
}

.wc-btn.primary:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.wc-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--wc-text);
    border: 1px solid var(--wc-border);
}

.wc-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Lottery Screen ===== */

.wc-lottery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    text-align: center;
}

.wc-lottery-title {
    font-size: 24px;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 8px;
}

.wc-lottery-cost {
    font-size: 14px;
    color: var(--wc-text-light);
    margin-bottom: 4px;
}

.wc-lottery-cost strong {
    color: #fbbf24;
}

.wc-lottery-balance {
    font-size: 14px;
    color: var(--wc-text-light);
    margin-bottom: 24px;
}

.wc-lottery-balance strong {
    color: #fbbf24;
}

.wc-lottery-box {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.wc-lottery-gift {
    font-size: 80px;
    transition: transform 0.3s;
    line-height: 1;
}

.wc-lottery-gift.spinning {
    animation: gift-spin 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-lottery-gift.opened {
    animation: gift-open 0.5s ease forwards;
}

@keyframes gift-spin {
    0% { transform: scale(1) rotate(0deg); }
    20% { transform: scale(1.1) rotate(-10deg); }
    40% { transform: scale(1.15) rotate(10deg); }
    60% { transform: scale(1.2) rotate(-8deg); }
    80% { transform: scale(1.25) rotate(6deg); }
    100% { transform: scale(1.3) rotate(0deg); }
}

@keyframes gift-open {
    0% { transform: scale(1.3); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1.1); }
}

.wc-lottery-result {
    min-height: 60px;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.wc-lottery-result.show {
    opacity: 1;
}

.wc-prize-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.wc-prize-desc {
    font-size: 14px;
    color: var(--wc-text-light);
}

.wc-draw-btn {
    margin-bottom: 12px;
    padding: 14px 36px;
    font-size: 16px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.wc-draw-btn:hover {
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.4);
}

.wc-draw-btn:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.wc-lottery-back {
    margin-top: 4px;
}

.wc-insufficient {
    color: var(--wc-forgot);
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

.wc-insufficient.show {
    display: block;
}

/* ===== Responsive ===== */

@media (max-width: 480px) {
    .wc-grade-grid {
        gap: 10px;
    }

    .wc-grade-card {
        padding: 16px 14px;
    }

    .wc-grade-name {
        font-size: 16px;
    }

    .wc-question-word {
        font-size: 34px;
    }

    .wc-choice-btn {
        padding: 14px 16px;
        font-size: 16px;
    }

    .wc-results-stats {
        gap: 10px;
    }

    .wc-stat-item {
        padding: 12px 14px;
        min-width: 70px;
    }
}

@media (min-width: 768px) {
    .wc-home-content,
    .wc-units-content {
        max-width: 520px;
        margin: 0 auto;
    }
}
