/* ==========================================================
   作业自动统计管理系统 · 一体机端
   设计目标：教室大屏 / 触摸屏，大字号、高对比、大点击区
   ========================================================== */

:root {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --card: #ffffff;
  --line: #e3e8f2;
  --line-strong: #cdd6e8;
  --text: #1c2434;
  --text-2: #5b6779;
  --text-3: #8a94a6;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0fe;
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;

  /* 五态配色（与论文一致） */
  --s-submitted: #16a34a;
  --s-missing: #94a3b8;
  --s-absent: #3b82f6;
  --s-duplicate: #f97316;
  --s-pending: #eab308;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(28, 36, 52, .06);
  --shadow-lg: 0 10px 34px rgba(28, 36, 52, .12);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------------- 布局 ---------------- */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.topbar {
  flex: 0 0 auto;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 9px 26px 0;
  box-shadow: var(--shadow);
  z-index: 5;
}

.topbar-head { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex: 0 0 auto;
}

.topbar-title { font-size: 19px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.topbar-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2);
  font-size: 12.5px; border: 1px solid var(--line);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.dot.off { background: var(--text-3); }

/* ---------------- 流程条 ---------------- */
.steps { display: flex; align-items: center; gap: 0; padding: 16px 0 14px; }

.step {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px; border-radius: 999px;
  color: var(--text-3); font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: .18s;
}
.step .num {
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--bg-soft); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line);
}
.step.active { background: var(--primary-soft); color: var(--primary-dark); }
.step.active .num { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.done { color: var(--ok); }
.step.done .num { background: var(--ok); color: #fff; border-color: var(--ok); }
.step-line { flex: 1; height: 2px; background: var(--line); min-width: 22px; border-radius: 2px; }
.step-line.done { background: var(--ok); }

/* ---------------- 主区 ----------------
   设计约束：整屏不滚动。顶栏/底栏固定，主区按视口高度弹性分配，
   需要滚动的只有名单、日志、异常样本这类天然超长的内容区（内部各自滚动）。 */
.main { flex: 1; min-height: 0; overflow: hidden; padding: 12px 18px; display: flex; }
.wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1520px; margin: 0 auto; }

.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.pane[hidden] { display: none !important; }        /* flex 会覆盖 hidden，必须显式声明 */
.pane > .card, .pane > .grid2, .pane > .grid4,
.pane > .scan-layout, .pane > .report-grid { min-height: 0; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 0;
}
.card + .card { margin-top: 12px; }
.pane > .card + .card { margin-top: 0; }           /* 由 .pane 的 gap 统一控制间距 */
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.scroll { overflow: auto; min-height: 0; }
.card-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .idx {
  width: 21px; height: 21px; border-radius: 6px; background: var(--primary-soft);
  color: var(--primary-dark); font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.card-desc { font-size: 12.5px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; flex: 1; min-height: 0; }
.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.grid4 > .card, .grid2 > .card { min-height: 0; overflow: auto; }
@media (max-width: 1180px) { .grid4 { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }

/* ---------------- 表单控件 ---------------- */
.field { margin-top: 12px; }
.label { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 7px; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); font-size: 13.5px; transition: .15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 可删除的预设标签：左侧选名字，右侧「×」删除 */
.chip-box {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
}
.chip-box:hover { border-color: var(--primary); }
.chip-box.on { background: var(--primary); border-color: var(--primary); }
.chip-pick {
  border: 0; background: transparent; font-family: inherit;
  padding: 7px 4px 7px 13px; font-size: 13.5px; color: var(--text-2);
}
.chip-box.on .chip-pick { color: #fff; font-weight: 600; }
.chip-box.on .chip-pick:hover { color: #fff; }
.chip-pick:hover { color: var(--primary); }
.chip-x {
  border: 0; background: transparent; font-family: inherit; cursor: pointer;
  padding: 0 10px 0 6px; font-size: 15px; line-height: 1; color: var(--text-3);
}
.chip-x:hover { color: var(--danger); font-weight: 700; }
.chip-box.on .chip-x { color: rgba(255, 255, 255, .72); }
.chip-box.on .chip-x:hover { color: #fff; }

.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 14px; background: #fff; color: var(--text);
  outline: none; transition: .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.7; font-family: var(--font); }

.row { display: flex; gap: 9px; align-items: center; }
.row .input { flex: 1; }

.btn {
  padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: #fff; color: var(--text); font-size: 14px; font-weight: 600; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803d; color: #fff; }
.btn-danger { background: #fff; border-color: #f0b4b4; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 34px; font-size: 17px; border-radius: 12px; }
.btn-xl { padding: 22px 62px; font-size: 26px; border-radius: 20px; letter-spacing: 4px; }

/* ---------------- 步骤 1：开始 ---------------- */
.hero {
  flex: 1; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px;
}
.hero .proj-name {
  font-size: 14px; color: var(--text-3); letter-spacing: .5px;
  padding: 6px 16px; border: 1px dashed var(--line-strong); border-radius: 999px;
  margin-bottom: 10px;
}
.hero h1 { font-size: 34px; margin: 0; letter-spacing: 1px; font-weight: 800; }
.hero .sub { color: var(--text-2); font-size: 15px; margin-bottom: 22px; }
.hero .features { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.feat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 20px; width: 210px; box-shadow: var(--shadow);
}
.feat .t { font-weight: 700; font-size: 14.5px; margin-bottom: 5px; }
.feat .d { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }

/* ---------------- 步骤 2：名单 ---------------- */
.roster-scroll { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 7px; }
.person {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; background: #fff;
}
.person:hover { border-color: var(--primary); }
.person.on { border-color: var(--s-absent); background: #eff6ff; }
.person .seat { color: var(--text-3); font-size: 11.5px; min-width: 20px; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { border-bottom: 1px solid var(--line); padding: 5px 7px; text-align: left; }
.mini-table th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.mini-table input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 13px; }
.mini-scroll { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------------- 步骤 3：ROI ---------------- */
/* 舞台：回归「按宽度等比缩放」。
   旋转 90/270 后画面是竖向的，若强行塞进一屏会被压得几乎看不清，
   因此这里只按宽度缩放、高度自然撑开，画面过高时由 .stage-wrap 自身纵向滚动。 */
.stage-wrap {
  position: relative; background: #0f172a; border-radius: var(--radius);
  overflow: auto; flex: 1; min-height: 0;
}
#stageBox { position: relative; width: 100%; line-height: 0; }
.stage-field { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 采集源 video：保持渲染但不可见，避免切换步骤时浏览器停止解码 */
.src-video {
  position: fixed; left: 0; bottom: 0; width: 2px; height: 2px;
  opacity: .02; pointer-events: none; z-index: -1;
}
/* overlay 处于常规流中，由它撑起 stageBox 的高度（绝对定位会导致容器塌陷为 0）。
   宽度铺满，高度随 canvas 内在宽高比自动得出。 */
#overlay { position: relative; display: block; width: 100%; height: auto; cursor: crosshair; }
.stage-tip {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  background: rgba(15, 23, 42, .74); color: #fff; font-size: 12.5px;
  padding: 6px 11px; border-radius: 8px; pointer-events: none;
}
.roi-readout { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.roi-readout b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------- 步骤 4：扫描 ---------------- */
.scan-layout { display: grid; grid-template-columns: 1fr 400px; gap: 12px; flex: 1; min-height: 0; align-items: stretch; }
.scan-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.scan-col > .card { flex: none; }
@media (max-width: 1180px) { .scan-layout { grid-template-columns: 1fr; } }

.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.legend .item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.legend .sw { width: 13px; height: 13px; border-radius: 4px; }

.students {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px; margin-top: 12px;
  flex: 1; min-height: 0; overflow: auto; align-content: start;
}
.stu {
  border: 1px solid var(--line); border-left: 4px solid var(--s-missing);
  border-radius: 9px; padding: 8px 10px; background: #fff;
  transition: .2s; position: relative;
}
.stu .nm { font-size: 14px; font-weight: 600; }
.stu .st { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.stu.s-submitted { border-left-color: var(--s-submitted); background: #f0fdf4; }
.stu.s-submitted .st { color: var(--s-submitted); }
.stu.s-missing { border-left-color: var(--s-missing); background: #f8fafc; }
.stu.s-absent { border-left-color: var(--s-absent); background: #eff6ff; }
.stu.s-absent .st { color: var(--s-absent); }
.stu.s-duplicate { border-left-color: var(--s-duplicate); background: #fff7ed; }
.stu.s-duplicate .st { color: var(--s-duplicate); }
.stu.s-pending { border-left-color: var(--s-pending); background: #fefce8; }
.stu.s-pending .st { color: #a16207; }
.stu.flash { animation: flash .9s ease; }
@keyframes flash { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(22,163,74,.55);} 40% { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(22,163,74,0);} 100% { transform: scale(1);} }

.counter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.counter {
  flex: 1; min-width: 88px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.counter .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.counter .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.crop-preview {
  width: 100%; background: #0f172a; border-radius: var(--radius-sm);
  min-height: 190px; display: block; object-fit: contain;
}
/* 画面变化强度仪表 */
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.meter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.meter {
  position: relative; height: 8px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.meter-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, var(--brand));
  transition: width .12s linear;
}
.meter-mark {
  position: absolute; top: -3px; width: 2px; height: 14px;
  background: var(--danger, #e11d48); left: 20%;
}
.params { display: grid; gap: 2px; margin-top: -4px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline span { width: 68px; flex: none; font-size: 12.5px; color: var(--text-3); }
.field-inline input[type=range] { flex: 1; min-width: 0; }
.field-inline .mono { width: 62px; flex: none; text-align: right; font-size: 12.5px; color: var(--text-2); }
#liveBadge.on { background: var(--brand-soft, #e8f0fe); color: var(--brand); }

.log-list { max-height: 180px; overflow: auto; font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: #fbfcfe; }
.log-list div { padding: 2px 0; border-bottom: 1px dashed var(--line); color: var(--text-2); }
.log-list div:last-child { border-bottom: 0; }

.mode-tabs { display: flex; gap: 8px; }
.mode-tab {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; text-align: left; transition: .15s;
}
/* 紧凑版：只保留标题，说明文字单行截断，避免把采集按钮挤下去 */
.mode-tab.compact { padding: 8px 11px; }
.mode-tab.compact .d {
  font-size: 11.5px; margin-top: 2px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 参数折叠区：默认收起，摘要里直接显示当前三个数值，不展开也能确认 */
.param-sum {
  cursor: pointer; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg-soft);
  font-size: 13px; color: var(--text-2); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.param-sum::-webkit-details-marker { display: none; }
.param-sum::before { content: '▸'; font-size: 11px; color: var(--text-3); }
details[open] > .param-sum::before { content: '▾'; }
.param-sum b { margin-left: auto; color: var(--text); font-size: 12.5px; }
.mode-tab .t { font-weight: 700; font-size: 14px; }
.mode-tab .d { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.mode-tab.on { border-color: var(--primary); background: var(--primary-soft); }
.mode-tab.on .t { color: var(--primary-dark); }

/* ---------------- 步骤 5：复核 ---------------- */
.pending-item {
  display: grid; grid-template-columns: 230px 1fr; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: #fff;
}
.pending-item + .pending-item { margin-top: 11px; }
/* 缩略图：固定 3:1 的展示框，图片按真实比例 contain 进去，
   既不会被拉变形，也能让纵向的 ROI 完整显示（上下留深色边）。点击可放大。 */
.pending-item .thumb {
  position: relative; width: 100%; aspect-ratio: 3 / 1; border-radius: 8px;
  border: 1px solid var(--line); background: #0f172a; overflow: hidden;
  display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.pending-item .thumb:hover { border-color: var(--primary); }
.pending-item .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.pending-item .thumb .zoom-hint {
  position: absolute; right: 5px; bottom: 4px; font-size: 11px; color: rgba(255,255,255,.72);
  background: rgba(15,23,42,.55); padding: 1px 6px; border-radius: 6px; pointer-events: none;
}
.pending-item .thumb.empty-thumb { cursor: default; color: #7c8798; font-size: 12px; }

/* ---------------- 留痕图放大查看 ---------------- */
.viewer {
  position: fixed; inset: 0; z-index: 999; background: rgba(15, 23, 42, .82);
  display: flex; flex-direction: column; padding: 18px;
}
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 12px; color: #fff; margin-bottom: 10px; }
.viewer-bar .muted { color: rgba(255,255,255,.66); font-size: 12.5px; }
.viewer-bar .btn { margin-left: auto; }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.viewer-body img {
  max-width: 96vw; max-height: calc(100vh - 110px);
  object-fit: contain; border-radius: 10px; background: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.pending-item .meta { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.pending-item .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; align-items: center; }
.pending-item select { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; }

.report-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 12px; flex: 1; min-height: 0; }
.report-grid > .col { overflow: auto; }
@media (max-width: 1180px) { .report-grid { grid-template-columns: 1fr; } }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
canvas.chart { width: 100%; height: 200px; display: block; }
.chart-cap { text-align: center; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }

.bar-list { margin-top: 12px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.bar-row.on { background: var(--primary-soft); }
.bar-row.on .nm { color: var(--primary-dark); font-weight: 700; }
.bar-row .nm { min-width: 110px; color: var(--text-2); }
.bar-track { flex: 1; height: 16px; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; background: var(--primary); }
.bar-row .vv { min-width: 62px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------------- 通用 ---------------- */
.muted { color: var(--text-3); font-size: 12.5px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.tag.gray { background: var(--bg-soft); color: var(--text-2); }
.tag.green { background: #dcfce7; color: #15803d; }
.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.orange { background: #ffedd5; color: #c2410c; }
.tag.yellow { background: #fef9c3; color: #a16207; }
.tag.red { background: #fee2e2; color: #b91c1c; }

.empty { padding: 34px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.footbar {
  flex: 0 0 auto; background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 26px; display: flex; align-items: center; gap: 12px;
}
/* display:flex 会覆盖 hidden 属性，必须显式关掉（同 .pane[hidden] 的坑） */
.footbar[hidden] { display: none !important; }
.footbar .spacer { flex: 1; }

.toast-host { position: fixed; right: 22px; bottom: 76px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #1c2434; color: #fff; padding: 11px 16px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: slidein .22s ease; max-width: 340px;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
.modal { background: #fff; border-radius: var(--radius); width: min(760px, 100%); max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; align-items: center; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--text-3); line-height: 1; }
