/* ============================================================
   聚创 · theme.css — 唯一设计 Token 事实源
   琥珀胶片金 + 影院近黑 | 移动端 H5 高保真原型
   ============================================================ */

:root {
  color-scheme: light;

  /* ---- 品牌 / 主色 ---- */
  --color-primary: #F5A623;
  --color-primary-strong: #EE9A0C;
  --color-primary-soft: #FEF3E0;
  --color-accent: #FF8A3D;
  --color-primary-gradient: linear-gradient(135deg, #F5A623 0%, #FF8A3D 100%);
  --color-on-primary: #2A1B05;

  /* ---- 浅色场 ---- */
  --color-background: #F5F6F8;
  --color-surface: #FFFFFF;
  --color-surface-2: #FAFAFB;
  --color-text: #17191F;
  --color-muted-text: #626A78;
  --color-faint-text: #9AA1AE;
  --color-border: #E6E9EE;
  --color-border-strong: #D7DBE2;

  /* ---- 深色沉浸场 ---- */
  --color-cinema: #0E0F12;
  --color-cinema-surface: #17191F;
  --color-cinema-surface-2: #1F222A;
  --color-cinema-text: #F2F3F5;
  --color-cinema-muted: #9AA1AE;
  --color-cinema-border: #2A2E37;

  /* ---- 状态色 ---- */
  --color-success: #2FB86E;
  --color-success-soft: #E4F7EE;
  --color-warning: #F59E0B;
  --color-warning-soft: #FEF3DC;
  --color-danger: #F2483E;
  --color-danger-soft: #FDEBE9;
  --color-info: #3B82F6;
  --color-info-soft: #E8F0FE;
  --color-focus: #F5A623;

  /* ---- 字体 ---- */
  --font-body: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- 字号 ---- */
  --fs-display: 22px;
  --fs-title: 17px;
  --fs-card-title: 15px;
  --fs-body: 14px;
  --fs-small: 12px;
  --fs-micro: 11px;

  /* ---- 间距 ---- */
  --space-unit: 0.25rem;
  --space-page: 16px;
  --space-gap: 12px;
  --space-section: 24px;

  /* ---- 圆角 ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- 层级 ---- */
  --shadow-card: 0 1px 2px rgba(16, 18, 24, 0.05), 0 4px 14px rgba(16, 18, 24, 0.05);
  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.18);
  --z-header: 40;
  --z-tabbar: 40;
  --z-sheet: 80;
  --z-toast: 100;

  /* ---- 触控 / 内容 ---- */
  --touch-target: 44px;
  --content-width: 480px;
  --header-h: 52px;
  --tabbar-h: 56px;
}

* { box-sizing: border-box; }

html {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  max-width: var(--content-width);
  margin-inline: auto;
  background: var(--color-background);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: var(--z-toast);
  padding: 10px 14px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }

/* ============================================================
   布局壳层
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--space-page) 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.app-header h1 {
  font-size: var(--fs-title);
  line-height: var(--header-h);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-btn {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
  color: var(--color-text);
}
.header-btn:last-child { margin-left: 0; margin-right: -8px; }

main {
  display: block;
  padding-bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom, 0px));
}
main.no-tabbar { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
main:focus { outline: none; }

.section { padding: var(--space-section) var(--space-page) 0; }
.section:first-child { padding-top: 16px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: var(--fs-title); }
.section-link {
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
}

/* ============================================================
   Tab Bar
   ============================================================ */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--content-width);
  z-index: var(--z-tabbar);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--color-border);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--fs-micro);
  color: var(--color-faint-text);
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.is-active { color: var(--color-primary-strong); font-weight: 600; }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--touch-target);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body);
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--color-primary-gradient);
  color: var(--color-on-primary);
  border-color: transparent;
}
.btn-gold-soft {
  background: var(--color-primary-soft);
  color: #9A6205;
  border-color: transparent;
}
.btn-dark {
  background: var(--color-cinema-surface);
  color: var(--color-cinema-text);
  border-color: transparent;
}
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--fs-small);
  border-radius: var(--radius-pill);
}

/* ============================================================
   Chips / 标签
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  white-space: nowrap;
}
.chip.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}
.chip-gold {
  background: var(--color-primary-soft);
  border-color: transparent;
  color: #9A6205;
  font-weight: 600;
}
.hscroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px var(--space-page);
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.hscroll.flush { padding-inline: 0; }

/* ============================================================
   角标 / 徽章
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-micro);
  font-weight: 600;
  background: var(--color-info-soft);
  color: var(--color-info);
}
.badge-success { background: var(--color-success-soft); color: #17824D; }
.badge-warn { background: var(--color-warning-soft); color: #B4690A; }
.badge-danger { background: var(--color-danger-soft); color: #C23027; }
.badge-muted { background: #EEF0F3; color: var(--color-muted-text); }
.badge-dark { background: rgba(255,255,255,0.12); color: var(--color-cinema-text); }
.badge-gold { background: rgba(245,166,35,0.18); color: var(--color-primary); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.dot.spin {
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   卡片
   ============================================================ */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(230, 233, 238, 0.8);
}
.card-pad { padding: 16px; }

/* ============================================================
   创作页 · 深色 Hero
   ============================================================ */

.hero {
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(245,166,35,0.22) 0%, rgba(245,166,35,0) 55%),
    var(--color-cinema);
  color: var(--color-cinema-text);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--space-page) 20px;
}
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--color-primary-gradient);
  display: grid;
  place-items: center;
  color: #2A1B05;
}
.brand-name { font-size: var(--fs-title); font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: var(--fs-micro); color: var(--color-cinema-muted); }

.team-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: var(--fs-small);
  color: var(--color-cinema-text);
}
.team-switch .avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-primary-gradient);
  color: #2A1B05;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

.hero-title {
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}
.hero-sub {
  font-size: var(--fs-small);
  color: var(--color-cinema-muted);
  margin-bottom: 16px;
}

/* 模式大卡 */
.mode-cards { display: grid; gap: 12px; }
.mode-card {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--color-cinema-surface);
  border: 1px solid var(--color-cinema-border);
  color: var(--color-cinema-text);
  overflow: hidden;
}
.mode-icon, .mode-body { position: relative; z-index: 2; }
.mode-card::after {
  content: "";
  position: absolute;
  right: -28px; top: -28px;
  width: 110px; height: 110px;
  background: radial-gradient(closest-side, rgba(245,166,35,0.18), transparent);
}
.mode-icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: rgba(245,166,35,0.14);
  color: var(--color-primary);
}
.mode-body { flex: 1; min-width: 0; }
.mode-body h3 { font-size: var(--fs-card-title); margin-bottom: 3px; }
.mode-body p { font-size: var(--fs-small); color: var(--color-cinema-muted); line-height: 1.5; }
.mode-tag {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-micro);
  color: var(--color-primary);
}

/* 风格库卡片 */
.style-card {
  width: 104px;
  flex: 0 0 auto;
}
.style-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 7px;
}
.style-thumb .style-name {
  position: absolute;
  left: 8px; bottom: 7px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
.style-meta {
  font-size: var(--fs-micro);
  color: var(--color-faint-text);
}

/* 最近项目 */
.recent-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px var(--space-page);
}
.recent-row::-webkit-scrollbar { display: none; }
.recent-card { flex: 0 0 200px; }

/* ============================================================
   缩略图（纯 CSS + 中文标注）
   ============================================================ */

.thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.thumb .thumb-label {
  position: relative;
  z-index: 2;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  text-align: center;
  padding: 0 8px;
  text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(0,0,0,0.28));
}
/* 胶片孔装饰 */
.thumb .film-holes {
  position: absolute;
  z-index: 1;
  top: 0; left: 0; right: 0;
  height: 7px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.35) 1.6px, transparent 2.2px);
  background-size: 12px 7px;
  background-repeat: repeat-x;
  background-position: 3px 2px;
}
.t-snow { background: linear-gradient(160deg, #6B8CAE, #33455C 70%, #1E2735); }
.t-dusk { background: linear-gradient(160deg, #E8915A, #A04E3C 65%, #4A2222); }
.t-night { background: linear-gradient(160deg, #2A3550, #141A2B 70%, #0B0E18); }
.t-guofeng { background: linear-gradient(160deg, #C98B5E, #8C4A38 60%, #4E2620); }
.t-sai-bo { background: linear-gradient(160deg, #2E6E8E, #1B3A5C 60%, #0C1B2E); }
.t-2d { background: linear-gradient(160deg, #E7A98C, #C56E5C 60%, #7A3C38); }
.t-forest { background: linear-gradient(160deg, #5E8A68, #345C42 65%, #1C3326); }
.t-portrait { background: linear-gradient(160deg, #B9C4D4, #78849A 65%, #3E4657); }
.t-prop { background: linear-gradient(160deg, #C9B392, #96795A 65%, #5A4632); }
.t-video { background: linear-gradient(160deg, #3A4050, #1C2029 70%, #10131A); }
.t-audio { background: linear-gradient(160deg, #4E5A78, #2B3247 70%, #161B2B); }
.t-real { background: linear-gradient(160deg, #9AA7BE, #5E6B84 65%, #333C4E); }

/* ============================================================
   项目列表
   ============================================================ */

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  margin: 12px var(--space-page) 4px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-faint-text);
}
.searchbar input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: var(--fs-body);
}
.searchbar svg { flex: 0 0 auto; }

.project-list { padding: 12px var(--space-page) 0; display: grid; gap: 12px; }
.project-card {
  display: flex;
  gap: 12px;
  padding: 12px;
}
.project-cover {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 120px;
  border-radius: var(--radius-md);
}
.project-cover .cover-state {
  position: absolute;
  left: 6px; bottom: 6px;
  z-index: 3;
}
.project-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project-info h3 {
  font-size: var(--fs-card-title);
  line-height: 1.4;
}
.project-meta {
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.project-meta .sep { color: var(--color-border-strong); }
.progress {
  height: 5px;
  border-radius: var(--radius-pill);
  background: #EDF0F3;
  overflow: hidden;
  margin-top: 2px;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary-gradient);
}
.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-micro);
  color: var(--color-faint-text);
}

/* ============================================================
   工作台 · 步骤条
   ============================================================ */

.workspace-header h1 { font-size: var(--fs-card-title); }

.stage-bar {
  display: flex;
  align-items: flex-start;
  padding: 14px var(--space-page) 6px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.stage-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  font-size: var(--fs-small);
  color: var(--color-faint-text);
  background: none;
}
.stage-step::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}
.stage-step:first-child::before { display: none; }
.stage-step.is-done::before { background: var(--color-primary); }
.stage-dot {
  position: relative;
  z-index: 1;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border-strong);
  display: grid;
  place-items: center;
  color: var(--color-faint-text);
  font-size: 12px;
  font-weight: 700;
}
.stage-step.is-done .stage-dot {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}
.stage-step.is-current { color: var(--color-text); font-weight: 600; }
.stage-step.is-current .stage-dot {
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.stage-panel { display: none; }
.stage-panel.is-active { display: block; }

.stage-summary {
  margin: 14px var(--space-page) 0;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.stage-summary .summary-ic {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-success-soft);
  color: var(--color-success);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.stage-summary h3 { font-size: var(--fs-card-title); margin-bottom: 2px; }
.stage-summary p { font-size: var(--fs-small); color: var(--color-muted-text); }

/* 生成提示条 */
.gen-notice {
  margin: 12px var(--space-page) 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
  color: #8A5A12;
  font-size: var(--fs-small);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gen-notice svg { flex: 0 0 auto; animation: spin 1.4s linear infinite; }

/* 集切换 */
.episode-bar { padding-top: 14px; }
.episode-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px var(--space-page);
}
.episode-chips::-webkit-scrollbar { display: none; }
.ep-chip {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: var(--touch-target);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  font-weight: 600;
}
.ep-chip.is-active {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #fff;
}
.ep-chip small { display: block; font-size: 10px; font-weight: 400; opacity: 0.75; }
.ep-chip.is-active small { opacity: 0.7; }

.episode-panel { display: none; }
.episode-panel.is-active { display: block; }
.shot-list { padding: 14px var(--space-page) 0; display: grid; gap: 12px; }

/* ============================================================
   分镜卡
   ============================================================ */

.shot-card { padding: 12px; }
.shot-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.shot-no {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--color-text);
}
.shot-no .clapper { color: var(--color-primary-strong); display: inline-flex; }
.shot-duration {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--color-muted-text);
}
.shot-top .badge { margin-left: auto; }

.shot-main { display: flex; gap: 12px; }
.shot-thumb {
  position: relative;
  flex: 0 0 128px;
  width: 128px;
  height: 90px;
  border-radius: var(--radius-sm);
}
.shot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-micro);
  background: #F1F3F6;
  color: var(--color-muted-text);
}
.ref-chip.role { background: var(--color-info-soft); color: #2B5FC0; }
.ref-chip.scene { background: #FDF0E2; color: #B35E1E; }
.shot-line {
  position: relative;
  font-size: var(--fs-small);
  color: var(--color-text);
  line-height: 1.55;
  padding-left: 9px;
}
.shot-line::before {
  content: "";
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 2.5px;
  border-radius: 2px;
  background: var(--color-primary);
}
.shot-line .speaker { color: var(--color-muted-text); margin-right: 4px; }
.move-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-micro);
  color: var(--color-muted-text);
}
.shot-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
}
.shot-actions .btn { flex: 1; }

/* 分镜生成中骨架 */
.shot-card.is-loading .shot-thumb {
  background: linear-gradient(100deg, #E7EAEE 30%, #F4F6F8 50%, #E7EAEE 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: #EDF0F3;
}
.loading-caption {
  font-size: var(--fs-micro);
  color: var(--color-muted-text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.loading-caption .dot { background: var(--color-warning); }

/* 空状态 */
.empty-state {
  margin: 14px var(--space-page) 0;
  padding: 34px 20px;
  text-align: center;
}
.empty-state .empty-ic {
  width: 58px; height: 58px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  display: grid; place-items: center;
}
.empty-state h3 { font-size: var(--fs-card-title); margin-bottom: 6px; }
.empty-state p { font-size: var(--fs-small); color: var(--color-muted-text); line-height: 1.6; margin-bottom: 14px; }

/* ============================================================
   底部固定操作坞
   ============================================================ */

.action-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--content-width);
  z-index: 30;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
}
.select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  min-height: var(--touch-target);
}
.checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--color-border-strong);
  display: grid;
  place-items: center;
  color: transparent;
  flex: 0 0 auto;
}
.select-all.is-checked .checkbox,
.shot-check.is-checked .checkbox {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}
.shot-check {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 5;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
}
.shot-card { position: relative; }
.dock-spacer { height: 92px; }
.dock-info { flex: 1; min-width: 0; }
.dock-info strong { display: block; font-size: var(--fs-body); }
.dock-info span { font-size: var(--fs-micro); color: var(--color-muted-text); }
.action-dock .btn-primary { flex: 0 0 auto; }

/* ============================================================
   视频阶段 · 黑色时间线
   ============================================================ */

.video-stage-wrap {
  background: var(--color-cinema);
  min-height: 70vh;
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
.video-stage-wrap .stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-page);
}
.video-stage-wrap .stage-head h2 {
  color: var(--color-cinema-text);
  font-size: var(--fs-card-title);
}
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-gradient);
  color: var(--color-on-primary);
  font-size: var(--fs-small);
  font-weight: 600;
}
.player {
  position: relative;
  margin: 0 var(--space-page);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(80% 100% at 50% 0%, #20283A 0%, #0D1018 70%);
  border: 1px solid var(--color-cinema-border);
}
.player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.play-big {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid rgba(255,255,255,0.75);
  display: grid;
  place-items: center;
  color: #fff;
}
.tc-overlay {
  position: absolute;
  right: 10px; top: 9px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: #FFD98A;
  background: rgba(0,0,0,0.45);
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}
.player-label {
  position: absolute;
  left: 10px; bottom: 9px;
  z-index: 2;
  font-size: var(--fs-micro);
  color: rgba(255,255,255,0.8);
}
.player-bar {
  position: absolute;
  left: 10px; right: 10px; bottom: 26px;
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}
.player-bar > span { display: block; width: 42%; height: 100%; background: var(--color-primary); border-radius: 2px; }

.tl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--space-page) 8px;
  color: var(--color-cinema-muted);
  font-size: var(--fs-small);
}
.tl-meta .duration { font-family: var(--font-mono); color: #FFD98A; }
.timeline {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px var(--space-page) 8px;
  scrollbar-width: thin;
}
.timeline::-webkit-scrollbar { height: 4px; }
.timeline::-webkit-scrollbar-thumb { background: var(--color-cinema-border); border-radius: 4px; }
.tl-clip {
  flex: 0 0 auto;
  width: 88px;
}
.tl-thumb {
  position: relative;
  height: 58px;
  border-radius: 6px;
  border: 1px solid var(--color-cinema-border);
}
.tl-thumb .clip-no {
  position: absolute;
  left: 5px; top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.tl-thumb .clip-dur {
  position: absolute;
  right: 4px; bottom: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #FFD98A;
}
.tl-clip.is-pending .tl-thumb {
  background: repeating-linear-gradient(-45deg, #1B1E26, #1B1E26 6px, #232731 6px, #232731 12px);
  border-style: dashed;
}
.tl-clip.is-pending .clip-no, .tl-clip.is-pending .clip-dur { color: var(--color-cinema-muted); text-shadow: none; }
.tl-track {
  margin: 0 var(--space-page);
  height: 10px;
  border-radius: 3px;
  background: var(--color-cinema-surface);
  border: 1px solid var(--color-cinema-border);
  display: flex;
}
.tl-track span {
  display: grid;
  place-items: center;
  font-size: 9px;
  color: var(--color-cinema-muted);
  border-right: 1px solid var(--color-cinema-border);
}
.tl-track span:last-child { border-right: 0; }
.video-hint {
  margin: 12px var(--space-page) 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-cinema-surface);
  border: 1px solid var(--color-cinema-border);
  color: var(--color-cinema-muted);
  font-size: var(--fs-small);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.video-hint svg { flex: 0 0 auto; color: var(--color-primary); margin-top: 1px; }
.back-to-shots {
  margin: 14px var(--space-page) 0;
  width: calc(100% - 32px);
}

/* ============================================================
   资产页
   ============================================================ */

.cat-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}
.cat-tab-list {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--space-page);
}
.cat-tab-list::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto;
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-body);
  color: var(--color-muted-text);
  position: relative;
  white-space: nowrap;
}
.cat-tab.is-active { color: var(--color-text); font-weight: 700; }
.cat-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary-gradient);
}
.asset-panel { display: none; }
.asset-panel.is-active { display: block; }
.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px var(--space-page) 0;
}
.asset-card { padding: 10px; }
.asset-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
}
.asset-thumb .portrait-mark {
  position: absolute;
  right: 6px; bottom: 6px;
  z-index: 3;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  display: grid;
  place-items: center;
  color: #FFD98A;
}
.asset-card h3 { font-size: var(--fs-body); margin-bottom: 3px; }
.asset-card .sub { font-size: var(--fs-micro); color: var(--color-muted-text); margin-bottom: 7px; }
.asset-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #EEF1F5;
  color: var(--color-muted-text);
}
.mini-badge.gold { background: var(--color-primary-soft); color: #9A6205; }
.asset-wide { aspect-ratio: 4 / 3; }

/* ============================================================
   我的
   ============================================================ */

.me-hero {
  background:
    radial-gradient(120% 120% at 90% -30%, rgba(245,166,35,0.2) 0%, rgba(245,166,35,0) 55%),
    var(--color-cinema);
  color: var(--color-cinema-text);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--space-page) 18px;
}
.me-account { display: flex; align-items: center; gap: 13px; }
.me-avatar {
  width: 54px; height: 54px;
  border-radius: var(--radius-md);
  background: var(--color-primary-gradient);
  color: var(--color-on-primary);
  font-size: 20px;
  font-weight: 700;
  display: grid; place-items: center;
}
.me-id { flex: 1; min-width: 0; }
.me-id h2 { font-size: var(--fs-title); margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.verify-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(47,184,110,0.18);
  color: #58D99A;
}
.me-id p { font-size: var(--fs-small); color: var(--color-cinema-muted); }

.balance-card {
  margin: -10px var(--space-page) 0;
  position: relative;
  padding: 16px;
  overflow: hidden;
}
.balance-card::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 18px solid rgba(245,166,35,0.08);
}
.balance-label { font-size: var(--fs-small); color: var(--color-muted-text); display: flex; align-items: center; gap: 6px; }
.balance-amount { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin: 4px 0 2px; }
.balance-amount .yen { font-size: 17px; font-weight: 700; margin-right: 2px; color: var(--color-muted-text); }
.balance-sub { font-size: var(--fs-micro); color: var(--color-faint-text); }
.balance-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-small);
}
.balance-foot a {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--color-muted-text); min-height: 32px;
}
.balance-foot .charge { color: var(--color-primary-strong); font-weight: 700; }

.points-card {
  margin: 12px var(--space-page) 0;
  padding: 16px;
}
.points-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.points-head h3 { font-size: var(--fs-card-title); }
.points-num { font-size: var(--fs-small); color: var(--color-muted-text); }
.points-num strong { font-size: 18px; color: var(--color-text); }
.points-card .progress { height: 7px; }
.points-foot {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-micro);
  color: var(--color-faint-text);
}

.me-menu {
  margin: 12px var(--space-page) 0;
  overflow: hidden;
}
.menu-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--color-surface);
  text-align: left;
  font-size: var(--fs-body);
  border-bottom: 1px solid var(--color-border);
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .menu-ic {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: #F4F6F9;
  color: var(--color-muted-text);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.menu-item .menu-label { flex: 1; }
.menu-item .menu-value { font-size: var(--fs-small); color: var(--color-faint-text); }
.menu-item .chevron { color: var(--color-faint-text); display: inline-flex; }

/* ============================================================
   Sheet / Action Sheet / Toast
   ============================================================ */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(8, 9, 12, 0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-overlay.is-open { display: flex; }
.sheet {
  width: 100%;
  max-width: var(--content-width);
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-float);
  transform: translateY(16px);
  opacity: 0.6;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.sheet-overlay.is-open .sheet { transform: translateY(0); opacity: 1; }
.sheet-grab {
  width: 38px; height: 4px;
  border-radius: 3px;
  background: #D8DCE2;
  margin: 4px auto 12px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sheet-head h3 { font-size: var(--fs-title); }
.sheet-close {
  min-width: 36px; min-height: 36px;
  display: grid; place-items: center;
  color: var(--color-muted-text);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  font-size: var(--fs-body);
  border-bottom: 1px solid var(--color-border);
}
.cost-row:last-of-type { border-bottom: 0; }
.cost-row span { color: var(--color-muted-text); }
.cost-row strong { font-weight: 600; }
.cost-total {
  margin-top: 8px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cost-total span { font-size: var(--fs-small); color: #9A6205; }
.cost-total strong { font-size: 19px; color: #8A5605; }
.cost-total strong em { font-style: normal; font-size: 12px; margin-right: 2px; }
.sheet-note {
  margin: 10px 0 14px;
  font-size: var(--fs-small);
  color: var(--color-muted-text);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.sheet-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--color-primary-strong); }
.sheet .btn-block + .btn-block { margin-top: 10px; }
.sheet-cancel {
  margin-top: 10px;
  color: var(--color-muted-text);
  background: #F3F5F8;
  border-color: transparent;
}

.action-list { display: grid; gap: 2px; }
.action-item {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.action-item:last-child { border-bottom: 0; }
.action-ic {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.action-item .action-body { flex: 1; min-width: 0; }
.action-item strong { display: block; font-size: var(--fs-body); font-weight: 600; }
.action-item span { font-size: var(--fs-micro); color: var(--color-muted-text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  z-index: var(--z-toast);
  max-width: 80%;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(20, 22, 28, 0.92);
  color: #fff;
  font-size: var(--fs-small);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

body.no-scroll { overflow: hidden; }

/* ============================================================
   降级：无 JS 时通过 :target 显示阶段面板
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
