/* 熊猫AI 全局样式 */

:root {
  --bg: #0f1117;
  --card: #161b26;
  --card-hover: #1c2333;
  --border: rgba(255, 255, 255, 0.06);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --amber: #fbbf24;
  --success: #34d399;
  --error: #f87171;
  --radius: 14px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body.page-body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(139, 92, 246, 0.12), transparent),
    var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* 导航 */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(16px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-left { display: flex; align-items: center; gap: 2rem; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.brand-text {
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links { display: none; gap: 0.25rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-links a, .nav-right a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover, .nav-right a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-right { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }

.nav-logout {
  color: var(--muted);
  text-decoration: none;
}

.nav-logout:hover { color: var(--text); }

.credit-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fcd34d;
  font-size: 0.75rem;
}

.vip-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  font-size: 0.7rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #818cf8, #8b5cf6);
}

.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8125rem; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover { background: var(--card-hover); }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-link-danger {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--error);
  cursor: pointer;
  text-decoration: none;
}

.btn-link-danger:hover { text-decoration: underline; }

/* Flash */
.flash-wrap { padding-top: 1rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.flash-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}

.flash-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

.main-content { padding: 2rem 0 3rem; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card-glass {
  background: rgba(22, 27, 38, 0.7);
  backdrop-filter: blur(12px);
}

/* 首页 Hero */
.home-hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  margin-bottom: 0.5rem;
}

.home-hero-inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.home-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.08);
  font-size: 0.875rem;
  font-weight: 600;
  color: #c7d2fe;
}

.home-hero-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.85rem;
}

.home-hero h1 {
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.85rem;
  background: linear-gradient(135deg, #f8fafc 0%, #a5b4fc 45%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero-lead {
  margin: 0 0 0.5rem;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text);
}

.home-hero-sub {
  margin: 0 0 1.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.home-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.home-stat {
  min-width: 96px;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(22, 27, 38, 0.65);
}

.home-stat strong {
  display: block;
  font-size: 1.5rem;
  color: #a5b4fc;
  line-height: 1.2;
}

.home-stat span {
  font-size: 0.75rem;
  color: var(--muted);
}

.home-section {
  margin-bottom: 2.75rem;
}

.home-section-head {
  margin-bottom: 1.25rem;
}

.home-section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.home-section-head p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.home-section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.home-section-link {
  color: var(--accent-hover);
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.home-feature {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 27, 38, 0.55);
}

.home-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.home-feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.home-feature p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.home-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.home-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.home-empty-desc {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 0.9375rem;
}

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.stats-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-item strong { display: block; font-size: 1.75rem; color: #a5b4fc; }
.stat-item span { font-size: 0.8rem; color: var(--muted); }

/* 模式标签 */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .mode-tabs { grid-template-columns: repeat(4, 1fr); }
}

.mode-tab {
  padding: 0.85rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.8125rem;
}

.mode-tab:hover { border-color: rgba(99, 102, 241, 0.4); color: #fff; }

.mode-tab.active {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.mode-tab .icon { font-size: 1.25rem; display: block; margin-bottom: 0.25rem; }

/* 创作页布局 */
.create-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .create-layout { grid-template-columns: 1fr 320px; }
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-textarea { min-height: 120px; resize: vertical; }

/* 上传区 */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-item img, .preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.65rem;
  padding: 2px 4px;
  text-align: center;
}

.upload-panel { display: none; }
.upload-panel.active { display: block; }

/* 作品网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.home-gallery {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

@media (max-width: 640px) {
  .home-gallery,
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .home-hero {
    padding: 2rem 0 1.5rem;
  }

  .home-features {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .home-feature {
    padding: 1rem;
  }
}

@media (max-width: 420px) {
  .home-features {
    grid-template-columns: 1fr;
  }
}

.work-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.work-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(99, 102, 241, 0.35);
}

.work-thumb {
  aspect-ratio: 16 / 9;
  background: #0a0c10;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.work-thumb-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #0a0c10;
}

.work-thumb-poster {
  z-index: 1;
}

.work-thumb-video {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.work-thumb-video.is-ready,
.work-card:hover .work-thumb-video.is-ready {
  opacity: 1;
}

.work-thumb--solo .work-thumb-video {
  opacity: 1;
}

.work-card:hover .work-thumb-poster {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .work-thumb-video.is-ready {
    opacity: 1;
  }

  .work-thumb-poster {
    z-index: 2;
    opacity: 1 !important;
  }

  .work-thumb--solo .work-thumb-video {
    z-index: 2;
  }

  .work-thumb:not(.work-thumb--solo) .work-thumb-video {
    opacity: 0 !important;
  }

  .work-card:hover .work-thumb-poster {
    opacity: 1 !important;
  }
}

.work-thumb .play-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s;
  background: rgba(0, 0, 0, 0.22);
}

.play-hint-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  background: rgba(99, 102, 241, 0.85);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding-left: 0.15rem;
}

.work-card:hover .play-hint {
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .work-card:hover .play-hint {
    opacity: 1;
  }
}

.video-card {
  cursor: pointer;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top))
           max(1rem, env(safe-area-inset-right))
           max(1rem, env(safe-area-inset-bottom))
           max(1rem, env(safe-area-inset-left));
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.video-modal[hidden] {
  display: none !important;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.video-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  background: rgba(15, 17, 23, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.video-modal-title {
  font-size: 0.8125rem;
  color: var(--muted);
}

.video-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
}

.video-modal-player,
.video-modal-panel .detail-video {
  width: 100%;
  max-width: 100%;
  max-height: calc(100dvh - 8rem);
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #000;
}

.video-modal-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.work-thumb video, .work-thumb img {
  /* 由 .work-thumb-media 统一控制 */
}

.work-thumb .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 2rem;
}

.work-meta { padding: 1rem; }

.work-meta p {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-meta .author {
  font-size: 0.75rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
}

.badge-t2v { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-i2v { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.badge-r2v { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.badge-v2v { background: rgba(244, 114, 182, 0.15); color: #f9a8d4; }

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-bar a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
}

.filter-bar a.active, .filter-bar a:hover {
  color: #c7d2fe;
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.page-subtitle {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: #fff; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.sidebar-card { position: sticky; top: 88px; }

.cost-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--amber);
}

.detail-video {
  width: 100%;
  max-width: 900px;
  border-radius: var(--radius);
  background: #000;
}

.ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.ref-grid img, .ref-grid video {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.pagination a, .pagination span {
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pagination a:hover { border-color: var(--accent); color: #fff; }
.pagination .current { background: rgba(99, 102, 241, 0.15); color: #c7d2fe; border-color: var(--accent); }

.auth-box { max-width: 420px; margin: 2rem auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data-table th, table.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th { color: var(--muted); font-weight: 500; }

.hidden { display: none !important; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.payment-mode-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.payment-section { margin-bottom: 1.75rem; }

.payment-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.plan-grid, .channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.plan-card, .channel-card {
  cursor: pointer;
}

.plan-card input, .channel-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card-body, .channel-card-body {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plan-card input:checked + .plan-card-body,
.channel-card input:checked + .channel-card-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.plan-amount {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.plan-credits {
  margin: 0.35rem 0 0;
  color: var(--amber);
  font-size: 0.9rem;
}

.plan-extra {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: rgba(251, 191, 36, 0.7);
}

.channel-card-body {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem;
}

.channel-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  background: var(--channel-color, var(--accent));
}

.channel-label { font-size: 0.9rem; font-weight: 500; }

.payment-checkout-amount {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.payment-checkout-channel {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.payment-checkout-credits {
  margin: 0.25rem 0 0;
  color: var(--amber);
}

.payment-checkout-order {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: monospace;
}

.payment-qr-box { margin-bottom: 1.25rem; }

.payment-qr-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.payment-qr-icon {
  display: inline-flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.payment-qr-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.payment-checkout-status {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  animation: pulse 1.5s ease infinite;
}

.payment-result-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.payment-result-success {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
}

.payment-result-pending {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
}

.payment-result-fail {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

/* Admin */
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 88px;
  padding: 1rem;
}

.admin-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.875rem;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}

.admin-back-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.admin-back-link:hover { color: var(--accent-hover); }

.admin-main { min-width: 0; }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-stat-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.admin-stat-card strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.admin-stat-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.admin-card-head h2,
.admin-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.admin-card-head a {
  font-size: 0.8rem;
  color: var(--accent-hover);
  text-decoration: none;
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.admin-form .form-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-form .form-input,
.admin-filter-bar .form-input {
  width: 100%;
  max-width: 320px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  font: inherit;
}

.admin-link {
  color: var(--accent-hover);
  text-decoration: none;
}

.admin-link:hover { text-decoration: underline; }

.btn-link-muted {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  cursor: pointer;
}

.btn-link-muted:hover { color: var(--accent-hover); }

.order-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.order-stat-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.order-stat-card strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
  color: var(--amber);
}

.order-stat-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }
}

/* --- 任务向导（5 步工作流） --- */
.workflow-shell {
  max-width: none;
  padding: 0;
  margin: 0;
}

.workflow-app {
  display: grid;
  grid-template-columns: 200px 280px 1fr;
  min-height: calc(100vh - 64px - 80px);
}

.workflow-sidebar {
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  background: rgba(15, 17, 23, 0.6);
}

.workflow-sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.workflow-sidebar-brand p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.workflow-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.workflow-nav-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.workflow-nav-item:hover,
.workflow-nav-item.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
}

.workflow-steps-panel {
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
}

.workflow-steps-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.workflow-debug-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}

.workflow-debug-card input { margin-top: 0.2rem; }

.workflow-debug-card span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.workflow-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.workflow-step-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  opacity: 0.55;
}

.workflow-step-item.current {
  opacity: 1;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.workflow-step-item.done { opacity: 0.85; }

.workflow-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.workflow-step-item.current .workflow-step-num {
  background: var(--accent);
  color: #fff;
}

.workflow-step-item strong {
  display: block;
  font-size: 0.875rem;
}

.workflow-step-item span {
  font-size: 0.72rem;
  color: var(--muted);
}

.workflow-main {
  padding: 1.5rem 2rem;
  overflow: auto;
}

.workflow-run-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.workflow-step-header { margin-bottom: 1.25rem; }

.workflow-step-badge {
  font-size: 0.75rem;
  color: var(--accent-hover);
  margin: 0 0 0.35rem;
}

.workflow-step-title {
  margin: 0;
  font-size: 1.5rem;
}

.workflow-step-desc {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workflow-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.project-card {
  display: block;
  cursor: pointer;
}

.project-card input { display: none; }

.project-card-body {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.15s, background 0.15s;
}

.project-card.selected .project-card-body,
.project-card input:checked + .project-card-body {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.project-card strong { display: block; margin-bottom: 0.35rem; }

.project-card span {
  font-size: 0.75rem;
  color: var(--muted);
}

.workflow-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.workflow-inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.workflow-inline-form .form-input { flex: 1; }

.workflow-new-project {
  margin-top: 1rem;
  padding: 1rem;
}

.workflow-new-project summary {
  cursor: pointer;
  color: var(--accent-hover);
  font-size: 0.875rem;
}

.workflow-placeholder code {
  font-size: 0.85rem;
  color: var(--amber);
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
}

.status-completed { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.status-running { background: rgba(99, 102, 241, 0.15); color: var(--accent-hover); }
.status-failed { background: rgba(248, 113, 113, 0.15); color: var(--error); }
.status-draft { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
.status-waiting_confirm { background: rgba(251, 191, 36, 0.15); color: var(--amber); }

.workflow-section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.workflow-upload-card {
  margin-bottom: 1.25rem;
}

.workflow-upload-form {
  margin-top: 0.5rem;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.benchmark-card {
  display: block;
  cursor: pointer;
}

.benchmark-card input { display: none; }

.benchmark-card-body {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
  transition: border-color 0.15s;
}

.benchmark-card.selected .benchmark-card-body,
.benchmark-card input:checked + .benchmark-card-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.benchmark-thumb {
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benchmark-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.benchmark-thumb-placeholder {
  font-size: 0.75rem;
  color: var(--muted);
}

.benchmark-meta {
  padding: 0.75rem;
}

.benchmark-meta strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.benchmark-meta span {
  font-size: 0.72rem;
  color: var(--muted);
}

.workflow-summary-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.875rem;
}

.workflow-summary-list span {
  color: var(--muted);
}

.workflow-debug-banner {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.workflow-debug-banner p {
  margin: 0;
  font-size: 0.875rem;
}

.workflow-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.workflow-provider-tag {
  font-size: 0.75rem;
  color: var(--muted);
}

.scene-table-wrap {
  overflow-x: auto;
}

.scene-table td {
  max-width: 220px;
  vertical-align: top;
  font-size: 0.8rem;
  line-height: 1.45;
}

.variant-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.variant-block summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.variant-prompt {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.5rem 0 1rem;
  overflow-x: auto;
}

.workflow-generate-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.workflow-generate-summary span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.video-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-task-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.35);
}

.task-status-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
}

.task-status-pill.status-succeeded { color: var(--success); }
.task-status-pill.status-running,
.task-status-pill.status-pending { color: var(--accent-hover); }
.task-status-pill.status-failed { color: var(--error); }

.task-prompt-preview {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.video-task-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.task-thumb-video {
  width: 160px;
  border-radius: 8px;
}

.task-pending-label,
.task-error-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.task-error-label { color: var(--error); }

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

@media (max-width: 960px) {
  .workflow-app {
    grid-template-columns: 1fr;
  }

  .workflow-sidebar,
  .workflow-steps-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .workflow-form-row {
    grid-template-columns: 1fr;
  }
}
