/* 擦除工坊 · 本地工作台 */
:root {
  --bg: #0a0b0e;
  --bg-2: #0d0f13;
  --panel: #111318;
  --panel-2: #151821;
  --line: #23262f;
  --line-soft: #1b1e26;
  --text: #eef0f5;
  --text-2: #b6bccb;
  --muted: #7d8597;
  --ember: #ff5c35;
  --ember-2: #ff8a4c;
  --ember-soft: rgba(255, 92, 53, .12);
  --ok: #43d17a;
  --warn: #ffb020;
  --err: #ff5d5d;
  --info: #6aa9ff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(255, 92, 53, .28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #242833; border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(255, 92, 53, .13), transparent 62%),
    radial-gradient(760px 480px at 92% 4%, rgba(90, 110, 255, .09), transparent 65%),
    radial-gradient(1200px 700px at 50% 108%, rgba(255, 138, 76, .05), transparent 70%);
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(1200px 600px at 50% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(1200px 600px at 50% 0%, #000 10%, transparent 78%);
}

main, .topbar, .footer, .banner { position: relative; z-index: 1; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  background: rgba(10, 11, 14, .78);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .04em; font-weight: 650; }
.brand-text em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--muted);
  margin-top: 3px;
  font-family: var(--mono);
}
.top-actions { display: flex; align-items: center; gap: 10px; }

/* ---------------- 工具目录 ---------------- */
.catalog {
  position: sticky;
  top: 69px;
  z-index: 19;
  padding: 8px clamp(18px, 4vw, 44px) 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  background: rgba(10, 11, 14, .92);
}
.cat-strip, .tool-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar, .tool-strip::-webkit-scrollbar { display: none; }
.tool-strip { gap: 6px; margin-top: 7px; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cat-chip:hover { color: var(--text); border-color: #3a3f4d; }
.cat-chip.on {
  color: #ffd0b8;
  border-color: rgba(255, 138, 76, .45);
  background: linear-gradient(135deg, rgba(255, 92, 53, .18), rgba(255, 138, 76, .06));
  box-shadow: 0 0 0 1px rgba(255, 92, 53, .08) inset;
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tool-chip:hover { color: var(--text-2); background: rgba(255, 255, 255, .03); }
.tool-chip.on { color: var(--text); background: rgba(255, 255, 255, .055); border-color: var(--line); }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px rgba(67, 209, 122, .7); }

.tool-page { padding: 34px 0 70px; }
.tool-hero { max-width: 780px; }
.tool-hero h1 { margin-top: 12px; font-size: clamp(28px, 3vw, 38px); line-height: 1.2; letter-spacing: -.01em; font-weight: 680; }
.tool-hero p { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.tool-runner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel);
}
.runner-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.runner-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.runner-title span { font-size: 11px; font-weight: 400; color: var(--muted); }
.runner-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed #2c313d;
  border-radius: 12px;
  background: rgba(255, 255, 255, .012);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.runner-drop:hover, .runner-drop.dragover { border-color: rgba(255, 138, 76, .55); background: rgba(255, 92, 53, .04); }
.runner-drop-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 138, 76, .1);
  color: #ffb18f;
}
.runner-drop-icon svg { width: 20px; height: 20px; }
.runner-drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.runner-drop-text b { font-size: 12.5px; font-weight: 600; }
.runner-drop-text span { font-size: 11px; color: var(--muted); }
.runner-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #0d0f14;
  font-size: 12px;
}
.runner-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.runner-file-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.tool-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.tool-field label { font-size: 11px; color: var(--muted); }
.tool-field small { font-size: 10px; color: #5f6777; }
.tool-field.check { flex-direction: row; align-items: center; gap: 7px; padding-top: 18px; }
.tool-field.check input { width: 14px; height: 14px; }
.runner-actions { display: flex; align-items: center; gap: 12px; }
.viewer-image { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: 12px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.status-chip.ok i { background: var(--ok); box-shadow: 0 0 10px rgba(67, 209, 122, .6); }
.status-chip.warn i { background: var(--warn); box-shadow: 0 0 10px rgba(255, 176, 32, .55); }
.status-chip.err i { background: var(--err); }
.status-chip.ok { color: #cfeedd; }
.status-chip.warn { color: #ffe3ad; }
.user-chip i { background: #6aa9ff; box-shadow: 0 0 10px rgba(106, 169, 255, .5); }
.user-chip { color: #cfe1ff; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 550;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.ghost { background: rgba(255, 255, 255, .03); border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: #3a3f4d; color: var(--text); background: rgba(255,255,255,.05); }
.btn.primary {
  background: linear-gradient(135deg, var(--ember) 0%, #ff7c3f 100%);
  color: #1a0a04;
  border-color: rgba(255, 138, 76, .5);
  box-shadow: 0 12px 30px -12px rgba(255, 92, 53, .8);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn.big { height: 46px; padding: 0 24px; font-size: 14.5px; border-radius: 12px; }
.ico { width: 15px; height: 15px; flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  transition: .18s ease;
}
.icon-btn:hover { color: var(--text); border-color: #3a3f4d; background: rgba(255,255,255,.05); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 15px; height: 15px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  font-size: 12.5px;
  transition: color .16s ease;
}
.link-btn:hover { color: var(--ember-2); }

/* ---------------- 主区 ---------------- */
main {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 70px;
  min-height: calc(100vh - 220px);
}

.banner {
  width: min(1280px, calc(100% - 36px));
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 176, 32, .28);
  background: rgba(255, 176, 32, .07);
  color: #ffd894;
  font-size: 13px;
}

.hidden { display: none !important; }

/* ---------------- Hero ---------------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 2px 30px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--ember-2);
  opacity: .9;
}
.eyebrow .line { width: 26px; height: 1px; background: linear-gradient(90deg, var(--ember), transparent); }
.hero h1 {
  margin-top: 14px;
  font-size: clamp(30px, 3.5vw, 46px);
  line-height: 1.16;
  letter-spacing: -.02em;
  font-weight: 680;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ff6a3d 0%, #ffb37a 60%, #ff8a4c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin-top: 14px;
  max-width: 560px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}
.hero-stats { display: flex; gap: 8px; flex: none; }
.stat {
  min-width: 96px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.006));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat b {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* ---------------- 面板 ---------------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
  gap: 16px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .022), transparent 40%),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2, .section-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: .02em;
}
.no {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ember-2);
  border: 1px solid rgba(255, 138, 76, .3);
  background: var(--ember-soft);
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: .06em;
}
.muted { color: var(--muted); font-size: 12px; }

/* ---------------- 上传 ---------------- */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 396px;
  border: 1.5px dashed #2c313d;
  border-radius: 14px;
  background: radial-gradient(600px 200px at 50% 0%, rgba(255, 92, 53, .05), transparent 70%);
  transition: border-color .18s ease, background .18s ease;
  text-align: center;
  padding: 28px;
  outline: none;
}
.drop:hover, .drop:focus-visible { border-color: rgba(255, 138, 76, .55); background: radial-gradient(600px 240px at 50% 0%, rgba(255, 92, 53, .09), transparent 70%); }
.drop.dragover { border-color: var(--ember); background: rgba(255, 92, 53, .08); }
.drop-art { color: var(--ember-2); opacity: .85; }
.drop-art svg { width: 58px; height: 58px; }
.drop h3 { font-size: 15.5px; font-weight: 600; }
.drop p { max-width: 330px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .012);
}
.flow-step { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.flow-step b {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: #ffbf9a;
  border: 1px solid rgba(255, 138, 76, .24);
  background: rgba(255, 138, 76, .06);
  padding: 2px 5px;
  border-radius: 5px;
}
.flow i { font-style: normal; color: #3a404d; font-size: 11px; }

.preview { display: flex; flex-direction: column; gap: 12px; }
.stage {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 0;
  overflow: visible;
  border: 1px solid var(--line);
  line-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.video-wrap { position: relative; max-width: 100%; width: fit-content; line-height: 0; }
.stage video { display: block; max-width: 100%; max-height: 430px; width: auto; height: auto; background: #000; }
.box-layer { position: absolute; inset: 0; touch-action: none; cursor: crosshair; user-select: none; }
.stage-tip {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 9, 12, .82);
  border: 1px solid rgba(255, 138, 76, .35);
  color: #ffd0b8;
  font-size: 11.5px;
  line-height: 1.4;
  pointer-events: none;
}
.player {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0d0f14;
}
.pbtn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.pbtn:hover { color: var(--text); border-color: #3a3f4d; background: rgba(255, 255, 255, .05); }
.pbtn svg { width: 14px; height: 14px; }
.ptime {
  flex: none;
  min-width: 38px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.player input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.player input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ember) 0%, var(--ember-2) var(--fill, 0%),
    #242833 var(--fill, 0%), #242833 100%);
}
.player input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #ffc4a8;
  border: 2px solid #241009;
  box-shadow: 0 0 8px rgba(255, 92, 53, .45);
}
.player input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: #242833; }
.player input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--ember), var(--ember-2)); }
.player input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #241009; border-radius: 50%; background: #ffc4a8; }
.mute-x { transition: opacity .15s ease; }
.player.unmuted .mute-x { opacity: 0; }
.box {
  position: absolute;
  border: 1.5px solid rgba(255, 92, 53, .8);
  background: rgba(255, 92, 53, .1);
  border-radius: 4px;
  cursor: move;
  touch-action: none;
  transition: background .15s ease, box-shadow .15s ease;
}
.box:hover { background: rgba(255, 92, 53, .2); }
.box.on {
  border-color: #ff5c35;
  background: rgba(59, 130, 246, .30);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .45), 0 0 18px -6px rgba(59, 130, 246, .85);
  z-index: 2;
}
.box::after {
  content: attr(data-label);
  position: absolute;
  top: -9px;
  left: -1px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px 4px 0 0;
  background: var(--ember);
  color: #1a0a04;
}
.box.draft { border-style: dashed; background: rgba(59, 130, 246, .18); pointer-events: none; }
.hbar {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #ffb18f;
  border: 1px solid #3a1608;
  display: none;
  z-index: 3;
}
.box.on .hbar { display: block; }
.hbar.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.hbar.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.hbar.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.hbar.se { right: -5px; bottom: -5px; cursor: nwse-resize; }

.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.file-id { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.file-name { font-size: 13px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { color: var(--muted); font-size: 11.5px; font-family: var(--mono); }

.box-editor {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, .014);
}
.box-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.box-editor-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 560; color: var(--text-2); }
.box-count { font-family: var(--mono); font-size: 9.5px; color: var(--muted); border: 1px solid var(--line); padding: 1px 7px; border-radius: 999px; }
.box-editor-actions { display: flex; align-items: center; gap: 6px; }
.box-editor-actions .btn { height: 28px; padding: 0 9px; font-size: 11.5px; }
.box-tip { margin-top: 8px; font-size: 10.8px; color: var(--muted); line-height: 1.65; }
.box-warn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 176, 32, .3);
  background: rgba(255, 176, 32, .07);
  font-size: 10.8px;
  line-height: 1.6;
  color: #ffd894;
}
.box-warn .btn { height: 26px; padding: 0 8px; font-size: 10.5px; flex: none; }
.box-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.box-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 64px 24px;
  gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: #0d0f14;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.box-item:hover { border-color: #333947; }
.box-item.on { border-color: rgba(59, 130, 246, .55); background: rgba(59, 130, 246, .07); }
.box-item .idx {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 138, 76, .28);
  background: rgba(255, 138, 76, .1);
  color: #ffbf9a;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
}
.box-item .coords { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.box-item label { display: flex; align-items: center; gap: 3px; min-width: 0; font-size: 9.5px; color: var(--muted); }
.box-item label span { flex: none; }
.box-item input { height: 27px; min-width: 0; padding: 0 5px; text-align: right; font-size: 11px; font-family: var(--mono); border-radius: 7px; }
.box-item .dim { font-family: var(--mono); font-size: 9px; color: #6f7788; text-align: right; white-space: nowrap; }
.box-item .del { width: 24px; height: 24px; border-radius: 6px; color: #8f97a8; font-size: 12px; line-height: 1; }
.box-item .del:hover { color: #ff9a9a; background: rgba(255, 93, 93, .1); }
.box-empty {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--line-soft);
  border-radius: 9px;
  text-align: center;
  font-size: 11px;
  color: #5f6777;
}
@media (max-width: 720px) {
  .box-editor-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .box-editor-actions { width: 100%; display: grid; grid-template-columns: repeat(2, 1fr); }
  .box-warn { flex-direction: column; align-items: flex-start; }
  .box-item { grid-template-columns: 22px minmax(0, 1fr) 24px; }
  .box-item .dim { display: none; }
  .box-item .coords { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------- 方案 ---------------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode {
  text-align: left;
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
  transition: .18s ease;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mode:hover { border-color: #343a48; background: rgba(255,255,255,.032); }
.mode.active {
  border-color: rgba(255, 92, 53, .6);
  background: linear-gradient(180deg, rgba(255, 92, 53, .11), rgba(255, 92, 53, .03));
  box-shadow: 0 0 0 1px rgba(255, 92, 53, .12) inset, 0 14px 30px -22px rgba(255, 92, 53, .9);
}
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mode-name { font-size: 14px; font-weight: 620; }
.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .02em;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.ac { color: #ffbf9a; border-color: rgba(255, 138, 76, .32); background: rgba(255, 138, 76, .08); }
.mode p { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.mode-foot { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; color: #9aa2b4; margin-top: 2px; }
.mode-foot .rec { color: var(--ember-2); }

.advanced { margin-top: 16px; display: flex; flex-direction: column; gap: 11px; }
.row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 10px; }
.row label { font-size: 12px; color: var(--muted); }
.row-inline { display: flex; gap: 8px; min-width: 0; }
.row-inline > * { min-width: 0; flex: 1; }

select, input[type="number"], input[type="text"], input[type="password"], input:not([type]) {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d0f14;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
  width: 100%;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6f7788 50%), linear-gradient(135deg, #6f7788 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
option { background: #0d0f14; color: var(--text); }
select:focus, input:focus { border-color: rgba(255, 138, 76, .55); box-shadow: 0 0 0 3px rgba(255, 92, 53, .09); }
input::placeholder { color: #5c6474; }

.seg { display: inline-flex; padding: 3px; gap: 3px; background: #0d0f14; border: 1px solid var(--line); border-radius: 10px; width: fit-content; }
.seg button {
  height: 29px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  transition: .16s ease;
  white-space: nowrap;
}
.seg button.on { background: rgba(255, 92, 53, .14); color: #ffc2a6; box-shadow: inset 0 0 0 1px rgba(255, 138, 76, .22); }

.more { border-top: 1px dashed var(--line-soft); padding-top: 10px; }
.more summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; font-family: var(--mono); color: var(--ember-2); }
.more[open] summary::before { content: "−"; }
.more-body { display: flex; flex-direction: column; gap: 9px; padding-top: 10px; }

.std-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, .018);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.estimate { display: flex; flex-direction: column; gap: 1px; }
.estimate span { font-size: 11px; color: var(--muted); }
.estimate b { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.submit-progress { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.bar { height: 4px; border-radius: 99px; background: #1b1e26; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--ember), var(--ember-2)); transition: width .3s ease; }
.submit-progress span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ---------------- 任务 ---------------- */
.tasks-section { margin-top: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-actions { display: flex; align-items: center; gap: 10px; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.004)), var(--panel);
}
.task:hover { border-color: #2b303c; }
.task-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.task-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kind {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--text-2);
}
.kind.precision { color: #ffc4a9; border-color: rgba(255, 138, 76, .3); background: rgba(255, 138, 76, .07); }
.kind.tool { color: #9cc4ff; border-color: rgba(106, 169, 255, .3); background: rgba(106, 169, 255, .08); }
.task-title { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-sub { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); flex-wrap: wrap; }
.task-sub .badge { font-family: var(--sans); }
.state { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.state.running { color: #ffc6a9; border-color: rgba(255, 138, 76, .35); background: rgba(255, 138, 76, .08); }
.state.ok { color: #b8f0cd; border-color: rgba(67, 209, 122, .32); background: rgba(67, 209, 122, .08); }
.state.err { color: #ffc0c0; border-color: rgba(255, 93, 93, .32); background: rgba(255, 93, 93, .08); }
.state.dim { color: var(--muted); }
.task-bar { height: 3px; border-radius: 99px; background: #1a1d25; overflow: hidden; }
.task-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-2)); transition: width .5s ease; }
.task-bar i.indeterminate { width: 32% !important; animation: slide 1.5s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -32%; } 100% { margin-left: 100%; } }
.task-stage { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.task-stage .err-text { color: #ff9f9f; }
.task-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.task-actions .btn { height: 30px; padding: 0 10px; font-size: 11.5px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px 20px;
  border: 1px dashed var(--line-soft);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.empty svg { width: 54px; height: 54px; opacity: .5; }
.empty p { font-size: 12.5px; }

/* ---------------- 页脚 ---------------- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, .045);
  padding: 16px clamp(18px, 4vw, 44px) 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
}
.foot-left, .foot-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.foot-left .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(67, 209, 122, .6); }
.foot-left span:not(.dot) { font-family: var(--mono); }
.sep { opacity: .4; }

/* ---------------- 弹窗 ---------------- */
.dlg {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow: visible;
}
.dlg.wide { width: min(860px, calc(100% - 28px)); }
.dlg::backdrop { background: rgba(5, 6, 9, .72); backdrop-filter: blur(6px); }
.dlg-card {
  border: 1px solid #2a2f3a;
  border-radius: 18px;
  background: linear-gradient(180deg, #14171e, #0f1116);
  box-shadow: 0 40px 100px -30px #000;
  padding: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dlg-head h2 { font-size: 16px; font-weight: 620; }
.dlg-head .icon-btn { font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; color: var(--text-2); }
.field small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; font-family: var(--mono); letter-spacing: .02em; }
.key-tools { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.key-link { color: #ffb18f; font-size: 11.5px; text-decoration: none; }
.key-link:hover { color: #ffd0b8; text-decoration: underline; }
#copyKeyBtn { height: 27px; padding: 0 10px; font-size: 11px; }
#settingsDlg.user-mode .platform-only { display: none !important; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.dlg-lead { color: var(--text-2); font-size: 12.5px; line-height: 1.75; }
.dlg-note { color: var(--muted); font-size: 11.5px; margin-top: 10px; line-height: 1.7; }

.pwd-box { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 13px; }
.pwd-box summary { cursor: pointer; font-size: 12px; color: #9aa3b3; list-style: none; user-select: none; }
.pwd-box summary::-webkit-details-marker { display: none; }
.pwd-box summary::before { content: '+'; display: inline-block; width: 14px; color: #ffb18f; }
.pwd-box[open] summary::before { content: '−'; }
.pwd-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.pwd-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.pwd-actions .muted { font-size: 11px; }

.kv-list { margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 500; color: var(--text-2); font-size: 11.5px; }
.mono { font-family: var(--mono); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.exe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.exe-cell { padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.018); display: flex; flex-direction: column; gap: 3px; }
.exe-cell span { font-size: 11px; color: var(--muted); }
.exe-cell b { font-size: 13px; font-weight: 550; }
.code {
  margin: 0;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0a0c10;
  color: #b9c2d4;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.viewer video { width: 100%; max-height: 62vh; border-radius: 12px; background: #000; display: block; }

/* ---------------- 提交遮罩 ---------------- */
.submit-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 9, .55);
  opacity: 1;
  transition: opacity .45s ease;
}
.submit-mask.fade { opacity: 0; pointer-events: none; }
.submit-mask-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid #2f3542;
  background: #14171e;
  box-shadow: 0 30px 80px -30px #000;
  max-width: min(92vw, 420px);
}
.submit-mask-card b { display: block; font-size: 13.5px; color: #fff; }
.submit-mask-card span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 138, 76, .22);
  border-top-color: #ff8a4c;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; right: 20px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 120; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid #2c313d;
  background: #15181f;
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 18px 40px -18px #000;
  animation: toastIn .24s ease both;
  max-width: 380px;
}
.toast.ok { border-color: rgba(67, 209, 122, .32); }
.toast.err { border-color: rgba(255, 93, 93, .35); }
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); flex: none; }
.toast.ok i { background: var(--ok); }
.toast.err i { background: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-stats { width: 100%; }
  .stat { flex: 1; }
  .tool-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  main { width: calc(100% - 24px); }
  .topbar { padding: 12px 12px; }
  .catalog { top: 65px; padding: 6px 12px 8px; }
  .tool-fields { grid-template-columns: 1fr; }
  .runner-actions { flex-direction: column; align-items: stretch; }
  .tool-foot { flex-direction: column; align-items: flex-start; }
  .brand-text em { display: none; }
  .top-actions .exe-btn span { display: none; }
  .hero h1 { font-size: 30px; }
  .hero-stats { gap: 6px; }
  .stat { min-width: 0; padding: 11px 12px; }
  .stat b { font-size: 18px; }
  .panel { padding: 14px; }
  .row { grid-template-columns: 1fr; align-items: stretch; gap: 6px; }
  .row-inline { flex-direction: column; }
  .submit-bar { flex-direction: column; align-items: stretch; }
  .submit-bar .btn { width: 100%; }
  .task { grid-template-columns: 1fr; }
  .task-actions { justify-content: flex-end; }
  .exe-grid { grid-template-columns: 1fr; }
  .dlg-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
