/* ============================================================
   地面站考卷生成器 · 更炽热
   品牌红 #FF4338 · 暖白底 · 卡片式布局
   ============================================================ */
:root {
  --brand: #FF4338;
  --brand-deep: #E93A30;
  --brand-dark: #7A1B14;
  --brand-soft: #FFF1EF;
  --brand-tint: #FBE9E6;
  --ink: #262220;
  --ink-2: #6b625e;
  --ink-3: #a29a95;
  --line: #ece5e1;
  --line-strong: #ddd2cc;
  --bg: #f7f3f1;
  --card: #ffffff;
  --ok: #1f8a54;
  --ok-soft: #eaf6ef;
  --bad: #c0392b;
  --bad-soft: #fdf1ef;
  --shadow-1: 0 1px 2px rgba(38, 34, 32, .04), 0 2px 8px rgba(38, 34, 32, .04);
  --shadow-2: 0 2px 6px rgba(38, 34, 32, .05), 0 10px 28px rgba(38, 34, 32, .07);
  --shadow-btn: 0 2px 6px rgba(255, 67, 56, .28), 0 1px 2px rgba(255, 67, 56, .2);
  --radius: 16px;
}

* { box-sizing: border-box; }

/* 有 display 的块（.fig-panel 等）会盖掉 hidden 属性，统一兜住 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 顶部一层极淡的品牌色雾，让页面不至于是一片死白 */
body::before {
  content: '';
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 320px;
  background:
    radial-gradient(760px 300px at 22% -60px, rgba(255, 67, 56, .09), rgba(255, 67, 56, 0) 72%),
    radial-gradient(620px 260px at 88% -90px, rgba(255, 138, 92, .08), rgba(255, 138, 92, 0) 70%);
  pointer-events: none;
  z-index: 0;
}
.top, main, .bar, .savebar { position: relative; z-index: 1; }

body { padding-bottom: 96px; }

::selection { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 页头 ---------- */
.top {
  padding: 24px 20px 6px;
  max-width: 880px;
  margin: 0 auto;
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { height: 30px; width: auto; display: block; }
.top h1 {
  margin: 14px 0 4px;
  font-size: 23px;
  letter-spacing: .3px;
  color: var(--ink);
  font-weight: 700;
}
.top .sub { margin: 0 0 6px; color: var(--ink-2); font-size: 13.5px; }

.who {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
}
.who #whoName {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  border-radius: 999px; padding: 4px 12px; color: var(--ink);
  font-weight: 500;
}
.who #logout { color: var(--brand-deep); padding: 4px 2px; }

main { max-width: 880px; margin: 0 auto; padding: 4px 16px 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
  animation: card-in .28s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: .2px;
}
.card-head h2 b {
  display: inline-flex;
  width: 22px; height: 22px;
  align-items: center; justify-content: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #ff6a52);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
}
.card-head .hint {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-head h2 { flex: 0 0 auto; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  padding: 30px 16px 26px;
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
  background: linear-gradient(180deg, #fdfbfa, #fbf8f6);
}
.drop:hover, .drop.over {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.drop svg {
  display: inline-block;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 14px;
  padding: 11px;
  width: 50px; height: 50px;
  box-sizing: content-box;
  margin-bottom: 10px;
  transition: transform .18s;
}
.drop:hover svg, .drop.over svg { transform: translateY(-2px) scale(1.05); }
.drop-main { margin: 2px 0 4px; font-size: 15px; font-weight: 550; color: var(--ink); }
.drop-sub { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.when-full { display: none; }

/* 已经有文件了：把整块虚线区收成一条细栏，别一直占着半屏 */
.card.has-files .drop {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  text-align: left;
  border-style: solid;
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow-1);
}
.card.has-files .drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.card.has-files .drop svg {
  width: 18px; height: 18px;
  padding: 7px;
  border-radius: 10px;
  margin: 0;
  flex: 0 0 auto;
}
.card.has-files .drop:hover svg { transform: none; }
.card.has-files .drop-main { margin: 0; font-size: 13.5px; }
.card.has-files .drop-sub { display: none; }
.card.has-files .when-empty { display: none; }
.card.has-files .when-full { display: inline; }
kbd {
  font: inherit; font-size: 11.5px;
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 0 5px; background: #fff;
  color: var(--ink-2);
}

/* ---------- 缩略图 ---------- */
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.page {
  position: relative;
  width: 124px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #faf7f5;
  overflow: hidden;
  padding-bottom: 28px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, transform .15s;
}
.page:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.page.cont { border-color: #f0c3bd; background: #fff8f7; }
/* 第一页没有「并入上一套」，底部不留那条 28px 的空条 */
.page.no-join { padding-bottom: 0; }
.page.no-join .pno, .page.no-join .vd { bottom: 5px; }
.page img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-bottom: 1px solid var(--line);
}
.page .badge {
  position: absolute; left: 5px; top: 5px;
  max-width: calc(100% - 34px);
  white-space: nowrap;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), #ff6a52);
  color: #fff;
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(255, 67, 56, .35);
}
.page.cont .badge { background: #c96a60; box-shadow: none; }
.page .pno {
  position: absolute; right: 4px; bottom: 32px;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .85);
  color: var(--ink-3);
  backdrop-filter: blur(2px);
}
.page .rm {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 21px; height: 21px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .5); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background .15s;
}
.page .rm:hover { background: rgba(0, 0, 0, .72); }
.page .join {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 28px;
  border: 0; border-top: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.page .join:hover { background: #fdfbfa; }
.page .join.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; border-top-color: #f0c3bd; }

.group-hint {
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--brand-soft);
  border: 1px solid var(--brand-tint);
  border-radius: 10px;
  padding: 9px 12px;
  line-height: 1.6;
}

/* ---------- 套切换 ---------- */
.sets { margin-bottom: 18px; }
.sets-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px;
}
.sets-head b { color: var(--brand-dark); font-size: 14px; }
.sets-head .hint { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.chips::-webkit-scrollbar { height: 5px; }
.chips::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.chip {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 2px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  padding: 8px 13px;
  min-width: 88px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.chip b { font-size: 13px; color: var(--ink); font-weight: 600; }
.chip span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 1px 4px rgba(255, 67, 56, .15); }
.chip.on b { color: var(--brand-dark); }
.chip.on span { color: #b9746c; }

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ---------- 按钮 ---------- */
.primary {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff5347, var(--brand-deep));
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  padding: 13px;
  transition: .16s;
  box-shadow: var(--shadow-btn);
  letter-spacing: .3px;
}
.primary:disabled {
  background: #ece4df; color: #b3aaa4; cursor: not-allowed;
  box-shadow: none;
}
.primary:not(:disabled):hover { filter: brightness(1.04); }
.primary:not(:disabled):active { transform: scale(.985); filter: brightness(.97); }
.primary.wide { margin-top: 0; }
/* 次要主按钮：描边款，和「下载 PDF」并排 */
.primary.outline {
  background: #fff;
  color: var(--brand-deep);
  border: 1.5px solid var(--brand);
  box-shadow: 0 1px 3px rgba(255, 67, 56, .12);
}
.primary.outline:not(:disabled):hover { background: var(--brand-soft); filter: none; }
.primary.outline:not(:disabled):active { background: var(--brand-tint); transform: scale(.985); }

/* ---------- 状态行 ---------- */
.status {
  margin: 12px 2px 0; font-size: 13px; color: var(--ink-2); min-height: 20px;
  transition: color .15s;
}
.status.error { color: var(--bad); }
.status.ok { color: var(--ok); }

/* ---------- 识别 / 检测两个动作 ---------- */
.act { display: flex; gap: 10px; margin-top: 16px; }
.act .primary { margin-top: 0; flex: 1 1 auto; }
.ghost {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 12px;
  font-size: 14px;
  padding: 0 16px;
  white-space: nowrap;
  transition: .15s;
  box-shadow: var(--shadow-1);
}
.ghost:disabled { color: #c4bbb6; background: #faf7f5; cursor: not-allowed; box-shadow: none; }
.ghost:not(:disabled):hover { border-color: var(--line-strong); color: var(--ink); }
.ghost:not(:disabled):active { background: #f7f2ef; }

/* ---------- 页卡片上的检测结论 ---------- */
.page .vd {
  position: absolute; left: 5px; bottom: 32px;
  max-width: calc(100% - 48px);
  font-size: 9.5px;
  font-family: inherit;
  line-height: 1;
  padding: 3px 6px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.page .vd.ok { background: rgba(31, 138, 84, .92); }
.page .vd.no { background: rgba(192, 57, 43, .93); cursor: pointer; }

/* ---------- 预检结论面板 ---------- */
.verdict {
  margin-top: 14px;
  border: 1px solid var(--brand-tint);
  background: #fdf7f5;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  animation: card-in .22s ease both;
}
.verdict.warn { border-color: #f2dcb8; background: #fdf8ee; }
.verdict.bad { border-color: #f0c3bd; background: var(--bad-soft); }
.verdict h3 { margin: 0 0 6px; font-size: 14px; color: var(--brand-dark); }
.verdict.bad h3 { color: #b02a1c; }
.verdict ul { margin: 0 0 8px; padding-left: 18px; }
.verdict li { margin: 2px 0; }
.verdict li.y { color: #2c7a52; }
.verdict li.n { color: #b02a1c; }
.verdict .hint { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.verdict-act { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.verdict-act .primary { margin-top: 0; width: auto; padding: 9px 18px; font-size: 14px; }
.verdict-act .link { padding: 8px 2px; }

/* ---------- 有页没识别成功 ---------- */
.retry-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 14px;
  padding: 11px 13px;
  border: 1px solid #f0c3bd;
  background: var(--bad-soft);
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.6;
  color: #8c2b1e;
  animation: card-in .22s ease both;
}
.retry-box p { margin: 0; flex: 1; }
.retry-box .link { padding: 0; flex: 0 0 auto; color: #b02a1c; font-weight: 600; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input[type="text"], .field input:not([type]), .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fdfbfa;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:hover, .field textarea:hover { border-color: var(--line-strong); }
.field input:focus, .field textarea:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 67, 56, .1);
}
.field textarea { resize: vertical; line-height: 1.7; font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 13px; }
.field code { background: #f4efec; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.field-head { display: flex; align-items: baseline; gap: 8px; }
.field-head .link { margin-left: auto; }

/* 两行标题在桌面上并排，省一半高度 */
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- 分段选择 ---------- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 13.5px;
  transition: .15s;
}
.seg button:hover { border-color: var(--line-strong); }
.seg button.on {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 600;
}

.fig-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 13px;
  border-radius: 12px;
  background: #faf7f5;
  margin-bottom: 12px;
}
.mini { display: block; font-size: 12.5px; color: var(--ink-2); }
.mini > span { display: block; margin-bottom: 4px; }
.mini input, .mini select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s;
}
.mini input:focus, .mini select:focus { outline: none; border-color: var(--brand); }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.switch input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ---------- 图形微调 ---------- */
.fig-adj {
  margin: 2px 0 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdfc;
  transition: border-color .15s;
}
.fig-adj[open] { border-color: var(--brand-tint); background: #fffafa; padding-bottom: 12px; }
.fig-adj > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.fig-adj > summary::-webkit-details-marker { display: none; }
.fig-adj > summary b { color: var(--brand-dark); font-weight: 600; }
.fig-adj > summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 11px;
  color: #b9afaa;
  transition: transform .18s;
}
.fig-adj[open] > summary::after { transform: rotate(180deg); }
.seg.small { margin-bottom: 10px; }
.seg.small button { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.fig-adj .fig-panel { margin-bottom: 0; }

/* ---------- 答案对照 ---------- */
.answers { margin: 4px 0 16px; border-top: 1px solid var(--line); padding-top: 11px; }
.answers summary { cursor: pointer; font-size: 13px; color: var(--ink-2); user-select: none; }
.answers ol { margin: 10px 0 0; padding-left: 22px; font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.answers ol b { color: var(--brand-dark); }

/* 选项做成小卡片，点哪块都行，比裸复选框好按 */
.options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; padding-top: 6px; }
.options .switch {
  border: 1px solid var(--line);
  background: #fdfbfa;
  border-radius: 10px;
  padding: 9px 13px;
  transition: border-color .15s, background .15s;
}
.options .switch:hover { border-color: var(--line-strong); background: #fff; }
.options .switch:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 550; }

/* ---------- 预览 ---------- */
.paper-wrap {
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(120% 90% at 50% 0%, #f6efe9 0%, #ece3dc 100%);
  padding: 18px 12px;
  border: 1px solid var(--line);
}
.paper {
  width: 794px;
  min-height: 300px;
  background: #fff;
  margin: 0 auto;
  transform-origin: top left;
  box-shadow: 0 3px 8px rgba(60, 40, 34, .1), 0 14px 36px rgba(60, 40, 34, .12);
  border-radius: 3px;
  overflow: hidden;
  transition: opacity .12s;
}
.paper canvas { display: block; width: 794px; height: auto; }
.paper canvas + canvas { border-top: 1px dashed #e3d9d4; }
.paper.busy { opacity: .55; }
.paper:empty::after {
  content: '排版中…';
  display: block;
  padding: 120px 0;
  text-align: center;
  color: #b3a8a2;
  font-size: 13px;
}

/* ---------- 历史 ---------- */
.history { list-style: none; margin: 0; padding: 0; }
.history li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid #f2ece9;
  font-size: 13.5px;
  transition: background .15s;
  border-radius: 8px;
}
.history li:hover { background: #fdfbfa; }
.history li:last-child { border-bottom: 0; }
.history .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .d { color: var(--ink-3); font-size: 12px; }
.history button.link { margin-left: 8px; }
.link {
  border: 0; background: none; color: var(--brand-deep);
  font-size: 13px; padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.link:hover { background: var(--brand-soft); }

/* ---------- 底部操作条 ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -6px 24px rgba(38, 34, 32, .06);
}
.bar-inner {
  max-width: 848px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-inner .primary { flex: 1; }
.bar-inner .link { white-space: nowrap; padding: 10px 4px; }

/* ---------- 下载结果条 ---------- */
.savebar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(848px, calc(100% - 32px));
  padding: 11px 12px 11px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 10px 34px rgba(60, 40, 34, .16);
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(8px);
  animation: card-in .2s ease both;
}
.savebar-main { min-width: 0; }
.savebar-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.savebar-tip { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.savebar-act { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.savebar-act .link { padding: 6px 4px; white-space: nowrap; }
/* 关闭键：手机上 22px 太难点，撑到 30px 并常显底色 */
.savebar-x {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: #f2ece9;
  color: #8a7f79;
  font-size: 17px; line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.savebar-x:hover { background: #eae2de; color: var(--ink); }
.savebar-x:active { background: #e2d8d3; }

@media (max-width: 420px) {
  .fig-panel { grid-template-columns: 1fr; }
  .top h1 { font-size: 20px; }
  .savebar { flex-direction: column; align-items: stretch; gap: 8px; }
  .savebar-act { justify-content: space-between; }
}

/* ============================================================
   登录页
   ============================================================ */
.login-body {
  padding: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 500px at 50% -180px, #ffe9e5 0%, rgba(247, 243, 241, 0) 68%),
    var(--bg);
}
.login-wrap {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 26px 16px calc(26px + env(safe-area-inset-bottom));
  gap: 12px;
}
.login-card {
  width: 100%; max-width: 386px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px 22px;
  box-shadow: var(--shadow-2);
  animation: card-in .3s ease both;
}
.login-logo { height: 27px; width: auto; display: block; margin-bottom: 20px; }
.login-card h1 {
  margin: 0 0 6px;
  font-size: 20px; letter-spacing: .4px;
  color: var(--ink);
  font-weight: 700;
}
.login-sub { margin: 0 0 22px; font-size: 13px; color: var(--ink-2); }

.login-field { display: block; margin-bottom: 14px; }
.login-field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.login-field input {
  width: 100%; height: 47px;
  padding: 0 14px;
  font: inherit; font-size: 15px;
  color: var(--ink);
  background: #fdfbfa;
  border: 1px solid var(--line);
  border-radius: 11px;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input:hover { border-color: var(--line-strong); }
.login-field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 67, 56, .12);
}

.login-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 4px 0 18px; font-size: 13px;
}
.login-err {
  margin: 0 0 12px;
  padding: 9px 13px;
  border-radius: 10px;
  background: var(--bad-soft);
  border: 1px solid #f7cfca;
  color: #b3261e;
  font-size: 13px;
  animation: card-in .2s ease both;
}
.login-btn { height: 47px; font-size: 15px; }
.login-btn:disabled { opacity: .72; cursor: default; }
.login-foot {
  margin: 18px 0 0;
  font-size: 12px; line-height: 1.7;
  color: var(--ink-2); text-align: center;
}
.login-foot .dim { color: #a89f9a; }
.login-tip { margin: 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }

.shake { animation: shake .32s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50% { transform: translateX(-6px); }
}
@media (max-width: 420px) {
  .login-card { padding: 24px 18px 20px; border-radius: 18px; }
  .login-card h1 { font-size: 18.5px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
