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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 20px;
    position: relative;
}

header h1 {
    font-size: 28px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.update-time {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.search-section {
    margin: 20px 0;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #4a6cf7;
}

.search-box button {
    padding: 12px 24px;
    background: #4a6cf7;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #3a5ce7;
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    background: #e8eaf6;
    color: #4a6cf7;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag:hover {
    background: #4a6cf7;
    color: white;
}

.filter-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.filter-section select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: white;
}

.result-count {
    margin-left: auto;
    color: #666;
    font-size: 14px;
}

.results {
    margin: 20px 0;
}

.article-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #4a6cf7;
    transition: box-shadow 0.2s;
}

.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

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

.article-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.article-num {
    background: #4a6cf7;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.article-source {
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

.article-content {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 12px;
}

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

.article-tag {
    padding: 3px 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    font-size: 12px;
}

.highlight {
    background: #fff3cd;
    padding: 1px 3px;
    border-radius: 2px;
}

.regulation-list {
    margin-top: 30px;
}

.regulation-list h2 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 15px;
}

#regulationCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.reg-card {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.2s;
}

.reg-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.reg-card h3 {
    font-size: 15px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.reg-card .reg-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.reg-card .reg-count {
    font-size: 13px;
    color: #4a6cf7;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 22px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-count {
        margin-left: 0;
        text-align: center;
    }
    
    #regulationCards {
        grid-template-columns: 1fr;
    }
}

/* ==================== 在线考试样式 ==================== */

.exam-panel {
    margin: 20px 0;
}

.exam-panel h2 {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.exam-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.exam-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.exam-form-group {
    margin-bottom: 16px;
}

.exam-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.exam-form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.exam-form-row select,
.exam-form-row input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.exam-reg-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.exam-reg-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f7f8fc;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.exam-reg-item:hover {
    border-color: #4a6cf7;
    background: #eef1ff;
}

.exam-reg-item input:checked + span {
    color: #4a6cf7;
    font-weight: 600;
}

.exam-reg-item small {
    color: #999;
}

.exam-btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #4a6cf7, #6366f1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.exam-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74,108,247,0.3);
}

.exam-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.exam-btn-secondary {
    display: inline-block;
    padding: 10px 24px;
    background: #fff;
    color: #4a6cf7;
    border: 2px solid #4a6cf7;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
}

.exam-btn-secondary:hover {
    background: #eef1ff;
}

.exam-status {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

/* 答题页 */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.exam-info {
    font-size: 13px;
    color: #666;
}

.exam-question {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.exam-q-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.exam-q-num {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 16px;
    min-width: 30px;
}

.exam-q-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.exam-q-type.single { background: #e8f5e9; color: #2e7d32; }
.exam-q-type.multi { background: #fff3e0; color: #e65100; }
.exam-q-type.essay { background: #e3f2fd; color: #1565c0; }

.exam-q-text {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 38px;
}

.exam-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.exam-option:hover {
    border-color: #4a6cf7;
    background: #f8f9ff;
}

.exam-option input:checked + span {
    color: #4a6cf7;
    font-weight: 600;
}

.exam-essay-input {
    width: 100%;
    margin-left: 38px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.exam-essay-input:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

/* 成绩页 */
.exam-score-card {
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.exam-score-card h2 {
    color: #fff;
    margin-bottom: 16px;
}

.exam-score-big {
    margin: 16px 0;
}

.exam-score-detail {
    font-size: 14px;
    opacity: 0.85;
}

.exam-result-item {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #e0e0e0;
}

.exam-result-item.exam-correct { border-left-color: #38a169; }
.exam-result-item.exam-wrong { border-left-color: #e53e3e; }
.exam-result-item.exam-essay-score { border-left-color: #3182ce; }

.exam-r-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.exam-r-num {
    font-weight: 700;
    font-size: 15px;
}

.exam-r-score {
    margin-left: auto;
    font-weight: 700;
    font-size: 16px;
    color: #4a6cf7;
}

.exam-r-question {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

.exam-answer-row {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.5;
}

.exam-label {
    color: #666;
    font-weight: 600;
}

.exam-answer-row .correct { color: #38a169; font-weight: 600; }
.exam-answer-row .wrong { color: #e53e3e; font-weight: 600; }

.exam-r-detail {
    font-size: 13px;
    color: #555;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7f8fc;
    border-radius: 6px;
    line-height: 1.5;
}

.exam-r-explanation {
    font-size: 13px;
    color: #4a6cf7;
    margin-top: 8px;
    padding: 8px 12px;
    background: #eef1ff;
    border-radius: 6px;
    line-height: 1.5;
}

.exam-r-ref {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

@media (max-width: 600px) {
    .exam-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 设置按钮和弹窗 ==================== */

.settings-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: #f0f0f0;
    border-color: #4a6cf7;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 16px;
    color: #1a1a2e;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 4px;
}

.modal-close:hover { color: #333; }

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 12px;
}

.modal-body .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.modal-body small {
    display: block;
    margin-top: 6px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
}
