:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --primary-light: #e8f4fd;
    --secondary-color: #5cb85c;
    --danger-color: #d9534f;
    --warning-color: #f0ad4e;
    --info-color: #5bc0de;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e1e4e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
}

/* ============ 导航栏 ============ */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-logo {
    color: white;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.username {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* ============ 容器 ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ============ 首页 Hero ============ */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 50%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-align: center;
    min-width: 140px;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

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

.hero-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.feature {
    background: rgba(255,255,255,0.12);
    padding: 20px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.feature h3 {
    font-size: 15px;
    margin-bottom: 6px;
}

.feature p {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

/* ============ 登录页面 ============ */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo h1 {
    font-size: 56px;
    margin-bottom: 4px;
}

.logo h2 {
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 18px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ============ 统计卡片 ============ */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-card {
    background: var(--card-bg);
    padding: 20px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s;
}

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

.stats-icon {
    font-size: 32px;
}

.stats-info h3 {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.stats-info p {
    color: var(--text-light);
    font-size: 12px;
    margin: 0;
}

/* ============ 分类选择 ============ */
.section-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 600;
}

.categories-section {
    margin-bottom: 24px;
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.category-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-left: 4px solid var(--primary-color);
}

.category-icon {
    font-size: 28px;
}

.category-info h3 {
    font-size: 15px;
    margin-bottom: 2px;
    font-weight: 600;
}

.category-info p {
    color: var(--text-light);
    font-size: 12px;
    margin: 0;
}

.category-arrow {
    margin-left: auto;
    font-size: 20px;
    color: var(--primary-color);
}

/* ============ 快捷功能 ============ */
.quick-actions {
    margin-bottom: 24px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-card {
    background: var(--card-bg);
    padding: 20px 12px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

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

.action-icon {
    font-size: 28px;
}

.action-text {
    font-size: 13px;
    font-weight: 500;
}

/* ============ 考试页面 ============ */
.exam-page {
    background: var(--bg-color);
    min-height: 100vh;
}

.exam-container {
    max-width: 900px;
    margin: 16px auto;
    padding: 0 12px;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exam-title {
    font-weight: 600;
    font-size: 14px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timer {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 15px;
    font-family: monospace;
}

.question-area {
    background: var(--card-bg);
    padding: 24px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.question-number {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.question-type {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.question-content {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 24px;
    white-space: pre-wrap;
}

/* 共用备选答案 */
.shared-options {
    background: #f8f9fa;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.shared-options h4 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 14px;
}

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

.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

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

.option.selected {
    background: var(--primary-color);
    color: white;
}

.option.correct {
    background: #d4edda;
    border-color: var(--secondary-color);
}

.option.wrong {
    background: #f8d7da;
    border-color: var(--danger-color);
}

.option-letter {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
    font-size: 14px;
}

.option.selected .option-letter {
    background: rgba(255,255,255,0.3);
    color: white;
}

.option-text {
    flex: 1;
    line-height: 1.5;
    font-size: 15px;
}

.option-mark {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--secondary-color);
    color: white;
    white-space: nowrap;
}

.option-mark.wrong {
    background: var(--danger-color);
}

/* 考试导航 */
.exam-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-nav {
    padding: 12px 28px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

/* 题号导航 */
.question-nav {
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.question-nav h4 {
    margin-bottom: 12px;
    font-size: 14px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.nav-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

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

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

.nav-item.answered {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
}

.modal-content p {
    margin-bottom: 24px;
    color: var(--text-light);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 成绩显示 */
.result-content .score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.score-value {
    font-size: 36px;
    font-weight: 700;
    color: white;
}

.score-label {
    color: white;
    font-size: 18px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.result-stats p {
    font-size: 15px;
    margin: 0;
}

/* ============ 页面标题 ============ */
.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* ============ 题目卡片 ============ */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.question-card .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.question-num {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.question-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: scale(1.15);
}

.explanation {
    margin-top: 16px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.explanation h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
}

.explanation p {
    font-size: 14px;
    margin: 0;
}

/* ============ 历史记录 ============ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.history-title {
    display: flex;
    flex-direction: column;
}

.exam-category {
    font-size: 16px;
    font-weight: 600;
}

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

.history-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.history-score .score-value {
    font-size: 28px;
    color: var(--primary-color);
}

.history-score .score-value.pass {
    color: var(--secondary-color);
}

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

.history-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
}

.stat-value {
    font-size: 15px;
    font-weight: 600;
}

.stat-value.correct {
    color: var(--secondary-color);
}

.stat-value.wrong {
    color: var(--danger-color);
}

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* ============ Footer ============ */
.footer {
    background: var(--card-bg);
    padding: 24px;
    text-align: center;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
}

/* ============ 响应式设计 ============ */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 12px;
        height: 52px;
    }
    
    .nav-links {
        gap: 2px;
    }
    
    .nav-links a {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .username {
        display: none;
    }
    
    .hero {
        padding: 40px 16px;
    }
    
    .hero h1 {
        font-size: 26px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 120px;
    }
    
    .hero-features {
        flex-direction: column;
        align-items: center;
    }
    
    .feature {
        max-width: 100%;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .question-area {
        padding: 18px 14px;
    }
    
    .question-content {
        font-size: 15px;
    }
    
    .option {
        padding: 12px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .nav-item {
        font-size: 13px;
    }
    
    .exam-nav {
        flex-direction: column;
    }
    
    .btn-nav {
        width: 100%;
    }
    
    .history-header {
        flex-direction: column;
    }
    
    .history-score {
        align-self: flex-start;
    }
    
    .history-stats {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px 12px;
    }
    
    .login-box {
        padding: 24px 20px;
        margin: 0 12px;
    }
    
    .logo h1 {
        font-size: 48px;
    }
    
    .logo h2 {
        font-size: 18px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .stats-card {
        padding: 16px 14px;
    }
    
    .stats-info h3 {
        font-size: 20px;
    }
    
    .question-nav {
        padding: 14px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* 移动端按钮优化 */
    .btn {
        padding: 14px 28px;
        font-size: 16px;
        min-height: 48px;
        min-width: 120px;
    }
    
    .btn-lg {
        padding: 16px 32px;
        font-size: 18px;
        min-height: 52px;
    }
    
    .btn-sm {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 40px;
    }
    
    /* 考试页面移动端优化 */
    .exam-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .exam-footer .btn {
        width: 100%;
        margin: 4px 0;
    }
    
    /* 导航栏优化 */
    .navbar {
        position: fixed;
        width: 100%;
        top: 0;
    }
    
    body {
        padding-top: 52px;
    }
    
    /* 选项优化 */
    .option {
        padding: 14px 12px;
        margin-bottom: 10px;
    }
    
    .option-indicator {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    /* 登录按钮优化 */
    .btn-login, .btn-register {
        padding: 16px;
        font-size: 17px;
        font-weight: 600;
        min-height: 52px;
    }
    
    /* 底部导航优化 */
    .bottom-nav {
        padding: 8px 4px;
    }
    
    .bottom-nav-item {
        font-size: 11px;
        padding: 6px 4px;
    }
    
    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 2px;
    }
}

/* ============ 练习模式新增样式 ============ */

/* 进度条 */
.progress-bar {
    height: 4px;
    background: #e1e4e8;
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 练习统计 - 页面底部 */
.practice-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.practice-stats .stat {
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
}

.practice-stats .stat.correct {
    color: var(--secondary-color);
    background: #d4edda;
}

.practice-stats .stat.wrong {
    color: var(--danger-color);
    background: #f8d7da;
}

.practice-stats .stat.total {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* 收藏按钮 */
.btn-favorite {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

/* 答案反馈 */
.answer-feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

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

.feedback-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.feedback-header.correct {
    color: var(--secondary-color);
}

.feedback-header.wrong {
    color: var(--danger-color);
}

.correct-answer {
    font-size: 14px;
    color: var(--danger-color);
    margin-left: auto;
}

.answer-feedback .explanation {
    background: var(--primary-light);
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.answer-feedback .explanation h4 {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 14px;
}

.answer-feedback .explanation p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* 题号导航 - 练习模式 */
.nav-item.correct {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.nav-item.wrong {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.nav-hint {
    font-size: 12px;
    color: var(--text-light);
    font-weight: normal;
    margin-left: 8px;
}

/* 结束按钮区域 */
.finish-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.finish-section .btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.finish-section .btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 弹窗内按钮 */
.modal .btn-secondary {
    background: #f0f0f0;
    color: var(--text-color);
    border: none;
}

.modal .btn-secondary:hover {
    background: #e0e0e0;
}

/* ============ 题目反馈功能 ============ */

.btn-feedback {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

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

#feedbackModal .modal-content {
    max-width: 450px;
}

#feedbackModal .form-row {
    margin-bottom: 16px;
    text-align: left;
}

#feedbackModal label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

#feedbackModal select,
#feedbackModal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

#feedbackModal select:focus,
#feedbackModal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

#feedbackModal textarea {
    min-height: 80px;
    resize: vertical;
}

#feedbackModal p {
    color: var(--text-light);
    margin-bottom: 16px;
}

/* ============ 批量导入样式 ============ */
.import-box {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.import-box h3 {
    margin-bottom: 8px;
}

.import-box p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.import-box textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.import-box textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-row {
    margin: 16px 0;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.import-actions {
    margin-top: 16px;
}

.import-result {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-color);
}

/* ============ 批量导入样式 ============ */
.import-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.import-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.import-tab:hover {
    color: var(--primary-color);
}

.import-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.import-content {
    animation: fadeIn 0.3s ease;
}

.format-example {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.format-example h5 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.format-example pre {
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.format-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 13px;
}

/* ============ 移动端全面优化 ============ */
@media (max-width: 768px) {
    /* 按钮触摸区域优化 */
    .btn {
        padding: 14px 24px;
        font-size: 15px;
        min-height: 48px;
        min-width: 100px;
        border-radius: 10px;
        touch-action: manipulation;
    }
    
    .btn-primary, .btn-secondary, .btn-danger {
        min-height: 48px;
        font-size: 16px;
        font-weight: 600;
    }
    
    /* 导航栏移动端 */
    .navbar {
        height: 50px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    
    .nav-container {
        height: 50px;
        padding: 0 12px;
    }
    
    .nav-logo {
        font-size: 15px;
    }
    
    body {
        padding-top: 50px;
    }
    
    /* 登录页面移动端 */
    .login-container {
        padding: 20px 16px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .login-box {
        width: 100%;
        max-width: 400px;
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 50px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* 考试页面移动端 */
    .exam-container {
        padding: 12px;
    }
    
    .question-area {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .question-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .question-number {
        font-size: 14px;
        padding: 4px 10px;
    }
    
    .question-content {
        font-size: 16px;
        line-height: 1.7;
        margin-bottom: 16px;
    }
    
    .option {
        padding: 14px 12px;
        min-height: 50px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .option-indicator {
        width: 32px;
        height: 32px;
        font-size: 14px;
        min-width: 32px;
    }
    
    .option-text {
        font-size: 15px;
    }
    
    /* 导航按钮 */
    .exam-nav {
        flex-direction: column;
        gap: 12px;
        padding: 16px 0;
    }
    
    .btn-nav {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
    }
    
    .btn-nav:first-child {
        order: 2;
    }
    
    .btn-nav:last-child {
        order: 1;
    }
    
    /* 题目导航 */
    .question-nav {
        padding: 12px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .nav-item {
        height: 40px;
        font-size: 14px;
    }
    
    /* 反馈按钮 */
    .btn-feedback {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        margin: 12px 0;
    }
    
    /* 进度统计 */
    .practice-stats {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .stat {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 底部结束按钮 */
    .finish-section {
        padding: 16px 0;
    }
    
    .finish-section .btn {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
    }
    
    /* 弹窗移动端 */
    .modal-content {
        padding: 20px;
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* 反馈弹窗 */
    .form-row {
        margin-bottom: 14px;
    }
    
    .form-row label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-row select,
    .form-row textarea {
        padding: 12px;
        font-size: 15px;
        min-height: 44px;
    }
    
    /* 收藏按钮 */
    .btn-favorite {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 针对小屏幕的额外优化 */
@media (max-width: 375px) {
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .nav-item {
        height: 36px;
        font-size: 12px;
    }
    
    .option {
        padding: 12px 10px;
    }
    
    .option-indicator {
        width: 28px;
        height: 28px;
        font-size: 13px;
        min-width: 28px;
    }
    
    .option-text {
        font-size: 14px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .option:hover {
        transform: none;
    }
    
    .option:active {
        background: var(--primary-light);
    }
}

/* ============ 移动端导航栏优化 ============ */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.2);
}

@media (max-width: 768px) {
    .nav-logo {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-links {
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 12px;
        gap: 4px;
        display: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        max-height: calc(100vh - 50px);
        overflow-y: auto;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links a {
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 8px;
        text-align: center;
    }
    
    .nav-links .username {
        padding: 14px 16px;
        font-size: 14px;
        text-align: center;
        background: rgba(255,255,255,0.1);
        margin: 4px 0;
        border-radius: 8px;
    }
    
    .nav-links #logoutBtn {
        background: rgba(255,255,255,0.2);
        margin-top: 8px;
    }
}

/* 底部导航栏 - 默认隐藏，仅移动端显示 */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        z-index: 1000;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 6px 12px;
        color: var(--text-light);
        text-decoration: none;
        font-size: 11px;
        transition: color 0.2s;
    }
    
    .bottom-nav-item i {
        font-size: 22px;
    }
    
    .bottom-nav-item.active {
        color: var(--primary-color);
    }
    
    /* 主内容区域增加底部间距 */
    .container {
        padding-bottom: 80px;
    }

/* ============ 考试页面移动端详细优化 ============ */
@media (max-width: 768px) {
    /* 考试容器 */
    .exam-container {
        padding: 12px 10px;
    }
    
    /* 顶部进度条区域 */
    .practice-stats {
        display: flex;
        justify-content: space-between;
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .stat {
        font-size: 12px;
        padding: 6px 10px;
        background: white;
        border-radius: 6px;
        flex: 1;
        text-align: center;
    }
    
    /* 题目区域 */
    .question-area {
        background: white;
        padding: 14px 12px;
        border-radius: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    
    .question-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }
    
    .question-number {
        background: var(--primary-color);
        color: white;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
    }
    
    .question-type {
        font-size: 11px;
        color: var(--text-light);
        background: #f5f5f5;
        padding: 3px 8px;
        border-radius: 4px;
    }
    
    /* 题目内容 */
    .question-content {
        font-size: 15px;
        line-height: 1.7;
        color: var(--text-color);
        margin-bottom: 16px;
        word-wrap: break-word;
    }
    
    /* 选项 */
    .options-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .option {
        display: flex;
        align-items: flex-start;
        padding: 12px 10px;
        min-height: 48px;
        border: 2px solid #e8e8e8;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.15s;
        background: white;
    }
    
    .option:hover {
        border-color: var(--primary-color);
        background: var(--primary-light);
    }
    
    .option.selected {
        border-color: var(--primary-color);
        background: var(--primary-light);
    }
    
    .option.correct {
        border-color: var(--secondary-color);
        background: #e8f5e9;
    }
    
    .option.wrong {
        border-color: var(--danger-color);
        background: #ffebee;
    }
    
    .option-indicator {
        width: 28px;
        height: 28px;
        min-width: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f5f5f5;
        font-size: 13px;
        font-weight: 600;
        margin-right: 10px;
    }
    
    .option.selected .option-indicator {
        background: var(--primary-color);
        color: white;
    }
    
    .option-text {
        flex: 1;
        font-size: 14px;
        line-height: 1.5;
        padding-top: 3px;
    }
    
    /* 导航按钮 */
    .exam-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 16px 0;
    }
    
    .btn-nav {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 10px;
        min-height: 50px;
    }
    
    /* 题号导航 */
    .question-nav {
        background: white;
        padding: 12px;
        border-radius: 12px;
        margin-top: 12px;
    }
    
    .question-nav h4 {
        font-size: 13px;
        color: var(--text-light);
        margin-bottom: 10px;
    }
    
    .nav-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .nav-item {
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        border-radius: 6px;
        font-size: 13px;
        cursor: pointer;
    }
    
    .nav-item.current {
        background: var(--primary-color);
        color: white;
    }
    
    .nav-item.correct {
        background: #e8f5e9;
        color: var(--secondary-color);
    }
    
    .nav-item.wrong {
        background: #ffebee;
        color: var(--danger-color);
    }
    
    /* 反馈按钮 */
    .btn-feedback {
        width: 100%;
        padding: 12px;
        font-size: 13px;
        background: #fff3e0;
        color: #e65100;
        border: 1px solid #ffcc02;
        border-radius: 8px;
        margin-top: 12px;
    }
    
    /* 结束按钮 */
    .finish-section {
        margin-top: 16px;
    }
    
    .finish-section .btn {
        width: 100%;
        padding: 14px;
        font-size: 15px;
        background: var(--secondary-color);
        color: white;
        border-radius: 10px;
    }
    
    /* 解析区域 */
    .answer-feedback {
        margin-top: 12px;
        padding: 12px;
        border-radius: 8px;
        background: #f5f5f5;
    }
    
    .feedback-header {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .explanation {
        font-size: 13px;
        line-height: 1.6;
        color: var(--text-light);
    }
}
