/* ==========================================
   全局重置与变量
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 深色主题配色 */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-elevated: #2d333b;
    
    /* 文字颜色 */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    /* 强调色 */
    --accent-blue: #4184f3;
    --accent-blue-hover: #2f6dd3;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-orange: #f59e0b;
    
    /* 边框 */
    --border-color: #30363d;
    --border-hover: #484f58;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* ==========================================
   侧边栏布局
   ========================================== */
.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Logo区域 */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 标签页切换 */
.sidebar-tabs {
    display: flex;
    padding: 12px;
    gap: 6px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: white;
}

.tab-icon {
    font-size: 16px;
}

/* 侧边栏内容 */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 各个section */
.upload-section,
.info-section,
.question-section,
.search-section,
.exam-list-section,
.theme-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.question-count,
.exam-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* 上传框 */
.upload-box {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-box:hover {
    border-color: var(--accent-blue);
    background: var(--bg-elevated);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.btn-upload {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: var(--accent-blue-hover);
}

/* 已选文件 */
.file-selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

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

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 信息区域 */
.info-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.info-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================
   主题选择器
   ========================================== */
.theme-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-option:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.theme-option.selected {
    border-color: var(--accent-blue);
    background: rgba(65, 132, 243, 0.1);
}

.theme-colors {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.theme-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.theme-badge {
    padding: 2px 8px;
    background: var(--accent-orange);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.theme-loading,
.theme-error {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.theme-error {
    color: #ef4444;
}

/* 题目列表 */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.question-item {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.question-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.question-item.active {
    background: var(--accent-blue);
    color: white;
}

/* 搜索框 */
.search-input {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-elevated);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* 试卷列表 */
.exam-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exam-wrapper {
    margin-bottom: 6px;
}

.exam-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.exam-item:hover {
    background: var(--bg-elevated);
    transform: translateX(2px);
}

.exam-item.active {
    background: linear-gradient(135deg, rgba(65, 132, 243, 0.2), rgba(16, 185, 129, 0.2));
    border-left: 3px solid var(--accent-blue);
}

.exam-icon {
    font-size: 24px;
}

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

.exam-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.exam-action {
    display: flex;
    gap: 6px;
}

.exam-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.exam-btn-parse {
    background: var(--accent-blue);
    color: white;
}

.exam-btn-parse:hover {
    background: var(--accent-blue-hover);
}

.exam-btn-generate {
    background: var(--accent-green);
    color: white;
}

.exam-btn-generate:hover {
    background: var(--accent-green-hover);
}

.exam-badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border-radius: var(--radius-sm);
}

/* 试卷下的题目列表 */
.exam-questions {
    margin-top: 8px;
    margin-left: 36px;
    border-left: 2px solid var(--border-color);
    padding-left: 12px;
    display: none;
}

.exam-questions.show {
    display: block;
}

.exam-question-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.exam-question-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.exam-question-item.active {
    background: var(--accent-blue);
    color: white;
}

.loading-text {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================
   主内容区
   ========================================== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* 顶部操作栏 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon {
    font-size: 16px;
}

.btn-parse {
    background: var(--accent-blue);
    color: white;
}

.btn-parse:hover {
    background: var(--accent-blue-hover);
}

.btn-generate {
    background: var(--accent-green);
    color: white;
}

.btn-generate:hover {
    background: var(--accent-green-hover);
}

.btn-download {
    background: var(--accent-blue);
    color: white;
}

.btn-download:hover {
    background: var(--accent-blue-hover);
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* 欢迎视图 */
.welcome-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px;
}

.welcome-content {
    text-align: center;
    max-width: 900px;
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 48px;
}

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

.feature-card {
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.feature-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 进度视图 */
.progress-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px;
}

.progress-container {
    width: 100%;
    max-width: 500px;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.progress-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

.progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-percent {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-blue);
}

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* 预览视图 */
.preview-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 统计栏 */
.stats-bar {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.stat-card {
    flex: 1;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

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

/* 内容显示 */
.content-display {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    color: var(--text-muted);
}

.question-content {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.question-header {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.question-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.question-title-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.question-title {
    font-size: 20px;
    font-weight: 600;
}

.question-nav-info {
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

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

.btn-compact {
    padding: 8px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.btn-nav {
    padding: 8px 12px;
    font-size: 16px;
    min-width: 40px;
}

.btn-ghost {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.background-section {
    padding: 20px;
    background: linear-gradient(135deg, rgba(65, 132, 243, 0.1), rgba(16, 185, 129, 0.05));
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.background-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 10px;
}

.background-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.background-image {
    margin-top: 16px;
    text-align: center;
}

.background-image img {
    max-width: 100%;
    height: auto;
    max-height: 42vh;
    object-fit: contain;
    display: block;
    margin: 8px auto;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.question-body {
    padding: 24px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.question-stem {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.question-images {
    margin: 20px 0;
    text-align: center;
}

.question-images .background-image {
    margin-bottom: 16px;
}

.question-images img {
    max-width: 100%;
    height: auto;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: block;
    margin: 0 auto;
}

.question-meta {
    color: var(--accent-orange);
    font-weight: 600;
    margin-bottom: 12px;
}

.options-list {
    padding: 16px 0;
}

.option-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
}

/* 追加：题目工具栏与紧凑布局辅助样式 */
.question-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.question-toolbar .qt-left, .question-toolbar .qt-right { display: flex; align-items: center; gap: 8px; }
.question-toolbar .qt-meta { font-size: 12px; color: var(--text-muted); }
.btn.btn-ghost, .question-toolbar .btn { background: var(--bg-tertiary); border: 1px solid var(--border-color); color: var(--text-primary); padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.question-toolbar .btn:hover { background: var(--bg-elevated); }

/* 紧凑展示：背景块、两列选项、图标注 */
.background-section { background: var(--bg-tertiary); border-left: 3px solid var(--accent-blue); padding: 8px; border-radius: 4px; margin-bottom: 8px; }
.background-image img { max-width: 100%; height: auto; max-height: 42vh; object-fit: contain; display: block; margin: 8px auto; background: white; }

/* 强化主图与背景图可见性，避免渲染为小方块 */
.question-images .background-image img { max-width: 100%; height: auto; max-height: 42vh; object-fit: contain; display: block; margin: 0 auto; }
.options-list { column-count: 2; column-gap: 12px; }
.option-item { break-inside: avoid; margin: 0 0 6px; }
.figure-label { text-align: center; font-weight: 600; margin-top: 4px; }
.question-images img { max-width: 100%; max-height: 40vh; object-fit: contain; display: block; margin: 8px auto; background: white; }

/* 紧凑两列布局（与 mock_dense_slide 对齐） */
.dense-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; align-items: start; }
.dense-col { min-width: 0; }
.dense-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.dense-sep { height: 1px; background: var(--border-color); margin: 8px 0; }
.dense-stem { font-weight: 600; }
.dense-opts { column-count: 2; column-gap: 12px; }
.dense-opts .option-item { padding: 6px 8px; }
.dense-figure { background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 6px; padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.dense-figure img { max-width: 100%; height: auto; }
.dense-figure .figure-label { margin-top: 8px; }

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ==========================================
   主题选择弹窗
   ========================================== */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.theme-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.theme-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.theme-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.theme-modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

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

.theme-card {
    padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.theme-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.theme-card.selected {
    border-color: var(--accent-blue);
    background: rgba(65, 132, 243, 0.15);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.theme-card-colors {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}

.theme-card-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.theme-card-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.theme-card-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    background: var(--accent-orange);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.theme-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-cancel:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .theme-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .theme-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   左右布局样式
   ========================================== */
.question-layout {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    min-height: 400px;
}

.layout-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.layout-right {
    flex: 0 0 auto;
    width: 35%;
    min-width: 420px;
    max-width: 600px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 左侧文字区块 */
.text-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    border-left: 3px solid var(--accent-blue);
}

.text-label {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.text-content {
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-wrap;
}

.question-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* 选项列表 */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    background: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.option-item:hover {
    background: var(--bg-elevated);
}

/* 选项中的图片 */
.option-image {
    display: block;
    max-width: 240px;
    max-height: 100px;
    background: white;
    padding: 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    margin: 0 auto;
}

/* 右侧图表区 */
.figures-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

.figure-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.figure-item img {
    max-width: 100%;
    height: auto;
    display: block;
    background: white;
    border-radius: var(--radius-sm);
    padding: 8px;
}

.figure-label {
    padding: 8px 12px;
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 8px;
    width: 100%;
}

.no-figures {
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
    font-size: 0.95rem;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .question-layout {
        flex-direction: column;
    }
    
    .layout-right {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        max-height: 500px;
    }
}
