/* ===== H3 影像引擎 — 用户端主题 ===== */
:root {
  --bg: #05070f;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(12, 17, 32, 0.78);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #eef2fb;
  --dim: #8fa0bd;
  --accent: #6366f1;
  --accent2: #22d3ee;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --purple: #c4b5fd;
  --blue: #60a5fa;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}
::selection { background: rgba(99, 102, 241, 0.4); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ---- 极光背景 ---- */
.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 15% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
              radial-gradient(ellipse 70% 55% at 85% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
              var(--bg);
}
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
}
.aurora::before { width: 520px; height: 520px; left: -140px; top: 12%; background: rgba(99, 102, 241, 0.22); animation: drift1 22s ease-in-out infinite alternate; }
.aurora::after { width: 460px; height: 460px; right: -120px; bottom: -80px; background: rgba(34, 211, 238, 0.16); animation: drift2 28s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(90px, 60px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-70px, -50px) scale(1.08); } }

/* ---- 通用 ---- */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.btn-primary {
  background: var(--grad);
  color: #fff; border: none; cursor: pointer;
  border-radius: 12px; padding: 11px 22px; font-size: 14px; font-weight: 600;
  letter-spacing: 0.5px; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.big { width: 100%; padding: 13px 22px; font-size: 15px; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 14px;
  cursor: pointer; font-size: 13px; transition: background .15s ease;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.dim { color: var(--dim); font-size: 12px; }

input[type="text"], input[type="password"], textarea, select {
  background: rgba(5, 8, 18, 0.6);
  border: 1px solid var(--border-strong);
  color: var(--text); border-radius: 12px; padding: 11px 14px;
  font-size: 14px; width: 100%; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
select { cursor: pointer; }

/* ---- 登录 / 注册 ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(420px, 94vw); padding: 36px 34px; position: relative; overflow: hidden; }
.auth-card::before {
  content: ""; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 160px; background: var(--grad); filter: blur(70px); opacity: 0.25; border-radius: 50%;
}
.brand { text-align: center; margin-bottom: 26px; position: relative; }
.brand .logo {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
}
.brand h1 { font-size: 22px; letter-spacing: 1px; }
.brand h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand p { color: var(--dim); font-size: 12.5px; margin-top: 6px; letter-spacing: 2px; }

.auth-tabs { display: flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 20px; position: relative; }
.auth-tabs button {
  flex: 1; background: transparent; border: none; color: var(--dim); padding: 9px 0;
  border-radius: 9px; cursor: pointer; font-size: 14px; transition: all .2s ease;
}
.auth-tabs button.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
.field { margin-bottom: 14px; position: relative; }
.field label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
.auth-err { min-height: 20px; color: var(--red); font-size: 12.5px; margin-bottom: 10px; }
.auth-hint { text-align: center; color: var(--dim); font-size: 12px; margin-top: 14px; }
.machine-panel {
  margin-top: 16px; padding: 13px 14px; border-radius: 12px;
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.28);
  font-size: 12.5px; line-height: 1.7;
}
.machine-panel b { color: var(--green); }
.machine-code-box {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
}
.machine-code-box code {
  flex: 1; background: rgba(0, 0, 0, 0.35); border: 1px dashed rgba(52, 211, 153, 0.4);
  padding: 6px 10px; border-radius: 8px; color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.machine-code-box button { flex-shrink: 0; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px; border-radius: 0;
  border-left: none; border-right: none; border-top: none;
}
.brand-mini { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.brand-mini .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.brand-mini em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.chips { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.chip {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px; font-size: 12.5px; color: var(--text);
}
.chip .val { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.chip.balance .val { color: var(--green); font-weight: 700; font-size: 13.5px; }
.chip.price .val { color: var(--yellow); font-weight: 600; }
.chip.copy-btn { cursor: pointer; transition: all .15s ease; }
.chip.copy-btn:hover { border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.08); }
.chip.copy-btn:hover .val { color: var(--green); }

/* ---- 二级导航 ---- */
.subnav {
  position: sticky; top: 60px; z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 10px 24px; margin-top: -1px;
  border-left: none; border-right: none; border-top: none; border-radius: 0;
  max-width: 1440px; margin-left: auto; margin-right: auto;
}
.subtab {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
  transition: all .18s ease;
}
.subtab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.subtab.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35); }
/* 导航右侧组：API 对接 tab + 脚本生成附加区整体推至最右 */
.subnav-right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
/* 脚本生成 subnav 附加区（描述 + 重置/API配置按钮），仅切到脚本生成时显示 */
.sg-subnav { display: inline-flex; align-items: center; gap: 10px; }
.sg-subnav-sub { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.sg-subnav-btn { padding: 5px 12px !important; font-size: 12px; white-space: nowrap; }
@media (max-width: 900px) { .sg-subnav-sub { display: none; } }

/* ---- 主布局 ---- */
.layout { display: grid; grid-template-columns: minmax(400px, 460px) 1fr; gap: 20px; padding: 24px; max-width: 1440px; margin: 0 auto; align-items: start; }
@media (max-width: 1020px) { .layout { grid-template-columns: 1fr; } .chips { margin-left: 0; } .topbar { flex-wrap: wrap; } }

/* ---- API 对接页 ---- */
.api-layout { display: flex; flex-direction: column; gap: 20px; padding: 24px; max-width: 1080px; margin: 0 auto; }
.api-layout .card { padding: 24px; }
.api-layout h2 { font-size: 16.5px; margin-bottom: 6px; }
.api-layout .lead { color: var(--dim); font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 16px; transition: border-color .15s ease;
}
.key-row:hover { border-color: var(--border-strong); }
.key-row .k-code { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; color: var(--green); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-row .k-label { color: var(--dim); font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-row .k-badge { background: rgba(99, 102, 241, 0.16); border: 1px solid rgba(99, 102, 241, 0.4); color: #a5b4fc; font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.key-row .k-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-danger { background: transparent; border: 1px solid rgba(248, 113, 113, 0.35); color: var(--red); border-radius: 10px; padding: 6px 12px; cursor: pointer; font-size: 12.5px; transition: all .15s ease; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }
.endpoint {
  border: 1px solid var(--border); border-radius: 13px; margin-bottom: 14px; overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.endpoint .ep-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ep-method { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 7px; letter-spacing: .5px; }
.ep-method.get { background: rgba(52, 211, 153, 0.15); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); }
.ep-method.post { background: rgba(96, 165, 250, 0.15); color: var(--blue); border: 1px solid rgba(96, 165, 250, 0.35); }
.ep-path { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.endpoint .ep-body { padding: 12px 16px; color: var(--dim); font-size: 12.5px; line-height: 1.75; }
.endpoint .ep-body code { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; padding: 1px 6px; border-radius: 5px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.endpoint .ep-body b { color: var(--text); }
.param-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.param-table th, .param-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.param-table th { color: var(--dim); font-weight: 600; }
.param-table td code { font-size: 12px; }
.code-block {
  position: relative; background: rgba(3, 6, 14, 0.85); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.code-block .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--dim); }
.code-block pre {
  padding: 16px; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px; line-height: 1.65; color: #d6e0f5;
}
.code-block pre::-webkit-scrollbar { height: 7px; }
.hl-com { color: #5b6b85; }
.hl-kw { color: #c4b5fd; }
.hl-str { color: #7ee0a3; }
.hl-fn { color: #93c5fd; }
.hl-num { color: #fbbf24; }


.card { padding: 24px; }
.card h2 { font-size: 16.5px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.card h2 .sub { font-size: 12px; color: var(--dim); font-weight: 400; margin-left: auto; }

/* ---- 创建任务 ---- */
.step-label { font-size: 13px; color: var(--dim); margin: 18px 0 9px; font-weight: 600; letter-spacing: 0.5px; }
.step-label:first-of-type { margin-top: 0; }
.step-label .count { font-weight: 400; float: right; }
.step-label .count.full { color: var(--yellow); }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  padding: 26px 18px; text-align: center; cursor: pointer; color: var(--dim);
  transition: all .18s ease; font-size: 13px; position: relative;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(99, 102, 241, 0.07); color: var(--text); }
.dropzone.small { padding: 16px 18px; }
.dropzone .dz-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.dropzone input[type="file"] { display: none; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 12px; }
.img-cell { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.3); }
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .15s ease; }
.img-cell img:hover { transform: scale(1.05); }
.img-cell .rm {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.65); color: #fff; border: none; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center; transition: all .15s ease; backdrop-filter: blur(4px);
}
.img-cell .rm:hover { background: var(--red); }

.audio-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.audio-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 12px; font-size: 13px;
}
.audio-row .a-ico { font-size: 16px; }
.audio-row .a-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.audio-row .a-size { color: var(--dim); font-size: 11.5px; }
.audio-row .rm {
  background: transparent; border: none; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 6px;
  border-radius: 6px; transition: all .15s ease;
}
.audio-row .rm:hover { color: var(--red); background: rgba(248, 113, 113, 0.12); }

textarea#prompt { min-height: 110px; resize: vertical; line-height: 1.6; font-family: inherit; }
.char-count { text-align: right; color: var(--dim); font-size: 11.5px; margin-top: 5px; }

.opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.opt-row label { font-size: 12.5px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }
.opt-row select { font-size: 13.5px; }

.cost-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(34, 211, 238, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.22);
}
.cost-row .cost b { font-size: 19px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cost-row .bal { text-align: right; font-size: 12.5px; color: var(--dim); }
.cost-row .bal b { font-size: 15px; color: var(--green); }
.cost-row .bal .low { color: var(--red); }

#submitBtn { margin-top: 18px; }

/* ---- 队列 ---- */
.queue { min-height: 60vh; }
.queue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.queue-head h2 { margin-bottom: 0; }
.queue-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-pill {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; font-size: 12px; color: var(--dim);
}
.stat-pill b { color: var(--text); margin-left: 4px; }

.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-card {
  border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  background: rgba(255, 255, 255, 0.03); transition: border-color .2s ease;
  animation: fadeUp .3s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.task-card:hover { border-color: var(--border-strong); }
.task-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.task-thumbs { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.task-thumb {
  width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.3);
  cursor: zoom-in; transition: border-color .15s ease, transform .15s ease;
}
.task-thumb:hover { border-color: var(--accent); transform: scale(1.04); }
.thumb-more {
  width: 54px; height: 54px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06); border: 1px dashed var(--border-strong);
  color: var(--dim); font-size: 12px;
}
.task-title { flex: 1; min-width: 0; }
.task-title .t-id { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--dim); }
.task-title .t-meta { font-size: 12px; color: var(--dim); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.task-prompt {
  font-size: 13px; color: var(--dim); line-height: 1.55; margin-bottom: 12px;
  word-break: break-all;   /* 提示词完整显示，不截断 */
}

.tag { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.tag.queued { background: rgba(251, 191, 36, 0.13); color: var(--yellow); border: 1px solid rgba(251, 191, 36, 0.3); }
.tag.running { background: rgba(96, 165, 250, 0.13); color: var(--blue); border: 1px solid rgba(96, 165, 250, 0.3); }
.tag.downloading { background: rgba(196, 181, 253, 0.13); color: var(--purple); border: 1px solid rgba(196, 181, 253, 0.3); }
.tag.retry_download { background: rgba(251, 146, 60, 0.13); color: #fdba74; border: 1px solid rgba(251, 146, 60, 0.3); }
.tag.completed { background: rgba(52, 211, 153, 0.13); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.3); }
.tag.failed { background: rgba(248, 113, 113, 0.13); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.3); }

.progress-wrap { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.progress-track { flex: 1; height: 7px; background: rgba(255, 255, 255, 0.07); border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 99px; background: var(--grad);
  transition: width .8s ease; position: relative; overflow: hidden;
}
.progress-fill.active::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-num { font-size: 12px; font-family: ui-monospace, Menlo, monospace; color: var(--dim); min-width: 36px; text-align: right; }
.queue-pos { font-size: 12px; color: var(--yellow); }

.task-error {
  font-size: 12.5px; color: var(--red); background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22); border-radius: 10px;
  padding: 8px 12px; margin: 8px 0 12px; word-break: break-all; line-height: 1.55;
}
.task-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-cost { font-size: 12px; color: var(--yellow); margin-left: auto; }

.task-logs {
  margin-top: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; max-height: 220px; overflow-y: auto;
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; line-height: 1.65; color: var(--dim);
}

.empty {
  text-align: center; padding: 70px 20px; color: var(--dim); font-size: 13.5px;
}
.empty .e-ico { font-size: 40px; display: block; margin-bottom: 14px; opacity: 0.7; }

/* ---- 视频预览弹窗 ---- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 5, 12, 0.82); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: min(860px, 96vw); animation: popIn .25s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.modal-head .m-close { background: transparent; border: none; color: var(--dim); font-size: 17px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.modal-head .m-close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.modal-card video { width: 100%; display: block; border-radius: 0 0 var(--radius) var(--radius); background: #000; max-height: 74vh; }
.modal-foot { display: flex; gap: 10px; padding: 13px 18px; border-top: 1px solid var(--border); justify-content: flex-end; }

/* ---- Toast ---- */
#toastBox { position: fixed; top: 74px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--panel-strong); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 12px 18px; font-size: 13px; backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); animation: slideIn .25s ease; max-width: 340px;
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
