/* ==========================================
   Exam System CSS - 考试系统样式
   ========================================== */

/* --- Base Variables --- */
:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --primary-light: #6BA3E0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

/* --- Navbar --- */
.navbar-exam {
    background: #fff;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    min-height: 60px;
    margin-bottom: 0;
    z-index: 1000;
}

.navbar-exam .navbar-brand {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    height: 60px;
    line-height: 28px;
    padding: 16px 15px;
}

.navbar-exam .navbar-brand:hover {
    color: var(--primary-dark);
}

.navbar-exam .navbar-brand i {
    margin-right: 5px;
}

.navbar-exam .navbar-nav {
    display: flex;
    flex-wrap: nowrap;
}

.navbar-exam .navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.navbar-exam .navbar-right > li > a {
    display: flex;
    align-items: center;
    height: 60px;
}

.navbar-exam .navbar-nav > li > a.nav-link {
    height: 60px;
    line-height: 28px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    padding: 16px 12px;
    transition: all 0.25s ease;
    position: relative;
    white-space: nowrap;
}

.navbar-exam .navbar-nav > li > a.nav-link:hover,
.navbar-exam .navbar-nav > li > a.nav-link:focus {
    color: var(--primary);
    background: rgba(74, 144, 217, 0.06);
}

.navbar-exam .navbar-nav > li > a.nav-link i {
    margin-right: 4px;
    font-size: 15px;
}

.navbar-exam .navbar-nav > li.active > a.nav-link {
    color: var(--primary);
    background: rgba(74, 144, 217, 0.08);
}

.navbar-exam .navbar-nav > li.active > a.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.navbar-exam .navbar-right .avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    overflow: hidden;
    flex-shrink: 0;
}

.navbar-exam .navbar-right .avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dropdown */
.navbar-exam .navbar-right .dropdown-toggle {
    cursor: pointer;
    display: flex !important;
    align-items: center;
    height: 60px;
}
.navbar-exam .navbar-right .dropdown-toggle .caret {
    margin-left: 4px;
    border-top: 5px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}
.navbar-exam .navbar-right .dropdown {
    position: relative;
}
.navbar-exam .navbar-right .dropdown-menu {
    margin-top: 0;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 5px 0;
    min-width: 160px;
}
.navbar-exam .navbar-right .dropdown.open .dropdown-menu {
    display: block;
}
.navbar-exam .navbar-right .dropdown-menu > li > a {
    padding: 8px 20px;
    font-size: 14px;
    color: var(--gray-700);
}
.navbar-exam .navbar-right .dropdown-menu > li > a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.navbar-exam .btn-login,
.navbar-exam .btn-register {
    margin: 14px 5px;
    padding: 6px 20px !important;
    border-radius: 20px;
    font-size: 13px;
    height: auto !important;
    line-height: 1.5 !important;
}

.navbar-exam .btn-login {
    color: var(--primary) !important;
    border: 1px solid var(--primary);
    background: transparent;
}

.navbar-exam .btn-login:hover {
    background: var(--primary);
    color: #fff !important;
}

.navbar-exam .btn-register {
    color: #fff !important;
    background: var(--primary);
    border: 1px solid var(--primary);
}

.navbar-exam .btn-register:hover {
    background: var(--primary-dark);
}

/* --- Content Area --- */
.exam-content {
    min-height: calc(100vh - 60px - 120px);
    padding-top: 20px;
    padding-bottom: 40px;
    background: var(--gray-100);
}

/* --- Footer --- */
.exam-footer {
    background: var(--gray-800);
    color: var(--gray-400);
    padding: 30px 0;
    font-size: 13px;
}

.exam-footer .footer-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.exam-footer .footer-desc {
    color: var(--gray-500);
    margin-bottom: 0;
}

.exam-footer a {
    color: var(--gray-400);
    transition: color 0.2s;
}

.exam-footer a:hover {
    color: #fff;
    text-decoration: none;
}

/* ==========================================
   Hero Section - 首页横幅
   ========================================== */
.exam-hero {
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 40%, #2E6BA6 100%);
    color: #fff;
    padding: 60px 0;
    margin: -20px -15px 30px;
    position: relative;
    overflow: hidden;
}

.exam-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.exam-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.exam-hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.exam-hero p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 25px;
}

.exam-hero .hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.exam-hero .stat-item {
    text-align: center;
}

.exam-hero .stat-num {
    font-size: 32px;
    font-weight: 700;
    display: block;
}

.exam-hero .stat-label {
    font-size: 13px;
    opacity: 0.85;
}

.hero-btn {
    display: inline-block;
    padding: 12px 35px;
    background: #fff;
    color: var(--primary);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: var(--primary-dark);
    text-decoration: none;
}

.hero-btn-outline {
    display: inline-block;
    padding: 11px 34px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    margin-left: 15px;
    transition: all 0.3s ease;
}

.hero-btn-outline:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}

/* ==========================================
   Cards - 卡片组件
   ========================================== */
.exam-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.exam-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.exam-card .card-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--gray-200);
}

.exam-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.exam-card .card-header .badge {
    font-weight: 500;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
}

.exam-card .card-body {
    padding: 18px 20px;
    flex: 1;
}

.exam-card .card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Paper Card --- */
.paper-card {
    cursor: pointer;
}

.paper-card .card-body {
    padding: 20px;
}

.paper-card .paper-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    line-height: 1.4;
}

.paper-card .paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.paper-card .meta-item {
    font-size: 13px;
    color: var(--gray-600);
}

.paper-card .meta-item i {
    margin-right: 4px;
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.paper-card .paper-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.paper-card .tag {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary);
}

.paper-card .tag.tag-free {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.paper-card .tag.tag-paid {
    background: rgba(255, 193, 7, 0.15);
    color: #e6a800;
}

.paper-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paper-card .paper-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--danger);
}

.paper-card .paper-price.is-free {
    color: var(--success);
}

.paper-card .btn-start {
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: var(--primary);
    color: #fff;
    border: none;
    transition: all 0.25s;
}

.paper-card .btn-start:hover {
    background: var(--primary-dark);
}

/* --- Cate Card --- */
.cate-card {
    text-align: center;
    cursor: pointer;
}

.cate-card .card-body {
    padding: 30px 20px;
}

.cate-card .cate-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    font-size: 24px;
    line-height: 60px;
    margin: 0 auto 15px;
    transition: transform 0.3s;
}

.cate-card:hover .cate-icon {
    transform: scale(1.1);
}

.cate-card .cate-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.cate-card .cate-count {
    font-size: 13px;
    color: var(--gray-500);
}

/* --- Section Header --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    position: relative;
    padding-left: 12px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.section-header .more-link {
    color: var(--gray-500);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.section-header .more-link:hover {
    color: var(--primary);
}

.section-header .more-link i {
    margin-left: 4px;
}

/* ==========================================
   Exam Page - 考试页面
   ========================================== */
.exam-container {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.exam-main {
    flex: 1;
    min-width: 0;
}

.exam-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* --- Exam Header --- */
.exam-header {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px 25px;
    margin-bottom: 20px;
}

.exam-header .exam-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.exam-header .exam-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.exam-header .info-item {
    font-size: 13px;
    color: var(--gray-600);
}

.exam-header .info-item i {
    margin-right: 5px;
    color: var(--primary);
}

/* --- Question Area --- */
.question-area {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 30px;
}

.question-nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
}

.question-nav-tabs .q-tab {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--gray-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-weight: 500;
}

.question-nav-tabs .q-tab:hover {
    color: var(--primary);
}

.question-nav-tabs .q-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.question-item {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px dashed var(--gray-200);
}

.question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-num {
    display: inline-block;
    min-width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-right: 10px;
}

.question-type {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary);
    margin-left: 8px;
    font-weight: 500;
}

.question-title {
    font-size: 15px;
    color: var(--gray-800);
    line-height: 1.7;
    margin-bottom: 12px;
    margin-top: 10px;
}

.question-title img {
    max-width: 100%;
    border-radius: 4px;
}

/* --- Options --- */
.options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.options-list .option-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 14px;
    margin-bottom: 6px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--gray-700);
}

.options-list .option-item:hover {
    border-color: var(--primary-light);
    background: rgba(74, 144, 217, 0.04);
}

.options-list .option-item.selected {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.08);
}

.options-list .option-item.correct {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.08);
}

.options-list .option-item.wrong {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.06);
}

.option-letter {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
    margin-right: 10px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--gray-600);
    transition: all 0.2s;
}

.options-list .option-item.selected .option-letter {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.options-list .option-item.correct .option-letter {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.options-list .option-item.wrong .option-letter {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.option-text {
    flex: 1;
    line-height: 1.6;
    padding-top: 2px;
}

/* --- Judge Options (two buttons) --- */
.judge-options {
    display: flex;
    gap: 12px;
}

.judge-options .judge-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
}

.judge-options .judge-btn:hover {
    border-color: var(--primary);
}

.judge-options .judge-btn.selected.correct {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.judge-options .judge-btn.selected.wrong {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.08);
    color: var(--danger);
}

.judge-options .judge-btn.selected {
    border-color: var(--primary);
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary);
}

/* --- Fill / Short Answer --- */
.answer-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    resize: vertical;
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* --- Answer Analysis --- */
.answer-analysis {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--gray-100);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.answer-analysis .analysis-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.answer-analysis .correct-answer {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-700);
}

.answer-analysis .correct-answer strong {
    color: var(--success);
}

.answer-analysis .analysis-text {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.7;
}

/* --- Question Navigation --- */
.question-nav-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.q-nav-item {
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-600);
    background: #fff;
}

.q-nav-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.q-nav-item.current {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.q-nav-item.answered {
    border-color: var(--primary-light);
    background: rgba(74, 144, 217, 0.15);
    color: var(--primary);
}

.q-nav-item.correct {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.15);
    color: var(--success);
}

.q-nav-item.wrong {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
}

/* --- Sidebar Timer --- */
.timer-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.timer-panel .timer-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.timer-panel .timer-display {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.timer-panel .timer-display.warning {
    color: var(--warning);
}

.timer-panel .timer-display.danger {
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- Sidebar Answer Sheet --- */
.answer-sheet {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.answer-sheet .sheet-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 15px;
}

.answer-sheet .legend {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--gray-500);
}

.answer-sheet .legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.answer-sheet .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.legend-dot.dot-answered { background: var(--primary); }
.legend-dot.dot-current { background: var(--danger); }
.legend-dot.dot-unanswered { background: var(--gray-300); }

/* --- Submit Button --- */
.btn-submit-exam {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s;
}

.btn-submit-exam:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-submit-exam:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

/* ==========================================
   Result Page - 结果页面
   ========================================== */
.result-summary {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    margin-bottom: 25px;
}

.result-score {
    font-size: 72px;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1;
}

.result-score.pass {
    color: var(--success);
}

.result-score.fail {
    color: var(--danger);
}

.result-label {
    font-size: 16px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.result-status {
    display: inline-block;
    padding: 8px 30px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
}

.result-status.pass {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.result-status.fail {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--gray-200);
}

.result-stats .stat {
    text-align: center;
}

.result-stats .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.result-stats .stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ==========================================
   Practice Page - 刷题页面
   ========================================== */
.practice-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.practice-main {
    flex: 1;
    min-width: 0;
}

.practice-toolbar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.practice-toolbar .mode-tabs {
    display: flex;
    gap: 8px;
}

.practice-toolbar .mode-tab {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.practice-toolbar .mode-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.practice-toolbar .mode-tab:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.practice-progress {
    font-size: 13px;
    color: var(--gray-500);
}

.practice-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: space-between;
}

.practice-actions .btn-nav {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.practice-actions .btn-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.practice-actions .btn-nav.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.practice-actions .btn-nav.primary:hover {
    background: var(--primary-dark);
}

.practice-actions .btn-action {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-100);
    color: var(--gray-600);
}

.practice-actions .btn-action:hover {
    background: var(--gray-200);
}

.practice-actions .btn-action.is-collected {
    background: rgba(255, 193, 7, 0.15);
    color: #e6a800;
}

/* --- Practice Question (single) --- */
.practice-question {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.practice-question .q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.practice-question .q-progress {
    font-size: 14px;
    color: var(--gray-500);
}

/* ==========================================
   Grades Page - 成绩页面
   ========================================== */
.grade-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    transition: all 0.25s;
}

.grade-card:hover {
    box-shadow: var(--shadow);
}

.grade-card .grade-score {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.grade-card .grade-score.pass {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.grade-card .grade-score.fail {
    background: rgba(220, 53, 69, 0.08);
    color: var(--danger);
}

.grade-card .score-num {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.grade-card .score-unit {
    font-size: 11px;
    margin-top: 2px;
}

.grade-card .grade-info {
    flex: 1;
}

.grade-card .grade-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.grade-card .grade-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.grade-card .grade-meta span {
    font-size: 13px;
    color: var(--gray-500);
}

.grade-card .grade-meta span i {
    margin-right: 4px;
}

.grade-card .grade-action {
    margin-left: 15px;
}

.grade-card .btn-detail {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.grade-card .btn-detail:hover {
    background: var(--primary);
    color: #fff;
}

/* ==========================================
   Rank Page - 排行榜
   ========================================== */
.rank-list {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.rank-item:hover {
    background: var(--gray-100);
}

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

.rank-index {
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    margin-right: 15px;
    background: var(--gray-200);
    color: var(--gray-600);
}

.rank-index.top-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-index.top-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
    color: #fff;
}

.rank-index.top-3 {
    background: linear-gradient(135deg, #CD7F32, #A0522D);
    color: #fff;
}

.rank-user {
    flex: 1;
}

.rank-user .name {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
}

.rank-user .time {
    font-size: 12px;
    color: var(--gray-500);
}

.rank-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   Notice / Announcements
   ========================================== */
.notice-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.notice-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.notice-item .notice-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

.notice-badge.badge-new {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.notice-badge.badge-info {
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary);
}

.notice-item .notice-title {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-item .notice-title a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.2s;
}

.notice-item .notice-title a:hover {
    color: var(--primary);
}

.notice-item .notice-date {
    font-size: 12px;
    color: var(--gray-400);
    margin-left: 15px;
    flex-shrink: 0;
}

/* ==========================================
   Empty State - 空状态
   ========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--radius);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.empty-state .btn {
    border-radius: 20px;
    padding: 8px 25px;
}

/* ==========================================
   Detail Page - 试卷详情
   ========================================== */
.detail-header {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 35px;
    margin-bottom: 25px;
}

.detail-header .detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 15px;
}

.detail-header .detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.detail-header .meta-item {
    font-size: 14px;
    color: var(--gray-500);
}

.detail-header .meta-item i {
    margin-right: 5px;
    color: var(--primary);
}

.detail-header .detail-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.btn-exam-start {
    padding: 12px 40px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
}

.btn-exam-start:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-exam-start.btn-danger {
    background: var(--danger);
}

.btn-exam-start.btn-danger:hover {
    background: #c82333;
}

/* ==========================================
   Filter Bar
   ========================================== */
.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 15px 20px;
    margin-bottom: 20px;
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filter-bar .filter-group:last-child {
    margin-bottom: 0;
}

.filter-bar .filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-right: 15px;
    white-space: nowrap;
}

.filter-bar .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-bar .filter-btn {
    padding: 4px 14px;
    border-radius: 15px;
    font-size: 13px;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-bar .filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-bar .filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==========================================
   Pagination
   ========================================== */
.exam-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.exam-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin: 0 4px;
    font-size: 14px;
    color: var(--gray-600);
    background: #fff;
    text-decoration: none;
    transition: all 0.2s;
    padding: 0 12px;
}

.exam-pagination .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.exam-pagination .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.exam-pagination .page-btn.disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 991px) {
    .exam-container {
        flex-direction: column;
    }
    .exam-sidebar,
    .practice-sidebar {
        width: 100%;
        order: -1;
    }
    .exam-hero h1 {
        font-size: 28px;
    }
    .exam-hero .hero-stats {
        gap: 20px;
    }
    .exam-hero .stat-num {
        font-size: 24px;
    }
}

@media (max-width: 767px) {
    .exam-hero {
        padding: 40px 0;
    }
    .exam-hero h1 {
        font-size: 22px;
    }
    .hero-btn-outline {
        margin-left: 0;
        margin-top: 10px;
        display: block;
    }
    .exam-container {
        gap: 10px;
    }
    .question-area {
        padding: 20px 15px;
    }
    .grade-card {
        flex-direction: column;
        text-align: center;
    }
    .grade-card .grade-score {
        margin-right: 0;
        margin-bottom: 15px;
    }
    .grade-card .grade-action {
        margin-left: 0;
        margin-top: 15px;
    }
    .navbar-exam .btn-login,
    .navbar-exam .btn-register {
        margin: 5px;
    }

    /* === 移动端增强样式 === */

    /* 卡片网格单列 */
    .row.flex-row {
        flex-direction: column;
    }
    .row.flex-row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    /* 考试页面侧边栏折叠 */
    .exam-sidebar {
        order: -1;
        max-height: 50px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        cursor: pointer;
        position: relative;
    }
    .exam-sidebar.expanded {
        max-height: 600px;
    }
    .exam-sidebar::after {
        content: '展开答题卡 ▼';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: var(--primary);
        white-space: nowrap;
    }
    .exam-sidebar.expanded::after {
        content: '收起答题卡 ▲';
    }

    /* 练习侧边栏折叠 */
    .practice-sidebar {
        order: -1;
        max-height: 50px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        cursor: pointer;
        position: relative;
    }
    .practice-sidebar.expanded {
        max-height: 600px;
    }
    .practice-sidebar::after {
        content: '展开分类 ▼';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 12px;
        color: var(--primary);
        white-space: nowrap;
    }
    .practice-sidebar.expanded::after {
        content: '收起分类 ▲';
    }

    /* 答题卡网格 */
    .question-nav-bar {
        gap: 6px;
    }
    .question-nav-bar .nav-item {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* 选项触摸友好 */
    .option-item {
        padding: 14px 16px;
        margin-bottom: 10px;
    }
    .option-item .option-letter {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* 答题区域优化 */
    .question-item {
        padding: 0;
    }
    .question-content {
        font-size: 15px;
        line-height: 1.7;
    }

    /* 结果页面 */
    .result-summary {
        padding: 20px 16px;
    }
    .result-score {
        font-size: 56px;
    }
    .result-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
    .result-stats .stat-item {
        flex: 0 0 calc(50% - 6px);
    }

    /* 筛选栏横向滚动 */
    .filter-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .filter-bar .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* 分页按钮 */
    .exam-pagination .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .exam-pagination .pagination li a {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* 表格响应式 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 富文本内容 */
    .news-content img,
    .notice-content img {
        max-width: 100%;
        height: auto;
    }
    .news-content table,
    .notice-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 视频播放器 */
    .bili-player,
    .news-content iframe,
    .notice-content iframe {
        max-width: 100%;
    }

    /* 会员卡片 */
    .member-card {
        margin-bottom: 12px;
    }

    /* 成绩卡片 */
    .grade-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    /* 试卷卡片 */
    .paper-card .paper-title {
        font-size: 15px;
    }
    .paper-card .paper-meta {
        font-size: 12px;
    }

    /* 通知卡片 */
    .notice-card {
        padding: 12px;
    }

    /* 排行榜 */
    .rank-item {
        padding: 12px;
    }
    .rank-item .rank-index {
        width: 28px;
        font-size: 14px;
    }

    /* 空状态 */
    .empty-state {
        padding: 40px 20px;
    }
    .empty-state i {
        font-size: 48px;
    }
}

/* ==========================================
   Loading
   ========================================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   Alert / Toast
   ========================================== */
.exam-alert {
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 14px;
}

.exam-alert.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.exam-alert.alert-warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.exam-alert.alert-danger {
    background: rgba(220, 53, 69, 0.08);
    color: var(--danger);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* --- Notice Rich Content --- */
.notice-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}
.notice-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}
.notice-content table td,
.notice-content table th {
    border: 1px solid var(--gray-300);
    padding: 8px 12px;
    font-size: 14px;
}
.notice-content table th {
    background: var(--gray-100);
    font-weight: 600;
}
.notice-content p {
    margin: 0 0 10px 0;
}
.notice-content ul,
.notice-content ol {
    padding-left: 25px;
    margin: 10px 0;
}
.notice-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 15px;
    margin: 10px 0;
    background: var(--gray-100);
    color: var(--gray-600);
}
.notice-content pre,
.notice-content code {
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 13px;
}
.notice-content pre {
    padding: 12px;
    overflow-x: auto;
}
.notice-content code {
    padding: 2px 6px;
}
.notice-content a {
    color: var(--primary);
    text-decoration: underline;
}
.notice-content h1,
.notice-content h2,
.notice-content h3,
.notice-content h4,
.notice-content h5,
.notice-content h6 {
    margin: 15px 0 10px;
    font-weight: 600;
}
.notice-content video,
.notice-content iframe {
    max-width: 100%;
    margin: 10px 0;
}

/* --- News / Ziliao Card --- */
.news-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.news-card img {
    transition: transform 0.3s;
}
.news-card:hover img {
    transform: scale(1.05);
}

/* --- News Content (article detail) --- */
.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
}
.news-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
.news-content table th,
.news-content table td {
    border: 1px solid var(--gray-300);
    padding: 8px 12px;
    text-align: left;
}
.news-content table th {
    background: var(--gray-100);
    font-weight: 600;
}
.news-content pre,
.news-content code {
    background: var(--gray-100);
    border-radius: 4px;
    padding: 2px 6px;
}
.news-content pre {
    padding: 15px;
    overflow-x: auto;
}
.news-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 15px;
    margin: 15px 0;
    background: var(--gray-100);
    border-radius: 0 4px 4px 0;
}
.news-content a {
    color: var(--primary);
    text-decoration: underline;
}
.news-content video,
.news-content iframe {
    max-width: 100%;
    margin: 10px 0;
    border-radius: 6px;
}
.news-content iframe {
    width: 100%;
    min-height: 400px;
    border: none;
}
.news-content h1,
.news-content h2,
.news-content h3,
.news-content h4,
.news-content h5,
.news-content h6 {
    margin: 15px 0 10px;
    font-weight: 600;
}

/* ==========================================
   Mobile-Web 模式补充优化（767px以下）
   ========================================== */
@media (max-width: 767px) {
    /* 搜索框全宽 */
    .mobile-web-mode .form-control[style*="width:250px"],
    .mobile-web-mode input[type="text"][style*="width:250px"] {
        width: 100% !important;
    }

    /* 首页统计数字 */
    .mobile-web-mode .exam-hero .stat-num {
        font-size: 20px;
    }
    .mobile-web-mode .exam-hero .stat-label {
        font-size: 11px;
    }

    /* 课程/知识库卡片图片 */
    .mobile-web-mode .news-card-img img {
        width: 100%; height: 100%; object-fit: cover;
    }

    /* 用户中心 */
    .mobile-web-mode .user-baseinfo {
        text-align: center;
    }
    .mobile-web-mode .user-baseinfo .col-md-3,
    .mobile-web-mode .user-baseinfo .col-sm-3 {
        width: 100% !important;
        float: none !important;
        margin-bottom: 12px;
    }
    .mobile-web-mode .user-baseinfo .col-md-9,
    .mobile-web-mode .user-baseinfo .col-sm-9 {
        width: 100% !important;
        float: none !important;
    }
    .mobile-web-mode .avatar-img img {
        width: 72px; height: 72px; border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .mobile-web-mode .basicinfo {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 0 16px;
    }
    .mobile-web-mode .ui-content h4 {
        font-size: 18px;
    }

    /* 侧边栏隐藏 */
    .mobile-web-mode .sidenav { display: none !important; }
    .mobile-web-mode .col-md-3.sidenav { display: none !important; }
    .mobile-web-mode #content-container .row > .col-md-3 { display: none !important; }
    .mobile-web-mode #content-container .row > .col-md-9 { width: 100% !important; }

    /* 表格 */
    .mobile-web-mode .table {
        font-size: 13px;
    }
    .mobile-web-mode .table th,
    .mobile-web-mode .table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* 面板 */
    .mobile-web-mode .panel {
        border-radius: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        border: none;
    }
    .mobile-web-mode .panel-heading {
        border-radius: 12px 12px 0 0;
    }

    /* 链接列表 */
    .mobile-web-mode .list-group-item {
        border-left: none;
        border-right: none;
        padding: 12px 16px;
    }
    .mobile-web-mode .list-group-item:first-child {
        border-top: none;
    }

    /* 分页 */
    .mobile-web-mode .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }
    .mobile-web-mode .pagination > li > a,
    .mobile-web-mode .pagination > li > span {
        border-radius: 10px;
        padding: 8px 14px;
        font-size: 14px;
    }

    /* 标签页 */
    .mobile-web-mode .nav-tabs {
        border-bottom: 0.5px solid rgba(0,0,0,0.06);
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }
    .mobile-web-mode .nav-tabs::-webkit-scrollbar { display: none; }
    .mobile-web-mode .nav-tabs > li > a {
        font-size: 14px;
        padding: 10px 16px;
    }
}
