:root {
  --bg: #0b0d10;
  --bg-2: #11151a;
  --sidebar: #0e1116;
  --surface: #161b22;
  --surface-2: #1c222b;
  --elev: #222a35;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --muted: #8b949e;
  --accent: #00d4aa;
  --accent-2: #14e8bc;
  --accent-dim: rgba(0, 212, 170, 0.14);
  --accent-glow: rgba(0, 212, 170, 0.28);
  --danger: #ff5c6c;
  --radius: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --sidebar-w: 236px;
  --topbar-h: 56px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #04110d; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #333b46; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.app {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(0, 212, 170, 0.08), transparent 60%),
    var(--bg);
}
.sidebar-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 16px;
  min-height: 0;
  height: 100%;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; color: inherit;
  text-align: left; cursor: pointer;
  padding: 4px 10px 18px;
}
.logo {
  width: 32px; height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.brand h1 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-item.on {
  background: var(--accent-dim);
  color: var(--accent);
}
.ni {
  width: 18px; height: 18px; position: relative; flex-shrink: 0;
}
.ni-home {
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ni-script {
  border: 2px solid currentColor; border-radius: 2px;
  background: linear-gradient(currentColor, currentColor) 4px 5px / 8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 9px / 8px 1.5px no-repeat;
}
.ni-user {
  border: 2px solid currentColor; border-radius: 50%;
}
.ni-user::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: -2px; height: 7px;
  border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0;
}
.ni-play {
  background: currentColor;
  clip-path: polygon(20% 10%, 90% 50%, 20% 90%);
}
.ni-task {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M7 8h10'/%3E%3Cpath d='M7 12h6'/%3E%3Cpath d='M7 16h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M7 8h10'/%3E%3Cpath d='M7 12h6'/%3E%3Cpath d='M7 16h8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ni-bill {
  width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h8'/%3E%3Cpath d='M8 15h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
}
.sidebar-user-meta { flex: 1; min-width: 0; }
.sidebar-user .name {
  font-size: 13px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .bal { font-size: 12px; color: var(--accent); font-weight: 650; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.35);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}

.app-main {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.86);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 10;
}
.menu-btn {
  display: none;
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 16px;
}
.topbar-title { font-size: 13px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-right: auto; }
.workspace { flex: 1; min-height: 0; overflow: auto; padding: 20px 28px; }
.workspace.fill { padding: 0; display: flex; overflow: hidden; }
.workspace:has(.char-page) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.char-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.char-page .page-head { flex-shrink: 0; margin-bottom: 14px; }
.char-page .page-head h2 { font-size: 22px; }
.char-page .form-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.char-page .panel { min-height: 0; overflow-y: auto; }
.char-page .preview-box { max-height: 100%; }

.balance-chip {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  display: flex; gap: 10px; align-items: center;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(100%, 560px);
  white-space: nowrap;
  overflow: hidden;
}
.balance-chip .chip-bal {
  color: #5eead4; font-size: 16px; font-weight: 650;
  flex-shrink: 0;
}
.balance-hit {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 2px 4px; margin: -2px -4px;
  border-radius: 999px; color: inherit; font: inherit;
  flex-shrink: 1; min-width: 0;
}
.balance-hit:hover { background: rgba(255,255,255,.05); }
.balance-hit:hover .chip-bal { color: var(--accent-2); }
.balance-chip .chip-label,
.balance-chip .chip-frozen {
  color: var(--muted); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.balance-chip .user-in-chip {
  color: var(--text); font-weight: 650; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 0; flex-shrink: 1;
}
.balance-chip .chip-uname {
  overflow: hidden; text-overflow: ellipsis; max-width: 96px;
}
.logout-in-chip {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logout-in-chip:hover { color: var(--text); background: rgba(255,255,255,.06); }
.chip-split { width: 1px; height: 18px; background: var(--line); flex-shrink: 0; }
.btn.gold { background: #f5c400; color: #111; }
.btn.gold:hover { background: #ffe27a; }
.recharge-in-chip {
  margin-left: 2px; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.ico-person, .ico-logout, .ico-wallet {
  width: 14px; height: 14px; background: currentColor; flex-shrink: 0;
}
.ico-person {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-logout {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-wallet {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='6' rx='2'/%3E%3Cpath d='M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M22 10h-4a2 2 0 0 0 0 4h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='6' rx='2'/%3E%3Cpath d='M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M22 10h-4a2 2 0 0 0 0 4h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h2 { margin: 4px 0 0; font-size: 26px; font-weight: 750; letter-spacing: .02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 28px; font-weight: 750; }
.stat span { color: var(--muted); font-size: 13px; }

.section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.split-row .section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.split-row .list {
  flex: 1;
  overflow: auto;
}
.split-row #characters .card-grid.portrait {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.split-row #characters .char-tile {
  flex: 0 0 120px;
  width: 120px;
  height: auto;
}
.split-row #characters .thumb.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
}
.split-row #characters .list-empty {
  flex: 1;
  display: flex;
  align-items: center;
}
.section .list {
  border: 0;
  background: transparent;
  border-radius: 0;
}
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.section-title { font-size: 16px; font-weight: 700; }
.section-head .mark {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--accent-glow);
}
.section-head .btn, .section-head .icon-btn { margin-left: auto; }
.icon-btn {
  width: 32px; height: 32px; padding: 0;
  border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  border-radius: 8px;
  display: grid; place-items: center;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.accent:hover { color: var(--accent-2); background: var(--accent-dim); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.icon-btn:disabled:hover { background: transparent; color: var(--accent); }
.ico-user-plus {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-4-4h-6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='15' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-4-4h-6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='15' cy='7' r='4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-book-plus {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Cpath d='M9 19.5v-15A2.5 2.5 0 0 1 11.5 2H22v20H11.5A2.5 2.5 0 0 1 9 19.5z'/%3E%3Cpath d='M13 7h6'/%3E%3Cpath d='M13 11h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Cpath d='M9 19.5v-15A2.5 2.5 0 0 1 11.5 2H22v20H11.5A2.5 2.5 0 0 1 9 19.5z'/%3E%3Cpath d='M13 7h6'/%3E%3Cpath d='M13 11h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-video-plus {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Ccircle cx='16' cy='12' r='7'/%3E%3Cpolygon points='14 9 19.5 12 14 15'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='8' x2='5' y2='14'/%3E%3Cline x1='2' y1='11' x2='8' y2='11'/%3E%3Ccircle cx='16' cy='12' r='7'/%3E%3Cpolygon points='14 9 19.5 12 14 15'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-more {
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-edit {
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-scene {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--accent);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Cpath d='M7 3v18'/%3E%3Cpath d='M3 7.5h4'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M3 16.5h4'/%3E%3Cpath d='M17 3v18'/%3E%3Cpath d='M17 7.5h4'/%3E%3Cpath d='M17 16.5h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Cpath d='M7 3v18'/%3E%3Cpath d='M3 7.5h4'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M3 16.5h4'/%3E%3Cpath d='M17 3v18'/%3E%3Cpath d='M17 7.5h4'/%3E%3Cpath d='M17 16.5h4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-save {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'/%3E%3Cpolyline points='17 21 17 13 7 13 7 21'/%3E%3Cpolyline points='7 3 7 8 15 8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'/%3E%3Cpolyline points='17 21 17 13 7 13 7 21'/%3E%3Cpolyline points='7 3 7 8 15 8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-spark {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 1.9 5.8H20l-4.9 3.6 1.9 5.8L12 14.6 7 18.2l1.9-5.8L4 8.8h6.1z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 1.9 5.8H20l-4.9 3.6 1.9 5.8L12 14.6 7 18.2l1.9-5.8L4 8.8h6.1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-portrait {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='18' x='5' y='3' rx='2'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M8 17c.7-1.5 2-2.5 4-2.5s3.3 1 4 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='18' x='5' y='3' rx='2'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3Cpath d='M8 17c.7-1.5 2-2.5 4-2.5s3.3 1 4 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-merge {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 3 4 4 4-4'/%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='m4 14 4 4 4-4'/%3E%3Cpath d='M8 18h8'/%3E%3Cpath d='m16 10 4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 3 4 4 4-4'/%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='m4 14 4 4 4-4'/%3E%3Cpath d='M8 18h8'/%3E%3Cpath d='m16 10 4 4-4 4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-plus {
  width: 16px; height: 16px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit;
  padding: 10px 14px; cursor: pointer; text-align: left;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: rgba(255,255,255,.04); }
.list-item.static { cursor: default; }
.list-item.static:hover { background: transparent; }
.list-avatar {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-2);
}
.list-avatar.ph {
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
}
.list-avatar.ph .ni { width: 14px; height: 14px; }
.list-item .ico-book { width: 18px; height: 18px; flex-shrink: 0; }
.list-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.card-grid.portrait { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0; text-align: left; color: inherit;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.tile-hit {
  appearance: none; border: 0; background: transparent;
  padding: 0; margin: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer; width: 100%;
  display: flex; flex-direction: column;
}
.tile-gear {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, .58);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.tile-gear:hover { background: var(--accent); color: #04110d; }
.ico-gear {
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 170, 0.4);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.tile.plus { background: transparent; border-style: dashed; border-color: rgba(0,212,170,.35); }
.thumb { background: #0c0f13; position: relative; overflow: hidden; }
.thumb.wide { width: 100%; aspect-ratio: 16/9; }
.thumb.portrait { width: 100%; aspect-ratio: 3/4; }
.thumb.plus {
  display: grid; place-items: center;
  color: var(--accent); font-size: 40px; font-weight: 300;
  background: linear-gradient(180deg, #14181f, #0c0f13);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .x {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px)),
    linear-gradient(to top left, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px));
}
.thumb.ph {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #161b22, #0c0f13);
}
.ico-book {
  width: 36px;
  height: 36px;
  color: var(--accent);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3Cpath d='M8 7h8'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-video {
  width: 40px;
  height: 40px;
  color: var(--accent);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='10 8 16 12 10 16 10 8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolygon points='10 8 16 12 10 16 10 8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tile-body { padding: 10px 12px 12px; }
.card-cap {
  font-size: 13px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-grid.portrait .card-cap { white-space: normal; }
.char-tile .name-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 1;
}
.card-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.card-time { font-weight: 500; color: var(--muted); font-size: 11px; }

.btn {
  appearance: none; border: 0; cursor: pointer;
  background: #fff; color: #111;
  font-weight: 650; font-size: 14px;
  padding: 9px 18px; border-radius: var(--pill);
  transition: background .15s ease, transform .15s ease, opacity .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; white-space: nowrap;
}
.btn [class^="ico-"] { width: 16px; height: 16px; flex-shrink: 0; }
.btn:hover { background: #e8e8e8; }
.btn:active { transform: scale(.98); }
.btn.white, .btn.ghost {
  background: transparent; color: #fff;
  border: 1px solid var(--line-strong);
}
.btn.white:hover, .btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn.accent { background: var(--accent); color: #04110d; box-shadow: 0 8px 20px var(--accent-glow); }
.btn.accent:hover { background: var(--accent-2); }
.btn.danger { background: rgba(220, 38, 38, 0.92); color: #fff; }
.btn.danger:hover { background: #ef4444; }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.sm [class^="ico-"] { width: 15px; height: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.section-head .btn.sm { padding: 8px 14px; }

.crumb { color: var(--muted); font-size: 13px; }
.crumb button.crumb-link {
  background: none; border: 0; padding: 0; margin: 0;
  color: var(--muted); font: inherit; cursor: pointer;
}
.crumb button.crumb-link:hover { color: var(--accent); }
.crumb .here { color: var(--text); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.editor {
  width: 100%; min-height: 48vh;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 15px; line-height: 1.75;
  resize: vertical; outline: none;
}
.editor:focus { border-color: rgba(0,212,170,.45); box-shadow: 0 0 0 3px var(--accent-dim); }

.form-grid {
  display: flex;
  align-items: stretch;
  gap: 20px;
}
.form-grid > .panel {
  flex: 1;
  min-width: 0;
}
.preview-box {
  flex: 0 0 auto;
  align-self: stretch;
  container-type: size;
  width: 0;
  min-width: calc(100cqh * 9 / 16);
  aspect-ratio: 9 / 16;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.preview-box img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #0a0a0a;
  max-width: none;
}
.preview-box .x {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px)),
    linear-gradient(to top left, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px));
}

.field { margin-bottom: 16px; }
.field label, .modal-body label {
  display: block; margin-bottom: 8px;
  font-size: 13px; color: var(--muted); font-weight: 600;
}
.field input, .field select, .field textarea,
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 14px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus,
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  border-color: rgba(0,212,170,.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.field select, .modal-body select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.field textarea { min-height: 140px; resize: vertical; }
.field .hint, .hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.req-box {
  margin: 4px 0 8px; padding: 12px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,170,.22);
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.55;
}
.req-box .req-title { font-weight: 650; margin-bottom: 6px; color: var(--accent); }
.req-box ul { margin: 0; padding-left: 18px; color: #cfcfcf; }
.refs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ref-thumb, .ref-add {
  width: 72px; height: 72px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: relative; overflow: hidden;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-del {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .68);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
  z-index: 1;
}
.ref-del:hover { background: var(--danger); }
.ico-x {
  width: 10px; height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ref-add {
  color: var(--accent); font-size: 32px; cursor: pointer;
  display: grid; place-items: center;
  border-style: dashed; border-color: rgba(0,212,170,.4);
}

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  padding: 16px; z-index: 40;
}
.modal {
  width: min(480px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
  font-size: 16px; font-weight: 700;
}
.modal-head button {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
}
.modal-body { padding: 8px 18px 20px; }
.modal-body label { margin: 12px 0 6px; }
.modal-body textarea { min-height: 120px; }
.confirm-modal { width: min(400px, 100%); }
.confirm-lead { margin: 0 0 8px; font-size: 14px; line-height: 1.55; color: #d6d6d6; }
.confirm-spec { margin: 0 0 14px; }
.confirm-cost {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: 12px;
  font-size: 13px; color: var(--muted);
}
.confirm-cost b { color: var(--accent); font-size: 22px; font-weight: 750; }
.confirm-bal { margin: 12px 0 0; }
.confirm-modal .modal-actions { margin-top: 18px; gap: 10px; }
.recharge-modal { width: min(420px, 100%); }
.recharge-amts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 4px 0 16px;
}
.recharge-amt {
  appearance: none; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); border-radius: 12px; padding: 12px 8px; cursor: pointer;
  font-size: 16px; font-weight: 650;
}
.recharge-amt.on {
  border-color: #f5c400; color: #f5c400; background: rgba(245,196,0,.12);
}
.recharge-pay-amt {
  text-align: center; font-size: 26px; color: #5eead4; margin: 4px 0 8px;
}
.recharge-qr-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.recharge-qr-wrap img {
  width: 240px; height: 240px; background: #fff; border-radius: 12px; padding: 8px;
}
.recharge-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.bill-modal { width: min(720px, 100%); max-height: min(82vh, 720px); display: flex; flex-direction: column; }
.bill-modal .modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bill-summary {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline;
  margin-bottom: 12px; font-size: 13px; color: var(--muted);
}
.bill-summary b { color: #5eead4; font-size: 18px; font-weight: 650; }
.bill-frozen { color: var(--muted); }
.bill-table-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bill-table th, .bill-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.bill-table th { color: var(--muted); font-weight: 650; background: rgba(255,255,255,.02); position: sticky; top: 0; }
.bill-table tr:last-child td { border-bottom: 0; }
.bill-time { white-space: nowrap; color: var(--muted); }
.bill-remark { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-amt.pos { color: #5eead4; font-weight: 650; }
.bill-amt.neg { color: #fca5a5; font-weight: 650; }
.bill-pager {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
}
.bill-loading, .bill-empty { text-align: center; padding: 24px 0; }
.bills-section .bill-summary { margin-bottom: 14px; }
.bills-section .bills-table-wrap { max-height: none; }
.bills-section .bill-remark { max-width: none; white-space: normal; }
.bill-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.bill-filters select,
.bill-filters input[type="date"] {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.bill-date-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.bill-date-field input[type="date"] { color-scheme: dark; }
.task-filters { margin-bottom: 14px; }
.task-filters select {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.task-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; align-items: stretch;
}
.task-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  position: relative;
}
.task-del {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, .62);
  color: #fca5a5; cursor: pointer;
  display: grid; place-items: center;
}
.task-del:hover { background: rgba(220, 38, 38, .92); color: #fff; }
.ico-trash {
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3Cpath d='M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3Cpath d='M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.task-media {
  aspect-ratio: 16/10; background: #0a0a0a;
  display: grid; place-items: center; overflow: hidden;
  flex-shrink: 0;
}
.task-media img, .task-media video { width: 100%; height: 100%; object-fit: cover; }
.task-media-portrait {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-media-portrait .task-media-blur {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  object-fit: cover;
  filter: blur(22px) brightness(0.5) saturate(1.15);
  transform: scale(1.06);
  pointer-events: none;
  z-index: 0;
}
.task-media-portrait .task-media-fit {
  position: relative;
  z-index: 1;
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain !important;
}
.task-ph { color: var(--muted); font-size: 13px; font-weight: 650; }
.task-body {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; padding: 10px 12px 0;
}
.task-prompt {
  flex: 1; font-size: 12px; color: #c9c9c9;
  line-height: 1.5; min-height: 38px;
}
.task-meta {
  margin-top: auto; flex-shrink: 0;
  padding: 8px 12px 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--line);
}
.task-meta span:first-child { min-width: 0; }
.task-meta span:last-child { flex-shrink: 0; white-space: nowrap; }
.task-err { padding: 6px 0 0; font-size: 11px; color: #fca5a5; }
.task-empty { grid-column: 1 / -1; }
.task-pager { margin-top: 14px; }
.modal.detail {
  width: min(calc((100dvh - 108px) * 9 / 16 + 456px), calc(100vw - 32px));
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
}
.modal.detail .modal-head { flex-shrink: 0; }
.modal.detail .modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
  overflow: hidden;
  padding-bottom: 16px;
}
.detail-pic {
  height: 100%;
  aspect-ratio: 9 / 16;
  width: calc((100dvh - 108px) * 9 / 16);
  flex: 0 0 calc((100dvh - 108px) * 9 / 16);
  max-width: 42vw;
  background: #0c0f13;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.detail-pic img {
  width: 100%; height: 100%; object-fit: cover;
  max-width: none;
}
.detail-pic .x {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px)),
    linear-gradient(to top left, transparent calc(50% - .5px), #2a323c, transparent calc(50% + .5px));
}
.detail-side {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.detail-name-row {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.detail-name { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; }
.detail-meta { margin: 4px 0 10px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.detail-traits {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.detail-traits label,
.detail-refs label { flex-shrink: 0; margin-top: 0; }
.detail-text {
  flex: 1;
  min-height: 72px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px; line-height: 1.6; color: #d4d4d4;
  white-space: pre-wrap;
}
.detail-refs { flex-shrink: 0; margin-top: 4px; }
.detail-refs .refs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}
.detail-refs-empty { font-size: 13px; color: var(--muted); padding: 4px 0 2px; }

@media (max-width: 720px) {
  .modal.detail { width: min(420px, 100%); }
  .modal.detail .modal-body {
    display: flex;
    flex-direction: column;
  }
  .detail-pic {
    width: 100%;
    height: auto;
    max-height: 42vh;
    flex: 0 0 auto;
    aspect-ratio: 9 / 16;
  }
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.scene-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 220px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.scene-card .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 650;
}
.scene-label {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0;
}
.scene-card .body {
  flex: 1; padding: 12px; overflow: auto; white-space: pre-wrap;
  min-height: 160px; font-size: 13px; color: #cfcfcf; line-height: 1.6;
}

.studio {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  width: 100%;
}
.studio-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.studio-err { padding: 8px 18px; }
.studio-mid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
}
.studio-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  background: var(--sidebar);
  min-height: 0;
}
.studio-list-h {
  padding: 12px 14px 8px;
  font-size: 12px; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
}
.shot {
  margin: 0 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.shot-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 6px;
}
.shot-h .icon-btn {
  width: 28px; height: 28px; flex-shrink: 0;
}
.shot-h .icon-btn .ico-video,
.shot-h .icon-btn .ico-image {
  width: 16px; height: 16px; color: inherit;
}
.ico-image {
  display: block;
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ico-cover {
  display: inline-block;
  width: 14px; height: 14px; margin-right: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cover-shot { border-color: rgba(0, 212, 170, 0.22); }
.cover-shot.collapsed { padding-bottom: 10px; }
.cover-fold-btn .ico-chevron {
  display: block;
  width: 14px; height: 14px;
  background: currentColor;
  transition: transform .18s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cover-fold-btn.folded .ico-chevron { transform: rotate(-90deg); }
.cover-gen-btn {
  width: 100%;
  margin-top: 12px;
  justify-content: center;
}
.cover-gen-btn .ico-image {
  width: 15px; height: 15px;
  color: inherit;
}
.cover-tabs {
  display: flex; gap: 4px;
  margin: 0 0 10px;
  padding: 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cover-tab {
  flex: 1; appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 650;
  padding: 7px 8px; border-radius: 8px;
}
.cover-tab:hover { color: var(--text); }
.cover-tab.on {
  background: rgba(0, 212, 170, 0.16);
  color: var(--accent);
}
.cover-meta { margin: 0 0 10px; font-size: 11px; color: var(--muted); }
.cover-prefix label,
.cover-label {
  display: block; margin-bottom: 6px;
  font-size: 11px; color: var(--muted); font-weight: 650;
}
.cover-prefix-text {
  padding: 8px 10px; margin-bottom: 10px;
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 12px; line-height: 1.55; color: #d6d6d6;
}
.cover-prompt {
  width: 100%; min-height: 96px; resize: vertical;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  font-size: 12px; line-height: 1.55;
}
.cover-ref-hint { margin: 8px 0 0; font-size: 11px; }
.cover-refs { margin-top: 10px; }
.cover-preview { margin-top: 0; }
.cover-frame {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #161b22, #0c0f13);
}
.cover-ar-landscape { aspect-ratio: 16 / 10; width: 100%; }
.cover-ar-portrait { aspect-ratio: 9 / 16; width: 100%; max-height: 240px; margin: 0 auto; }
.cover-ar-square { aspect-ratio: 1 / 1; width: 100%; max-width: 240px; margin: 0 auto; }
.cover-ph {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; text-align: center; padding: 12px;
}
.cover-ph-sm { font-size: 11px; gap: 4px; padding: 6px; }
.ico-cover-lg {
  width: 32px; height: 32px;
  background: rgba(0, 212, 170, 0.55);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 20'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cover-ph-sm .ico-cover-lg { width: 22px; height: 22px; opacity: 0.85; }
.cover-img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cover-img[hidden] { display: none !important; }
.cover-frame-tl {
  height: 84px;
  aspect-ratio: unset;
  max-height: none;
  max-width: none;
}
.cover-frame-tile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border: 0;
  border-radius: 0;
  max-height: none;
  max-width: none;
}
.cover-frame-stage {
  width: min(100%, 920px);
  max-height: min(100%, 100%);
  height: auto;
}
.stage-cover-wrap {
  width: 100%; height: 100%;
  min-height: 0;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
.stage-cover-wrap small { color: var(--muted); font-size: 12px; }
.shot p {
  margin: 0; font-size: 12px; color: #c9c9c9;
  white-space: pre-wrap; max-height: 88px; overflow: auto; line-height: 1.5;
}
.shot-refs {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.shot-refs-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
  font-size: 12px; color: var(--muted); font-weight: 650;
}
.shot-ref-empty { margin: 0; font-size: 11px; }
.shot-ref-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shot-ref-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  max-width: 100%;
}
.shot-ref-av {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--surface);
}
.shot-ref-av.ph { display: block; background: linear-gradient(180deg, #222, #111); }
.shot-ref-name {
  font-size: 12px; max-width: 72px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot-ref-del {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 2px;
}
.shot-ref-del:hover { color: #fca5a5; }
.char-picker-modal { width: min(560px, 100%); max-height: min(82vh, 640px); display: flex; flex-direction: column; }
.char-picker-modal .modal-body { flex: 1; min-height: 0; overflow: auto; }
.char-picker-empty { text-align: center; padding: 16px 0; }
.char-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.char-pick {
  position: relative; appearance: none; border: 1px solid var(--line);
  background: var(--surface); border-radius: 12px; padding: 8px;
  cursor: pointer; color: inherit; text-align: center;
}
.char-pick:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.char-pick.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.char-pick.no-img { opacity: .72; }
.char-pick-thumb {
  width: 100%; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden;
  background: #111; display: grid; place-items: center; margin-bottom: 6px;
}
.char-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }
.char-pick-name {
  display: block; font-size: 11px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.char-pick-check {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #04110d;
  font-size: 11px; font-weight: 800; line-height: 18px;
}
.studio-stage {
  background: #07080a;
  display: grid; place-items: center;
  min-height: 0;
  overflow: hidden;
  position: relative;
  margin: 12px 14px 12px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.studio-stage video {
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 13px;
}
.stage-empty {
  text-align: center; color: var(--muted);
}
.stage-empty .ni { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--accent); }
.stage-empty p { margin: 0; color: var(--text); font-weight: 700; }
.stage-empty small { display: block; margin-top: 6px; }

.studio-tl {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 8px 14px 14px;
}
.tl-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.tl-item { flex: 0 0 148px; text-align: center; }
.tl-item.on .tl-thumb { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.tl-thumb {
  height: 84px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--muted); font-size: 12px;
  overflow: hidden;
}
.tl-thumb.tl-hit {
  appearance: none;
  width: 100%;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.tl-thumb.tl-hit:disabled { cursor: default; opacity: 1; }
.tl-thumb.tl-hit:not(:disabled):hover { border-color: var(--line-strong); }
.tl-loading {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px;
  width: 100%;
  height: 100%;
}
.tl-ph { padding: 8px; }
.tl-thumb video, .tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tl-cap { margin-top: 6px; font-size: 12px; color: #d0d0d0; }

.boot {
  min-height: 100vh; display: grid; place-items: center;
  color: var(--muted); font-size: 14px;
}
.spin {
  width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 12px;
}
.spin.sm {
  width: 18px; height: 18px;
  margin: 0;
  border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  align-content: center;
  background:
    radial-gradient(700px 420px at 50% -40px, rgba(0,212,170,.16), transparent 65%),
    var(--bg);
}
.mobile-pc-tip {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  color: #fef3c7;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.96), rgba(92, 40, 8, 0.94));
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.auth:has(.mobile-pc-tip) {
  padding-top: calc(64px + env(safe-area-inset-top, 0px));
}
.auth-card {
  width: min(400px, 100%);
  background: rgba(22, 27, 34, .94);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow: var(--shadow);
}
.auth-card .brand { margin-bottom: 18px; padding: 0; }
.auth-card h2 { margin: 0 0 18px; font-size: 22px; font-weight: 700; }
.auth-card .actions { margin-top: 8px; }
.auth-card .actions .btn { flex: 1; }
.err { color: var(--danger); font-size: 13px; margin-top: 8px; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid; place-items: center; }
  .studio-mid { grid-template-columns: 1fr; }
  .studio-list { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar {
    height: auto;
    min-height: var(--topbar-h);
    padding: 8px 12px;
    gap: 8px;
  }
  .topbar-title { display: none; }
  .balance-chip {
    margin-left: auto;
    padding: 5px 5px 5px 10px;
    gap: 8px;
    max-width: calc(100vw - 68px);
  }
  .balance-chip .chip-uname,
  .balance-chip .chip-label-text,
  .balance-chip .chip-frozen,
  .balance-chip .chip-split { display: none; }
  .balance-hit .chip-frozen { display: none; }
  .balance-chip .chip-bal { font-size: 14px; }
  .recharge-in-chip { padding: 5px 10px; font-size: 12px; }
}
@media (max-width: 860px) {
  .workspace { padding: 16px 14px 36px; }
  .page-head h2 { font-size: 22px; }
  .stats { grid-template-columns: 1fr; }
  .split-row { grid-template-columns: 1fr; }
  .form-grid { flex-direction: column; overflow: auto; }
  .workspace:has(.char-page) { overflow: auto; }
  .char-page { height: auto; }
  .preview-box {
    container-type: normal;
    width: min(200px, 52vw);
    min-width: 0;
    height: auto;
    max-height: 42vh;
    margin: 0 auto;
  }
  .actions .btn { width: 100%; }
  .section-head .btn-label { display: none; }
  .section-head .btn.sm {
    width: 40px; height: 40px; padding: 0; border-radius: 10px;
  }
}
@media (max-width: 420px) {
  .balance-chip { gap: 6px; padding: 4px 4px 4px 8px; }
  .recharge-text { display: none; }
  .recharge-in-chip { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; }
}
