/* ========================================
   HAM EXAM 统一样式表
   ======================================== */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.6;
}

/* A 类主题（默认） */
body.theme-a .navbar,
.navbar.theme-a {
    background: #1a1a1a;
}

body.theme-a .question-number,
.question-number.theme-a {
    background: #1a1a1a;
}

body.theme-a .option.selected,
.option.selected.theme-a {
    border-color: #1a1a1a;
    background: #1a1a1a;
}

body.theme-a .option.selected .option-letter,
.option.selected .option-letter.theme-a {
    color: #1a1a1a;
}

body.theme-a .nav-btn.submit,
.nav-btn.submit.theme-a {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

body.theme-a .progress-bar,
.progress-bar.theme-a {
    background: #1a1a1a;
}

/* B 类主题 */
body.theme-b .navbar,
.navbar.theme-b {
    background: #0064c8;
}

body.theme-b .question-number,
.question-number.theme-b {
    background: #0064c8;
}

body.theme-b .option:hover,
.option:hover.theme-b {
    border-color: #0064c8;
    background: #f0f7ff;
}

body.theme-b .option.selected,
.option.selected.theme-b {
    border-color: #0064c8;
    background: #0064c8;
    color: white;
}

body.theme-b .option.selected .option-letter,
.option.selected .option-letter.theme-b {
    background: white;
    color: #0064c8;
}

body.theme-b .nav-btn.submit,
.nav-btn.submit.theme-b {
    background: #0064c8;
    border-color: #0064c8;
}

body.theme-b .progress-bar,
.progress-bar.theme-b {
    background: #0064c8;
}

/* 导航栏基础样式 */
.navbar {
    background: #1a1a1a;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-brand span {
    color: #666;
}

.navbar-info {
    font-size: 0.9em;
    color: #999;
}

.navbar-btn {
    padding: 6px 12px;
    border: 2px solid #444;
    background: transparent;
    color: #999;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    text-decoration: none;
    margin-left: 8px;
    display: inline-block;
    white-space: nowrap;
}

.navbar-btn:hover {
    border-color: #666;
    color: #ccc;
}

.navbar-btn.active {
    background: #ffd700;
    border-color: #ffd700;
    color: #1a1a1a;
}

/* A 类主题导航按钮 */
body.theme-a .navbar-btn,
.navbar-btn.theme-a {
    border-color: #444;
    color: #999;
}

body.theme-a .navbar-btn:hover,
.navbar-btn:hover.theme-a {
    border-color: #666;
    color: #ccc;
}

/* B 类主题导航按钮 */
body.theme-b .navbar-btn,
.navbar-btn.theme-b {
    border-color: rgba(255,255,255,0.3);
    color: white;
}

body.theme-b .navbar-btn:hover,
.navbar-btn:hover.theme-b {
    border-color: white;
    color: white;
}

.navbar-btn.submit {
    background: #2d2d2d;
    border-color: #2d2d2d;
    color: white;
}

.navbar-btn.submit:hover {
    background: #404040;
    border-color: #404040;
}

/* 倒计时样式 */
.timer-display {
    display: inline-block;
    padding: 8px 16px;
    background: #2d2d2d;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9em;
    margin-right: 15px;
    color: #fff;
    font-family: 'Courier New', monospace;
}

.timer-display.warning {
    background: #d9480f;
    animation: pulse 1s infinite;
}

.timer-display.danger {
    background: #c92a2a;
    animation: pulse 0.5s infinite;
}

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

/* 主卡片 */
.main-card {
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 统计栏 */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
}

.stat-item {
    background: white;
    padding: 25px 15px;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a1a;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* 题目区域 */
.question-area {
    padding: 40px 30px;
}

.question-header {
    margin-bottom: 25px;
}

.question-number {
    display: inline-block;
    background: #1a1a1a;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.35em;
    line-height: 1.7;
    color: #1a1a1a;
    font-weight: 500;
}

.question-type-tag {
    display: inline-block;
    background: #666;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.question-type-tag.multi {
    background: #e67700;
}

/* 选项样式 */
.options {
    display: grid;
    gap: 12px;
    margin-top: 30px;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.option:hover:not(.disabled) {
    border-color: #1a1a1a;
    background: #fafafa;
}

.option.selected {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
}

.option.selected .option-letter {
    background: white;
    color: #1a1a1a;
}

.option.correct {
    border-color: #2d2d2d;
    background: #2d2d2d;
    color: white;
}

.option.correct .option-letter {
    background: white;
    color: #2d2d2d;
}

.option.incorrect {
    border-color: #999;
    background: #f5f5f5;
    color: #666;
}

.option.incorrect .option-letter {
    background: #999;
    color: white;
}

.option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f0f0;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    line-height: 1.6;
}

/* 反馈区域 */
.feedback {
    margin-top: 25px;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: #ebfbee;
    border-color: #40c057;
}

.feedback.incorrect {
    background: #fff5f5;
    border-color: #ff6b6b;
}

.feedback-title {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.feedback-title.correct {
    color: #2b8a3e;
}

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

.feedback-text {
    color: #333;
    line-height: 1.6;
}

/* 导航栏 */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
}

.nav-btn {
    padding: 12px 25px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.nav-btn:hover:not(:disabled) {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-btn.submit {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.nav-btn.submit:hover {
    background: #333;
    border-color: #333;
}

.progress-section {
    flex: 1;
    margin: 0 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #666;
}

.progress-track {
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #1a1a1a;
    transition: width 0.3s ease;
}

/* 结果区域 */
.result-area {
    padding: 60px 30px;
    text-align: center;
    display: none;
}

.result-area.show {
    display: block;
}

.result-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.result-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.result-score {
    font-size: 4em;
    font-weight: 800;
    color: #1a1a1a;
    margin: 30px 0;
    line-height: 1;
}

.result-status {
    font-size: 2em;
    font-weight: 700;
    padding: 15px 40px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 20px;
}

.result-status.pass {
    background: #ebfbee;
    color: #2b8a3e;
    border: 2px solid #40c057;
}

.result-status.fail {
    background: #fff5f5;
    color: #c92a2a;
    border: 2px solid #ff6b6b;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.result-card {
    padding: 25px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.result-card-value {
    font-size: 2.5em;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.result-card-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 10px;
}

/* 考试规则 */
.exam-rules {
    background: #fafafa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    margin: 30px 0;
    text-align: left;
}

.exam-rules p {
    margin: 10px 0;
    line-height: 1.6;
    color: #333;
}

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

.export-modal.show {
    display: flex;
}

.export-modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.export-modal-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

.export-modal-desc {
    color: #666;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.6;
}

.export-options {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-option:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.export-option-icon {
    font-size: 2em;
}

.export-option-info {
    flex: 1;
}

.export-option-name {
    font-weight: 700;
    font-size: 1.1em;
    color: #1a1a1a;
}

.export-option-desc {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.export-modal-close {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.export-modal-close:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

/* 信息栏 */
.info-bar {
    padding: 15px 30px;
    background: #fff9db;
    border-left: 4px solid #fcc419;
    color: #5c4813;
}

/* 过滤器 */
.filter-bar {
    padding: 20px 30px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
}

.filter-select {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

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

.empty-state h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #666;
}

.empty-state p {
    color: #999;
    margin-bottom: 30px;
}

.empty-state-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.2em;
    margin-bottom: 20px;
}

/* 收藏夹样式 */
.favorites-header {
    padding: 40px 30px;
    border-bottom: 1px solid #e8e8e8;
}

.favorites-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.favorites-desc {
    color: #666;
    font-size: 1.1em;
}

.favorites-list {
    padding: 30px;
}

.favorite-item {
    padding: 25px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 20px;
    background: white;
    transition: all 0.2s;
}

.favorite-item:hover {
    border-color: #1a1a1a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.favorite-date {
    font-size: 0.9em;
    color: #666;
}

.favorite-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.favorite-stat {
    font-size: 0.9em;
    color: #666;
}

.favorite-stat strong {
    color: #1a1a1a;
}

.favorite-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.btn-primary {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.btn-primary:hover {
    background: #333;
    border-color: #333;
    color: white;
}

.btn-danger {
    border-color: #c92a2a;
    color: #c92a2a;
}

.btn-danger:hover {
    background: #c92a2a;
    color: white;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 0.9em;
}

.footer p {
    margin: 5px 0;
}

.footer button {
    margin-top: 15px;
    padding: 10px 25px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    font-size: 0.9em;
    transition: all 0.2s;
}

.footer button:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

/* 答题卡样式 */
.navbar-btn.answer-sheet {
    background: #3a3a3a;
    border-color: #3a3a3a;
    color: white;
}

.navbar-btn.answer-sheet:hover {
    background: #4a4a4a;
    border-color: #4a4a4a;
}

.navbar-btn.favorite {
    background: transparent;
    border-color: #444;
    color: #999;
}

.navbar-btn.favorite:hover {
    border-color: #666;
    color: #ccc;
}

.navbar-btn.favorite.active {
    background: #ffd700;
    border-color: #ffd700;
    color: #1a1a1a;
}

.answer-sheet-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.answer-sheet-panel.show {
    right: 0;
}

.answer-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.answer-sheet-overlay.show {
    display: block;
}

.answer-sheet-header {
    background: #1a1a1a;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.answer-sheet-title {
    font-size: 1.3em;
    font-weight: 700;
}

.answer-sheet-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-sheet-close:hover {
    opacity: 0.7;
}

.answer-sheet-stats {
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #e8e8e8;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.answer-sheet-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.answer-sheet-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #1a1a1a;
}

.answer-sheet-stat-label {
    font-size: 0.75em;
    color: #666;
    margin-top: 5px;
}

.answer-sheet-content {
    padding: 20px;
}

.answer-sheet-section {
    margin-bottom: 25px;
}

.answer-sheet-section-title {
    font-size: 1em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8e8e8;
}

.answer-sheet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.answer-sheet-question {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.95em;
    background: white;
}

.answer-sheet-question:hover {
    border-color: #1a1a1a;
    background: #fafafa;
}

.answer-sheet-question.current {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
}

.answer-sheet-question.answered {
    border-color: #40c057;
    background: #ebfbee;
    color: #2b8a3e;
}

.answer-sheet-question.unanswered {
    border-color: #ffa94d;
    background: #fff4e6;
    color: #e67700;
}

.answer-sheet-legend {
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #e8e8e8;
}

.legend-box.current {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.legend-box.answered {
    background: #ebfbee;
    border-color: #40c057;
}

.legend-box.unanswered {
    background: #fff4e6;
    border-color: #ffa94d;
}

/* 模式选择器 */
.mode-selector {
    padding: 60px 30px;
    text-align: center;
}

.mode-selector h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.mode-selector p {
    color: #666;
    margin-bottom: 50px;
    font-size: 1.1em;
}

.mode-grid {
    display: grid;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.mode-card {
    padding: 40px 30px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    background: white;
}

.mode-card:hover {
    border-color: #1a1a1a;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mode-card h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.mode-card p {
    color: #666;
    line-height: 1.8;
}

.mode-card.practice {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.02) 0%, rgba(26, 26, 26, 0.05) 100%);
}

.mode-card.exam {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.02) 0%, rgba(26, 26, 26, 0.05) 100%);
}

.mode-card.review {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.02) 0%, rgba(26, 26, 26, 0.05) 100%);
}

.mode-card.b-exam {
    background: linear-gradient(135deg, rgba(0, 100, 200, 0.05) 0%, rgba(0, 100, 200, 0.1) 100%);
    border-color: #0064c8;
}

.mode-card.b-exam h2 {
    color: #0064c8;
}

/* 类别切换 */
.class-switcher {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.class-btn {
    padding: 12px 30px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.class-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.class-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.class-btn.b-active {
    background: #0064c8;
    border-color: #0064c8;
    color: white;
}

/* 统计预览 */
.stats-preview {
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    padding: 40px 30px;
}

.stats-preview h3 {
    font-size: 1.2em;
    margin-bottom: 25px;
    color: #1a1a1a;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .mode-selector {
        padding: 40px 20px;
    }

    .mode-selector h2 {
        font-size: 1.6em;
    }

    .mode-grid {
        gap: 15px;
    }

    .mode-card {
        padding: 30px 20px;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .navigation {
        flex-direction: column;
        gap: 15px;
    }

    .progress-section {
        margin: 0;
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }
}
