/* ===== 雪城标注平台 · 轻量样式 ===== */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e3e5e8;
  --txt: #1f2329;
  --muted: #8a9099;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --pass: #16a34a;
  --fail: #dc2626;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; }
kbd {
  background: #e5e8ec; border: 1px solid #d3d8de; border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; font-size: 11px; font-family: inherit;
  color: #3f454d; font-weight: 600;
}
/* 彩色按钮 / 深色工具条上的按键提示：改半透明白底 + 白字。
   原先 kbd 是浅灰底 #eef0f3，按钮文字是白色，白字压浅灰底对比度只有 1.06:1，等于看不见。 */
.btn.pass kbd, .btn.fail kbd, .btn.primary kbd, .lb-bar kbd {
  background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.42); color: #fff;
}
code { background: #eef0f3; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.muted { color: var(--muted); }
.sm-txt { font-size: 12px; }
.pad { padding: 16px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  padding: 8px 16px; font-size: 14px; font-family: inherit; line-height: 1.4;
  background: #eef0f3; color: var(--txt); transition: all .12s;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); filter: none; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.pass { background: var(--pass); color: #fff; }
.btn.fail { background: var(--fail); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.big { padding: 12px 28px; font-size: 16px; border-radius: 10px; }
.btn.block { width: 100%; }

/* ===== 卡片 / 表格 ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.page-pad { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { background: #fafbfc; color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafbfc; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 4px; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  background: #eef0f3; color: var(--muted); white-space: nowrap;
}
.tag.open { background: #dbeafe; color: #1d4ed8; }
.tag.assigned { background: #fef3c7; color: #b45309; }
.tag.done { background: #dcfce7; color: #15803d; }
.tag.archived { background: #f1f5f9; color: #64748b; }

/* ===== 顶部导航 ===== */
.topnav {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 50;
}
.topnav-brand { font-weight: 700; font-size: 15px; }
.topnav-links { display: flex; gap: 4px; flex: 1; }
.topnav-links a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.topnav-links a:hover { background: #f2f4f7; color: var(--txt); }
.topnav-links a.on { background: #e8effd; color: var(--primary); font-weight: 600; }
.topnav-user { display: flex; align-items: center; gap: 10px; color: var(--muted); }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #f4f5f7 60%); }
.login-card {
  width: 380px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff;
  font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { font-size: 19px; margin: 0; }
.login-sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-card .btn { margin-top: 22px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

/* 企业微信扫码登录 */
.login-sso { margin-top: 4px; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px; margin: 18px 0 0;
}
.login-divider::before,
.login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.wecom-btn {
  margin-top: 14px !important;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: #07c160; border: 1px solid #07c160;
}
.wecom-btn:hover { background: #f0fdf5; }
.wecom-btn svg { flex: none; }
.wecom-btn:disabled { opacity: .55; cursor: not-allowed; }
.login-sso-hint { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; text-align: center; }
.login-sso-hint.err { color: #dc2626; }

/* ===== 表单 ===== */
input, textarea, select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff; color: var(--txt);
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { width: 100%; font-family: Consolas, monospace; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select { width: 100%; }

/* ===== 标注页 ===== */
.annotate-wrap { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.an-top {
  display: flex; align-items: center; gap: 16px; padding: 8px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); z-index: 10;
}
.an-title { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-progress { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.an-progress .bar { flex: 1; height: 8px; border-radius: 4px; background: #e8eaee; overflow: hidden; }
.an-progress .bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }

.an-main { flex: 1; position: relative; background: #e9ebef; overflow: hidden; display: flex; }
.an-layer {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: calc(100% - 48px); max-height: calc(100% - 32px);
  object-fit: contain; cursor: zoom-in; border-radius: 4px; box-shadow: var(--shadow);
  user-select: none;
}
.an-badge {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  background: rgba(17,24,39,.72); color: #fff; border-radius: 6px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; pointer-events: none;
}
.an-badge.cmp { background: rgba(37,99,235,.85); }
.an-state {
  position: absolute; top: 44px; left: 12px; z-index: 3;
  border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  pointer-events: none;
}
.an-state.pass { background: rgba(22,163,74,.92); color: #fff; }
.an-state.fail { background: rgba(220,38,38,.92); color: #fff; }
.an-tools { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; gap: 8px; align-items: center; }
.an-tools .btn { background: rgba(255,255,255,.92); }
.an-seg { display: inline-flex; background: rgba(17,24,39,.72); border-radius: 8px; padding: 2px; gap: 2px; }
.an-seg button {
  border: 0; background: transparent; color: #cbd5e1; font: inherit;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.an-seg button.on { background: #fff; color: #111827; }
.an-seg button[data-v="cmp"].on { background: #2563eb; color: #fff; }
.an-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 76px; border: 0; border-radius: 8px;
  background: rgba(17,24,39,.4); color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; opacity: .5; transition: opacity .15s;
}
.an-nav:hover:not(:disabled) { opacity: 1; }
.an-nav:disabled { opacity: .12; cursor: default; }
.an-nav.prev { left: 10px; }
.an-nav.next { right: 10px; }
.an-pos { color: var(--muted); font-size: 12px; white-space: nowrap; }
.an-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-direction: column; gap: 10px; text-align: center; padding: 20px;
  z-index: 2;
}

.an-foot { background: var(--card); border-top: 1px solid var(--line); padding: 8px 12px; }
.filmstrip {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px;
  scrollbar-width: thin;
}
.strip-thumb {
  height: 46px; width: auto; border-radius: 6px; border: 2px solid transparent;
  opacity: .55; flex-shrink: 0; cursor: pointer;
}
.strip-thumb.pass { border-color: rgba(22,163,74,.8); opacity: .85; filter: none; }
.strip-thumb.fail { border-color: rgba(220,38,38,.8); opacity: .85; filter: none; }
.strip-thumb.cur { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.22); }
/* 底部操作区：网格三列，中间一列放按钮 → 按钮永远居中，左侧提示条再长也只会自己省略，压不到按钮上。
   原来是 position:absolute 的提示条 + 居中按钮，窗口窄到 1200 以下就叠在一起。
   两侧必须写 minmax(0,1fr)：默认 1fr 的收缩下限是内容宽度，长提示会把中间按钮顶偏。 */
.an-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; }
.an-btns { display: flex; align-items: center; justify-content: center; gap: 14px; }
.an-hint {
  color: var(--muted); font-size: 12px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 已提交（只读）状态下替代 通过/不通过 按钮的锁定提示 */
.an-locked {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px;
  background: rgba(100,116,139,.12); color: var(--muted);
  font-size: 13px; font-weight: 600;
}

/* 完成页 */
.done-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.done-card {
  text-align: center; background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 48px 56px;
}
.done-icon { font-size: 52px; margin-bottom: 8px; }
.done-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* ===== Lightbox：左右并排放大 ===== */
.lb-root { position: fixed; inset: 0; z-index: 1000; background: #0f1218; display: flex; flex-direction: column; }
.lb-stage { flex: 1; position: relative; overflow: hidden; cursor: grab; }
.lb-stage:active { cursor: grabbing; }
/* transform 只作用在这一层：两侧共用同一套缩放与平移，天然对齐 */
.lb-pair {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform-origin: center center;
  will-change: transform;
  transition: transform .06s linear;
}
.lb-cell {
  position: relative; flex: 1 1 50%; height: 100%; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lb-cell-l { border-right: 1px solid rgba(255,255,255,.22); }
.lb-pair.lb-single .lb-cell-r { flex-basis: 100%; border-right: 0; }
.lb-cell img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
  user-select: none; -webkit-user-drag: none;
}
.lb-tag {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff;
  border-radius: 6px; padding: 2px 8px; font-size: 12px;
  pointer-events: none;
}
.lb-loading {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 3;
  background: rgba(255,255,255,.92); color: var(--txt);
  border-radius: 6px; padding: 2px 10px; font-size: 12px;
}
/* 工具条用不透明底色：原来是 rgba(255,255,255,.06)，下层标注页的绿/红按钮会透上来，
   看着就像文字互相重叠（2026-10-25 Karl 报的现象，实测确认是透视不是布局重叠）。 */
.lb-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: #15181d; border-top: 1px solid rgba(255,255,255,.08);
}
.lb-side { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); font-size: 12px; }
.lb-bar .btn.ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.lb-hint { color: rgba(255,255,255,.72); font-size: 12px; margin-right: auto; }

/* ===== 管理端向导 ===== */
.modal {
  position: fixed; inset: 0; z-index: 900; background: rgba(15, 18, 24, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  width: 560px; max-width: 100%; max-height: 90vh; overflow: auto; padding: 22px 24px;
}
.modal-box.wide { width: 960px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-box h3 { margin-bottom: 12px; }
.modal-box label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.modal-box input { width: 100%; }

.wiz-step { margin-bottom: 16px; }
.wiz-title { font-weight: 600; margin-bottom: 8px; }
.wiz-tabs { display: flex; gap: 18px; margin-bottom: 10px; }
.radio { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.wiz-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.task-cfg {
  margin-bottom: 10px; padding: 10px 12px;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 10px;
}
.task-cfg textarea { width: 100%; margin-top: 8px; font-family: inherit; font-size: 13px; }
.guide-body {
  margin-top: 8px; padding: 12px 14px;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  max-height: 50vh; overflow: auto;
}
.an-main.an-single { display: flex; }
.an-main.an-single .an-pane { flex: 1; min-width: 0; }
.wiz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; max-height: 46vh; overflow: auto; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; background: #fafbfc;
}
.wiz-cell {
  position: relative; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 3px solid transparent; background: #dde1e7; aspect-ratio: 3/2;
}
.wiz-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wiz-cell img.broken { visibility: hidden; }
.wiz-cell.s1 { border-color: var(--pass); }
.wiz-cell.s2 { border-color: var(--fail); }
.wiz-badge {
  position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.65); color: #fff;
  font-size: 11px; border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.wiz-cell.s1 .wiz-badge { background: var(--pass); }
.wiz-cell.s2 .wiz-badge { background: var(--fail); }
.wiz-name {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 报表 ===== */
.pack-detail { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.pack-detail summary {
  padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pack-detail .tbl { border-top: 1px solid var(--line); }
.rp-thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 4px; cursor: zoom-in; display: block; }
.ok { color: var(--pass); }
.warn { color: var(--warn); }
.bad { color: var(--fail); }

/* 判定概览：大数字卡 */
.rp-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.rp-stat {
  flex: 1 1 130px; min-width: 110px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fafbfc; display: flex; flex-direction: column; gap: 2px;
}
.rp-stat .k { font-size: 12px; color: var(--muted); }
.rp-stat .v {
  font-size: 24px; font-weight: 700; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

/* 通过率：数字 + 绿(通过)/红(不通过) 占比条 */
.rp-rate { display: flex; align-items: center; gap: 8px; }
.rp-rate-num { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 40px; }
.rp-bar {
  flex: 1; min-width: 56px; height: 6px; border-radius: 999px;
  background: rgba(220, 38, 38, .28); overflow: hidden;
}
.rp-bar i { display: block; height: 100%; background: var(--pass); border-radius: 999px; }
.rp-bar.big { height: 10px; margin-top: 2px; }

/* 合计行 */
.tbl tfoot .rp-total td {
  background: #f7f8fa; font-weight: 600; border-top: 2px solid var(--line);
}
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== 进度条（工作台） ===== */
.prog-line { display: flex; align-items: center; gap: 8px; }
.bar.sm { width: 90px; height: 6px; background: #e8eaee; border-radius: 3px; overflow: hidden; }
.bar.sm i { display: block; height: 100%; background: var(--primary); }

/* ===== Toast ===== */
#toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2329; color: #fff; border-radius: 8px; padding: 9px 18px; font-size: 13px;
  box-shadow: var(--shadow); opacity: 1; transition: opacity .3s;
}
.toast.success { background: var(--pass); }
.toast.error { background: var(--fail); }
.toast.out { opacity: 0; }

/* ===== 移动端基础适配 ===== */
@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .topnav-links { order: 3; width: 100%; overflow-x: auto; }
  .an-actions { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .an-hint { display: none; }
  .an-btns { flex-wrap: wrap; }
  .btn.big { width: 45%; }
  .an-progress { min-width: 130px; }
  .an-nav { width: 30px; height: 56px; font-size: 22px; }
  .an-nav.prev { left: 4px; }
  .an-nav.next { right: 4px; }
  .an-pos { display: none; }
  .page-pad { padding: 12px 10px 40px; }
  .tbl th, .tbl td { padding: 8px 6px; font-size: 13px; }
}

/* ===== AI 接入指南 ===== */
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-title { margin: 0 0 6px; }
.ai-sub { margin: 0; font-size: 13px; line-height: 1.6; }
.ai-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ai-pre {
  background: #0f172a; color: #e5e7eb; border-radius: 8px; padding: 16px 18px;
  font-size: 12.5px; line-height: 1.6; max-height: 68vh; overflow: auto; white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.lb-cmp-btn.on { border-color: var(--primary); color: var(--primary); }

/* ===== 标注页左右分屏（三图可选） ===== */
.an-main.an-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #bdc3cc;
}
.an-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #eef0f3;
}
.pane-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.pane-bar > * { pointer-events: auto; }
.pane-seg {
  display: inline-flex;
  background: rgba(17, 24, 39, .74);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-wrap: wrap;
}
.pane-seg button {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.pane-seg button:hover { color: #fff; }
.pane-seg button.on { background: #fff; color: #111827; }
.pane-seg button[data-v="source"].on { background: #0f766e; color: #fff; }
.pane-seg button[data-v="cmp"].on { background: #2563eb; color: #fff; }
.pane-orig {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  background: rgba(17, 24, 39, .62);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.pane-orig:hover { background: rgba(17, 24, 39, .88); }
.pane-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: zoom-in;
}
.pane-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
/* stack 布局（商品展示）：左侧固定 2×2 四格，每格装一张素材，不足的格子留白。
   行数写死为 4 格是为了让不同 case 之间格子大小稳定 —— 2 个商品的 case 也不会把图撑大。
   2026-10-26 实测：素材是 3:2 横向图，竖排 4 行（800×181）时图只能缩到 271px 宽、
   左右留白各 265px，图片面积仅占格子 34%；2×2（399×364）能显示 399×266，面积翻 2.2 倍。 */
.pane-stage.is-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  background: #bdc3cc;
  cursor: default;
}
.pane-stage.is-stack .stack-cell {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #eef0f3;
  cursor: zoom-in;
}
.pane-stage.is-stack .stack-cell.empty {
  cursor: default;
  background: #e3e6eb;
}
.pane-stage.is-stack .stack-cell .pane-img {
  position: absolute;
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}
.pane-stage.is-stack .stack-cell.empty .pane-img { display: none; }
.stack-tag {
  position: absolute;
  left: 6px;
  top: 5px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  background: rgba(255, 255, 255, .86);
  border-radius: 5px;
  padding: 1px 6px;
  pointer-events: none;
}
.stack-tag.hidden { display: none; }
.pane-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  background: #eef0f3;
  z-index: 2;
}
/* 判定状态徽章挪到分屏中间上方，避免压住两侧的分段控件 */
.an-main.an-split .an-state {
  /* 分屏时顶部中间会被右侧的「原图/结果图/对照图」分段控件占住，
     徽章改放底部中间，避免压住按钮（2026-10-25 修） */
  top: auto;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: var(--shadow);
}

/* 放大视图的三图切换 */
.lb-seg {
  display: inline-flex;
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.lb-seg button {
  border: 0;
  background: transparent;
  color: #e5e7eb;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.lb-seg button.on { background: #fff; color: #111827; }
.lb-seg.hidden { display: none; }

@media (max-width: 820px) {
  .an-main.an-split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .pane-seg button { padding: 3px 7px; font-size: 11px; }
}


/* ===== 项目层（2026-10-25） ===== */
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: none; padding: 9px 16px; font: inherit; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--txt); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.pj-name { font-weight: 600; }
.pj-arch-title { margin: 18px 0 6px; }
.pj-prog { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.pj-prog-bar { height: 5px; background: #eef0f3; border-radius: 3px; overflow: hidden; }
.pj-prog-bar i { display: block; height: 100%; background: var(--primary); }
tr.dim { opacity: .62; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 18px; min-width: 130px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-k { color: var(--muted); font-size: 12px; }
.stat b { font-size: 20px; }

.pass-txt { color: var(--pass); }
.fail-txt { color: var(--fail); }
.warn-txt { color: var(--warn); }

.as-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; margin: 12px 0; }
.as-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: inherit; cursor: pointer; text-align: left;
}
.as-row:hover { border-color: var(--primary); background: #f8faff; }
.as-hand { font-size: 12px; color: var(--muted); }
.as-hand.warn { color: var(--warn); font-weight: 600; }

/* ===== 包预览（管理端） ===== */
.pv-toolbar { padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.pv-search {
  flex: 1; min-width: 280px; padding: 8px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; font-family: inherit; color: var(--txt);
}
.pv-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.pv-selbar { padding-top: 10px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.pv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }

.pv-chip {
  display: inline-flex; align-items: baseline; gap: 4px; font-size: 12px; color: var(--muted);
  background: #f5f7fa; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.pv-chip b { font-size: 14px; color: var(--txt); font-weight: 600; }
.pv-chip.pass b { color: var(--pass); }
.pv-chip.fail b { color: var(--fail); }

.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; padding: 12px; }
.pv-cell {
  position: relative; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: #f1f4f8; border: 2px solid transparent; transition: border-color .12s;
  display: flex; flex-direction: column;
}
.pv-cell:hover { border-color: #b9c2cc; }
.pv-cell.pass { border-color: var(--pass); }
.pv-cell.fail { border-color: var(--fail); }
.pv-cell.sel { box-shadow: 0 0 0 3px rgba(37,99,235,.45); }
/* contain 而不是 cover：预览的目的是「看清这张图有没有问题」，
   裁切会把海报边缘的字和留白切掉，那正是最容易出问题的地方。 */
.pv-cell img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; background: #eef1f5; }
.pv-cell.pv-hide { display: none; }
.pv-check { position: absolute; top: 6px; left: 6px; z-index: 2; width: 16px; height: 16px; cursor: pointer; }
.pv-badges { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.pv-badge {
  font-size: 11px; line-height: 1.5; padding: 0 6px; border-radius: 4px;
  color: #fff; background: #94a3b8; white-space: nowrap;
}
.pv-badge.pass { background: var(--pass); }
.pv-badge.fail { background: var(--fail); }
.pv-badge.trap { background: var(--warn); }
.pv-badge.over { background: #7c3aed; }
/* 编号独立成一行，不压在图上——压在图上会挡掉图片底部的内容 */
.pv-no {
  background: #fff; color: #475569; font-size: 11px; padding: 3px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: ui-monospace, Menlo, Consolas, monospace; border-top: 1px solid var(--line);
}
.pv-flash { animation: pvFlash 1.1s ease; }
@keyframes pvFlash {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,.7); }
  35% { box-shadow: 0 0 0 7px rgba(37,99,235,.55); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

.pv-viewer {
  background: var(--card); border-radius: 12px; width: min(96vw, 1180px); max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(15,23,42,.3);
}
.pv-viewer-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pv-viewer-head strong { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pv-viewer-tabs { display: flex; gap: 6px; padding: 8px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pv-viewer-tabs:empty { display: none; }
.pv-tab {
  font: inherit; font-size: 12px; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
}
.pv-tab:hover { border-color: var(--primary); color: var(--primary); }
.pv-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pv-viewer-stage { flex: 1; background: #0f172a; display: flex; align-items: center; justify-content: center; min-height: 300px; overflow: hidden; }
.pv-viewer-stage img { max-width: 100%; max-height: 64vh; object-fit: contain; display: block; }
.pv-viewer-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
