:root {
    --primary: #4facfe;
    --primary-dark: #2d8fd5;
    --primary-light: #e8f4fd;
    --success: #52c41a;
    --success-light: #f6ffed;
    --danger: #ff4d4f;
    --danger-light: #fff2f0;
    --warning: #faad14;
    --warning-light: #fffbe6;
    --bg: #f0f5fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e8edf2;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.comp-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(79,172,254,0.3);
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.back-btn:hover { opacity: 1; }

.header-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.header-spacer { width: 80px; }

.comp-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.comp-sidebar {
    width: 300px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-title {
    padding: 0 20px 16px;
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.sidebar-menu { list-style: none; }

.sidebar-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 15px;
}

.sidebar-item:hover {
    background: var(--primary-light);
}

.sidebar-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

.sidebar-icon { font-size: 20px; }

.comp-main {
    flex: 1;
    padding: 32px;
}

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

.main-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.exam-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    opacity: 0;
    transition: opacity 0.3s;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(79,172,254,0.2);
    border-color: var(--primary);
}

.exam-card:hover::before { opacity: 1; }

.exam-card-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.exam-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.exam-card-info {
    font-size: 12px;
    color: var(--text-light);
}

.exam-card-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.exam-card:hover .exam-card-arrow { opacity: 1; }

.loading-state, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 考试页面样式 ========== */
.exam-body { background: var(--bg); }

.exam-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(79,172,254,0.3);
}

.exam-header-inner {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exam-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 6px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
}

.timer-warning {
    background: rgba(255,77,79,0.8) !important;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-ended {
    background: rgba(0,0,0,0.3) !important;
    animation: none;
}

.exam-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 120px;
}

.section-block {
    margin-bottom: 32px;
}

.section-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-badge {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.question-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.question-card.q-correct {
    border-color: var(--success);
    background: var(--success-light);
}

.question-card.q-wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

.question-num-wrapper {
    position: relative;
    flex-shrink: 0;
}

.question-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.result-icon {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.correct-icon {
    background: var(--success);
    color: #fff;
}

.wrong-icon {
    background: var(--danger);
    color: #fff;
}

.q-correct .question-num { background: var(--success); }
.q-wrong .question-num { background: var(--danger); }

.question-body { flex: 1; }

.question-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.7;
}

.multi-hint {
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 400;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-list.tf-options {
    flex-direction: row;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-align: left;
    width: 100%;
    font-family: inherit;
    color: var(--text);
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 500;
}

.option-btn.correct {
    border-color: var(--success) !important;
    background: var(--success-light) !important;
    color: var(--success) !important;
}

.option-btn.wrong {
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
    color: var(--danger) !important;
}

.option-label {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.option-btn.selected .option-label {
    background: var(--primary);
    color: #fff;
}

.option-btn.correct .option-label {
    background: var(--success) !important;
    color: #fff !important;
}

.option-btn.wrong .option-label {
    background: var(--danger) !important;
    color: #fff !important;
}

.option-btn.tf {
    flex: 1;
    justify-content: center;
    padding: 14px;
}

.explanation {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    border-left: 3px solid var(--primary);
}

.exp-label {
    font-weight: 600;
    color: var(--primary-dark);
}

.scenario-card {
    flex-direction: column;
    gap: 16px;
}

.scenario-desc {
    font-size: 15px;
    line-height: 1.8;
    padding: 16px;
    background: var(--primary-light);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.scenario-input {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
}

.scenario-input:focus {
    outline: none;
    border-color: var(--primary);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
}

.exam-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 16px;
    display: flex;
    justify-content: center;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 100;
}

.submit-btn {
    padding: 14px 60px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    letter-spacing: 2px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,172,254,0.4);
}

.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.result-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.result-title {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--text);
}

.result-score {
    margin-bottom: 24px;
}

.score-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.score-value {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-total {
    font-size: 24px;
}

.score-breakdown {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-light);
    line-height: 2;
}

.score-note {
    margin-top: 8px;
    color: var(--warning);
    font-weight: 500;
}

.result-close-btn {
    padding: 12px 40px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.result-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79,172,254,0.4);
}

@media (max-width: 768px) {
    .comp-layout { flex-direction: column; }
    .comp-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 0;
    }
    .sidebar-title { display: none; }
    .sidebar-menu { display: flex; overflow-x: auto; padding: 0 16px; }
    .sidebar-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 8px 16px; }
    .sidebar-item.active { border-bottom-color: var(--primary); border-left: none; }
    .comp-main { padding: 20px 16px; }
    .exam-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .exam-card { padding: 16px 12px; }
    .exam-card-arrow { display: none; }
    .exam-main { padding: 16px 12px 120px; }
    .question-card { padding: 16px; gap: 12px; }
    .header-spacer { width: 60px; }
    .result-modal { padding: 24px; }
    .score-value { font-size: 42px; }
}
