:root {
  --bg: #f4f5f9;
  --panel: #ffffff;
  --panel-2: #fafaff;
  --text: #171a26;
  --muted: #6b7280;
  --line: #e6e8f0;
  --accent: #6d5efc;
  --accent-2: #a855f7;
  --accent-3: #f472b6;
  --grad: linear-gradient(135deg, #6d5efc 0%, #a855f7 58%, #f472b6 100%);
  --grad-soft: linear-gradient(135deg, rgba(109, 94, 252, .12), rgba(244, 114, 182, .12));
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(23, 26, 38, .07);
  --shadow-lg: 0 24px 60px rgba(23, 26, 38, .16);
}

[data-theme="dark"] {
  --bg: #0d0f16;
  --panel: #161923;
  --panel-2: #1b1f2b;
  --text: #eef0f7;
  --muted: #98a1b3;
  --line: #262b3a;
  --grad-soft: linear-gradient(135deg, rgba(109, 94, 252, .2), rgba(244, 114, 182, .14));
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
[v-cloak] { display: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 130, 160, .35); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 18px;
  cursor: pointer;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  position: relative;
  box-shadow: 0 6px 16px rgba(109, 94, 252, .35);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-mark.has-img::after { display: none; }

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 5px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: .92;
}

.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav-label {
  padding: 14px 12px 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .18s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(109, 94, 252, .28);
}
.nav-item .ico { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; }
.nav-item .ico svg { width: 100%; height: 100%; }

.sidebar-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.side-mini { font-size: 11px; color: var(--muted); line-height: 1.7; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 64px; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: fixed;
  top: 0;
  left: 236px;
  right: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  transition: box-shadow .25s ease, background .25s ease, border-color .25s ease;
}

.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--grad-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.balance-chip .spark { color: var(--accent); display: inline-flex; }
.balance-chip .spark svg { width: 15px; height: 15px; }

.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 188px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 11px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.menu-item:hover { background: var(--panel-2); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }

.content {
  padding: 24px 26px 64px;
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
}

.mobile-nav { display: none; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 20px rgba(109, 94, 252, .28); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(109, 94, 252, .38); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 13px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0 0 5px; font-size: 21px; letter-spacing: -.2px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }

.grid-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.tpl-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 17px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: all .2s ease;
  overflow: hidden;
}
.tpl-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .2s ease;
}
.tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.tpl-card:hover::before { opacity: 1; }
.tpl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--accent);
  background: var(--grad-soft);
  padding: 3px 8px;
  border-radius: 7px;
}
.tpl-dur { font-size: 11.5px; color: var(--muted); }
.tpl-card h3 { margin: 0; font-size: 16px; }
.tpl-tagline { color: var(--text); font-weight: 600; font-size: 12.5px; opacity: .86; }
.tpl-structure {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  background: var(--panel-2);
  border-radius: 9px;
  padding: 8px 10px;
  margin-top: 2px;
}
.tpl-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; }
.tpl-cover {
  position: relative;
  margin: -17px -17px 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--grad-soft);
}
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-cover .tpl-code {
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  background: rgba(15, 14, 24, .55);
  backdrop-filter: blur(6px);
}
.tpl-cover .tpl-dur {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fff;
  background: rgba(15, 14, 24, .55);
  padding: 3px 8px;
  border-radius: 7px;
}
.tpl-cover-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
}
.cover-field { display: flex; align-items: center; gap: 14px; }
.cover-preview {
  width: 168px;
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-2) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
}
.cover-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tpl-name { display: flex; align-items: center; gap: 9px; }
.tpl-thumb {
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--grad-soft) center / cover no-repeat;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-queued { background: rgba(107, 114, 128, .14); color: var(--muted); }
.badge-running {
  position: relative;
  overflow: hidden;
  background: rgba(109, 94, 252, .14);
  color: var(--accent);
}
.badge-running::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-160%);
  animation: badge-shine 1.7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes badge-shine {
  0% { transform: translateX(-160%); }
  100% { transform: translateX(320%); }
}
.badge-success { background: rgba(22, 163, 74, .13); color: var(--success); }
.badge-failed { background: rgba(220, 38, 38, .12); color: var(--danger); }
.badge-muted { background: var(--panel-2); color: var(--muted); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; position: relative; }
.dot.pulse { animation: dot-breath 1.2s ease-in-out infinite; }
.dot.pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: dot-ring 1.2s ease-out infinite;
}
@keyframes dot-breath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.72); }
}
@keyframes dot-ring {
  0% { opacity: .7; transform: scale(.6); }
  100% { opacity: 0; transform: scale(1.7); }
}
@media (prefers-reduced-motion: reduce) {
  .dot.pulse, .dot.pulse::after, .badge-running::before, .progress > i, .ai-progress > i, .btn-spinner { animation: none; }
}

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  border-radius: 26px;
  padding: 46px 44px;
  background: radial-gradient(120% 140% at 82% 12%, rgba(255, 255, 255, .26) 0%, transparent 48%), var(--grad);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 26px 60px rgba(109, 94, 252, .32);
  margin-bottom: 22px;
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  right: -80px; bottom: -190px;
}
.hero::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  right: 110px; top: -120px;
}
.hero-inner { position: relative; z-index: 2; max-width: 620px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.32; letter-spacing: -.5px; }
.hero p { margin: 0 0 26px; opacity: .86; line-height: 1.8; font-size: 14px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-light { background: #fff; color: #4c3ee8; border: none; }
.hero .btn-outline { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); color: #fff; }
.hero-badges { display: flex; gap: 20px; margin-top: 30px; flex-wrap: wrap; }
.hero-badges div { font-size: 12px; opacity: .85; }
.hero-badges strong { display: block; font-size: 21px; opacity: 1; margin-bottom: 2px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 17px 18px;
  box-shadow: var(--shadow);
}
.stat-card .label { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.stat-card .value { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat-card .hint { color: var(--muted); font-size: 11.5px; margin-top: 5px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.quick-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all .18s ease;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.quick-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--grad-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.quick-icon svg { width: 19px; height: 19px; }
.quick-card h3 { margin: 0 0 5px; font-size: 15px; }
.quick-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.list-panel { padding: 8px 6px; }
.task-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 13px;
  transition: background .15s ease;
}
.task-row:hover { background: var(--panel-2); }
.task-thumb {
  width: 56px; height: 56px;
  border-radius: 10px;
  background: var(--grad-soft);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex: 0 0 56px;
}
.task-thumb img { width: 100%; height: 100%; object-fit: cover; }
.task-thumb svg { width: 20px; height: 20px; }
.task-main { min-width: 0; }
.task-title { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.task-side { display: flex; align-items: center; gap: 8px; }

.progress {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px), var(--grad);
  background-size: 32px 100%, 100% 100%;
  animation: progress-stripes 1s linear infinite;
  transition: width .4s ease;
}
@keyframes progress-stripes {
  from { background-position: 0 0, 0 0; }
  to { background-position: 32px 0, 0 0; }
}

/* ---------- 列表页 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 13px;
  min-width: 230px;
  color: var(--muted);
}
.search-box svg { width: 15px; height: 15px; flex: 0 0 15px; }
.search-box input { border: none; outline: none; background: transparent; color: var(--text); font-size: 13px; width: 100%; }

.filter-tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 2px; }
.filter-tabs button {
  border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.filter-tabs button.active { background: var(--grad); color: #fff; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 15px; }
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all .18s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-cover {
  height: 132px;
  background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  position: relative;
  overflow: hidden;
}
.tile-cover img { width: 100%; height: 100%; object-fit: cover; }
.tile-cover svg { width: 30px; height: 30px; }
.tile-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0c0e16; }
.tile-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(12, 14, 22, .22);
}
.tile-play svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .35)); }
.tile-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-body h3 { margin: 0; font-size: 14.5px; }
.tile-body .price { color: var(--accent); font-weight: 800; font-size: 15px; }
.tile-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-actions { display: flex; gap: 8px; padding: 0 15px 15px; margin-top: auto; }
.placeholder-tag {
  position: absolute; bottom: 8px; left: 10px;
  font-size: 10.5px; color: var(--muted);
}

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel);
  font-size: 13px;
}
.empty .empty-ico { width: 42px; height: 42px; margin: 0 auto 12px; color: var(--accent); opacity: .7; }
.empty .empty-ico svg { width: 100%; height: 100%; }

/* ---------- 表单 / 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(12, 14, 22, .52);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 18px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--panel);
  border-radius: 20px;
  width: 640px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s ease;
  border: 1px solid var(--line);
}
.modal.wide { width: 820px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.icon-btn {
  border: none; background: var(--panel-2); color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}
.modal-body { padding: 20px 22px; }
.modal-foot {
  padding: 14px 22px 20px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--line);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; margin-bottom: 7px; color: var(--text); }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 94, 252, .13);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.upload-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-item {
  width: 84px; height: 84px; border-radius: 11px; overflow: hidden;
  position: relative; border: 1px solid var(--line); background: var(--panel-2);
}
.upload-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-item .del {
  position: absolute; top: 3px; right: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 1;
}
.upload-add {
  width: 84px; height: 84px; border-radius: 11px;
  border: 1px dashed var(--line); background: var(--panel-2);
  color: var(--muted); cursor: pointer; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.upload-add svg { width: 17px; height: 17px; }
.upload-add:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 创作向导 ---------- */
.steps { display: flex; align-items: center; gap: 8px; padding: 4px 0 18px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}
.step.active { color: var(--text); font-weight: 650; }
.step.active .step-num { background: var(--grad); color: #fff; border: none; }
.step.done .step-num { background: rgba(22, 163, 74, .14); color: var(--success); border-color: transparent; }
.step-line { flex: 1; height: 1px; background: var(--line); }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.pick-item {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.pick-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pick-item.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 94, 252, .12); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.pick-item h4 { margin: 0 0 4px; font-size: 13.5px; }
.pick-item p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pick-item .pick-meta { font-size: 10.5px; color: var(--muted); margin-top: 5px; }

.script-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; gap: 10px; }
.script-tools .left { font-size: 12.5px; font-weight: 650; }
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.ai-progress {
  height: 4px;
  margin: 0 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.ai-progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .35) 0 8px, transparent 8px 16px), var(--grad);
  background-size: 32px 100%, 100% 100%;
  animation: progress-stripes 1s linear infinite;
  transition: width .9s linear;
}
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.model-card {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.model-card:hover { border-color: var(--accent); }
.model-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109, 94, 252, .18); }
.model-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 650; }
.model-tag { padding: 1px 6px; border-radius: 999px; background: rgba(109, 94, 252, .12); color: var(--muted); font-size: 10.5px; font-weight: 500; }
.model-meta { margin: 4px 0 6px; color: var(--muted); font-size: 11.5px; }
.model-price { color: var(--accent); font-size: 15px; font-weight: 700; }
.summary-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.summary-line { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.summary-line span:first-child { color: var(--muted); }
.summary-line strong { text-align: right; }
.summary-script {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
}

/* ---------- 表格 / 后台 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .3px;
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--panel-2); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; letter-spacing: .4px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  border: none; background: transparent; padding: 10px 14px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 4px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(109, 94, 252, .16), transparent 60%),
    radial-gradient(50% 45% at 88% 85%, rgba(244, 114, 182, .16), transparent 60%),
    var(--bg);
}
.login-card {
  width: 920px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--panel);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.login-visual {
  padding: 44px 40px;
  background: var(--grad);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25);
  right: -120px; bottom: -140px;
}
.login-visual h2 { margin: 26px 0 10px; font-size: 27px; line-height: 1.45; letter-spacing: -.3px; }
.login-visual p { margin: 0; opacity: .84; line-height: 1.9; font-size: 13px; }
.login-features { display: grid; gap: 12px; margin-top: 26px; position: relative; z-index: 2; }
.login-feature { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; opacity: .95; }
.login-feature i {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 10px; flex: 0 0 18px;
}
.login-form { padding: 44px 40px; }
.login-form h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.4px; }
.login-form .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.tab-switch { display: flex; gap: 4px; background: var(--panel-2); border-radius: 11px; padding: 4px; margin-bottom: 22px; }
.tab-switch button {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer;
}
.tab-switch button.active { background: var(--panel); color: var(--text); box-shadow: 0 2px 8px rgba(20, 24, 40, .08); }
.login-foot { margin-top: 20px; font-size: 11.5px; color: var(--muted); line-height: 1.8; text-align: center; }
.login-foot a { color: var(--accent); }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; }
.toast {
  min-width: 220px;
  max-width: 480px;
  padding: 11px 16px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .2s ease;
}
.toast.success { border-color: rgba(22, 163, 74, .35); }
.toast.error { border-color: rgba(220, 38, 38, .35); }
.toast .bar { width: 3px; height: 18px; border-radius: 3px; background: var(--accent); }
.toast.success .bar { background: var(--success); }
.toast.error .bar { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.video-box { background: #000; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-box video { width: 100%; max-height: 62vh; display: block; }

.note {
  background: var(--grad-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text);
}
.note strong { color: var(--accent); }

.loading-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; gap: 10px;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 公告与客服 ---------- */
.announce-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px 14px;
  background: #FFFDF8;
  border: 1px solid #E8DFC9;
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  color: #5B5140;
  font-size: 13px;
  line-height: 1.7;
}
.announce-icon { width: 16px; height: 16px; color: var(--accent-2); flex: none; margin-top: 2px; }
.announce-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
.announce-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #A79C88;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.announce-close:hover { background: rgba(180, 154, 99, .12); color: #5B5140; }
.support-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease;
}
.support-btn:hover { border-color: #C9C2B4; }
.support-btn svg { width: 16px; height: 16px; }
.support-modal .modal-body { padding-top: 18px; }
.support-modal .modal-body img { display: block; margin: 0 auto; }
.field textarea.input { min-height: 84px; resize: vertical; line-height: 1.65; }

[data-theme="dark"] .announce-bar { background: #161511; border-color: #2C2820; color: #C9BFA9; }
[data-theme="dark"] .announce-close:hover { background: rgba(180, 154, 99, .16); color: #E2D2B2; }
[data-theme="dark"] .support-btn { background: var(--panel); }

@media (max-width: 980px) {
  .support-label { display: none; }
  .support-btn { padding: 0 9px; }
}

/* ---------- 简约高端主题（覆盖层） ---------- */
:root {
  --bg: #F5F3EE;
  --panel: #FFFFFF;
  --panel-2: #F1EFE9;
  --text: #171614;
  --muted: #7C766C;
  --line: #E4E0D6;
  --accent: #171614;
  --accent-2: #B49A63;
  --accent-3: #D8C8A8;
  --grad: linear-gradient(135deg, #1A1917, #2B2925);
  --grad-soft: #F2EFE7;
  --shadow: 0 1px 2px rgba(23, 22, 20, .04);
  --shadow-lg: 0 18px 50px rgba(23, 22, 20, .10);
}

body {
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sidebar {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
}
.brand-mark { background: #171614; border-radius: 9px; box-shadow: none; }
.brand-mark::after { background: var(--accent-2); opacity: 1; }
.brand-name { font-weight: 650; letter-spacing: .02em; }
.nav-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { border-radius: 9px; font-weight: 550; }
.nav-item.active { background: #171614; color: #fff; box-shadow: none; }
.nav-item.active .nav-icon { color: #fff; }
.nav-item:hover { background: var(--panel-2); }

.topbar {
  background: var(--bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 rgba(23, 22, 20, .04), 0 12px 28px -16px rgba(23, 22, 20, .35);
}
.avatar { background: #171614; color: #fff; box-shadow: none; }
.balance-chip {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--text);
}
.balance-chip svg, .balance-chip .spark { color: var(--accent-2); }

.section-head h2 { font-size: 23px; font-weight: 600; letter-spacing: .01em; }
.section-head p { color: var(--muted); font-size: 12.5px; }

.hero {
  background: #151412;
  border: 1px solid #23211D;
  border-radius: 18px;
  padding: 54px 50px;
  box-shadow: none;
  margin-bottom: 26px;
}
.hero::before, .hero::after { display: none; }
.hero-inner { max-width: 640px; }
.hero-kicker {
  background: transparent;
  border: 0;
  border-left: 2px solid var(--accent-2);
  border-radius: 0;
  padding: 0 0 0 12px;
  color: #C7B287;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: 39px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: .01em;
  margin-bottom: 14px;
}
.hero p { color: rgba(255, 255, 255, .58); font-weight: 300; line-height: 1.95; }
.hero .btn-light { background: #F5F3EE; color: #171614; border-radius: 9px; }
.hero .btn-outline { background: transparent; border-color: rgba(255, 255, 255, .22); color: #F5F3EE; }
.hero .btn-outline:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .04); }
.hero-badges {
  gap: 46px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-badges div { color: rgba(255, 255, 255, .5); font-size: 11.5px; letter-spacing: .04em; }
.hero-badges strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  color: #F5F3EE;
  letter-spacing: 0;
}

.btn {
  border-radius: 9px;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: none !important;
}
.btn:hover { transform: none; }
.btn-primary { background: #171614; color: #fff; }
.btn-primary:hover { background: #000; }
.btn-light { background: #fff; border: 1px solid var(--line); }
.btn-light:hover { border-color: #C9C2B4; }
.btn-outline { border-color: var(--line); }
.btn-outline:hover { border-color: #171614; color: #171614; background: transparent; }
.btn-danger { background: #fff; border-color: #E7C9C6; color: #A62B22; }
.btn-danger:hover { background: #FBF3F2; border-color: #D9A9A4; }

.card, .stat-card, .quick-card, .tpl-card, .table-wrap, .modal-card, .login-card {
  box-shadow: none;
  border-color: var(--line);
}
.card, .stat-card, .quick-card, .tpl-card { border-radius: 14px; }
.stat-card { padding: 20px 20px 18px; }
.stat-card .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.stat-card .value {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0;
}
.stat-card:hover, .quick-card:hover, .tpl-card:hover {
  transform: none;
  box-shadow: 0 12px 32px rgba(23, 22, 20, .06);
  border-color: #D6D0C3;
}
.quick-icon { background: var(--panel-2); color: #171614; border-radius: 10px; }
.quick-card h3 { font-weight: 600; }
.tpl-code { background: var(--panel-2); color: #171614; }
.tpl-cover .tpl-code { background: rgba(23, 22, 20, .72); color: #fff; }
.tpl-structure { background: #FAF9F5; }

.pick-item.selected, .model-card.active {
  border-color: #171614;
  box-shadow: 0 0 0 1px #171614;
  background: #fff;
}
.pick-item.selected .pick-meta, .model-card.active .model-meta { color: var(--muted); }
.model-tag { background: var(--panel-2); color: #6E6659; }
.model-price { color: #171614; font-family: Georgia, serif; font-weight: 500; }
.summary-box { background: #FAF9F5; }

.table th {
  background: #FAF9F5;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tabs button.active { color: #171614; border-bottom-color: #171614; }
.tabs button { font-weight: 550; }

.note { background: #FAF9F5; border-color: var(--line); }
.note strong { color: #171614; }

.login-page {
  background:
    radial-gradient(52% 42% at 12% 8%, rgba(180, 154, 99, .10), transparent 62%),
    var(--bg);
}
.login-card { border-radius: 18px; box-shadow: 0 30px 80px rgba(23, 22, 20, .10); }
.login-visual { background: #151412; }
.login-visual::after { border-color: rgba(255, 255, 255, .12); }
.login-feature i { background: rgba(180, 154, 99, .20); color: #E2D2B2; }
.login-visual h2 { font-weight: 600; letter-spacing: .01em; }
.tab-switch { background: var(--panel-2); }
.tab-switch button.active { box-shadow: none; border: 1px solid var(--line); }

.mobile-nav { background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); }
.mobile-nav button { border-radius: 8px; }
.mobile-nav button.active { background: #171614; }

[data-theme="dark"] {
  --bg: #0B0B0A;
  --panel: #121211;
  --panel-2: #191917;
  --text: #EFECE4;
  --muted: #8E8779;
  --line: #262521;
  --grad-soft: #1E1C18;
  --shadow: none;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .sidebar { background: rgba(18, 18, 17, .82); }
[data-theme="dark"] .topbar { background: var(--bg); }
[data-theme="dark"] .topbar.scrolled { background: var(--bg); box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 12px 28px -16px rgba(0, 0, 0, .85); }
[data-theme="dark"] .mobile-nav.scrolled { background: var(--panel); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .9); }
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .avatar {
  background: #EFECE4;
  color: #121211;
}
[data-theme="dark"] .mobile-nav { background: var(--panel); }
[data-theme="dark"] .mobile-nav button.active { background: transparent; color: #EFECE4; }
[data-theme="dark"] .mobile-nav button.active::after { background: #EFECE4; }
[data-theme="dark"] .nav-item.active .nav-icon { color: #121211; }
[data-theme="dark"] .btn-primary:hover { background: #fff; }
[data-theme="dark"] .balance-chip { background: var(--panel); }
[data-theme="dark"] .quick-icon { background: #1E1C18; color: #EFECE4; }
[data-theme="dark"] .hero { background: #151412; }
[data-theme="dark"] .table th,
[data-theme="dark"] .tpl-structure,
[data-theme="dark"] .summary-box,
[data-theme="dark"] .note { background: #161614; }
[data-theme="dark"] .btn-light { background: var(--panel); }
[data-theme="dark"] .step.active .step-num { background: #EFECE4; color: #121211; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .hero { padding: 36px 24px; border-radius: 16px; }
  .hero h1 { font-size: 28px; }
  .hero-badges { gap: 24px; }

  .mobile-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    height: 44px;
    overflow-x: auto;
    padding: 0 10px;
    background: var(--panel);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 29;
    scrollbar-width: none;
    transition: box-shadow .25s ease, background .25s ease;
  }
  .mobile-nav.scrolled {
    background: var(--panel);
    box-shadow: 0 10px 24px -16px rgba(23, 22, 20, .38);
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav button {
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    transition: color .15s ease;
  }
  .mobile-nav button.active { background: transparent; color: var(--text); }
  .mobile-nav button.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transform: translateX(-50%);
  }
  .nav-full { display: none; }
  .nav-short { display: inline; }
  .content { padding: 62px 16px 60px; }
  .topbar { padding: 0 16px; left: 0; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 26px; }
  .login-card { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form { padding: 32px 24px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 48px 1fr; }
  .task-side { grid-column: 1 / -1; justify-content: flex-end; }
}
