/* ==========================================================================
   Quiz · 后台录题界面
   --------------------------------------------------------------------------
   令牌与卡片观感来自 app.css；这里只负责录题相关的版式：
   列表页、录题工作台（左侧材料目录 + 右侧表单）、预览弹层、发布检查。
   设计原则：信息密度高、层次靠留白与浅灰层，不用粗描边。
   ========================================================================== */

/* --- 页面标题区 --- */
.exam-page-heading {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.exam-page-heading > div { min-width: 0; }
.exam-page-heading h2 {
  font-size: 23px; font-weight: 700; letter-spacing: -.035em; margin: 0 0 4px;
}
.exam-page-heading p { font-size: 13px; color: var(--muted); margin: 0; max-width: 52em; line-height: 1.65; }
.exam-back {
  display: inline-block; font-size: 12px; color: var(--muted);
  margin-bottom: 8px; padding: 4px 8px 4px 0; font-weight: 550;
}
.exam-back:hover, .exam-text-button:hover { color: var(--brand-text); }
.exam-footnote { font-size: 12px; color: var(--muted); margin: 14px 0 0; line-height: 1.75; }
.exam-full-width { grid-column: 1 / -1; }
.exam-block { display: block; }
.exam-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.exam-text-button {
  padding: 5px 0; border: 0; background: none; color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.exam-danger { color: var(--danger-text) !important; }
.exam-icon-button {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  min-width: 32px; min-height: 32px;
  border: 0; border-radius: 10px; background: var(--fill);
  font-size: 14px; color: var(--text-2); line-height: 1;
  transition: background .16s, color .16s, transform .16s;
}
.exam-icon-button:hover { background: var(--fill-strong); color: var(--brand-text); transform: translateY(-1px); }
.exam-icon-button:disabled { cursor: default; opacity: .35; transform: none; }
.exam-feedback { font-size: 12px; line-height: 1.75; max-width: 100%; overflow-wrap: anywhere; }
.exam-feedback:empty { display: none; }
.exam-feedback p { margin: 0; }
.exam-feedback ul { padding-left: 20px; margin: 8px 0 0; max-height: 250px; overflow-y: auto; }
.exam-feedback a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.exam-success { color: var(--success-text); }
.exam-unsaved { color: var(--warn-text) !important; }
.exam-copy-field { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; }
.exam-error-page h2 { margin: 0 0 8px; font-size: 20px; }
.exam-error-page ul { padding-left: 20px; margin: 0; }

/* --- 新建试卷折叠面板 --- */
.exam-create-panel { margin-bottom: 14px; padding: 0; overflow: hidden; }
.exam-create-panel > summary,
.exam-paper-settings > summary,
.exam-redistribute > summary,
.exam-import-panel > summary,
.exam-publish-panel > summary,
.exam-unit-notes > summary {
  cursor: pointer; font-weight: 600; font-size: 14px;
  line-height: 1.7; list-style: none;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.exam-create-panel > summary::-webkit-details-marker,
.exam-paper-settings > summary::-webkit-details-marker,
.exam-redistribute > summary::-webkit-details-marker,
.exam-import-panel > summary::-webkit-details-marker,
.exam-publish-panel > summary::-webkit-details-marker,
.exam-unit-notes > summary::-webkit-details-marker { display: none; }
.exam-create-panel > summary::after,
.exam-paper-settings > summary::after,
.exam-redistribute > summary::after,
.exam-import-panel > summary::after,
.exam-publish-panel > summary::after,
.exam-unit-notes > summary::after {
  content: '⌄'; margin-left: auto; color: var(--muted); font-size: 13px;
  transition: transform .2s var(--ease);
}
.exam-create-panel[open] > summary::after,
.exam-paper-settings[open] > summary::after,
.exam-redistribute[open] > summary::after,
.exam-import-panel[open] > summary::after,
.exam-publish-panel[open] > summary::after,
.exam-unit-notes[open] > summary::after { transform: rotate(180deg); }
.exam-create-panel[open] > summary { border-bottom: 1px solid var(--line); }
.exam-create-panel > form,
.exam-import-panel > .stack,
.exam-redistribute > p,
.exam-redistribute > .form-field,
.exam-redistribute > .row,
.exam-unit-notes > .stack { padding: 16px 18px 18px; }
.exam-create-panel > summary .quiet,
.exam-paper-settings > summary .quiet,
.exam-redistribute > summary .quiet,
.exam-import-panel > summary .quiet {
  font-size: 12px; font-weight: 400; color: var(--muted);
}
.exam-publish-panel > summary .pill { margin-left: 4px; }
.exam-unit-notes { padding: 0; }
.exam-unit-notes > summary { padding: 12px 18px; font-size: 13px; }
.exam-unit-notes[open] > summary { border-bottom: 1px solid var(--line); }
.exam-paper-settings { margin-top: 14px; padding: 0; }
.exam-paper-settings[open] > summary { border-bottom: 1px solid var(--line); }
.exam-paper-settings > form,
.exam-paper-settings > .stack { padding: 16px 18px 18px; }
.exam-paper-settings > summary { padding: 12px 18px; }

/* --- 筛选条：一行放完，窄屏折行 --- */
.exam-filter-bar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 12px; padding: 12px 14px;
  background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-xs);
}
.exam-filter-bar .form-field { gap: 4px; min-width: 132px; flex: 1 1 150px; }
.exam-filter-bar .form-field:first-child { flex: 1 1 220px; }
.exam-filter-bar .form-field label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.exam-filter-bar input, .exam-filter-bar select { min-height: 38px; font-size: 13px; }
.exam-filter-bar .button { min-height: 38px; flex: 0 0 auto; }
.exam-filter-bar .exam-text-button { padding: 9px 6px; }

/* --- 试卷列表 --- */
.exam-paper-table { padding: 0; overflow: hidden; }
.exam-paper-table table { min-width: 780px; }
.exam-paper-table th:first-child, .exam-paper-table td:first-child { padding-left: 18px; }
.exam-paper-table td { font-size: 13px; vertical-align: middle; padding: 12px 14px; }
.exam-paper-table td:first-child { min-width: 200px; }
.exam-paper-table td:nth-child(3) { min-width: 130px; }
.exam-paper-table .progress-track { width: 120px; margin-top: 7px; height: 4px; }
.exam-paper-title {
  display: inline-block; font-size: 14px; font-weight: 600;
  margin-bottom: 2px; max-width: 340px; overflow-wrap: anywhere;
  letter-spacing: -.012em;
}
.exam-paper-title:hover { color: var(--brand-text); }
.exam-progress-caption { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exam-table-actions { display: flex; align-items: center; gap: 8px; }
.exam-table-actions > .button { white-space: nowrap; }
.exam-action-menu { position: relative; }
.exam-action-menu > summary {
  list-style: none; cursor: pointer; font-size: 18px; line-height: 1;
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 10px; color: var(--muted); background: var(--fill);
}
.exam-action-menu > summary::-webkit-details-marker { display: none; }
.exam-action-menu > summary:hover { background: var(--fill-strong); color: var(--text); }
.exam-action-menu > div {
  position: absolute; right: 0; z-index: 20;
  display: grid; min-width: 132px; padding: 5px;
  border-radius: 14px; background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: var(--shadow-md), 0 0 0 .5px rgba(0, 0, 0, .06);
  margin-top: 4px;
  animation: slide-in .16s var(--ease-out);
}
.exam-action-menu form button {
  border: 0; background: none; padding: 8px 10px; width: 100%;
  text-align: left; font-size: 13px; white-space: nowrap; border-radius: 9px;
}
.exam-action-menu form button:hover { background: var(--fill); color: var(--brand-text); }

/* --- 考试模板卡 --- */
.exam-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.exam-template-card { display: flex; flex-direction: column; min-width: 0; }
.exam-template-card h3 { font-size: 20px; letter-spacing: -.03em; margin: 14px 0 6px; }
.exam-template-icon {
  display: inline-block; font-size: 11px; letter-spacing: .06em; font-weight: 700;
  padding: 3px 9px; border-radius: 8px;
  background: rgba(var(--brand-rgb), .10); color: var(--brand-text);
}
.exam-template-description { font-size: 13px; line-height: 1.7; min-height: 40px; margin: 0; color: var(--muted); }
.exam-inline-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.exam-inline-stats > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.exam-inline-stats dt { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.exam-inline-stats dd {
  font-size: 23px; line-height: 1.3; font-weight: 700; margin: 0;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.exam-inline-stats dd small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.exam-blueprint-summary { display: grid; gap: 2px; margin-bottom: 14px; }
.exam-outline-part { border-radius: 10px; }
.exam-outline-part > summary {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  list-style: none; border-radius: 10px;
}
.exam-outline-part > summary::-webkit-details-marker { display: none; }
.exam-outline-part > summary::before { content: '›'; color: var(--muted); transition: transform .16s; }
.exam-outline-part > summary > span:first-of-type { flex: 1; }
.exam-outline-part[open] > summary { background: var(--fill); }
.exam-outline-part[open] > summary::before { transform: rotate(90deg); }
.exam-outline-part > summary .quiet { font-weight: 500; font-size: 12px; }
.exam-outline-section { padding: 8px 12px 4px 22px; font-size: 12px; }
.exam-outline-section ul { list-style: none; padding: 0; margin: 6px 0; }
.exam-outline-section li {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 6px; padding: 4px 0; line-height: 1.6; font-size: 12px;
}
.exam-card-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
}
.exam-card-actions form { margin-left: auto; }

/* --- 录题工作台骨架 --- */
.exam-paper-workspace { display: grid; gap: 14px; }
.exam-paper-overview .exam-page-heading { margin-bottom: 12px; }
.exam-paper-overview .exam-page-heading h2 { font-size: 21px; }
.exam-overview-progress {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--muted);
}
.exam-overview-progress > .progress-track { width: 200px; max-width: 45%; }

.exam-editor-layout {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.exam-editor-sidebar { position: sticky; top: 12px; min-width: 0; }
.exam-editor-nav { padding: 8px; max-height: calc(100dvh - 24px); overflow-y: auto; scrollbar-width: thin; }
.exam-editor-nav > summary {
  font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 6px 8px 8px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted);
}
.exam-editor-nav > summary::-webkit-details-marker { display: none; }
.exam-editor-nav > summary .quiet { font-size: 11px; font-weight: 400; }
.exam-nav-part + .exam-nav-part { margin-top: 12px; }
.exam-nav-part-title {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  margin: 0 8px 6px; font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.exam-nav-part-title small { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.exam-nav-section + .exam-nav-section { margin-top: 6px; }
.exam-nav-section-title { font-size: 11px; color: var(--muted); line-height: 1.5; padding: 0 8px 3px; }
.exam-unit-link {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 7px 8px; margin: 1px 0; border-radius: 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--text-2);
  transition: background .16s, color .16s;
}
.exam-unit-link:hover { background: var(--fill); }
.exam-unit-link.current { background: rgba(var(--brand-rgb), .12); color: var(--brand-text); font-weight: 600; }
.exam-unit-link small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.exam-unit-link.current small { color: var(--brand-text); opacity: .8; }
.exam-unit-dot { font-size: 11px; flex: 0 0 auto; color: var(--gray-3, #C7C7CC); line-height: 1.5; margin-top: 1px; }
.exam-unit-dot.complete { color: var(--ios-green); }
.exam-nav-check {
  display: block; margin: 12px 8px 2px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--brand-text);
}
.exam-editor-main { min-width: 0; display: grid; gap: 14px; }

.exam-unit-heading h2 { font-size: 21px; letter-spacing: -.03em; margin: 6px 0; }
.exam-unit-heading .quiet { font-size: 12px; }
.exam-unit-heading .eyebrow { font-size: 11px; }
.exam-directions { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.exam-directions summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.exam-directions p { font-size: 13px; line-height: 1.8; color: var(--text-2); margin: 8px 0 0; }
.exam-fieldset { border: 0; min-width: 0; padding: 0; margin: 0; display: grid; gap: 14px; }

/* --- 材料与题目卡 --- */
.exam-material-card .row, .exam-questions-card > .row { margin-bottom: 12px; }
.exam-material-card h3, .exam-questions-card h3 { font-size: 13px; font-weight: 650; margin: 0; color: var(--text); }
.exam-material-card h4 { font-size: 12px; font-weight: 600; margin: 0 0 10px; color: var(--text-2); }
.exam-material-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.exam-material-section > .row { margin-bottom: 10px; }
.exam-material-section > .row .quiet { font-size: 11px; }
.exam-material-section > [data-add-paragraph] { margin-top: 10px; }

.exam-word-bank-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.exam-word-bank-editor .form-field { display: grid; grid-template-columns: 15px minmax(0, 1fr); align-items: center; gap: 6px; }
.exam-word-bank-editor input { font-size: 13px; padding: 7px 10px; }
.exam-word-bank-editor label { color: var(--muted); font-weight: 700; font-size: 12px; }

.exam-paragraph-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 32px;
  gap: 10px; align-items: start;
}
.exam-paragraph-row input { text-align: center; font-weight: 600; padding: 8px 6px; }
.exam-paragraph-tools { padding-top: 22px; display: grid; gap: 5px; }

.exam-media-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.exam-media-section > summary {
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2);
  list-style: none; padding: 4px 0;
}
.exam-media-section > summary::-webkit-details-marker { display: none; }
.exam-media-section > summary::before { content: '▸ '; color: var(--muted); }
.exam-media-section[open] > summary::before { content: '▾ '; }
.exam-media-section[open] > summary { margin-bottom: 12px; }
.exam-media-input { display: flex; align-items: center; gap: 8px; min-width: 0; }
.exam-media-input > input { min-width: 0; flex: 1; }
.exam-upload-control {
  position: relative; overflow: hidden; flex: 0 0 auto; cursor: pointer;
  font-size: 12px !important; font-weight: 600 !important;
  margin: 0 !important; white-space: nowrap;
  border-radius: 12px !important; min-height: 38px;
}
.exam-upload-control input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
  width: 100%; height: 100%; font-size: 0; padding: 0; border: 0;
}
.exam-media-section audio,
.exam-paper-settings audio,
.exam-preview-unit audio,
.exam-preview-shared-audio audio {
  display: block; width: 100%; max-width: 520px; margin-top: 10px; height: 40px;
}
.exam-material-image {
  display: block; max-width: 100%; max-height: 380px;
  object-fit: contain; object-position: left top; margin-top: 12px;
  border-radius: 12px; border: 1px solid var(--line);
}

/* --- 批量录入面板 --- */
.exam-bulk-panel {
  padding: 10px 12px; border-radius: 12px;
  background: var(--fill); margin: 12px 0;
}
.exam-bulk-panel > summary {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  cursor: pointer; list-style: none;
}
.exam-bulk-panel > summary::-webkit-details-marker { display: none; }
.exam-bulk-panel > summary::before { content: '▸ '; color: var(--muted); }
.exam-bulk-panel[open] > summary::before { content: '▾ '; }
.exam-bulk-panel[open] > summary { margin-bottom: 10px; }
.exam-bulk-panel .button { font-size: 12px; min-height: 32px; margin-top: 8px; padding: 5px 12px; }
.exam-bulk-panel textarea { font-size: 13px; }
.exam-bulk-panel .exam-feedback { margin-top: 6px; }

/* --- 单题编辑 --- */
.exam-question { padding: 14px 0; }
.exam-question:first-child { padding-top: 2px; }
.exam-question:last-child { padding-bottom: 0; }
.exam-question + .exam-question { border-top: 1px solid var(--line); }
.exam-question > .row { margin-bottom: 10px; }
.exam-question h4 { font-size: 13px; font-weight: 650; margin: 0; }
.exam-question > .row .quiet { font-size: 11px; }
.exam-question.exam-word-question {
  display: grid; grid-template-columns: 68px minmax(120px, 160px) minmax(0, 1fr);
  align-items: center; gap: 8px; padding: 8px 0;
}
.exam-word-question h4 { font-size: 12px; white-space: nowrap; }
.exam-word-answer.form-field { flex-direction: row; align-items: center; gap: 8px; }
.exam-word-answer > label { font-size: 11px; color: var(--muted); font-weight: 400; }
.exam-question .exam-word-answer > .quiz-select { width: 100px; max-width: 100%; flex-shrink: 0; }
.exam-word-question-details > summary { font-size: 11px; color: var(--muted); cursor: pointer; text-align: right; }
.exam-word-question-details[open] { grid-column: 1 / -1; }
.exam-word-question-details[open] > summary { text-align: left; margin: 2px 0 10px; }
.exam-word-question-details > .form-grid { padding: 12px; background: var(--fill); border-radius: 12px; }

.exam-option-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 12px 0; }
.exam-option-editor .form-field { gap: 4px; }
.exam-option-editor label { color: var(--muted); font-size: 11px; font-weight: 600; }
.exam-option-editor textarea { font-size: 13px; }
.exam-option-paste { margin: 10px 0 12px; }

.exam-answer-area { display: grid; gap: 12px; margin-top: 12px; }
.exam-answer-area > .form-field > .quiz-select { width: 190px; max-width: 100%; }
.exam-answer-area > .form-field > label { color: var(--text-2); font-size: 12px; }
.exam-answer-checkboxes {
  margin: 0; padding: 0; border: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.exam-answer-checkboxes legend { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.exam-answer-checkboxes > label {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--fill); font-size: 12px; font-weight: 600; cursor: pointer;
}
.exam-answer-checkboxes input { margin: 0; }
.exam-explanation > summary { font-size: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.exam-explanation > summary::-webkit-details-marker { display: none; }
.exam-explanation[open] > summary { margin-bottom: 8px; }

/* --- 保存条 --- */
.exam-save-bar {
  position: sticky; bottom: 10px; z-index: 26;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-md), 0 0 0 .5px rgba(0, 0, 0, .05);
}
.exam-save-bar > .quiet { font-size: 12px; }
.exam-save-bar > .button { margin-left: auto; }
.exam-save-bar > .exam-feedback:not(:empty) { flex: 1; }
.exam-save-feedback { min-width: 0; font-size: 12px; }
.exam-save-bar .error-box { max-height: 180px; overflow-y: auto; }
.exam-save-bar .row { justify-content: flex-end; flex: 0 0 auto; gap: 8px; }
.exam-save-bar .button { min-height: 38px; font-size: 13px; padding: 7px 16px; }

/* --- 结构编辑器 --- */
.exam-builder-summary {
  position: sticky; top: 8px; z-index: 20;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px 18px; font-size: 12px;
}
.exam-builder-summary strong { font-size: 18px; font-weight: 700; letter-spacing: -.04em; }
.exam-builder-summary .quiet strong { font-size: 13px; letter-spacing: 0; }
.exam-blueprint-editor { display: grid; gap: 12px; }
.exam-builder-node { background: var(--surface); border-radius: 16px; min-width: 0; box-shadow: var(--shadow-xs); }
.exam-builder-node > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none; min-width: 0;
}
.exam-builder-node > summary::-webkit-details-marker { display: none; }
.exam-builder-node > summary::before {
  content: '›'; color: var(--muted); font-size: 16px; line-height: 1;
  transition: transform .16s;
}
.exam-builder-node[open] > summary::before { transform: rotate(90deg); }
.exam-builder-node[open] > summary { border-bottom: 1px solid var(--line); }
.exam-node-tag {
  font-size: 11px; color: var(--brand-text); font-weight: 650;
  background: rgba(var(--brand-rgb), .10); border-radius: 7px; padding: 2px 8px;
  white-space: nowrap;
}
.exam-node-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.exam-node-metric { font-size: 11px; white-space: nowrap; color: var(--muted); }
.exam-node-tools { display: flex; align-items: center; gap: 4px; }
.exam-builder-node-body { padding: 14px; display: grid; gap: 14px; }
.exam-builder-children { display: grid; gap: 10px; }
.exam-builder-section { background: var(--fill); border-radius: 14px; }
.exam-builder-section > .exam-builder-node-body { padding: 12px; }
.exam-builder-unit > summary { padding: 10px 12px; }
.exam-builder-unit .exam-node-tag { background: var(--surface); color: var(--muted); }
.exam-builder-unit .form-grid { gap: 10px 14px; }
.exam-builder-node input, .exam-builder-node select, .exam-builder-node textarea { font-size: 13px; }
.exam-builder-node .exam-footnote { margin: 0; }
.exam-builder-checks { gap: 12px 20px; }
.exam-checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.65; }
.exam-checkbox-row input { margin: 3px 0 0; flex: 0 0 auto; width: 15px; height: 15px; }

/* --- 材料重分配 --- */
.exam-count-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.exam-redistribute > p { font-size: 12px; margin: 0; }
.exam-redistribute .form-field label { font-size: 12px; }
.exam-redistribute .exam-feedback { margin-top: 10px; padding: 0 18px 14px; }

/* --- 导入 --- */
.exam-import-panel { margin-bottom: 14px; padding: 0; }
.exam-import-panel > .stack { gap: 14px; }
.exam-code-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.7; }
.exam-import-preview { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.exam-import-preview > h3 { margin: 0 0 4px; font-size: 15px; }
.exam-import-preview > p { font-size: 12px; color: var(--muted); }
.exam-import-preview > .exam-checkbox-row { margin: 14px 0 12px; }
.exam-import-preview-unit { border-radius: 14px; background: var(--fill); margin: 10px 0; padding: 12px; }
.exam-import-preview-unit > summary { font-size: 12px; font-weight: 600; cursor: pointer; }
.exam-import-preview-unit > .exam-preview-unit { padding: 12px 0; }
.exam-import-preview-unit > .notice { font-size: 12px; margin-top: 12px; }
.exam-import-preview-unit > .notice p { margin: 0; }
.exam-import-preview-unit > .notice ul { margin-bottom: 0; padding-left: 20px; }

/* --- 发布检查 --- */
.exam-publish-panel { padding: 0; margin-top: 4px; }
.exam-publish-panel > p { font-size: 12px; padding: 12px 18px 0; margin: 0; }
.exam-publish-panel > .exam-checklist-item:first-of-type { margin-top: 8px; }
.exam-checklist-item { padding: 8px 18px; border-bottom: 1px solid var(--line); }
.exam-checklist-item > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  cursor: pointer; font-size: 12px; list-style: none; padding: 4px 0;
}
.exam-checklist-item > summary::-webkit-details-marker { display: none; }
.exam-checklist-item > summary > a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.exam-checklist-item > summary > .quiet { font-size: 11px; }
.exam-checklist-item > ul { font-size: 12px; color: var(--warn-text); padding-left: 20px; margin: 8px 0 4px; line-height: 1.85; }
.exam-publish-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px 16px; }
.exam-publish-actions > .quiet { font-size: 12px; }
.exam-publish-actions .exam-feedback { margin-top: 10px; }

/* --- 预览弹层 --- */
.exam-preview-dialog {
  width: min(840px, calc(100% - 28px)); max-height: 88dvh; overflow-y: auto;
  border: 0; border-radius: 22px; padding: 20px; color: var(--text);
  box-shadow: var(--shadow-lg);
}
.exam-preview-dialog::backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(3px); }
.exam-preview-dialog > .row {
  position: sticky; top: -20px; z-index: 1;
  background: #fff; padding: 4px 0 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 16px;
}
.exam-preview-dialog > .row h2 { font-size: 17px; margin: 0; }
.exam-preview-unit { min-width: 0; overflow-wrap: anywhere; }
.exam-preview-unit h3 { font-size: 17px; margin-top: 0; }
.exam-preview-unit .study-text { font-size: 16px; line-height: 1.85; }
.exam-preview-unit details > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.exam-preview-key { font-size: 12px; font-family: ui-monospace, monospace; }
.exam-preview-wordbank {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px; padding: 12px; margin: 14px 0;
  background: var(--fill); border-radius: 14px;
}
.exam-preview-wordbank > div { display: flex; gap: 8px; font-size: 12px; }
.exam-preview-wordbank dt { font-weight: 700; color: var(--muted); }
.exam-preview-wordbank dd { margin: 0; }
.exam-preview-paragraph { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; margin: 14px 0; }
.exam-preview-paragraph > strong { color: var(--brand-text); font-size: 12px; padding-top: 4px; }
.exam-preview-paragraph > p { font-family: var(--font-text); margin: 0; line-height: 1.85; font-size: 16px; }
.exam-preview-question { padding: 14px 0; border-top: 1px solid var(--line); margin-top: 14px; }
.exam-preview-question h4 { font-size: 13px; margin: 0 0 6px; }
.exam-preview-question > p { font-size: 13px; margin: 8px 0; line-height: 1.75; }
.exam-preview-options { display: grid; gap: 6px; font-size: 13px; margin: 10px 0; }
.exam-preview-options > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
.exam-preview-options dt { color: var(--muted); font-weight: 600; }
.exam-preview-options dd { margin: 0; }
.exam-preview-answer { color: var(--success-text); }
.exam-preview-part-title { font-size: 19px; margin: 8px 0 0; letter-spacing: -.03em; }
.exam-preview-shared-audio { margin-bottom: 18px; }
.exam-preview-shared-audio h3 { font-size: 13px; margin: 0; }

/* --- 题目反馈 --- */
.report-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  margin: 0 0 14px; border-radius: 14px; background: var(--fill-strong);
}
.report-tabs a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 11px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background .18s, color .18s;
}
.report-tabs a:hover { color: var(--text); }
.report-tabs a span {
  background: rgba(0, 0, 0, .06); border-radius: 980px;
  padding: 0 7px; font-size: 11px; color: inherit;
  font-variant-numeric: tabular-nums;
}
.report-tabs a[aria-current="page"] {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs);
}
.report-tabs a[aria-current="page"] span { background: rgba(var(--brand-rgb), .14); color: var(--brand-text); }
.report-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); }
.report-issue p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }
.report-issue .pill { margin-bottom: 2px; }
.report-user { white-space: nowrap; font-size: 12.5px; }
.report-actions { min-width: 220px; }
.report-resolve { gap: 6px; }
.report-resolve input[type=text] {
  min-height: 34px; border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 10px; font-size: 12.5px;
}
.report-resolve .row { gap: 6px; }
.report-resolve .button { min-height: 34px; padding: 4px 12px; font-size: 12.5px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (min-width: 1500px) {
  .exam-editor-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 1180px) {
  .exam-editor-layout { grid-template-columns: 186px minmax(0, 1fr); gap: 12px; }
  .exam-node-metric { display: none; }
  .exam-save-bar { flex-wrap: wrap; }
  .exam-save-bar .row { flex: 1; }
  .exam-template-card h3 { font-size: 18px; }
  .exam-inline-stats > div + div { padding-left: 12px; }
}
@media (max-width: 1000px) {
  .exam-editor-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-editor-sidebar { position: static; }
  .exam-editor-nav { max-height: none; }
  .exam-editor-nav > nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .exam-nav-part + .exam-nav-part { margin-top: 0; }
  .exam-template-grid { grid-template-columns: minmax(0, 1fr); }
  .exam-template-description { min-height: 0; }
  .exam-node-metric { display: block; }
  .exam-save-bar .row { flex: 0 0 auto; }
  .exam-node-tools { margin-left: auto; }
}
@media (max-width: 760px) {
  .exam-page-heading { gap: 10px; margin-bottom: 12px; }
  .exam-page-heading h2 { font-size: 20px; }
  .exam-page-heading > .button, .exam-page-heading > a.button { width: 100%; }
  .exam-page-heading p { font-size: 12px; }
  .exam-filter-bar { padding: 10px; gap: 8px; }
  .exam-filter-bar .form-field:first-child { flex: 1 1 100%; }
  .exam-filter-bar .button { flex: 1 1 auto; }
  .exam-inline-stats dd { font-size: 21px; }
  .exam-template-card h3 { margin-top: 12px; }
  .exam-builder-summary { gap: 10px 16px; padding: 10px 12px; top: 4px; }
  .exam-builder-summary strong { font-size: 16px; }
  .exam-builder-node > summary { padding: 10px 8px; gap: 6px; }
  .exam-node-title { font-size: 12px; }
  .exam-node-tag { font-size: 10px; padding: 2px 5px; }
  .exam-node-metric { display: none; }
  .exam-node-tools .exam-icon-button { min-width: 28px; min-height: 30px; }
  .exam-builder-node-body, .exam-builder-section > .exam-builder-node-body { padding: 10px; gap: 12px; }
  .exam-builder-children { gap: 8px; }
  .exam-save-bar {
    bottom: 4px; gap: 8px; padding: 8px;
    flex-direction: column; align-items: stretch;
  }
  .exam-save-bar > .button { margin-left: 0; width: 100%; }
  .exam-save-bar .row { flex: 1; justify-content: stretch; gap: 6px; }
  .exam-save-bar .row .button { flex: 1; }
  .exam-save-bar .exam-text-button { width: 100%; justify-content: center; }
  .exam-paper-workspace { gap: 12px; }
  .exam-editor-nav > nav { grid-template-columns: minmax(0, 1fr); }
  .exam-unit-heading h2 { font-size: 19px; }
  .exam-word-bank-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-option-editor { grid-template-columns: minmax(0, 1fr); }
  .exam-paragraph-row { grid-template-columns: 42px minmax(0, 1fr) 30px; gap: 7px; }
  .exam-count-grid { grid-template-columns: minmax(0, 1fr); }
  .exam-import-preview-unit { padding: 10px; }
  .exam-preview-dialog { padding: 16px; border-radius: 18px; }
  .exam-preview-dialog > .row { top: -16px; }
  .exam-preview-wordbank { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; }
  .exam-question { padding: 12px 0; }
  .exam-create-panel > summary,
  .exam-paper-settings > summary,
  .exam-import-panel > summary,
  .exam-publish-panel > summary { padding: 12px 14px; }
  .exam-create-panel > summary .quiet,
  .exam-paper-settings > summary .quiet,
  .exam-import-panel > summary .quiet { flex-basis: 100%; }
  .exam-create-panel > form,
  .exam-import-panel > .stack,
  .exam-redistribute > p,
  .exam-redistribute > .form-field,
  .exam-redistribute > .row,
  .exam-unit-notes > .stack,
  .exam-paper-settings > form,
  .exam-paper-settings > .stack { padding: 12px 14px 14px; }
  .report-tabs { width: 100%; }
  .report-tabs a { flex: 1 1 auto; justify-content: center; }
  .report-actions { min-width: 0; }
  /* 录题表单输入框 16px：避免 iOS 聚焦缩放 */
  .exam-filter-bar input, .exam-filter-bar select,
  .exam-builder-node input, .exam-builder-node select, .exam-builder-node textarea,
  .exam-word-bank-editor input, .exam-paragraph-row input, .exam-media-input > input,
  .exam-option-editor textarea, .exam-bulk-panel textarea, .exam-code-input { font-size: 16px; }
}
@media (pointer: coarse) {
  .exam-text-button { min-height: 40px; padding: 8px 0; }
  /* 方形图标钮在触屏放大到 40×40，用 --tap-min 覆盖全局的 44px，
     否则 40px 宽配 44px 高会变成竖向长方形。 */
  .exam-icon-button { --tap-min: 40px; min-width: 40px; min-height: 40px; }
  .exam-action-menu > summary { --tap-min: 40px; min-width: 40px; min-height: 40px; }
  .exam-unit-link { min-height: 40px; }
  .exam-table-actions > .button { min-height: 40px; }
}
