/* ============================================================================
 * 视频换背景 · 子页样式（2026-11-07）
 * ----------------------------------------------------------------------------
 * 🔴 作用域铁律：所有选择器都以 #sub-videobg 开头（配合全站唯一的 .bs- 类），
 *    绝不写裸类名，避免污染其它子页。
 * 🔴 显隐复用全站 .subpanel / .subpanel.active，本文件不写任何 display:none 的裸 id 规则。
 * 🔴 配色：站内暖橙浅色，白卡片 + 橙点缀，不做深色科技风。
 * ========================================================================== */

#sub-videobg {
  --bs-brand: #f95901;
  --bs-brand-2: #ff8a45;
  --bs-ink: #2b1c12;
  --bs-ink-2: #6b5a4e;
  --bs-mut: #9b887a;
  --bs-line: #f0e2d6;
  --bs-paper: #fffdfa;
  --bs-warm: #fff7f1;
  padding: 0;                 /* 子页块级内缩 0：左右留白交给 .main */
}
#sub-videobg #bsApp { padding: 0; margin: 0; }
#sub-videobg #bsApp * { box-sizing: border-box; }

/* ---------------------------------------------------------------- hero */
#sub-videobg .bs-wrap { display: block; width: 100%; }
#sub-videobg .bs-hero {
  margin-bottom: 14px; padding: 18px 18px 17px; border-radius: 18px;
  background: linear-gradient(140deg, #fff3e8 0%, #ffe9d8 100%);
  border: 1px solid #ffdcc0;
}
#sub-videobg .bs-hero-t { font-size: 20px; font-weight: 800; line-height: 1.3; color: #7a3208; letter-spacing: .2px; }
#sub-videobg .bs-hero-s { margin-top: 7px; font-size: 12.5px; line-height: 1.7; color: #965737; }

/* ---------------------------------------------------------------- 卡片 / 标题 */
#sub-videobg .bs-card {
  margin-bottom: 12px; padding: 14px 14px 15px; border-radius: 16px;
  background: var(--bs-paper); border: 1px solid var(--bs-line);
  box-shadow: 0 8px 22px -20px rgba(120, 70, 30, .55);
}
#sub-videobg .bs-ct { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--bs-ink); }
#sub-videobg .bs-ct-n {
  flex: 0 0 auto; width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800; color: #fff; background: var(--bs-brand);
}
#sub-videobg .bs-meta {
  margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--bs-mut);
  background: #f6efe8; border-radius: 999px; padding: 4px 10px;
}
#sub-videobg .bs-meta.on { color: var(--bs-brand); background: #fff1e7; }
#sub-videobg .bs-subct { margin: 14px 0 9px; font-size: 12.5px; font-weight: 700; color: var(--bs-ink-2); }
#sub-videobg .bs-note {
  margin-top: 9px; padding: 9px 11px; border-radius: 11px;
  background: #fff6ee; font-size: 12px; line-height: 1.65; color: var(--bs-ink-2);
}

/* ---------------------------------------------------------------- 上传视频 */
#sub-videobg .bs-drop {
  position: relative; margin-top: 11px;
  border: 1.5px dashed #f2c9a9; border-radius: 14px; background: var(--bs-warm);
  padding: 22px 12px; text-align: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
#sub-videobg .bs-drop.drag { border-color: var(--bs-brand); background: #fff2e8; }
#sub-videobg .bs-drop.has { padding: 10px; border-style: solid; border-color: #ffdcbf; background: #fff; }
#sub-videobg .bs-drop-hint { display: block; }
#sub-videobg .bs-hint-ico { font-size: 29px; line-height: 1; }
#sub-videobg .bs-hint-t { margin-top: 8px; font-size: 14.5px; font-weight: 700; color: var(--bs-ink); }
#sub-videobg .bs-hint-s { margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--bs-ink-2); }
#sub-videobg .bs-prev {
  width: 100%; max-height: 40vh; object-fit: contain; display: block;
  border-radius: 10px; background: #000;
}
#sub-videobg .bs-fileinfo {
  margin-top: 9px; padding: 9px 11px; border-radius: 11px;
  background: #fbf6f1; border: 1px solid #f2e7dc;
  font-size: 12px; line-height: 1.7; color: var(--bs-ink-2);
  word-break: break-all;
}
#sub-videobg .bs-fileinfo b { color: var(--bs-ink); font-weight: 700; }
#sub-videobg .bs-err {
  margin-top: 9px; padding: 9px 11px; border-radius: 11px;
  background: #fff1ec; border: 1px solid #ffd3c4;
  font-size: 12px; line-height: 1.6; color: #b23b17;
}

/* ---------------------------------------------------------------- 自定义背景图 */
#sub-videobg .bs-uprow { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
#sub-videobg .bs-upload-btn {
  padding: 9px 15px; border-radius: 11px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; color: var(--bs-brand);
  background: #fff5ee; border: 1px solid #ffd9c0;
}
#sub-videobg .bs-upload-btn:active { background: #ffe9d9; }
#sub-videobg .bs-thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: visible; }
#sub-videobg .bs-thumb-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--bs-line); }
#sub-videobg .bs-clear {
  position: absolute; right: -7px; top: -7px; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 21px;
  color: #fff; background: rgba(232, 74, 58, .95); box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* ---------------------------------------------------------------- 模板格子 */
#sub-videobg .bs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px;
}
#sub-videobg .bs-tpl {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 9px 4px 8px; border-radius: 12px; cursor: pointer; font-family: inherit;
  border: 1.5px solid #f1e5da; background: #fdfaf7;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
#sub-videobg .bs-tpl:active { transform: scale(.97); }
#sub-videobg .bs-tpl.on {
  border-color: var(--bs-brand);
  background: linear-gradient(150deg, #fff6ef 0%, #fff0e4 100%);
  box-shadow: 0 6px 16px rgba(249, 89, 1, .14);
}
#sub-videobg .bs-tpl-swatch {
  width: 100%; height: 34px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .07);
}
#sub-videobg .bs-tpl-thumb {
  width: 100%; height: 34px; border-radius: 8px; object-fit: cover; display: block;
  border: 1px solid rgba(0, 0, 0, .07); background: #f3ece5;
}
#sub-videobg .bs-tpl-label { font-size: 11px; font-weight: 600; color: var(--bs-ink-2); line-height: 1.2; text-align: center; }
#sub-videobg .bs-tpl.on .bs-tpl-label { color: var(--bs-brand); font-weight: 700; }
#sub-videobg .bs-tpl-check {
  display: none; position: absolute; right: 4px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%; font-size: 10px; line-height: 16px; text-align: center;
  color: #fff; background: var(--bs-brand);
}
#sub-videobg .bs-tpl.on .bs-tpl-check { display: block; }

/* ---------------------------------------------------------------- 清晰度 / 补充 */
#sub-videobg .bs-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 11px; }
#sub-videobg .bs-opt {
  padding: 10px 4px; border-radius: 11px; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; color: var(--bs-ink); white-space: nowrap;
  border: 1.5px solid #f1e5da; background: #fdfaf7;
}
#sub-videobg .bs-opt.on {
  border-color: var(--bs-brand); color: var(--bs-brand);
  background: linear-gradient(150deg, #fff6ef 0%, #fff0e4 100%);
  box-shadow: 0 6px 16px rgba(249, 89, 1, .14);
}
#sub-videobg .bs-extra {
  width: 100%; margin-top: 11px; padding: 10px 11px; border-radius: 11px;
  border: 1px solid #f1e5da; background: #fdfaf7; color: var(--bs-ink);
  font-family: inherit; font-size: 12.5px; line-height: 1.6; resize: vertical;
}
#sub-videobg .bs-extra:focus { outline: none; border-color: var(--bs-brand-2); background: #fff; }

/* ---------------------------------------------------------------- 生成按钮 */
#sub-videobg .bs-gen {
  width: 100%; margin: 4px 0 12px; padding: 13px 10px; border: 0; border-radius: 14px;
  cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff9a54 0%, #f95901 100%);
  box-shadow: 0 10px 22px -12px rgba(249, 89, 1, .9);
}
#sub-videobg .bs-gen:active { transform: scale(.99); }
#sub-videobg .bs-gen:disabled { opacity: .62; cursor: default; box-shadow: none; }

/* ---------------------------------------------------------------- 进度 */
#sub-videobg .bs-prog { padding: 14px 15px; border-radius: 16px; background: var(--bs-paper); border: 1px solid var(--bs-line); }
#sub-videobg .bs-prog-t { font-size: 13px; font-weight: 700; color: var(--bs-ink); }
#sub-videobg .bs-prog-bar { height: 8px; margin-top: 10px; border-radius: 999px; background: #f2e8df; overflow: hidden; }
#sub-videobg .bs-prog-fill {
  display: block; height: 100%; width: 35%; border-radius: 999px;
  background: linear-gradient(90deg, #ffb072 0%, #f95901 100%);
  animation: bsFlow 1.8s ease-in-out infinite;
}
#sub-videobg .bs-prog-s { margin-top: 9px; font-size: 12px; line-height: 1.6; color: var(--bs-mut); }
@keyframes bsFlow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ---------------------------------------------------------------- 结果 */
#sub-videobg .bs-result { padding: 14px; border-radius: 16px; background: var(--bs-paper); border: 1px solid var(--bs-line); }
#sub-videobg .bs-video { width: 100%; display: block; border-radius: 12px; background: #000; margin-top: 11px; }
#sub-videobg .bs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
#sub-videobg .bs-dl {
  display: flex; align-items: center; justify-content: center; text-decoration: none;
  padding: 11px 8px; border-radius: 12px; font-size: 13px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #ff9a54 0%, #f95901 100%);
}
#sub-videobg .bs-again {
  padding: 11px 8px; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; color: var(--bs-ink);
  border: 1px solid #ffdcbf; background: #fff;
}

/* ---------------------------------------------------------------- 提示 / 杂项 */
#sub-videobg .bs-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(8px);
  max-width: 82vw; padding: 9px 14px; border-radius: 999px;
  background: rgba(43, 28, 18, .92); color: #fff; font-size: 12.5px; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
}
#sub-videobg .bs-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#sub-videobg .bs-hide { display: none !important; }

@media (max-width: 380px) {
  #sub-videobg .bs-hero { padding: 16px 15px 15px; }
  #sub-videobg .bs-hero-t { font-size: 18.5px; }
  #sub-videobg .bs-grid { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
  #sub-videobg .bs-opt { font-size: 11.5px; padding: 10px 2px; }
}
