:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #fff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --danger: #b91c1c;
  --side: #0f172a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.badge-preview{margin:0}
.badge-preview__stage{display:inline-flex;align-items:center;min-height:36px;padding:8px 12px;border-radius:10px;background:#12121a}
.new-home-template-tags{display:inline-flex;max-width:100%;align-items:center}
.new-home-template-tags__tag{position:relative;display:inline-flex;align-items:center;max-width:100%;color:#fff;font-size:11px;font-weight:800;font-style:italic;line-height:14px;white-space:nowrap}
.new-home-template-tags__tag--video,
.new-home-template-tags__tag--video-audio,
.new-home-template-tags__tag--blend,
.new-home-template-tags__tag--fun,
.new-home-template-tags__tag--picture{padding:2px 8px;border-radius:20px}
.new-home-template-tags__tag--video{background:linear-gradient(90deg,#7a5cff,#3b1d8f)}
.new-home-template-tags__tag--video-audio{background:linear-gradient(90deg,#5b8cff,#24356b)}
.new-home-template-tags__tag--blend{background:linear-gradient(90deg,#ff7a45,#c43b6e)}
.new-home-template-tags__tag--fun{background:linear-gradient(90deg,#f5c542,#e07a1a);color:#1a1204}
.new-home-template-tags__tag--picture{background:linear-gradient(90deg,#3ec6ff,#2456d6)}
.new-home-template-tags__icon{position:absolute;z-index:1;left:0;top:50%;height:22px;width:auto;transform:translate(-4px,-50%);pointer-events:none}
.new-home-template-tags__icon-pill,
.new-home-template-tags__drama-pill{display:inline-flex;align-items:center;min-height:18px;padding:2px 8px 2px 18px;border-radius:20px}
.new-home-template-tags__icon-pill-placeholder,
.new-home-template-tags__drama-icon-placeholder{display:inline-block;width:8px;height:1px}
.new-home-template-tags__tag--premium .new-home-template-tags__icon-pill{background:linear-gradient(90deg,#f0b429,#8a5a00)}
.new-home-template-tags__tag--custom-prompt .new-home-template-tags__icon-pill{background:linear-gradient(90deg,#4aa3ff,#1d4ed8)}
.new-home-template-tags__tag--dirty-talk .new-home-template-tags__icon-pill{background:linear-gradient(90deg,#3ddc84,#0f8a45)}
.new-home-template-tags__tag--drama-30s,
.new-home-template-tags__tag--drama-60s{flex:0 0 auto;padding:0;overflow:visible;border:0;background:transparent;font-size:12px;font-style:italic;font-weight:800;line-height:16px}
.new-home-template-tags__tag--drama-30s .new-home-template-tags__drama-icon-placeholder,
.new-home-template-tags__tag--drama-60s .new-home-template-tags__drama-icon-placeholder{display:block;height:24px;width:auto;flex:0 0 23px}
.new-home-template-tags__tag--drama-30s .new-home-template-tags__drama-pill,
.new-home-template-tags__tag--drama-60s .new-home-template-tags__drama-pill{position:relative;z-index:0;display:inline-flex;height:24px;min-height:24px;flex:0 0 auto;align-items:center;justify-content:center;padding:4px 12px 4px 27px;border-radius:20px;background:linear-gradient(270deg,#d63df5 .88%,#600073 100.74%)}
.new-home-template-tags__tag--drama-30s .new-home-template-tags__icon,
.new-home-template-tags__tag--drama-60s .new-home-template-tags__icon{top:-2px;left:0;width:46px;height:28px;transform:none}
.new-home-template-tags__drama-pill .new-home-template-tags__label{position:relative;z-index:1;flex:none;overflow:visible;text-overflow:clip;transform:skew(-10deg)}
.new-home-template-tags__tag--free-trial{padding:0;background:none}
.new-home-template-tags__icon--free-trial{position:static;height:18px;transform:none}
.new-home-template-tags__tag--free-trial .new-home-template-tags__label:empty{display:none}

#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--side);
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 14px;
  padding: 28px 26px 22px;
}
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card h2 { margin: 0 0 8px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
label .hint { display: block; margin: 2px 0 0; font-weight: 400; }
label { display: block; margin: 12px 0; color: #334155; font-size: 13px; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--teal); }
button, .btn {
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  text-decoration: none;
  display: inline-block;
}
button:disabled { opacity: .6; cursor: progress; }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; }
button.danger { background: #fff; color: var(--danger); border: 1px solid #fecaca; }
.login-card button { width: 100%; margin-top: 6px; }
.login-card button.ghost { margin-top: 8px; }
.error { color: var(--danger); min-height: 1.2em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
#qr-box { margin: 8px 0; }
#qr-box svg { width: 180px; height: 180px; }

#app { display: flex; min-height: 100vh; }
aside {
  width: 220px;
  flex: none;
  background: var(--side);
  color: #e2e8f0;
  padding: 18px 0 24px;
}
.brand { padding: 0 16px; font-size: 18px; font-weight: 650; }
.brand-sub { padding: 0 16px 12px; color: #94a3b8; font-size: 12px; }
nav a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 9px 16px;
}
nav a:hover { background: #1e293b; }
nav a[aria-current="page"] { background: #1e293b; color: #fff; box-shadow: inset 3px 0 #2dd4bf; }
.nav-label { padding: 14px 16px 4px; color: #64748b; font-size: 12px; }
#nav button.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  background: transparent;
  color: #cbd5e1;
  border: 0;
  border-radius: 0;
  padding: 9px 16px;
  text-align: left;
}
#nav button.nav-toggle:hover { background: #1e293b; color: #fff; }
#nav button.nav-toggle .chev {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;
  flex: none;
}
#nav button.nav-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.subnav a { padding: 6px 16px 6px 28px; font-size: 13px; color: #94a3b8; }
#nav > a[data-nav="fleet"][aria-current="page"] { background: transparent; box-shadow: none; color: #e2e8f0; }
#app:has(.fleet-frame) { height: 100vh; overflow: hidden; }
#app:has(.fleet-frame) .main { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
#app:has(.fleet-frame) #view { flex: 1; min-height: 0; padding: 0 16px 16px; }
.fleet-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.gpu-switch { display: flex; gap: 8px; margin: 0 0 12px; flex: none; }
.gpu-switch button { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; }
.gpu-switch button[aria-selected="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
#app:has(.fleet-frame) .gpu-tasks { height: 100%; display: flex; flex-direction: column; min-height: 0; }
#app:has(.fleet-frame) .gpu-tasks .fleet-frame { flex: 1; min-height: 0; }
.gpu-tasks textarea { min-height: 72px; }
.gpu-tasks .checkline input { width: auto; margin: 0; }
.gpu-test-out video { display: block; width: min(420px, 100%); margin-top: 8px; border-radius: 10px; background: #0f172a; }
.gpu-error { color: var(--danger); margin: 8px 0; }
.main { flex: 1; min-width: 0; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
}
.top h1 { margin: 0; font-size: 20px; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#who { color: var(--muted); }
.banner {
  margin: 8px 20px 0;
  padding: 8px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
}
#flash { margin: 8px 20px 0; padding: 10px 12px; background: #ccfbf1; color: var(--teal-dark); border-radius: 8px; }
#flash.bad { background: #fee2e2; color: var(--danger); }
#view { padding: 12px 20px 48px; }
.note { color: var(--muted); margin: 0 0 12px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--card); border-radius: 12px; padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; margin-top: 6px; font-size: 28px; font-weight: 650; }

.panel { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.promo-id { display: flex; gap: 14px; align-items: center; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.promo-id b { display: block; font-size: 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; }
.checks label { display: flex; gap: 6px; align-items: center; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters label { margin: 0; }
.filters input, .filters select { width: 180px; }
.filters .grow { margin-left: auto; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pager span { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: #e2e8f0; display: block; }
.media-preview { width: 160px; height: 220px; object-fit: cover; border-radius: 10px; background: #e2e8f0; display: block; }
.checkline { display: flex; align-items: center; gap: 8px; }
.ops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
td.ops { flex-wrap: nowrap; width: 1%; white-space: nowrap; }
td.ops button { white-space: nowrap; }
.ops button, .ops a { padding: 4px 8px; font-size: 13px; }
.ops button.link { padding: 0 10px 0 0; background: transparent; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; color: #334155; white-space: nowrap; }
.pill.on, .pill.paid, .pill.succeeded, .pill.active, .pill.ok { background: #ecfdf3; color: #15803d; }
.pill.stop { background: #fef2f2; color: #b91c1c; }
.pill.gone { background: #f1f5f9; color: #64748b; }
.pill.processing, .pill.pending { background: #fef3c7; color: #92400e; }
.pill.banned, .pill.failed { background: #fee2e2; color: #991b1b; }
.muted { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.packs-editor { display: flex; gap: 8px; align-items: flex-start; }
.packs-editor #packs-list { flex: 1; min-width: 0; }
.packs-editor #pack-add { flex: none; min-width: 42px; height: 42px; margin: 37px 0 0; }
.pack-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 16px; align-items: end; }
.pack-row [data-act="pack-del"] { margin: 0 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; }
.checks label { margin: 0; display: flex; gap: 6px; align-items: center; }
.checks input { width: auto; margin: 0; }
.slots label { margin-top: 8px; }
.yt-source-head { display: flex; gap: 8px; align-items: flex-end; }
.yt-source-head label { flex: 1; margin-bottom: 0; }
.yt-source-head button { flex: none; min-width: 42px; height: 42px; margin: 0 0 14px; }
.yt-modes { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 4px 0 12px; }
.yt-modes label { margin: 0; display: flex; gap: 6px; align-items: center; }
.yt-modes input { width: auto; margin: 0; }
.yt-line, .yt-pair { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.yt-line input, .yt-line textarea, .yt-pair input { margin: 0; flex: 1; }
.yt-line label { margin: 0; flex: 1; }
.yingti-stage { margin: 12px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.yingti-stage .ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flow-row { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.flow-row select, .flow-row input[type="text"], .flow-row input:not([type]) { margin: 0; width: 100%; }
.flow-row label { margin: 0; }
dl.detail { display: grid; grid-template-columns: 140px 1fr; background: var(--card); border-radius: 12px; overflow: hidden; margin: 0 0 14px; }
dt, dd { margin: 0; padding: 10px 12px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
.faces { display: flex; flex-wrap: wrap; gap: 12px; }
.face { width: 160px; background: var(--card); border-radius: 12px; padding: 10px; }
.face img { width: 140px; height: 140px; object-fit: cover; background: #f1f5f9; border-radius: 8px; }
.foot-row { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.foot-row input, .foot-row select { margin: 0; }
.support-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.support-row input, .support-row select { margin: 0; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  padding: 16px;
}
.modal-card { width: min(480px, 100%); background: #fff; border-radius: 14px; padding: 18px; }
.modal-card h2 { margin: 0 0 8px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

button.link { background: transparent; color: #2563eb; border: 0; padding: 0 10px 0 0; }
button.link.danger { color: #dc2626; }
button.primary { background: #2563eb; }
.userchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.userchip .avatar { width: 28px; height: 28px; border-radius: 50%; background: #7c3aed; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 650; }
.crumb { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.crumb a { color: var(--muted); text-decoration: none; }
.promo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.promo-head h2 { margin: 0 0 4px; font-size: 22px; }
.promo-card { padding: 0; overflow: hidden; }
.promo-card-h { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 650; }
.promo-card-h span, .promo-card-split span { color: var(--muted); font-weight: 400; font-size: 13px; }
.promo-card-split { display: block; }
.promo-card-split b { display: block; }
.promo-card table { border-radius: 0; }
.who-cell b { display: block; }
.who-cell span { display: block; color: var(--muted); font-size: 12px; word-break: break-all; }
.code-badge { display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px solid #bfdbfe; color: #1d4ed8; background: #eff6ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pixel-search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.pixel-search input { width: 240px; margin: 0; }
.pixel-search label { margin: 0; font-size: 12px; color: var(--muted); }
.pixel-search select { width: 160px; margin: 0; }
.acq-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(100deg, #0b1f4d, #1d4ed8 58%, #60a5fa); color: #fff; border-radius: 16px; padding: 22px 24px 20px; margin: 0 0 14px; }
.acq-banner .acq-copy { min-width: 0; }
.acq-banner .eyebrow { margin: 0 0 8px; letter-spacing: .16em; font-size: 11px; opacity: .75; }
.acq-banner h2 { margin: 0 0 8px; font-size: 28px; display: flex; align-items: center; gap: 10px; }
.acq-banner p { margin: 0; opacity: .92; }
button.banner-action { background: #fff; color: #1d4ed8; border: 0; flex: none; font-weight: 650; }
.acq-badge { font-size: 12px; font-weight: 600; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 2px 10px; }
.acq-id { display: flex; gap: 14px; align-items: center; margin: 0 0 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; max-width: 520px; }
.acq-id b { display: block; font-size: 18px; word-break: break-all; }
.acq-id div span { display: block; color: var(--muted); font-size: 13px; }
.acq-ico { width: 42px; height: 42px; border-radius: 12px; background: #eff6ff; color: #1d4ed8; display: grid; place-items: center; font-weight: 700; flex: none; }
.acq-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 14px 16px 0; }
.acq-filters label { margin: 0; font-size: 12px; color: var(--muted); }
.acq-filters select { width: 220px; }
.acq-filters .spacer { flex: 1; min-width: 12px; }
.date-pair { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.date-pair input { width: 150px; margin: 0; }
.acq-now { margin: 8px 16px 12px; color: var(--ink); font-size: 13px; }
.acq-now span { display: block; color: var(--muted); }
.day-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #2563eb; }
td.n-invite { color: #2563eb; font-weight: 650; }
td.n-pay { color: #15803d; font-weight: 650; }
td.n-pend, td.money-pend { color: #dc2626; font-weight: 650; }
td.money { color: #15803d; font-weight: 650; }
.success-pill { display: inline-block; background: #ecfdf3; color: #15803d; border-radius: 999px; padding: 2px 10px; font-weight: 650; }
table.acq { font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  #app { display: block; }
  aside { width: auto; padding-bottom: 8px; }
  nav { display: flex; align-items: center; overflow-x: auto; }
  nav a, #nav button.nav-toggle { white-space: nowrap; flex: none; }
  .subnav { display: flex; flex: none; }
  .subnav a { padding: 9px 16px; }
  .top { flex-wrap: wrap; align-items: flex-start; }
  .top h1 { flex: 1 1 160px; min-width: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-grid, dl.detail { grid-template-columns: 1fr; }
  .pack-row { grid-template-columns: 1fr; }
  .foot-row, .support-row { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}

.member-plan{margin:0 0 20px;padding:12px 16px 16px;border:1px solid var(--line, #2a3142);border-radius:12px}
.member-plan legend{padding:0 6px;font-weight:700}
