/* =====================================================================
   学考同步 · 出卷系统 —— 应用样式
   视觉规范（设计稿 6.4）：深蓝绿主色 + 纸白背景 + 单一琥珀强调色
   ===================================================================== */

:root {
  --ink:        #1F4E5F;   /* 主色：深蓝绿，教研信任感 */
  --ink-700:    #173C4A;
  --ink-300:    #6E93A1;
  --paper:      #FAFAF7;   /* 纸白 */
  --surface:    #FFFFFF;
  --amber:      #C4881F;   /* 唯一强调色：关键动作 / 存疑 */
  --amber-bg:   #FDF6E7;
  --ok:         #2E7D46;
  --warn:       #B8860B;
  --err:        #B3372D;
  --line:       #E4E6E3;
  --line-soft:  #EFF1EE;
  --text:       #22302F;
  --muted:      #6B7B79;
  --radius:     6px;
  --radius-sm:  4px;
  --shadow:     0 1px 3px rgba(0, 0, 0, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --serif: "Times New Roman", SimSun, "Songti SC", serif;
}

* { box-sizing: border-box; }

/* 关键：遮罩类元素的 display 声明会盖掉浏览器默认的 [hidden]{display:none}，
   必须显式兜底，否则 loading / modal / 抽屉会一直浮在页面上。 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
code { font-family: Consolas, "Courier New", monospace; font-size: 12px; background: var(--line-soft); padding: 1px 4px; border-radius: 3px; }
.muted { color: var(--muted); }

/* ------------------------------- 顶栏 ------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1360px; margin: 0 auto;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; color: var(--ink); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; color: var(--ink); }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }

.mainnav { display: flex; gap: 4px; }
.navbtn {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 500;
}
.navbtn:hover { background: var(--line-soft); color: var(--ink); }
.navbtn.is-active { background: var(--ink); color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.modelchip {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
}
.modelchip:hover { border-color: var(--ink-300); color: var(--ink); }
.modelchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.modelchip .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,125,70,.15); }
.modelchip .dot.demo { background: var(--amber); box-shadow: 0 0 0 3px rgba(196,136,31,.15); }
.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); color: var(--muted);
}
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn:hover { border-color: var(--ink-300); color: var(--ink); }

/* ---------------------------- 五步进度条 ---------------------------- */
.stepbar { border-top: 1px solid var(--line-soft); background: var(--surface); }
.stepbar-inner {
  max-width: 1360px; margin: 0 auto; padding: 12px 24px 14px;
  display: flex; align-items: center; gap: 4px;
}
.step {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
  border: 0; background: transparent; text-align: left;
  padding: 6px 10px; border-radius: var(--radius); color: var(--muted);
}
.step i { font-style: normal; font-size: 12px; opacity: .8; }
.step b { font-size: 13px; font-weight: 600; }
.step em { font-style: normal; font-size: 11px; opacity: .75; }
.step:hover { background: var(--line-soft); }
.step.is-active { background: var(--ink); color: #fff; }
.step.is-active em { opacity: .8; }
.step.is-done b { color: var(--ink); }
.step.is-done::after { content: "✓"; position: absolute; }
.stepline { flex: none; width: 18px; height: 1px; background: var(--line); }

/* ------------------------------- 布局 ------------------------------- */
#main { max-width: 1360px; margin: 0 auto; padding: 24px; }
.view { display: none; }
.view.is-active { display: block; }
.pane { display: none; }
.pane.is-active { display: block; }

.pane-head { margin-bottom: 20px; }
.pane-head h2 { font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.pane-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 900px; }

.section-title { font-size: 16px; color: var(--ink); margin: 24px 0 12px; }
.card-title { font-size: 14px; color: var(--ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-title em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); background: var(--line-soft); padding: 1px 7px; border-radius: 999px; }

.pane-foot {
  display: flex; align-items: center; gap: 16px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line);
}
.foot-note { color: var(--muted); font-size: 13px; flex: 1; }
.foot-actions { display: flex; gap: 10px; }

/* ------------------------------- 按钮 ------------------------------- */
.btn {
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 18px; font-weight: 600; font-size: 14px;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-700); }
.btn-primary:disabled { background: #C9D2D3; cursor: not-allowed; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--ink-300); color: var(--ink); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-danger { background: transparent; color: var(--err); border: 0; padding: 4px 6px; font-weight: 500; }
.mini { border: 0; background: transparent; color: var(--ink-300); font-size: 12px; padding: 2px 6px; }
.mini:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------ 上传页 ------------------------------ */
.upload-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius); background: var(--surface);
  padding: 44px 24px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color .15s, background .15s;
}
.dropzone svg { width: 34px; height: 34px; color: var(--ink-300); }
.dropzone strong { color: var(--ink); font-size: 15px; }
.dropzone span { font-size: 12px; }
.dropzone-hint { font-size: 12px; color: var(--amber); margin-top: 6px; }
.dropzone:hover, .dropzone.is-over { border-color: var(--ink); background: #F5F8F8; }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.side-card h3 { font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.side-card p { font-size: 12px; margin: 0 0 10px; }
.side-card textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; resize: vertical; line-height: 1.6; font-size: 13px;
}
.side-card textarea:focus { outline: none; border-color: var(--ink); }
.row-between { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }

.filelist { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.filecard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow);
}
.filecard img { width: 46px; height: 46px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); flex: none; }
.filecard .ficon { width: 46px; height: 46px; display: grid; place-items: center; background: var(--line-soft); border-radius: var(--radius-sm); color: var(--ink-300); flex: none; font-size: 11px; font-weight: 700; }
.filecard .fmeta { min-width: 0; flex: 1; }
.filecard .fname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fsub { font-size: 11px; color: var(--muted); }
.filecard .fdel { border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; }
.filecard .fdel:hover { color: var(--err); }

/* ------------------------------ 解析页 ------------------------------ */
.progress-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.progress-steps { display: flex; gap: 28px; margin-bottom: 12px; }
.pstep { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pstep span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.pstep.is-run span { background: var(--amber); animation: pulse 1s infinite; }
.pstep.is-done span { background: var(--ok); }
.pstep.is-run, .pstep.is-done { color: var(--ink); font-weight: 600; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.progress-msg { font-size: 13px; color: var(--muted); min-height: 20px; }

.profile-wrap { margin-top: 20px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-wide { grid-column: 1 / -1; }
.card-warn { border-color: #EBD9A8; background: #FFFCF3; }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.list-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--line-soft); }
.list-item:hover { background: #E9EDEC; }
.list-item input[type=checkbox] { margin-top: 4px; flex: none; accent-color: var(--ink); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-sub { font-size: 11.5px; color: var(--muted); }
.list-item .li-ev { font-family: var(--serif); font-size: 12.5px; color: var(--ink-700); background: #fff; border-left: 2px solid var(--ink-300); padding: 2px 8px; margin-top: 4px; border-radius: 0 3px 3px 0; }
.uncertain { background: #FFF9E6; border-left: 2px solid var(--amber); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow: auto; }
.tagchip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; color: var(--text);
}
.tagchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tagchip small { opacity: .7; font-size: 10.5px; }
.tagchip .lv { font-size: 10px; padding: 0 4px; border-radius: 3px; }
.lv-gk { background: #E7EEF0; color: var(--ink); }
.lv-zk { background: #EAF3EC; color: var(--ok); }
.lv-out { background: var(--amber-bg); color: var(--amber); }

/* ------------------------------ 配置页 ------------------------------ */
.examtype-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.examtype {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
}
.examtype b { font-size: 15px; color: var(--ink); }
.examtype span { font-size: 12px; color: var(--muted); }
.examtype.is-on { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31,78,95,.08); }
.examtype.is-on b::after { content: " · 已选"; font-size: 11px; color: var(--amber); }

.config-cols { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.typecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.typecard {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; position: relative;
}
.typecard.is-on { border-color: var(--ink); background: #F7FAFA; }
.typecard.is-off { opacity: .55; }
.typecard .tc-top { display: flex; align-items: center; gap: 8px; }
.typecard .tc-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.typecard .tc-desc { font-size: 12px; color: var(--muted); }
.typecard .tc-spec { font-size: 11.5px; color: var(--ink-700); background: var(--line-soft); padding: 3px 8px; border-radius: 3px; display: inline-block; }
.typecard .tc-badge { position: absolute; top: 10px; right: 10px; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.badge-ok { background: #EAF3EC; color: var(--ok); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }
.badge-off { background: #F2F2EF; color: var(--muted); }
.tc-check { width: 15px; height: 15px; accent-color: var(--ink); flex: none; }

.config-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: sticky; top: 150px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px;
}
.field input:focus { outline: none; border-color: var(--ink); }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-inline > span { margin: 0; }
.field-inline input { width: 96px !important; text-align: right; }

.slider-row { display: flex; flex-direction: column; gap: 6px; }
.slider-line { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.slider-line input[type=range] { flex: 1; accent-color: var(--ink); }
.slider-row input[type=range] { width: 100%; accent-color: var(--ink); }
.diff-out { display: block; font-style: normal; font-size: 12px; color: var(--ink); margin-top: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 14px; font-size: 12.5px; color: var(--muted); }
.seg button.is-on { background: var(--ink); color: #fff; }

.gapbar { margin-top: 12px; background: var(--amber-bg); border: 1px solid #EBD9A8; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; color: #7A5A0F; }
.gapbar b { display: block; margin-bottom: 4px; color: var(--amber); }

/* ------------------------------ 预览页 ------------------------------ */
.preview-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.tb-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 320px; }
.title-input {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 12px;
  font-size: 15px; font-weight: 700; color: var(--ink); min-width: 320px; background: var(--surface);
}
.title-input:focus { outline: none; border-color: var(--ink); }
.tb-meta { font-size: 12px; color: var(--muted); }
.tb-right { display: flex; gap: 8px; }

.issuebar { background: var(--amber-bg); border: 1px solid #EBD9A8; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: #7A5A0F; margin-bottom: 14px; }
.issuebar b { color: var(--amber); }

.preview-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.preview-col { display: flex; flex-direction: column; gap: 8px; }
.preview-head { display: flex; align-items: center; gap: 10px; }
.preview-head .tag { background: var(--ink); color: #fff; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.preview-head .muted { font-size: 12px; flex: 1; }
.frame-wrap { background: #C3CCCB; border-radius: var(--radius); padding: 8px; height: 620px; overflow: auto; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 3px; box-shadow: 0 1px 6px rgba(0,0,0,.18); }

.qcards { display: flex; flex-direction: column; gap: 10px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.qcard.flagged { border-left: 3px solid var(--amber); }
.qcard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.qno { font-weight: 700; color: var(--ink); }
.qtype { font-size: 11.5px; background: var(--line-soft); color: var(--ink-700); padding: 1px 8px; border-radius: 999px; }
.qlevel { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; }
.qlevel.基础 { background: #EAF3EC; color: var(--ok); }
.qlevel.提高 { background: #E7EEF0; color: var(--ink); }
.qlevel.挑战 { background: var(--amber-bg); color: var(--amber); }
.qflag { font-size: 11.5px; color: var(--amber); font-weight: 600; }
.qcard-head .spacer { flex: 1; }
.qstem { font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.qopts { display: grid; gap: 3px; margin-top: 6px; font-size: 13.5px; }
.qopts div { padding: 2px 0; }
.qopts .right { color: var(--ok); font-weight: 600; }
.qev { margin-top: 8px; font-size: 12px; color: var(--muted); }
.qev summary { cursor: pointer; color: var(--ink-300); }
.qev blockquote { margin: 6px 0 0; padding: 6px 10px; background: var(--line-soft); border-left: 2px solid var(--ink-300); font-family: var(--serif); font-size: 12.5px; color: var(--ink-700); border-radius: 0 3px 3px 0; }
.qans { margin-top: 8px; font-size: 13px; background: #F4F8F4; border-radius: var(--radius-sm); padding: 8px 10px; color: var(--ink-700); }
.qans b { color: var(--ok); }
.qedit { margin-top: 8px; }
.qedit textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; font-size: 12.5px; min-height: 56px; }
.textbar { display: flex; gap: 8px; }

/* ------------------------------ 导出页 ------------------------------ */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.export-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.export-card h3 { font-size: 15px; color: var(--ink); }
.export-card .ec-desc { font-size: 12.5px; color: var(--muted); flex: 1; }
.export-card .ec-badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--line-soft); color: var(--ink-700); width: fit-content; }
.export-card .ec-actions { display: flex; gap: 8px; }

/* ------------------------------ 列表页 ------------------------------ */
.filterbar { display: flex; gap: 10px; margin-bottom: 16px; }
.filterbar input[type=search] { flex: 1; max-width: 320px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); }
.filterbar select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); }
.paperlist { display: flex; flex-direction: column; gap: 10px; }
.paperrow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.paperrow .pr-main { flex: 1; min-width: 0; }
.paperrow .pr-title { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.paperrow .pr-sub { font-size: 12px; color: var(--muted); }
.paperrow .pr-actions { display: flex; gap: 8px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px; text-align: center; color: var(--muted); }

/* ------------------------------ 设置抽屉 ------------------------------ */
.drawer-mask { position: fixed; inset: 0; background: rgba(20,30,32,.28); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw;
  background: var(--surface); z-index: 61; display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(0,0,0,.12);
}
.drawer-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { flex: 1; font-size: 15px; color: var(--ink); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.drawer-tip { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; background: var(--line-soft); padding: 12px; border-radius: var(--radius-sm); }
.quickpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; margin-bottom: 16px; }
.chipbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--text); }
.chipbtn:hover { border-color: var(--ink); color: var(--ink); }
.drawer-note { font-size: 12.5px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--line-soft); color: var(--muted); }
.drawer-note.ok { background: #EAF3EC; color: var(--ok); }
.drawer-note.err { background: #FBEDEB; color: var(--err); }

/* ------------------------------ 放大预览 ------------------------------ */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,32,.5); z-index: 70; display: grid; place-items: center; }
.modal { width: 92vw; height: 92vh; background: var(--surface); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 48px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { flex: 1; font-size: 14px; color: var(--ink); }
.modal-head-actions { display: flex; align-items: center; gap: 8px; }
.modal-body { flex: 1; background: #8E9A99; padding: 16px; overflow: auto; }
.modal-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 3px; }

/* ------------------------------ 提示 / 加载 ------------------------------ */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 380px; animation: slidein .18s ease; }
.toast.warn { background: var(--amber); }
.toast.err { background: var(--err); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

.loading-mask { position: fixed; inset: 0; background: rgba(250,250,247,.82); z-index: 80; display: grid; place-items: center; }
.loading-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 34px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.1); min-width: 280px; }
.loading-title { font-weight: 700; color: var(--ink); margin-top: 12px; }
.loading-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; min-height: 18px; }
.spinner { width: 26px; height: 26px; margin: 0 auto; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1080px) {
  .upload-grid, .config-cols, .preview-grid { grid-template-columns: 1fr; }
  .examtype-switch { grid-template-columns: 1fr; }
  .config-side { position: static; }
  .frame-wrap { height: 460px; }
  .mainnav { display: none; }
}
