/**
 * 试卷模式扩展样式
 * 模式选择器、chip 多选、竖式题、找对错、验算、默写
 */

/* ========== 模式选择器 ========== */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.mode-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 96px;
}

.mode-tab:hover {
    border-color: var(--accent-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 218, 198, 0.12);
}

.mode-tab.active {
    border-color: #03dac6;
    background: rgba(3, 218, 198, 0.12);
    color: #03dac6;
    box-shadow: 0 0 0 3px rgba(3, 218, 198, 0.2), 0 0 16px rgba(3, 218, 198, 0.15);
}

.mode-tab .mode-icon {
    font-size: 24px;
    line-height: 1;
}

.mode-tab .mode-name {
    font-size: 15px;
    font-weight: 600;
}

.mode-tab .mode-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.mode-tab.active .mode-desc {
    color: rgba(3, 218, 198, 0.7);
}

@media (max-width: 768px) {
    .mode-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Chip 多选组 ========== */
.topic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.topic-chip:hover {
    border-color: var(--accent-secondary);
    color: var(--text-primary);
}

.topic-chip input {
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent-secondary);
}

.topic-chip:has(input:checked) {
    background: rgba(3, 218, 198, 0.18);
    border-color: #03dac6;
    color: #03dac6;
    box-shadow: 0 0 0 2px rgba(3, 218, 198, 0.15), 0 0 10px rgba(3, 218, 198, 0.1);
}

/* ========== 复习大纲多选列表 ========== */
.outline-multi-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.review-chapter-group + .review-chapter-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-light);
}

.review-chapter-title {
    font-size: 13px;
    color: var(--accent-warm);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-select-all-bar {
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.review-select-all-global {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--accent-secondary);
    font-weight: 600;
    user-select: none;
}

.review-select-all-global input[type="checkbox"] {
    accent-color: var(--accent-secondary);
    cursor: pointer;
}

.review-select-all-chapter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    user-select: none;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.review-select-all-chapter:hover {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

.review-select-all-chapter input[type="checkbox"] {
    accent-color: var(--accent-warm);
    cursor: pointer;
}

/* ========== 竖式题 ========== */
.vertical-calc {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 20px 28px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: "Courier New", "Consolas", monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 8px;
}

.vc-line {
    min-width: 120px;
    text-align: right;
    letter-spacing: 4px;
}

.vc-divider {
    width: 100%;
    border-top: 2px solid var(--text-primary);
    margin: 4px 0;
}

.vc-input {
    background: transparent;
    border: none;
    border-bottom: 2px dashed var(--accent-secondary);
    color: var(--accent-secondary);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-align: right;
    width: 100%;
    min-width: 80px;
    padding: 4px 0;
    outline: none;
    letter-spacing: 4px;
}

.vc-input:focus {
    border-bottom-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* ========== 找对错 ========== */
.expr-judge {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.expr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.expr-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: "Courier New", "Consolas", monospace;
    flex: 1;
}

.expr-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.judge-btn-small {
    padding: 6px 18px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 56px;
}

.judge-btn-small:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.judge-btn-small.selected-correct {
    background: rgba(3, 218, 198, 0.15);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.judge-btn-small.selected-wrong {
    background: rgba(207, 102, 121, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ========== 验算 ========== */
.verify-block {
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.verify-original {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: "Courier New", "Consolas", monospace;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.verify-hint {
    color: var(--text-muted);
    font-size: 13px;
}

/* ========== 默写填空 ========== */
.recite-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    line-height: 2.2;
    padding: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
}

.recite-text {
    color: var(--text-primary);
}

.recite-input {
    display: inline-block;
    width: 120px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent-secondary);
    color: var(--accent-secondary);
    font-family: inherit;
    font-size: inherit;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.recite-input:focus {
    border-bottom-color: var(--accent-warm);
    color: var(--accent-warm);
}

/* ========== 网格默写 dictation_grid ========== */
.dictation-grid-wrap {
    margin: 12px 0;
}
.dict-source {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.dict-direction-tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 10px;
    margin-bottom: 12px;
    background: rgba(255, 183, 77, 0.15);
    color: var(--accent-warm);
    border-radius: 12px;
    font-weight: 500;
}
.dictation-grid {
    display: grid;
    gap: 10px;
    padding: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
}
.dict-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 6px;
    transition: background 0.2s;
    min-width: 0;
}
.dict-hint {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-secondary);
    line-height: 1.3;
    text-align: center;
    word-break: keep-all;
    /* 拼音用等宽字体 */
    font-family: 'JetBrains Mono', Consolas, monospace;
}
.dict-input {
    width: 100%;
    max-width: 80px;
    padding: 6px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent-secondary);
    color: var(--accent-secondary);
    font-family: inherit;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, color 0.2s;
    box-sizing: border-box;
}
	.dict-input:focus {
	    border-bottom-color: var(--accent-warm);
	    color: var(--accent-warm);
	}
	/* 背诵默写模式：单元格无提示，虚线边框占位 */
	.dict-cell-recite .dict-input {
	    border-bottom: 2px dashed var(--text-muted);
	    color: var(--text-primary);
	}
	.dict-cell-recite .dict-input:focus {
	    border-bottom-color: var(--accent-secondary);
	    color: var(--accent-secondary);
	}
	.dict-cell-recite .dict-input::placeholder {
	    color: var(--text-muted);
	    opacity: 0.4;
	}
.dict-input-static {
    border-bottom: 2px solid transparent;
    font-weight: 600;
    padding: 6px 4px;
    font-size: 16px;
    text-align: center;
    width: 100%;
    max-width: 80px;
    box-sizing: border-box;
}
/* 正确/错误标记 */
.dict-cell.correct {
    background: rgba(3, 218, 198, 0.08);
}
.dict-cell.correct .dict-input-static {
    color: var(--accent-secondary);
    border-bottom-color: rgba(3, 218, 198, 0.4);
}
.dict-cell.wrong {
    background: rgba(239, 83, 80, 0.06);
}
.dict-cell.wrong .dict-input-static {
    color: var(--accent-primary);
    border-bottom-color: rgba(239, 83, 80, 0.4);
}
.dict-correct {
    font-size: 11px;
    color: var(--accent-secondary);
    margin-top: 2px;
    line-height: 1.2;
    text-align: center;
    word-break: break-all;
}
/* 回顾页 */
.dict-review .dict-review-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding: 6px 12px;
    background: var(--bg-paper);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ========== 模式徽章 ========== */
.mode-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 4px;
    vertical-align: middle;
}
