/* ============================================================
   洗图工作台 — 样式
   ============================================================ */

:root {
  --bg: #08090b;
  --bg-2: #0d0f12;
  --panel: #111318;
  --panel-2: #161920;
  --panel-3: #1c2029;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #e9ebef;
  --text-2: #a3a8b3;
  --text-3: #6c727e;
  --accent: #2dd4bf;
  --accent-dim: rgba(45, 212, 191, 0.14);
  --accent-line: rgba(45, 212, 191, 0.38);
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.9);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(45, 212, 191, 0.07), transparent 62%),
    radial-gradient(900px 520px at 8% 0%, rgba(99, 102, 241, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.mark { width: 26px; height: 26px; color: var(--accent); flex: none; }

.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-text p {
  margin: 0;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.conn i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 0 currentColor;
}

.conn[data-state="on"] i { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.conn[data-state="on"] { color: var(--text); border-color: rgba(52, 211, 153, 0.28); }
.conn[data-state="busy"] i { background: var(--warn); animation: pulse 1.4s infinite; }
.conn[data-state="off"] i { background: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 520;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; flex: none; opacity: 0.75; }
.btn:hover { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.btn.tiny { padding: 4px 9px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }

.btn.primary {
  background: linear-gradient(180deg, #34e0c9, #1fb9a6);
  border-color: rgba(45, 212, 191, 0.55);
  color: #04211e;
  font-weight: 650;
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #48ead4, #24c7b2);
  box-shadow: 0 8px 26px -10px rgba(45, 212, 191, 0.65);
}

.btn.primary.big {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  border-radius: 10px;
  justify-content: space-between;
}

.btn.primary.big .btn-meta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 22px;
  align-items: start;
  max-width: 1460px;
  margin: 0 auto;
  padding: 22px 24px 64px;
}

.col-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------------- 拖拽区 ---------------- */

.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    var(--bg-2);
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  outline: none;
}

.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent-line); background: var(--panel); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-dim); }

.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dz-icon { width: 42px; height: 42px; color: var(--text-3); margin-bottom: 4px; }
.dropzone:hover .dz-icon, .dropzone.drag .dz-icon { color: var(--accent); }
.dz-title { margin: 0; font-size: 14.5px; font-weight: 560; }
.dz-title span { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dz-sub { margin: 0; font-size: 12px; color: var(--text-3); }

/* ---------------- 区块 ---------------- */

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.block-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--text-2);
  letter-spacing: 0;
}

.head-actions { display: flex; align-items: center; gap: 12px; }

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.mini-check input { accent-color: var(--accent); width: 13px; height: 13px; }

/* ---------------- 缩略图网格 ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0a0b0e;
}

.tile .tile-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(4px);
}

.tile:hover .tile-x { opacity: 1; }
.tile .tile-x:hover { background: var(--danger); }

.tile .tile-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 8px 6px;
  font-size: 11px;
  color: #dfe2e7;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile.uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.09) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 1.15s linear infinite;
}

@keyframes shimmer {
  from { background-position: 140% 0; }
  to { background-position: -60% 0; }
}

/* ---------------- 批次分组 ---------------- */

.batch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 14px;
  overflow: hidden;
}

.batch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.024), transparent);
  border-bottom: 1px solid var(--line);
}

.batch-title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.batch-stat { font-size: 12px; color: var(--text-3); }
.batch-head .spacer { flex: 1; }

.batch-jobs { display: flex; flex-direction: column; }

/* ---------------- 任务行 ---------------- */

.job {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.job:last-child { border-bottom: none; }

.job-thumb {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  overflow: hidden;
  background: #0a0b0e;
  border: 1px solid var(--line);
  flex: none;
  position: relative;
}

.job-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.job-main { min-width: 0; }

.job-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.job-sub {
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--mono);
}

.job-sub .err { color: var(--danger); font-family: inherit; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 560;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.chip[data-s="queued"] { color: var(--text-3); }
.chip[data-s="running"] { color: var(--warn); border-color: rgba(251, 191, 36, 0.28); }
.chip[data-s="running"]::before { animation: pulse 1.2s infinite; }
.chip[data-s="done"] { color: var(--ok); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }
.chip[data-s="failed"] { color: var(--danger); border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.08); }
.chip[data-s="canceled"] { color: var(--text-3); }

.job-right { display: flex; align-items: center; gap: 8px; }

.job-results { display: flex; gap: 6px; }

.res-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--accent-line);
  cursor: zoom-in;
  background: #0a0b0e;
  padding: 0;
  display: block;
}

.res-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-thumb:hover { border-color: var(--accent); }

/* ---------------- 侧栏面板 ---------------- */

.col-side { position: sticky; top: 66px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-head { display: flex; align-items: center; justify-content: space-between; }

.panel-head h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  font-weight: 600;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field-label.stack { flex-direction: column; align-items: flex-start; gap: 1px; }
.field-label label { font-size: 12.5px; color: var(--text); font-weight: 520; }
.hint { font-size: 11px; color: var(--text-3); }
.field-label output {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-dim);
}

.field-note { margin: 0; font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* 数字步进 */
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  overflow: hidden;
}

.stepper button {
  width: 36px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  transition: background 0.14s, color 0.14s;
}

.stepper button:hover { background: var(--panel-3); color: var(--text); }

.stepper input {
  flex: 1;
  width: 100%;
  height: 34px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-family: var(--mono);
  font-size: 13.5px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 滑杆 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 33%), rgba(255, 255, 255, 0.1) var(--fill, 33%));
  outline: none;
  margin: 6px 0 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eafffb;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #eafffb;
  border: 2px solid var(--accent);
  cursor: grab;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* 输入 */
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea { resize: vertical; min-height: 62px; line-height: 1.5; font-size: 12.5px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%236c727e' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 12px;
  padding-right: 26px;
}

/* 开关 */
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch span {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  display: block;
  transition: background 0.18s, border-color 0.18s;
  position: relative;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9aa0ac;
  transition: transform 0.18s, background 0.18s;
}

.switch input:checked + span { background: rgba(45, 212, 191, 0.22); border-color: var(--accent-line); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18); }

/* details */
.details { border-top: 1px solid var(--line); padding-top: 12px; }

.details summary {
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.details summary::-webkit-details-marker { display: none; }
.details summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.16s;
  margin-right: 2px;
}

.details[open] summary::before { transform: rotate(45deg); }

.key-row { display: flex; gap: 6px; margin-top: 8px; }
.key-row input { font-family: var(--mono); font-size: 12px; }

/* 队列指示 */
.queue-meter { display: flex; flex-direction: column; gap: 5px; }
.queue-meter .qm-bar { height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.queue-meter .qm-bar i {
  display: block;
  height: 100%;
  width: 32%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: slide 1.4s linear infinite;
}

@keyframes slide {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

.queue-meter span { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

/* 空状态 */
.empty-hint {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px 28px;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.8;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent);
}

.empty-hint p {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.eh-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.eh-steps li { display: flex; flex-direction: column; gap: 3px; }

.eh-steps b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.85;
}

.eh-steps span { font-size: 14px; color: var(--text); font-weight: 520; }
.eh-steps em { font-style: normal; font-size: 11.5px; color: var(--text-3); }

@media (max-width: 720px) {
  .eh-steps { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------------- 抽屉 ---------------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.62);
  backdrop-filter: blur(3px);
  z-index: 60;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 61;
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.2s ease-out;
}

@keyframes drawerIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.drawer-body { overflow-y: auto; padding: 12px 14px 40px; display: flex; flex-direction: column; gap: 8px; }

.hist {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-2);
}

.hist-main { min-width: 0; flex: 1; }
.hist-name { font-family: var(--mono); font-size: 12px; color: var(--text); }
.hist-meta { font-size: 11px; color: var(--text-3); }
.hist-actions { display: flex; gap: 6px; }

/* ---------------- 灯箱 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 5, 7, 0.94);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
}

.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; }
.lb-title { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-actions { display: flex; gap: 8px; flex: none; }

.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: repeating-conic-gradient(#15171c 0 25%, #101216 0 50%) 0 0 / 18px 18px;
  display: grid;
  place-items: center;
  user-select: none;
  touch-action: none;
}

.lb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.lb-before {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
}

.lb-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.75);
  cursor: ew-resize;
  transform: translateX(-1px);
}

.lb-handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #04211e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.lb-tip { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--text-3); }

/* ---------------- 访问码 ---------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}

.gate-box {
  width: min(340px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}

.gate-box h2 { margin: 0; font-size: 16px; }
.gate-box p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.gate-err { color: var(--danger) !important; }

/* ---------------- Toast ---------------- */

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  color: var(--text);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
  animation: toastIn 0.2s ease-out;
  max-width: 88vw;
}

.toast[data-kind="err"] { border-color: rgba(248, 113, 113, 0.45); color: #ffd7d7; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; order: -1; }
  .panel { gap: 12px; margin-bottom: 58px; }
  body { padding-bottom: 86px; }

  #btnStart {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    box-shadow: 0 16px 44px -14px rgba(45, 212, 191, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.07);
  }
}

@media (max-width: 640px) {
  .topbar { padding: 8px 14px; }
  .layout { padding: 14px 14px 48px; gap: 16px; }
  .brand-text p { display: none; }
  .jobs-block .head-actions { gap: 8px; }
  .job { grid-template-columns: 40px minmax(0, 1fr); }
  .job-right { grid-column: 1 / -1; justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .dropzone { padding: 22px 16px; }
  .dz-icon { width: 34px; height: 34px; }
  .conn span { display: none; }
}
