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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 219, 112, 0.2) 0%, transparent 50%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.quiz-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-container:hover {
    transform: translateY(-2px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 50%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(245, 87, 108, 0.8));
    }
}

.quiz-header {
    margin-bottom: 30px;
}

.quiz-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    flex-wrap: wrap;
}

.selector-label {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.question-bank-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-bank-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.question-bank-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.question-bank-select option {
    background: #2a2a2a;
    color: white;
}

.load-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #f093fb 50%, #f5576c 100%);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.question-text {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #ffffff;
}

.options-container {
    margin-bottom: 30px;
}

.option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: width 0.3s ease;
}

.option:hover::before {
    width: 100%;
}

.option:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
    border-color: rgba(255, 255, 255, 0.2);
}

.option.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.option.correct {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(34, 139, 34, 0.2) 100%);
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3);
}

.option.incorrect {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(178, 34, 34, 0.2) 100%);
    border-color: #dc3545;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
}

.option-letter {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    margin-right: 16px;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.option.correct .option-letter {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.option.incorrect .option-letter {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.option-text {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.button-container {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.submit-btn,
.reset-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.reset-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.4);
}

.feedback {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    display: none;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(32, 201, 151, 0.1) 100%);
    border-color: rgba(40, 167, 69, 0.3);
}

.feedback.incorrect {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.1) 100%);
    border-color: rgba(220, 53, 69, 0.3);
}

.feedback-title {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 12px;
}

.feedback.correct .feedback-title {
    color: #28a745;
}

.feedback.incorrect .feedback-title {
    color: #dc3545;
}

.feedback-icon {
    margin-right: 12px;
    font-size: 1.25rem;
}

.feedback-answer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.feedback-answer strong {
    color: rgba(255, 255, 255, 0.9);
}

/* 确认对话框样式 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-dialog.show {
    opacity: 1;
    visibility: visible;
}

.confirm-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-dialog.show .confirm-content {
    transform: scale(1);
}

.confirm-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
}

.confirm-message {
    margin-bottom: 32px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.confirm-btn.confirm {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.confirm-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.4);
}

/* 错题本按钮样式 */
.error-book-btn {
    background: linear-gradient(135deg, #ffa726 0%, #ff7043 100%);
    border: none;
    color: white;
    padding: 15px 20px;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
    min-width: 120px;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.3);
}

.error-book-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 167, 38, 0.4);
}

.error-book-btn .error-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 6px;
    margin-left: 8px;
    font-size: 0.8rem;
}

/* 错题本对话框样式 */
.error-book-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.error-book-dialog.show {
    opacity: 1;
    visibility: visible;
}

.error-book-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.error-book-dialog.show .error-book-content {
    transform: scale(1);
}

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

.error-book-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.error-book-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
}

.error-stat-item {
    text-align: center;
}

.error-stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ff7043;
    margin-bottom: 5px;
}

.error-stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-error-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.clear-error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.error-book-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 30px;
}

.error-book-list::-webkit-scrollbar {
    width: 8px;
}

.error-book-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.error-book-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.error-book-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.error-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.error-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.error-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
    line-height: 1.5;
}

.error-options {
    margin-bottom: 16px;
}

.error-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.error-option.correct {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.error-option.incorrect {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.error-option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.error-option.correct .error-option-letter {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.error-option.incorrect .error-option-letter {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.error-option-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.error-answer {
    padding: 12px;
    background: rgba(255, 167, 38, 0.1);
    border: 1px solid rgba(255, 167, 38, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.error-answer strong {
    color: #ffa726;
}

.empty-error-book {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-error-book i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-error-book p {
    font-size: 1.1rem;
    margin: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .quiz-container {
        padding: 24px;
        border-radius: 20px;
    }

    .title {
        font-size: 2rem;
        margin-bottom: 32px;
    }

    .stats {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 16px;
    }

    .stat-item {
        padding: 12px 8px;
        flex: 1;
        min-width: 0;
    }

    .stat-value {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .progress-bar-container {
        margin-bottom: 24px;
    }

    .question-text {
        font-size: 1.125rem;
        margin-bottom: 24px;
    }

    .option {
        padding: 16px;
    }

    .option-letter {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .button-container {
        flex-direction: column;
        gap: 12px;
    }

    .submit-btn,
    .reset-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .feedback {
        padding: 20px;
    }

    .confirm-content {
        padding: 32px 24px;
        margin: 20px;
    }

    .confirm-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .confirm-btn {
        width: 100%;
        padding: 14px 24px;
    }
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.completion-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.completion-label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.completion-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

@media (max-width: 480px) {
    .stats {
        gap: 4px;
    }

    .stat-item {
        padding: 10px 4px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .title {
        font-size: 1.75rem;
    }

    .quiz-container {
        padding: 20px;
    }

    .completion-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .button-container {
        flex-direction: column;
    }

    .error-book-btn {
        width: 100%;
        justify-content: center;
    }

    .error-book-content {
        width: 95%;
        max-height: 90vh;
    }

    .error-book-header {
        padding: 20px;
    }

    .error-book-title {
        font-size: 1.5rem;
    }

    .error-book-stats {
        padding: 15px 20px;
    }

    .error-stat-value {
        font-size: 2rem;
    }

    .error-book-list {
        padding: 0 20px 20px;
    }

    .error-question {
        font-size: 1rem;
    }

    .error-option {
        padding: 6px 10px;
    }

    .error-option-letter {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}