/* 转绘工具 · 设计系统
 *
 * 变量逐条抄自火爆漫剧（huobao.wuscy.com 的 _nuxt/entry.css），不是凭印象调的近似色——
 * 两个工具摆在同一个大厅里，长得像一家人比长得好看更要紧。
 */

:root {
  /* 底与面 */
  --surface-base: #f7f8fa;
  --surface-raised: #fff;
  --surface-soft: #fafbfc;
  --bg-2: #f1f3f6;
  --bg-3: #e7e9ee;
  --bg-hover: rgba(23, 24, 26, .045);
  --bg-active: rgba(23, 24, 26, .07);

  /* 描边 */
  --border: #e7e9ee;
  --border-strong: #d6dae1;
  --border-hover: #c3c9d2;
  --border-focus: #1a5fb4;

  /* 文字 */
  --text-0: #17181a;
  --text-1: #3a3f47;
  --text-2: #5c6370;
  /* 原来的 #9aa1ad 在白底上只有 2.6:1，却用在日期、表头、门禁细节这些承载信息的小字上（2026-09-28 模拟点击测试）；
     现在白底 5.2:1、顶栏与浅灰底也都过 4.5:1 */
  --text-3: #666d7a;

  /* 主色 */
  --accent: #1a5fb4;
  --accent-dark: #134e8f;
  --accent-bg: rgba(26, 95, 180, .1);
  --accent-gradient: linear-gradient(135deg, #1a5fb4, #2d7dd2);
  --on-accent: #fff;
  --button-focus: rgba(26, 95, 180, .2);

  /* 语义 */
  /* 药丸文字比语义色深一档：浅底配 #15803d / #dc2626 只有 4.2 / 4.1:1，不到 AA */
  --success: #16a34a;  --success-bg: rgba(22, 163, 74, .1);  --tag-success-text: #166534;
  --error: #dc2626;    --error-bg: rgba(220, 38, 38, .1);    --tag-error-text: #b91c1c;
  --info: #2563eb;     --info-bg: rgba(37, 99, 235, .1);     --tag-info-text: #1d4ed8;
  --warning: #d97706;  --warning-bg: rgba(217, 119, 6, .12); --tag-warning-text: #92400e;
  --accent-purple: #6366f1; --accent-purple-bg: rgba(99, 102, 241, .1); --accent-purple-text: #4f46e5;

  /* 阴影：双层，近处一层薄的压住边、远处一层散的托起来 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lift: 0 4px 14px rgba(16, 24, 40, .08), 0 16px 40px rgba(16, 24, 40, .14);
  --shadow-elevated: 0 8px 20px rgba(16, 24, 40, .12), 0 24px 56px rgba(16, 24, 40, .16);

  /* 圆角：按钮是胶囊 */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 980px;

  /* 间距 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Fira Code", Consolas, monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-bg: rgba(247, 248, 250, .75);
  --scrim: rgba(15, 23, 42, .45);
  --overlay-track: rgba(23, 24, 26, .06);

  /* 主要触控目标不低于 36px（手机上 44px，见文末小屏段） */
  --button-height: 36px;
  --button-height-sm: 36px;
  --topbar-h: 56px;
  --sidebar-w: 184px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-base);
  color: var(--text-0);
  font: 14px/1.55 var(--font-body);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 按钮 ---------- */

.btn {
  align-items: center;
  appearance: none;
  background: #e8eaee;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  color: var(--text-0);
  cursor: pointer;
  display: inline-flex;
  font: 600 13px/1 var(--font-body);
  gap: 6px;
  justify-content: center;
  letter-spacing: -.01em;
  min-height: var(--button-height);
  padding: 0 18px;
  white-space: nowrap;
  transition: background .18s var(--ease-out), color .18s var(--ease-out),
              box-shadow .18s var(--ease-out), transform .12s var(--ease-out);
}
.btn:hover { background: #dcdfe5; }
.btn:active { background: #d0d4db; transform: translateY(.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3.5px var(--button-focus); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-primary:active { background: var(--accent-dark); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--error-bg); color: var(--tag-error-text); box-shadow: none; }
.btn-danger:hover { background: rgba(220, 38, 38, .16); }
.btn-sm { font-size: 12px; gap: 5px; min-height: var(--button-height-sm); padding: 0 14px; }
.btn-icon { padding: 0; width: 36px; min-width: 36px; color: var(--text-1); }

/* ---------- 表单 ---------- */

label { display: block; font-size: 12px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
label .hint { font-weight: 400; color: var(--text-3); margin-left: 4px; }

input, select, textarea {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-0);
  font: 13.5px var(--font-body);
  letter-spacing: -.01em;
  outline: none;
  padding: 9px 12px;
  width: 100%;
  transition: border-color .16s, box-shadow .16s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px var(--button-focus);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option:disabled { color: var(--text-3); }
textarea { resize: vertical; min-height: 68px; font-family: var(--font-mono); font-size: 12px; }

.field { margin-bottom: var(--sp-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }

/* ---------- 卡片与面板 ---------- */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s var(--ease-out), transform .2s var(--ease-out),
              border-color .2s var(--ease-out);
}
.card-hover:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--button-focus); }
.card-pad { padding: var(--sp-5); }

.card-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.015em; }
.card-head .spacer { flex: 1; }

/* ---------- 药丸与徽标 ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-2); color: var(--text-1);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  padding: 5px 12px;
  white-space: nowrap;
}
.pill-xs { padding: 1px 7px; font-size: 11px; vertical-align: 1px; }
.pill-accent { background: var(--accent-bg); color: var(--accent); }
.pill-success { background: var(--success-bg); color: var(--tag-success-text); }
.pill-error { background: var(--error-bg); color: var(--tag-error-text); }
.pill-info { background: var(--info-bg); color: var(--tag-info-text); }
.pill-warning { background: var(--warning-bg); color: var(--tag-warning-text); }
.pill-purple { background: var(--accent-purple-bg); color: var(--accent-purple-text); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { animation: pulse 1.4s var(--ease-out) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 分段控件 ---------- */

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border-radius: var(--radius-pill);
}
.seg button {
  appearance: none; border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-pill);
  font: 600 12.5px/1 var(--font-body); color: var(--text-2);
  padding: 7px 14px; min-height: 36px;
  transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
.seg button:hover { color: var(--text-0); }
.seg button[aria-selected="true"] { background: #fff; color: var(--text-0); box-shadow: var(--shadow-xs); }

/* ---------- 顶栏 ---------- */

/* 顶栏固定 56px 高：里面的东西一律不折行，放不下就先收次要的（副标题、用户名），再让模型下拉变窄 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: var(--sp-4);
  white-space: nowrap; min-width: 0;
  height: var(--topbar-h);
  padding: 0 var(--sp-5);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-gradient);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-xs);
}
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--text-3); line-height: 1.15; }
.topbar .spacer { flex: 1; }
.topbar-tools { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.topbar-tools #hall-user { max-width: 10em; overflow: hidden; text-overflow: ellipsis; display: inline-block; }

/* 顶栏里的模型 / 分辨率选择器：贴着文字的小控件，不占一整行 */
.inline-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
/* 以前限死 230px，「模型名（价格）」普遍放不下、单价被截掉；现在按内容宽、最多 360px，顶栏挤时再收窄 */
.topbar .inline-field { min-width: 0; flex: 0 1 auto; }
.inline-field select {
  width: auto; min-width: 140px; max-width: 360px; min-height: 36px;
  padding: 5px 26px 5px 10px; font-size: 12px;
  border-radius: var(--radius-sm); border-color: var(--border);
  background: #fff;
  text-overflow: ellipsis;
}
.topbar .inline-field select { flex: 0 1 auto; }
.inline-field.check { min-height: 36px; cursor: pointer; }
.inline-field.check input { width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer; }

/* ---------- 布局 ---------- */

.page { max-width: 1240px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-16); }
.page-head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.page-head h1 { margin: 0 0 4px; font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--text-2); font-size: 13px; }
.page-head .spacer { flex: 1; }
.stats { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.toolbar {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.toolbar .search input { padding-left: 32px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; }

.grid-cards {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

/* ---------- 作业卡片 ---------- */

.job-card { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--border); font: inherit; }
.job-thumb {
  position: relative; aspect-ratio: 16 / 10;
  background: var(--accent-gradient);
  display: grid; place-items: center;
  color: hsla(0, 0%, 100%, .92); font-size: 30px; font-weight: 700; letter-spacing: -.04em;
}
.job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-thumb .badge {
  position: absolute; top: 10px; left: 10px;
  background: hsla(0, 0%, 100%, .94); color: var(--text-1);
  border-radius: var(--radius-pill); padding: 4px 10px;
  font-size: 11px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 5px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
}
.job-thumb .badge-success { color: var(--tag-success-text); }
.job-thumb .badge-error { color: var(--error); }
.job-thumb .badge-warning { color: var(--tag-warning-text); }
.job-thumb .badge-info { color: var(--tag-info-text); }
.job-thumb .res {
  position: absolute; right: 10px; bottom: 10px;
  color: #fff; font-size: 11px; font-weight: 650;
  background: rgba(0, 0, 0, .32); border-radius: var(--radius-pill); padding: 2px 8px;
}
.job-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.job-title { font-size: 13.5px; font-weight: 650; letter-spacing: -.015em; }
.job-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 11.5px; }

.bar { height: 4px; border-radius: 4px; background: var(--overlay-track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s var(--ease-out); }
.bar-success > i { background: var(--success); }
.bar-error > i { background: var(--error); }
.bar-muted > i { background: var(--text-3); }

/* ---------- 详情：阶段侧栏 ---------- */

/* 第二列写 minmax(0,1fr) 不是 1fr：网格项默认 min-width:auto，
   里面一段长 JSON 或宽表格就能把整页撑出横向滚动条，缩不回来。 */
.work { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.panel-stack { min-width: 0; }

.stages { position: sticky; top: calc(var(--topbar-h) + var(--sp-5)); min-width: 0; }
.stages .group { margin-bottom: var(--sp-4); }
.stages .group-name {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 0 10px; margin-bottom: 6px;
}
.stage {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2);
  transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
.stage .tick { width: 15px; flex: none; text-align: center; font-size: 11px; }
.stage-done { color: var(--text-1); }
.stage-done .tick { color: var(--success); }
.stage-now { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.stage-now .tick { color: var(--accent); }
.stage-wait .tick { color: var(--text-3); }
.stage-fail { background: var(--error-bg); color: var(--tag-error-text); font-weight: 650; }
.stage-stop { background: var(--bg-2); color: var(--text-1); font-weight: 650; }
.stage-tag { margin-left: auto; padding-left: 6px; font-size: 11px; font-weight: 600; opacity: .9; }

.stage-foot { border-top: 1px solid var(--border); padding-top: var(--sp-3); margin-top: var(--sp-4); }
.stage-foot .label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.stage-foot .label b { font-weight: 650; }

/* ---------- 详情：主面板 ---------- */

.panel-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
/* 面板按区块局部更新（app.js patchSections），每块一个包裹层 */
.panel-stack > .sec { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.scroll-x { overflow-x: auto; }
.row-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
h3.sub { margin: var(--sp-4) 0 var(--sp-2); font-size: 12.5px; font-weight: 650; color: var(--text-1); }
.ok { color: var(--tag-success-text); }
.bad { color: var(--tag-error-text); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  padding: 0 10px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
/* 短列（时间、申请秒、状态、花费）保持一行，别被长台词列挤成一字一行 */
table.tbl .nowrap { white-space: nowrap; overflow-wrap: normal; }
table.tbl td.wide { min-width: 11em; }
table.tbl td.task { color: var(--text-3); white-space: nowrap; }
table.tbl tr.total td { border-top: 1px solid var(--border-strong); font-weight: 650; }
table.tbl tr.row-chosen td { background: var(--accent-bg); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-4); font-size: 12.5px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.thumbs img.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; }

.events { max-height: 340px; overflow: auto; font-size: 12px; }
.events .ev { display: flex; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.events .ev:last-child { border-bottom: none; }
.events .ev .t { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 11.5px; min-width: 58px; flex: none; }
.events .ev .type { font-weight: 600; min-width: 96px; flex: none; }
.events .ev .msg { flex: 1; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.events .ev .msg b { color: var(--text-1); font-weight: 600; }
.events .ev .seq { color: var(--text-3); font-family: var(--font-mono); font-size: 11px; flex: none; }

/* 竖屏成片（720x1280）按列宽放大会比一屏还高、播放条和下载按钮都在首屏以下：限高、等比、居中。
   只限 80vh 还不够——视频上面有页头和卡片头（约 240px），1440x900 下播放条仍在首屏以下；按视口减去上下的东西算，最低 240px */
video { display: block; max-width: 100%; max-height: clamp(240px, calc(100vh - 300px), 80vh); width: auto; height: auto; margin: 0 auto; border-radius: var(--radius); background: #0b0d10; }
img.contact { width: 100%; border-radius: var(--radius); display: block; }

/* ---------- 抽屉（新建转绘） ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: var(--scrim); backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: min(520px, 100vw);
  background: var(--surface-raised);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elevated);
  display: flex; flex-direction: column;
  animation: slide-in .28s var(--ease-out);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
}
.drawer header h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.drawer header .spacer { flex: 1; }
.drawer:focus { outline: none; }
/* contain：滑到底不再带着背后的启动台一起滚；打开时再由 html.drawer-open 锁住背景 */
.drawer .body { flex: 1; overflow: auto; padding: var(--sp-5); overscroll-behavior: contain; }
html.drawer-open, html.drawer-open body { overflow: hidden; }
/* 锁滚动会把页面滚动条收掉，列表跟着横跳一个滚动条宽：按收掉的宽度补回右边距（app.js 量出来写进 --sb-comp）。
   不用 scrollbar-gutter:stable——那会让抽屉和遮罩右边永远空出一条滚动条宽的缝 */
html.drawer-open body { padding-right: var(--sb-comp, 0px); }
.drawer-msgs > .note { margin: var(--sp-3) var(--sp-5) 0; max-height: 30vh; overflow: auto; }
.drawer-msgs + footer { margin-top: var(--sp-3); }
.drawer-msgs .shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.field-note { margin-top: 8px; }
.drawer footer {
  display: flex; gap: var(--sp-2); justify-content: flex-end;
  padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
/* 在大厅 iframe 里：大厅的客服按钮悬浮在右下角（约 60px 圆，离边 20px），会压住「提交作业」 */
html.embedded .drawer footer { padding-right: 96px; }
.field-note .retry { margin-left: 8px; vertical-align: middle; }

details.adv { border-top: 1px solid var(--border); padding-top: var(--sp-4); margin-top: var(--sp-2); }
details.adv > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--text-1);
  list-style: none; display: flex; align-items: center; gap: 6px; min-height: 36px;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "▸"; color: var(--text-3); transition: transform .16s var(--ease-out); }
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > div { padding-top: var(--sp-4); }

/* ---------- 门禁 ---------- */

/* 每项门禁是一个可点开的 <details>：收着时细节单行省略，点开（没过的默认开着）完整换行显示——
   以前全文只放在 title 里，触屏上看不到 */
.gate { border-bottom: 1px solid var(--border); font-size: 12.5px; min-width: 0; }
.gate:last-of-type { border-bottom: none; }
.gate > summary {
  display: flex; align-items: center; gap: 10px; padding: 9px 0; min-height: 36px;
  cursor: pointer; list-style: none; min-width: 0;
}
.gate > summary::-webkit-details-marker { display: none; }
.gate .mark { width: 18px; flex: none; text-align: center; font-weight: 700; }
.gate .name { flex: none; font-weight: 600; }
.gate-pass .mark { color: var(--success); }
.gate-fail .mark { color: var(--error); }
.gate .detail {
  color: var(--text-3); font-size: 11.5px;
  margin-left: auto; min-width: 0; flex: 1; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gate[open] .detail { display: none; }
.gate .gate-full { padding: 0 0 10px 28px; color: var(--text-1); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
details.issues { margin-top: var(--sp-4); border-top: 1px solid var(--border); padding-top: var(--sp-2); }
details.issues > summary { cursor: pointer; font-size: 12.5px; font-weight: 650; min-height: 36px; display: flex; align-items: center; }
.issue { padding: 8px 0; border-bottom: 1px dashed var(--border); overflow-wrap: anywhere; }
.issue:last-child { border-bottom: none; }
.issue .hint { color: var(--text-1); margin-top: 2px; }

/* ---------- 空态与提示 ---------- */

.empty { text-align: center; padding: var(--sp-16) var(--sp-5); color: var(--text-3); }
.empty h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; color: var(--text-1); }

.note {
  background: var(--warning-bg); border: 1px solid #fde68a; color: #92400e;
  border-radius: var(--radius); padding: 10px 12px; font-size: 12.5px;
  overflow-wrap: anywhere;    /* 上游报错里常带不换行的长链接，不断行会把整页撑出横向滚动 */
}
.note .advice { margin-top: 4px; }
.note details.raw { margin-top: 8px; }
.note details.raw > summary { cursor: pointer; font-size: 12px; min-height: 28px; display: inline-flex; align-items: center; }
.note details.raw .mono { margin-top: 4px; opacity: .9; }
#list-warn { margin-bottom: var(--sp-4); }
.note-error { background: var(--error-bg); border-color: rgba(220, 38, 38, .25); color: #991b1b; }
.note-info { background: var(--info-bg); border-color: rgba(37, 99, 235, .22); color: var(--tag-info-text); }

/* ---------- 门禁页（未从大厅进入） ---------- */

.gatepage {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: var(--sp-5);
  background: var(--surface-base);
}
.gatepage .card { max-width: 420px; width: 100%; padding: var(--sp-8) var(--sp-6); text-align: center; }
.gatepage .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 19px; margin: 0 auto var(--sp-4); }
.gatepage h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.gatepage p { margin: 0 0 var(--sp-5); color: var(--text-2); font-size: 13px; line-height: 1.6; }

/* ---------- 小屏 ---------- */

@media (max-width: 900px) {
  .brand-sub { display: none; }
}

@media (max-width: 860px) {
  /* 这里也得是 minmax(0,1fr)：写成 1fr 会被阶段条（不折行）撑宽，320/360 宽出横向滚动 */
  .work { grid-template-columns: minmax(0, 1fr); }
  .stages { position: static; }
  .stages .rail { display: flex; gap: var(--sp-1); overflow-x: auto; padding-bottom: var(--sp-2); }
  .stages .group { margin: 0; }
  .stages .group-name { display: none; }
  .stage { white-space: nowrap; }
  .stage-foot { display: none; }
}

@media (max-width: 760px) {
  .topbar-tools #hall-user { display: none; }
}

@media (max-width: 620px) {
  .page { padding: var(--sp-4) var(--sp-4) var(--sp-12); }
  .topbar { padding: 0 var(--sp-4); gap: var(--sp-3); }
  /* 顶栏的模型选择器在这里藏起来，但表单里还有一个（#form-model）——
     只留顶栏那个的话，手机上选不了模型也就提交不了。 */
  .brand-sub, .topbar .inline-field { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; gap: var(--sp-3); }
  /* 卡片头在窄屏要能换行，否则标题被药丸挤成两行、药丸又各自折行，很难看 */
  .card-head { flex-wrap: wrap; row-gap: var(--sp-2); }
  .card-head .spacer { flex-basis: 100%; height: 0; }
  .stats { width: 100%; }
  #job-actions { flex-wrap: wrap; }
  .events .ev { flex-wrap: wrap; }
  .events .ev .msg { flex-basis: 100%; }
}

/* 手机：主要触控目标 44px */
@media (max-width: 620px), (pointer: coarse) {
  .btn, .btn-sm, .seg button, .inline-field.check, details.adv > summary, .gate > summary,
  details.issues > summary { min-height: 44px; }
  .btn-icon { width: 44px; min-width: 44px; }
  input, select { min-height: 44px; }
  input[type="checkbox"] { min-height: 0; }
}
