/* ============================================================
   深度伪造鉴别与 AI 攻防实验平台 —— 样式表
   深色取证实验室风格
   ============================================================ */

:root {
  --bg: #070a12;
  --bg-soft: #0b101c;
  --panel: #0f1626;
  --panel-2: #141d31;
  --panel-3: #1a2438;
  --line: #22304a;
  --line-soft: #1a2438;

  --text: #e8eefc;
  --text-dim: #94a3bb;
  --text-faint: #61708c;

  --cyan: #22d3ee;
  --cyan-dim: #0e7490;
  --violet: #818cf8;
  --violet-dim: #4c1d95;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb5c7d;
  --red: #f43f5e;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1000px 500px at 12% -8%, rgba(34, 211, 238, 0.11), transparent 62%),
    radial-gradient(800px 460px at 88% 4%, rgba(129, 140, 248, 0.10), transparent 60%),
    linear-gradient(180deg, #070a12 0%, #060910 100%);
  background-attachment: fixed;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22304a; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2e4166; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  background: rgba(8, 12, 20, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

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

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(34, 211, 238, 0.22), rgba(129, 140, 248, 0.22));
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 22px -6px rgba(34, 211, 238, 0.55);
  flex: none;
}
.brand-mark svg { width: 21px; height: 21px; }

.brand-text h1 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand-text p {
  margin: 0;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.6px;
  font-family: var(--mono);
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--mono);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.pill.ok { border-color: rgba(52, 211, 153, 0.42); color: var(--green); background: rgba(52, 211, 153, 0.08); }
.pill.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pill.warn { border-color: rgba(251, 191, 36, 0.4); color: var(--amber); background: rgba(251, 191, 36, 0.07); }
.pill.warn .dot { background: var(--amber); }

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

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #33456b; background: #1b2740; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, #0e7490, #155e75);
  border-color: rgba(34, 211, 238, 0.5);
  color: #e0fbff;
  box-shadow: 0 6px 20px -10px rgba(34, 211, 238, 0.9);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  border-color: var(--cyan);
}

.btn-accent {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  border-color: rgba(129, 140, 248, 0.5);
  color: #e6e8ff;
  font-weight: 600;
}
.btn-accent:hover:not(:disabled) { background: linear-gradient(135deg, #4f46e5, #4338ca); border-color: var(--violet); }

.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { border-color: rgba(244, 63, 94, 0.4); color: #fda4b3; background: rgba(244, 63, 94, 0.08); }

/* ---------------------------- 主容器 ---------------------------- */

.app {
  max-width: 1660px;
  margin: 0 auto;
  padding: 18px 22px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: linear-gradient(180deg, rgba(20, 29, 49, 0.86), rgba(13, 19, 33, 0.86));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 8px;
}
.panel-head .idx {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 5px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 16px; }

.hint { font-size: 11.5px; color: var(--text-faint); }

/* ---------------------------- 步骤条 / 工具栏 ---------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(7, 10, 18, 0.66);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
}

.seg {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.seg:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.seg.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(129, 140, 248, 0.18));
  color: #d6f8ff;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35);
  font-weight: 600;
}

.vsep { width: 1px; align-self: stretch; background: var(--line-soft); margin: 2px 4px; }

/* ---------------------------- 编辑画布区 ---------------------------- */

.stage {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  gap: 0;
  align-items: stretch;
}

.stage-side { display: flex; flex-direction: column; min-width: 0; }

.stage-side-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.stage-side-head .tag {
  font-size: 10.5px;
  font-family: var(--mono);
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid;
}
.tag-orig { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.35); background: rgba(56, 189, 248, 0.09); }
.tag-fake { color: #fda4af; border-color: rgba(251, 113, 133, 0.35); background: rgba(251, 113, 133, 0.09); }
.stage-side-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.stage-side-head .meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 14px;
  background:
    linear-gradient(45deg, #0a0f19 25%, transparent 25%, transparent 75%, #0a0f19 75%) 0 0 / 22px 22px,
    linear-gradient(45deg, #0a0f19 25%, transparent 25%, transparent 75%, #0a0f19 75%) 11px 11px / 22px 22px,
    #070b13;
  overflow: hidden;
}

.canvas-wrap canvas {
  max-width: 100%;
  max-height: 460px;
  display: block;
  border-radius: 8px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
  image-rendering: auto;
}

.canvas-wrap canvas.editing { cursor: crosshair; }

.dropzone {
  position: absolute;
  inset: 12px;
  border: 1.5px dashed #2a3b5a;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-faint);
  transition: all 0.18s ease;
  cursor: pointer;
  padding: 22px;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.05);
  color: var(--cyan);
}
.dropzone .dz-icon { width: 42px; height: 42px; margin: 0 auto 10px; opacity: 0.7; }
.dropzone strong { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 4px; }
.dropzone span { font-size: 11.5px; }

.stage-side-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--mono);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 36px;
  align-items: center;
}

.vs-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
}
.vs-mid .line { width: 1px; flex: 1; background: linear-gradient(180deg, transparent, var(--line), transparent); }
.vs-mid .badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--violet);
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(129, 140, 248, 0.09);
  letter-spacing: 0.5px;
}

/* 编辑工具浮层 */
.edit-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  background: rgba(9, 13, 22, 0.6);
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: #3a4d73; color: var(--text); }
.chip.active {
  background: rgba(251, 113, 133, 0.14);
  border-color: rgba(251, 113, 133, 0.5);
  color: #fecdd3;
  font-weight: 600;
}

/* ---------------------------- 检测区 ---------------------------- */

.detect-grid {
  display: grid;
  grid-template-columns: 268px 1fr 268px;
  gap: 14px;
  padding: 16px;
}

.score-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 13, 22, 0.62);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
}
.score-card.is-fake { border-color: rgba(251, 113, 133, 0.28); }

.score-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.5px; }
.score-head .dotmark { width: 7px; height: 7px; border-radius: 50%; }

.gauge { position: relative; display: grid; place-items: center; margin: 2px 0; }
.gauge svg { width: 158px; height: 158px; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: #1a2438; stroke-width: 9; }
.gauge .bar { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.7s cubic-bezier(.2,.8,.2,1), stroke 0.4s; }
.gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.gauge-center .val { font-size: 30px; font-weight: 700; font-family: var(--mono); line-height: 1.05; letter-spacing: -1px; }
.gauge-center .unit { font-size: 10px; color: var(--text-faint); font-family: var(--mono); letter-spacing: 1px; }

.verdict {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid;
  letter-spacing: 0.3px;
}
.verdict.safe { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.09); }
.verdict.mid { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.09); }
.verdict.bad { color: #fda4af; border-color: rgba(251, 92, 125, 0.45); background: rgba(251, 92, 125, 0.1); }
.verdict.idle { color: var(--text-faint); border-color: var(--line); background: transparent; font-weight: 500; }

.metric-list { display: flex; flex-direction: column; gap: 8px; }
.metric {
  display: grid;
  grid-template-columns: 82px 1fr 42px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}
.metric .mname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .mtrack { height: 5px; border-radius: 3px; background: #1a2438; overflow: hidden; }
.metric .mfill { height: 100%; border-radius: 3px; transition: width 0.6s ease, background 0.3s; }
.metric .mval { font-family: var(--mono); text-align: right; font-size: 10.5px; color: var(--text-faint); }

/* 证据 / 热力图 中列 */
.detect-mid { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.evidence-box {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 13, 22, 0.62);
  padding: 13px;
  overflow: auto;
  max-height: 320px;
  min-height: 150px;
}
.evidence-box h4 { margin: 0 0 9px; font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.6px; display: flex; align-items: center; gap: 7px; }
.ev {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed #1c2740;
  font-size: 12px;
  line-height: 1.55;
  color: #b9c6dc;
}
.ev:first-of-type { border-top: none; }
.ev .lv {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  height: 17px;
  line-height: 15px;
  margin-top: 1px;
  letter-spacing: 0.4px;
  border: 1px solid;
}
.lv-high { color: #fda4af; border-color: rgba(251, 92, 125, 0.45); background: rgba(251, 92, 125, 0.1); }
.lv-mid { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.lv-low { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.lv-info { color: #93c5fd; border-color: rgba(147, 197, 253, 0.35); background: rgba(147, 197, 253, 0.08); }
.ev .evtext { flex: 1; }
.ev .evtext b { color: #e8eefc; font-weight: 600; }

.empty-hint {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 120px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
  line-height: 1.9;
}

/* 热力图 */
.heat-box { border: 1px solid var(--line); border-radius: 12px; background: rgba(9, 13, 22, 0.62); padding: 12px; }
.heat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.heat-head h4 { margin: 0; font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.6px; }
.heat-head .spacer { margin-left: auto; }
.heat-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.heat-item { position: relative; border-radius: 8px; overflow: hidden; background: #060910; border: 1px solid #182238; }
.heat-item canvas { width: 100%; display: block; }
.heat-item .cap {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 9.5px; font-family: var(--mono);
  background: rgba(4, 7, 13, 0.82);
  color: #a8b6cd; padding: 1px 6px; border-radius: 4px;
}
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10px; color: var(--text-faint); font-family: var(--mono); }
.heat-legend .grad { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #0b2a4a, #1d6bb0, #4fd1c5, #f6e05e, #f56565); }

/* AI 总结 */
.ai-summary {
  display: flex;
  gap: 13px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.07), transparent 65%);
}
.ai-avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(129, 140, 248, 0.25), rgba(34, 211, 238, 0.2));
  border: 1px solid rgba(129, 140, 248, 0.38);
}
.ai-avatar svg { width: 18px; height: 18px; }
.ai-body { flex: 1; min-width: 0; }
.ai-body .ai-title { font-size: 11.5px; color: var(--violet); font-family: var(--mono); letter-spacing: 0.6px; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.ai-body .ai-text { font-size: 12.5px; color: #c3cfe4; line-height: 1.85; white-space: pre-wrap; }
.ai-body .ai-text .em { color: #e8eefc; font-weight: 600; }

/* ---------------------------- 攻防区 ---------------------------- */

.adv-grid { display: grid; grid-template-columns: 320px 1fr 380px; gap: 14px; padding: 16px; }

.ctrl-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 13, 22, 0.62);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.ctrl-row { display: flex; flex-direction: column; gap: 5px; }
.ctrl-row .lab { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.ctrl-row .lab .v { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--cyan); }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: #1e2b44;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  border: 2px solid #071019;
  box-shadow: 0 0 10px -1px rgba(34, 211, 238, 0.85);
  cursor: pointer;
}

.switch-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.switch {
  position: relative;
  width: 34px; height: 19px;
  border-radius: 999px;
  background: #1e2b44;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.18s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #64748b;
  transition: all 0.18s;
}
.switch.on { background: rgba(34, 211, 238, 0.24); border-color: rgba(34, 211, 238, 0.55); }
.switch.on::after { left: 17px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.chart-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 13, 22, 0.62);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chart-card h4 { margin: 0 0 4px; font-size: 12px; color: var(--text-dim); font-family: var(--mono); letter-spacing: 0.5px; }
.chart-card .sub { font-size: 11px; color: var(--text-faint); margin-bottom: 10px; }
#advChart { width: 100%; height: 236px; display: block; }

.adv-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.adv-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.adv-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #141d2f;
  color: #b9c6dc;
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.adv-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.adv-table .sv { font-weight: 700; }
.adv-table .delta-up { color: #6ee7b7; }
.adv-table .delta-down { color: #fda4af; }
.table-scroll { overflow: auto; max-height: 240px; }

/* ---------------------------- 弹窗 ---------------------------- */

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 24px;
}
.modal-mask.show { display: grid; }
.modal {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px #000;
  overflow: hidden;
  animation: mIn 0.22s cubic-bezier(.2,.9,.3,1);
}
@keyframes mIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--text-faint); background: none; border: none; font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; max-height: 66vh; overflow: auto; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-dim); }
.field input[type="text"], .field input[type="password"], .field select, .field textarea {
  background: #080d17;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-family: var(--mono);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan-dim); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }
.field .tip { font-size: 11px; color: var(--text-faint); line-height: 1.7; }

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

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-end;
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #101a2c;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  padding: 11px 15px;
  min-width: 250px;
  max-width: 400px;
  box-shadow: 0 16px 34px -14px #000;
  font-size: 12.5px;
  color: #cfd9ea;
  animation: tIn 0.24s ease;
}
@keyframes tIn { from { opacity: 0; transform: translateX(18px); } }
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--amber); }
.toast b { display: block; margin-bottom: 2px; color: var(--text); font-size: 12.5px; }

/* ---------------------------- 加载 ---------------------------- */

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(34, 211, 238, 0.25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.overlay-busy {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(2px);
  display: none;
  place-items: center;
  z-index: 10;
  border-radius: 12px;
}
.overlay-busy.show { display: grid; }
.overlay-busy .box { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; color: var(--cyan); font-family: var(--mono); }
.overlay-busy .spinner { width: 26px; height: 26px; border-width: 3px; }

/* 进度条 */
.progress { height: 3px; background: #16203300; }

/* ---------------------------- 其他 ---------------------------- */

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

.kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  color: var(--text-dim);
  background: #0b1220;
}

.badge-mode {
  font-size: 10px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}
.badge-local { color: #7dd3fc; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-vlm { color: #c4b5fd; background: rgba(139, 92, 246, 0.13); border: 1px solid rgba(139, 92, 246, 0.32); }

.divider-h { height: 1px; background: var(--line-soft); margin: 2px 0; }

.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); padding: 0 16px; }
.tab-btn {
  appearance: none; border: none; background: none;
  color: var(--text-faint);
  font-family: inherit; font-size: 12.5px;
  padding: 10px 4px; margin-right: 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text-dim); }
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 600; }

@media (max-width: 1280px) {
  .detect-grid { grid-template-columns: 230px 1fr 230px; }
  .adv-grid { grid-template-columns: 280px 1fr; }
  .adv-grid > .adv-right { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .vs-mid { flex-direction: row; padding: 8px 0; }
  .vs-mid .line { height: 1px; width: auto; flex: 1; background: linear-gradient(90deg, transparent, var(--line), transparent); }
  .detect-grid { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr; }
}
