* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

h1 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #e94560, #f5a623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

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

.screen.active {
    display: block;
}

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

.btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin: 10px 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #e94560, #f5a623);
    border: none;
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    box-shadow: 0 5px 25px rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
}

.btn-correct {
    background: rgba(46, 213, 115, 0.2);
    border-color: #2ed573;
    color: #2ed573;
}

.btn-wrong {
    background: rgba(255, 71, 87, 0.2);
    border-color: #ff4757;
    color: #ff4757;
}

.btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.mode-label {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f5a623;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560, #f5a623);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.chinese-display {
    text-align: center;
    margin: 30px 0;
}

.chinese-char {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.pinyin-display {
    font-size: 1.3rem;
    color: #aaa;
    margin-top: 8px;
}

.pinyin-hidden {
    visibility: hidden;
}

.english-word-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    margin: 30px 0;
}

.choices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.choices-grid .btn {
    margin: 0;
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
}

.choices-grid-english .btn {
    font-family: 'Inter', sans-serif;
}

.text-input-container {
    margin: 20px 0;
}

.text-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 1.2rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
}

.text-input:focus {
    border-color: #e94560;
}

.text-input::placeholder {
    color: #666;
}

.submit-btn {
    margin-top: 15px;
}

.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.feedback-correct {
    background: rgba(46, 213, 115, 0.15);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.feedback-wrong {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.feedback-info {
    background: rgba(245, 166, 35, 0.15);
    color: #f5a623;
    border: 1px solid rgba(245, 166, 35, 0.3);
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch.active {
    background: #e94560;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.9rem;
    color: #aaa;
}

.results-screen {
    text-align: center;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(90deg, #e94560, #f5a623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
}

.results-percentage {
    font-size: 1.2rem;
    color: #aaa;
    margin-bottom: 30px;
}

.results-details {
    text-align: left;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.results-details::-webkit-scrollbar {
    width: 4px;
}

.results-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.result-item-word {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.1rem;
}

.result-item-score {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.result-item-score.full {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
}

.result-item-score.half {
    background: rgba(245, 166, 35, 0.2);
    color: #f5a623;
}

.result-item-score.zero {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.question-number {
    font-size: 0.85rem;
    color: #888;
}

.back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-btn:hover {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
}

.hint-text {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

.number-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.number-presets .btn {
    margin: 0;
    padding: 14px;
    font-weight: 600;
}

.dict-count {
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-top: 15px;
}

.pinyin-inline {
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 480px) {
    .container {
        padding: 25px 20px;
        border-radius: 18px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .chinese-char {
        font-size: 3rem;
    }

    .choices-grid {
        grid-template-columns: 1fr;
    }

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