/* ==========================================================================
   考研数学一 · 真题专区（zhentiqiang 风格）布局
   ========================================================================== */

/* 两栏布局: 侧栏 + 主区 (主区放缩略图 + 题目 + 底部的考点频率) */
.zhenti-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;
    align-items: start;
    margin-top: 12px;
}

@media (max-width: 900px) {
    .zhenti-layout {
        grid-template-columns: 1fr;
    }
    .zhenti-sidebar { position: static; max-height: none; }
}

/* ============ 左栏：知识点树 ============ */
.zhenti-sidebar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    max-height: 80vh;
    overflow-y: auto;
    position: sticky;
    top: 12px;
}

.sidebar-header h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kp-search {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    margin-bottom: 8px;
}

.kp-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.knowledge-tree {
    font-size: 13px;
}

.kp-group {
    margin-bottom: 4px;
}

.kp-group-title {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    user-select: none;
    transition: background 0.15s;
}

.kp-group-title:hover {
    background: #cbd5e1;
}

.kp-group-title .kp-icon {
    margin-right: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    min-width: 22px;
    text-align: center;
}

.kp-group-title .kp-name {
    flex: 1;
}

.kp-group-title .kp-count {
    background: #64748b;
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}

.kp-children {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s;
}

.kp-group.open .kp-children {
    max-height: 1000px;
    padding: 4px 0;
}

.kp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px 5px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    color: #475569;
}

.kp-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.kp-item.selected {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
    border-left: 3px solid #f59e0b;
}

.kp-item-name {
    flex: 1;
}

.kp-item-count {
    color: #94a3b8;
    font-size: 11px;
}

/* ============ 主区域：缩略图条 + 筛选 + 题目 ============ */
.zhenti-main {
    min-width: 0;
}

/* 缩略图条 */
.zhenti-thumb-strip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.thumb-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

.thumb-tip {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.thumb-strip-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb-item {
    flex: 0 0 90px;
    height: 90px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    text-align: center;
    padding: 4px;
}

.thumb-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.15);
}

.thumb-year {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.thumb-stat {
    font-size: 10px;
    color: #64748b;
    display: flex;
    gap: 4px;
    margin: 2px 0;
}

.thumb-total {
    font-size: 11px;
    color: #3b82f6;
    font-weight: 600;
}

/* 筛选 */
.zhenti-filters {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

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

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.filter-pills {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-pill:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-pill.active {
    background: var(--btn-color, #3b82f6);
    color: #fff;
    border-color: var(--btn-color, #3b82f6);
}

.filter-input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 12px;
}

.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
}

/* 题目列表 */
.zhenti-content-area {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    min-height: 400px;
}

.zhenti-empty {
    text-align: center;
    padding: 60px 0;
    color: #94a3b8;
    font-size: 14px;
}

.zhenti-loading {
    text-align: center;
    padding: 60px 0;
    color: #94a3b8;
}

.zhenti-stats {
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #334155;
}

.kp-tag {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-size: 12px;
}

.year-block {
    margin-bottom: 16px;
}

.year-title {
    margin: 12px 0 8px 0;
    padding: 6px 10px;
    background: #1e293b;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.question-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.question-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fafafa;
}

.question-card:hover {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.q-head {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    flex-wrap: wrap;
}

.q-year {
    background: #1e293b;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.q-num {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.q-type {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.q-type-选择题 { background: #dbeafe; color: #1e40af; }
.q-type-填空题 { background: #d1fae5; color: #065f46; }
.q-type-解答题 { background: #fce7f3; color: #9f1239; }

.q-difficulty {
    color: #f59e0b;
    font-size: 10px;
}

.q-score {
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.q-body {
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 6px;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.q-opts {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.opt-line {
    padding: 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 10px;
}

.q-part {
    background: #f1f5f9;
    color: #475569;
    padding: 1px 5px;
    border-radius: 3px;
}

.kp-badge {
    background: #ecfeff;
    color: #0e7490;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: monospace;
}

.kp-badge.lg {
    padding: 3px 8px;
    font-size: 12px;
    margin: 0 4px 4px 0;
    display: inline-block;
}

.q-keywords {
    color: #94a3b8;
    font-size: 10px;
}

/* ============ 底部：考点频率图（占满主区宽度） ============ */
.zhenti-charts-bottom {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.zhenti-charts-bottom h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.chart-container {
    min-height: 80px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
}

.bar-row:hover {
    background: #f1f5f9;
}

.bar-label {
    min-width: 80px;
    color: #475569;
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 14px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    color: #fff;
    padding: 0 4px;
    display: flex;
    align-items: center;
    font-size: 10px;
    min-width: 24px;
}

/* ============ 弹窗 ============ */
.zhenti-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.zhenti-modal[hidden] {
    display: none;
}

.zhenti-modal-content {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zhenti-modal-large {
    max-width: 1100px;
}

.zhenti-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.zhenti-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.zhenti-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
}

.zhenti-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.zhenti-modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* 缩略图弹窗 */
.thumb-modal-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 12px;
}

.thumb-modal-stat {
    font-size: 14px;
    color: #334155;
}

.thumb-modal-dist {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.thumb-modal-questions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

/* 题目详情弹窗 */
.q-modal-body {
    max-width: 900px;
}

.q-modal-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

.q-chapter {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 3px;
}

.q-modal-kps {
    margin-bottom: 12px;
}

.q-modal-question {
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 14px;
}

.q-modal-opts {
    margin-bottom: 12px;
}

.modal-opt {
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 13px;
}

.answer-section {
    padding: 8px 12px;
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
    border-radius: 4px;
    margin-bottom: 12px;
}

.answer-title {
    color: #166534;
    font-weight: 600;
    font-size: 13px;
}

.answer-tip {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.solution-section {
    margin-bottom: 12px;
}

.sol-title {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid #3b82f6;
}

.solution-step {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8fafc;
    border-radius: 4px;
    border-left: 2px solid #cbd5e1;
}

.step-num {
    color: #3b82f6;
    font-weight: 600;
    font-size: 12px;
}

.step-title {
    font-weight: 600;
    color: #1e293b;
    margin: 4px 0;
}

.step-content {
    color: #475569;
    line-height: 1.6;
    font-size: 13px;
}

.common-errors {
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
}

.err-title {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}

.common-errors ul {
    margin: 0;
    padding-left: 20px;
    color: #991b1b;
    font-size: 12px;
}

.chapter-link {
    text-align: center;
    padding: 8px;
}

.chapter-link a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
}

.chapter-link a:hover {
    text-decoration: underline;
}

/* 滚动条 */
.zhenti-sidebar::-webkit-scrollbar,
.thumb-strip-list::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.zhenti-sidebar::-webkit-scrollbar-thumb,
.thumb-strip-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ==========================================================================
   掌握程度总览 + 筛选
   ========================================================================== */
.zhenti-mastery-panel {
    max-width: 1400px;
    margin: 20px auto;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mastery-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-total {
    font-size: 14px;
    color: #475569;
}

.ms-total strong {
    color: #10b981;
    font-size: 18px;
    font-weight: 700;
}

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

.ms-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #a855f7 100%);
    transition: width 0.3s ease;
}

.mastery-distribution {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mastery-stat-item {
    flex: 1 1 auto;
    min-width: 110px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    font-size: 12px;
}

.mastery-stat-item[data-level='mastered'],
.mastery-stat-item[data-level='expert'] {
    background: linear-gradient(135deg, #ecfdf5, #f3e8ff);
}

.ms-icon {
    font-size: 14px;
}

.ms-label {
    flex: 1;
    color: #475569;
    font-weight: 500;
}

.ms-count {
    font-weight: 700;
    color: #1e293b;
}

.ms-pct {
    color: #94a3b8;
    font-size: 11px;
}

/* mastery 筛选按钮 */
.mastery-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mastery-filter-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.m-filter-btn {
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #475569;
    transition: all 0.15s;
}

.m-filter-btn:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.m-filter-btn.active {
    background: var(--btn-color, #3b82f6);
    color: #fff;
    border-color: var(--btn-color, #3b82f6);
}

.m-filter-btn.active[style*='#94a3b8'] {
    color: #fff;
}

.m-filter-btn.danger {
    border-color: #fca5a5;
    color: #dc2626;
}

.m-filter-btn.danger.active {
    background: #fee2e2;
    color: #dc2626;
    border-color: #dc2626;
}

/* 题卡片 mastery 徽章插槽 */
.mastery-badge-slot {
    margin-left: auto;
}

.mastery-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ==========================================================================
   掌握程度按钮（弹窗中）
   ========================================================================== */
.q-collapse-mastery {
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
}

.q-collapse-mastery summary {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5b21b6;
}

.q-collapse-mastery .mastery-section {
    padding: 12px 16px;
    border-top: 1px solid #c4b5fd;
}

.mastery-tip {
    margin: 0 0 10px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 4px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.mastery-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.mastery-btn:hover {
    border-color: var(--btn-color, #3b82f6);
    background: #f8fafc;
    transform: translateY(-1px);
}

.mastery-btn.active {
    border-color: var(--btn-color, #3b82f6);
    background: var(--btn-color, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.mastery-btn.active .mastery-desc {
    color: rgba(255, 255, 255, 0.85);
}

.mastery-icon {
    font-size: 18px;
}

.mastery-label {
    font-weight: 600;
    font-size: 13px;
}

.mastery-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

.mastery-clear {
    margin-top: 10px;
    padding: 6px 14px;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.mastery-clear:hover {
    background: #fee2e2;
}

.current-state {
    font-weight: 600;
    margin-left: 8px;
}

/* ==========================================================================
   弹窗两栏布局：左（题目+解析） + 右（掌握程度侧边栏）
   ========================================================================== */
.q-modal-body {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 16px;
}

.q-modal-main {
    min-width: 0;
}

.q-modal-mastery-sidebar {
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
}

/* 题目标题区导航按钮 */
.q-modal-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.q-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.q-nav-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.q-nav-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.q-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8fafc;
}

.q-nav-prev {
    align-self: flex-start;
}

.q-nav-next {
    align-self: flex-end;
}

/* 掌握程度侧边栏（固定在右侧，始终可见）*/
.mastery-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mastery-sidebar-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #5b21b6;
    padding-bottom: 6px;
    border-bottom: 2px solid #ddd6fe;
}

.mastery-sidebar-state {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    padding: 6px 8px;
    background: #f5f3ff;
    border-radius: 6px;
}

.mastery-sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mastery-sidebar-buttons .mastery-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
}

.mastery-sidebar-buttons .mastery-btn .mastery-icon {
    font-size: 14px;
}

.mastery-sidebar-buttons .mastery-btn .mastery-label {
    font-size: 12px;
}

.mastery-sidebar-footer {
    text-align: center;
}

.mastery-clear-btn {
    padding: 5px 12px;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.mastery-clear-btn:hover {
    background: #fee2e2;
}

.mastery-sidebar-tip {
    margin: 0;
    color: #94a3b8;
    font-size: 10px;
    line-height: 1.4;
    text-align: center;
}

/* 移动端适配：弹窗内变单列 */
@media (max-width: 700px) {
    .q-modal-body {
        grid-template-columns: 1fr;
    }
    .q-modal-mastery-sidebar {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-left: 0;
        padding-top: 12px;
    }
    .mastery-sidebar-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .mastery-sidebar-buttons .mastery-btn {
        flex: 1 1 auto;
        min-width: 70px;
    }
}

/* ==========================================================================
   缩略图弹窗题目项（默认折叠，不显示答案）
   ========================================================================== */
.thumb-modal-tip {
    margin-top: 8px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 4px;
    font-size: 12px;
    color: #92400e;
}

.thumb-modal-questions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.thumb-q-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.15s;
}

.thumb-q-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateX(2px);
}

.thumb-q-head {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    flex-wrap: wrap;
}

.thumb-q-go {
    margin-left: auto;
    color: #3b82f6;
    font-weight: 500;
}

.thumb-opt {
    padding: 1px 0;
    color: #475569;
    font-size: 12px;
}

/* ==========================================================================
   题目详情弹窗折叠面板（核心改造）
   ========================================================================== */
.q-collapse {
    margin-top: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.q-collapse summary {
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
}

.q-collapse summary::-webkit-details-marker {
    display: none;
}

.q-collapse summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s;
    font-size: 10px;
    color: #94a3b8;
}

.q-collapse[open] summary::before {
    transform: rotate(90deg);
}

.collapse-hint {
    font-weight: 400;
    font-size: 11px;
    color: #94a3b8;
}

/* 答案面板（绿） */
.q-collapse-answer {
    border-color: #86efac;
    background: #f0fdf4;
}

.q-collapse-answer summary {
    background: #dcfce7;
    color: #166534;
}

.q-collapse-answer .answer-content {
    padding: 12px 16px;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
    border-top: 1px solid #86efac;
}

/* 解题骨架（蓝） */
.q-collapse-skeleton {
    border-color: #93c5fd;
    background: #eff6ff;
}

.q-collapse-skeleton summary {
    background: #dbeafe;
    color: #1e3a8a;
}

.q-collapse-skeleton .skeleton-content {
    padding: 10px 16px;
    border-top: 1px solid #93c5fd;
    color: #1e3a8a;
}

.skeleton-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.8;
}

.skeleton-list li {
    margin-bottom: 2px;
}

/* 详细步骤（紫） */
.q-collapse-detail {
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.q-collapse-detail summary {
    background: #ede9fe;
    color: #5b21b6;
}

.q-collapse-detail .detail-content {
    padding: 12px 16px;
    border-top: 1px solid #c4b5fd;
}

.empty-tip {
    margin: 0;
    color: #94a3b8;
    font-size: 12px;
    font-style: italic;
}

/* 涉及知识点（绿） */
.q-collapse-kp {
    border-color: #6ee7b7;
    background: #ecfdf5;
}

.q-collapse-kp summary {
    background: #d1fae5;
    color: #065f46;
}

.q-collapse-kp .kp-content {
    padding: 12px 16px;
    border-top: 1px solid #6ee7b7;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kp-section {
    background: #fff;
    border-radius: 4px;
    padding: 8px 10px;
}

.kp-section-name {
    font-weight: 600;
    color: #065f46;
    font-size: 13px;
    margin-bottom: 6px;
}

.kp-section-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.kp-tag {
    background: #ecfdf5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

.kp-jump {
    color: #3b82f6;
    font-size: 12px;
    text-decoration: none;
}

.kp-jump:hover {
    text-decoration: underline;
}

/* 相关练习（橙） */
.q-collapse-practice {
    border-color: #fdba74;
    background: #fff7ed;
}

.q-collapse-practice summary {
    background: #fed7aa;
    color: #9a3412;
}

.q-collapse-practice .practice-content {
    padding: 12px 16px;
    border-top: 1px solid #fdba74;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.practice-item {
    background: #fff;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.practice-item:hover {
    background: #fef3c7;
}

.practice-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
    margin-bottom: 4px;
    color: #9a3412;
}

.practice-ch {
    background: #9a3412;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.practice-type {
    color: #475569;
    font-weight: 500;
}

.practice-score {
    color: #94a3b8;
}

.practice-match {
    margin-left: auto;
    color: #16a34a;
    font-style: italic;
}

.practice-q {
    color: #475569;
    font-size: 12px;
    line-height: 1.4;
}

.practice-tip {
    margin: 8px 16px 12px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 4px;
    color: #92400e;
    font-size: 11px;
}

/* ==========================================================================
   真题专区 Tab 切换：题目列表 / 进度总览
   ========================================================================== */
.zhenti-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.zhenti-tab {
    padding: 8px 18px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: -1px;
    font-family: inherit;
}

.zhenti-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.zhenti-tab:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.zhenti-tab.active {
    background: #fff;
    color: #3b82f6;
    border-color: #e2e8f0;
    border-bottom: 1px solid #fff;
    font-weight: 600;
}

/* ==========================================================================
   进度总览区域（紧凑、清晰、响应式；与白底蓝灰主色协调）
   ========================================================================== */
.zhenti-progress-area {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    min-height: 400px;
}

.zhenti-progress-area[hidden] {
    display: none;
}

/* 顶部：图例 + 总览统计（复用 masteryStats 数据） */
.progress-legend {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.progress-summary {
    font-size: 14px;
    color: #334155;
    margin-bottom: 10px;
}

.progress-summary strong {
    color: #10b981;
    font-size: 18px;
    font-weight: 700;
    margin: 0 2px;
}

.progress-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.progress-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #475569;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend-label {
    font-weight: 500;
}

.legend-count {
    color: #1e293b;
    font-weight: 700;
    min-width: 18px;
    text-align: right;
}

/* 年份分组 */
.progress-years {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-year-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 10px 10px;
}

.progress-year-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    padding: 5px 10px;
    background: #1e293b;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.progress-year-stats {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.progress-year-stats strong {
    color: #10b981;
    font-weight: 700;
}

.progress-year-pct {
    font-style: normal;
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* 年份小进度条：复用 mastered→expert 的渐变，与顶部总览一致 */
.progress-year-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-year-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #a855f7 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 方格网格：紧凑、自动填充 */
.progress-q-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 4px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

/* 单个题目方格（button） */
.progress-q {
    height: 32px;
    min-width: 0;
    border: 1.5px solid var(--q-color, #cbd5e1);
    background: var(--q-bg, #f8fafc);
    color: var(--q-color, #64748b);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    line-height: 1;
    user-select: none;
}

.progress-q:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.18);
    z-index: 1;
    filter: brightness(1.04);
}

.progress-q:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
    z-index: 2;
}

.progress-q:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* 未开始：明显灰色态，避免被误认作已掌握 */
.progress-q[data-level="new"] {
    border-style: dashed;
    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #94a3b8;
}

/* 进度总览下隐藏只服务列表的板块（JS 会动态控制 hidden，这里给兜底） */
body[data-zhenti-tab="progress"] .zhenti-sidebar,
body[data-zhenti-tab="progress"] .zhenti-thumb-strip,
body[data-zhenti-tab="progress"] .zhenti-filters,
body[data-zhenti-tab="progress"] .zhenti-charts-bottom {
    display: none;
}

/* 进度总览：左侧统计图例，右侧按年份逐行排列题目方格 */
body[data-zhenti-tab="progress"] .zhenti-layout {
    grid-template-columns: minmax(0, 1fr);
}

body[data-zhenti-tab="progress"] .zhenti-progress-area {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

body[data-zhenti-tab="progress"] .progress-legend {
    grid-column: 1;
    margin: 0;
    position: sticky;
    top: 12px;
}

body[data-zhenti-tab="progress"] .progress-years {
    grid-column: 2;
    min-width: 0;
}

/* 移动端恢复单列布局 */
@media (max-width: 900px) {
    body[data-zhenti-tab="progress"] .zhenti-progress-area {
        grid-template-columns: minmax(0, 1fr);
    }

    body[data-zhenti-tab="progress"] .progress-legend,
    body[data-zhenti-tab="progress"] .progress-years {
        grid-column: 1;
        position: static;
    }
}


/* 移动端：方格更紧凑 */
@media (max-width: 600px) {
    body:has(#zhenti) {
        overflow-x: hidden;
    }
    body:has(#zhenti) .sidebar {
        display: none;
    }
    body:has(#zhenti) .main-content {
        margin-left: 0;
        min-width: 0;
        width: 100%;
    }
    .zhenti-progress-area {
        padding: 10px;
    }
    .progress-q-grid {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
        gap: 3px;
    }
    .progress-q {
        height: 28px;
        font-size: 11px;
    }
    .progress-legend {
        padding: 10px;
    }
    .progress-legend-item {
        padding: 3px 8px;
        font-size: 11px;
    }
    .progress-year-title {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 400px) {
    .progress-q-grid {
        grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
    }
    .progress-q {
        height: 24px;
        font-size: 10px;
        border-width: 1px;
    }
}
