﻿/* ============================================================
   工作台（亮色）：只写布局和组件，颜色/圆角/按钮全部来自 tokens.css
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
img, video { display: block; }

/* ---------- 顶栏 ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  height: 60px; padding: 0 var(--s-6);
  /* 液态玻璃：半透明 + 高模糊，内容从下面滚过时能看到虚化 */
  background: rgba(255, 255, 255, .58);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: saturate(200%) blur(20px);
  -webkit-backdrop-filter: saturate(200%) blur(20px);
  border-bottom: 1px solid rgba(232, 233, 238, .6);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.brand { font-weight: 750; letter-spacing: .2px; font-size: 15.5px; color: var(--text); }
.brand span { color: var(--brand); }
.nav { display: flex; gap: var(--s-1); }
.nav button {
  height: var(--h-sm);
  padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: .15s ease;
}
.nav button:hover { background: var(--surface-3); color: var(--text); }
.nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }

/* ---------- 布局 ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: var(--s-6) var(--s-6) 90px; }
.page-head { display: flex; align-items: flex-end; gap: var(--s-3); margin-bottom: var(--s-5); flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.page-head .sub { color: var(--muted); padding-bottom: 2px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s-5);
}
.card + .card { margin-top: var(--s-4); }
.card-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 56px 0; }

/* ---------- 动作卡 ---------- */
.grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
}
.vc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.vc:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.vc-media { position: relative; aspect-ratio: 3 / 4; background: var(--surface-3); overflow: hidden; }
.vc-media img, .vc-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vc-media video { opacity: 0; transition: opacity .25s; }
.vc-media.playing video { opacity: 1; }
.vc-media.playing img { opacity: 0; }
.vc-dur {
  position: absolute; left: var(--s-2); bottom: var(--s-2); z-index: 2;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 11.5px; padding: 2px 9px; border-radius: var(--r-pill);
}
.vc-play {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  opacity: 0; background: rgba(0, 0, 0, .18); transition: .2s;
}
.vc:hover .vc-play { opacity: 1; }
.vc-play span {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  display: grid; place-items: center; color: #111; font-size: 15px; padding-left: 3px;
}
.vc-body { padding: var(--s-3) var(--s-3) var(--s-4); }
.vc-name {
  font-weight: 650; font-size: 13.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vc-meta { margin-top: 3px; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.vc-meta .pt { color: var(--brand); font-weight: 650; }

/* ---------- 播放器（固定暗色，靠 theme-dark 复用同一套组件） ---------- */
.player {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: var(--s-5);
  background: rgba(10, 11, 16, .74);
  backdrop-filter: blur(6px);
}
.player-card {
  position: relative; width: min(940px, 100%); max-height: 88vh;
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg);
}
.player-stage { background: #000; display: grid; place-items: center; min-height: 320px; }
.player-stage video { width: 100%; max-height: 78vh; object-fit: contain; }
.player-side { display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-6); }
.player-side h2 { margin: 0; font-size: 18px; }
.player-side .sub { color: var(--muted); font-size: 13px; margin-top: var(--s-1); }
.player-side .tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--s-3); }
.player-side .tag { background: var(--surface-3); color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill); }
.player-x {
  position: absolute; top: var(--s-3); right: var(--s-3); z-index: 3;
  width: var(--h-sm); height: var(--h-sm); border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 19px; line-height: 1; cursor: pointer;
}
.player-x:hover { background: rgba(0, 0, 0, .7); }

/* 面板里的内联登录 */
.ps-auth { display: flex; flex-direction: column; gap: var(--s-3); }
.ps-auth-title { font-size: 15.5px; font-weight: 700; }
.ps-auth-sub { font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.ps-err { color: var(--err); font-size: 12.5px; }
.ps-back {
  align-self: flex-start; border: 0; background: transparent;
  color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 2px 0;
}
.ps-back:hover { color: var(--text); }
.player-side.authing { justify-content: center; }
.player-side.authing .grow { display: none; }

/* ---------- 创作 ---------- */
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s-4);
  color: var(--muted); font-size: 13.5px; cursor: pointer;
}
.back:hover { color: var(--text); }
.studio { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.studio-preview {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-lg);
  overflow: hidden; background: #000; box-shadow: var(--shadow-md);
}
.studio-preview video { width: 100%; height: 100%; object-fit: cover; }
.studio-preview .badge {
  position: absolute; left: var(--s-2); bottom: var(--s-2);
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill);
}
.step { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-1) 0 var(--s-3); }
.step .n {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 12px; font-weight: 750;
}
.step h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.step .hint { color: var(--muted); font-size: 12.5px; }
.drop {
  display: grid; place-items: center; gap: var(--s-2);
  padding: var(--s-7) var(--s-5);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer;
  transition: .15s ease;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.drop .big { font-size: 30px; line-height: 1; }
.portrait { display: flex; align-items: center; gap: var(--s-3); }
.portrait img { width: 84px; height: 84px; border-radius: var(--r-md); object-fit: cover; }
.portrait .name { font-weight: 650; }

/* ---------- 进度 / 结果 ---------- */
.panel {
  margin-top: var(--s-4); padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.panel-head { display: flex; align-items: center; gap: var(--s-2); }
.panel-head strong { font-size: 15px; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--brand); }
.dot.run { animation: pulse 1.3s infinite; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--err); }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .2 } }
.bar { height: 5px; margin: var(--s-4) 0 var(--s-2); border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .6s ease; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); max-width: 780px; margin: var(--s-4) auto; }
.compare figure { margin: 0; }
.compare img { width: auto; max-width: 100%; max-height: 54vh; margin: 0 auto; border-radius: var(--r-md); background: var(--surface-3); }
.compare figcaption { margin-top: var(--s-2); color: var(--muted); font-size: 12.5px; }
.result video { width: 100%; max-height: 62vh; border-radius: var(--r-lg); background: #000; }

/* ---------- 提示条 ---------- */
.notice { padding: 11px var(--s-4); border-radius: var(--r-md); font-size: 13.5px; margin: var(--s-3) 0; }
.notice.ok { background: var(--ok-soft); color: #05603a; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.err { background: var(--err-soft); color: var(--err); }


/* ---------- 列表 / 表格 ---------- */
.list { display: flex; flex-direction: column; gap: var(--s-2); }
.item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.item .t { font-weight: 650; }
.item .s { color: var(--muted); font-size: 12.5px; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.run { background: var(--brand-soft); color: var(--brand); }
.badge.err { background: var(--err-soft); color: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px var(--s-2); border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
.codebox {
  padding: var(--s-3); border-radius: var(--r-md);
  background: #0f1115; color: #e6e8ec;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------- 后台 tabs ---------- */
.tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-4); flex-wrap: wrap; }
.tabs button {
  height: var(--h-sm); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--muted); font-size: 13.5px; cursor: pointer;
}
.tabs button:hover { background: var(--surface-3); color: var(--text); }
.tabs button.on { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); }

/* ---------- 后台：模板上架表单 ---------- */
.tpl-form {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
}

/* 左：选片 / 预览 */
.drop.sm {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 186px; padding: var(--s-5);
}
.drop-plus {
  width: 34px; height: 34px; margin-bottom: 2px;
  display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 50%;
  font-size: 19px; font-weight: 300; line-height: 1;
}
.drop.sm .drop-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.drop.sm:hover .drop-title { color: var(--brand); }
.drop.sm .drop-sub { font-size: 12px; }

.pick { display: flex; flex-direction: column; gap: var(--s-3); }
.pick video {
  width: 100%; max-height: 300px;
  aspect-ratio: var(--ar, 3 / 4);
  object-fit: contain;
  border-radius: var(--r-md); background: #000;
}
.pick-body { display: flex; flex-direction: column; gap: 3px; }
.pick-name {
  font-size: 13px; font-weight: 650; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pick-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-acts { display: flex; gap: var(--s-2); margin-top: var(--s-2); }

/* 右：字段 */
.tpl-fields .field { margin-bottom: var(--s-3); }
.tpl-fields .field:last-child { margin-bottom: 0; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.field-2 .field { margin-bottom: var(--s-3); }
.fhint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
/* 选了比原片还长的档位：能点，但要提示会被裁到原片长度 */
.chip.capped { color: var(--muted); border-style: dashed; }
.chip.capped.on { color: var(--brand); border-style: dashed; border-color: var(--brand); }

/* 进度：上传走真实百分比，切档阶段切换成不确定态 */
.up { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.up-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); font-size: 13px; font-weight: 600; }
.up-pct { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.up .bar { margin: var(--s-2) 0 0; }
.up-sub { margin-top: var(--s-2); font-size: 12px; color: var(--muted); }
.bar.indet i { width: 40% !important; animation: indet 1.15s ease-in-out infinite; }
@keyframes indet {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.form-foot { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-5); }
.form-foot .fhint { margin: 0; }

/* ---------- 后台：模板列表 ---------- */
.tpl-list { display: flex; flex-direction: column; gap: var(--s-2); }
.tl {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .15s ease, background .15s ease;
}
.tl:hover { border-color: var(--line-strong); background: var(--surface-2); }
.tl-cover {
  position: relative; width: 54px; height: 72px; flex: none;
  border-radius: var(--r-sm); overflow: hidden; background: var(--surface-3);
}
.tl-cover img, .tl-cover video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-cover video { opacity: 0; transition: opacity .2s; }
.tl-cover.playing video { opacity: 1; }
.tl-cover.playing img { opacity: 0; }
.tl-dur {
  position: absolute; left: 4px; bottom: 4px; z-index: 2;
  background: rgba(0, 0, 0, .58); color: #fff;
  font-size: 10.5px; padding: 1px 6px; border-radius: var(--r-pill);
}
.tl-main { flex: 1; min-width: 0; }
.tl-title { display: flex; align-items: center; gap: var(--s-2); font-weight: 650; font-size: 14px; }
.tl-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tl-time { color: var(--muted); font-size: 11.5px; margin-top: 2px; opacity: .8; }
.tl-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.tl-sep { width: 1px; height: 16px; margin: 0 2px; background: var(--line); }
.tl-acts .btn.danger { color: var(--muted); }
.tl-acts .btn.danger:hover { color: var(--err); }

.modal-card.wide { max-width: 520px; }

@media (max-width: 780px) {
  .tpl-form { grid-template-columns: 1fr; }
  .tl { flex-wrap: wrap; }
  .tl-acts { width: 100%; justify-content: flex-end; }
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: var(--s-5);
  background: rgba(16, 24, 40, .42);
}
.modal-card {
  position: relative; width: 100%; max-width: 390px;
  padding: var(--s-7); background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.modal-card h2 { margin: 0 0 var(--s-1); font-size: 20px; }
.modal-card > .muted { margin: 0 0 var(--s-5); font-size: 13px; }
.modal-x {
  position: absolute; top: var(--s-3); right: var(--s-3);
  width: var(--h-sm); height: var(--h-sm); border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.auth-switch { margin-top: var(--s-4); text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 右上角用户菜单 ---------- */
.user { position: relative; }
.avatar {
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; font-weight: 750;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(91, 75, 255, .28);
  transition: transform .15s ease;
}
.avatar:hover { transform: translateY(-1px); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 40;
  width: 238px; padding: var(--s-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: menuIn .14s ease-out;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
.um-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px 10px var(--s-3); margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.um-avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 750;
}
.um-mail { font-size: 13px; font-weight: 650; line-height: 1.3; word-break: break-all; }
.um-credit { margin-top: 2px; font-size: 12px; color: var(--muted); }
.um-credit b { color: var(--brand); }
.um-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font-size: 13.5px; cursor: pointer;
}
.um-item:hover { background: var(--surface-3); }
.um-item.danger { color: var(--err); }
.um-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 100;
  transform: translateX(-50%);
  padding: 11px var(--s-5); border-radius: var(--r-md);
  background: #16181d; color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .studio-preview { max-width: 300px; margin: 0 auto; }
  .player-card { grid-template-columns: 1fr; }
  .player-side { padding: var(--s-5); }
  .compare { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header { padding: 0 var(--s-4); gap: var(--s-2); }
  .page { padding: var(--s-5) var(--s-4) 70px; }
  .grid { grid-template-columns: 1fr 1fr; gap: var(--s-3); }
}
/* ---------- 播放器：始终「左视频 + 右侧信息/按钮」，横版只把卡片放宽 ---------- */
.player-card.wide { width: min(1120px, 100%); }
.player-card.wide .player-stage { aspect-ratio: 16 / 9; min-height: 0; }
.player-card.wide .player-stage video {
  width: 100%; height: 100%;
  max-height: 66vh;
  object-fit: contain;
}
.player-card.authing { width: min(940px, 100%); }
.player-card.wide.authing { width: min(1120px, 100%); }

@media (max-width: 900px) {
  .player-card.wide { width: 100%; }
  .player-card.wide .player-stage { aspect-ratio: auto; }
}
/* ---------- 创作页：一行一项的紧凑布局 ---------- */
.create-head { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-5); }
.create-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.price-tag { color: var(--brand); font-size: 13px; font-weight: 650; }

.crow { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: 18px; }
.clabel { width: 36px; flex: none; padding-top: 9px; color: var(--muted); font-size: 13px; }

.kfs { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.kf {
  position: relative; width: 64px; aspect-ratio: var(--kf-ar, 9 / 16);
  padding: 0; border: 2px solid transparent; border-radius: var(--r-sm);
  background: var(--surface-3); overflow: hidden; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.kf img { width: 100%; height: 100%; object-fit: cover; }
.kf:hover { border-color: var(--line-strong); }
.kf.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.kf .t {
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 10px; line-height: 16px;
  padding: 0 5px; border-radius: 4px;
}
.chint { margin-top: var(--s-2); color: var(--muted); font-size: 12.5px; }

.drop.compact {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 14px; font-size: 13.5px;
}
.drop .ico { font-size: 16px; line-height: 1; }
.foot-hint { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 创作页：左预览、右表单卡片；横版只是把预览拉宽 ---------- */
.studio { align-items: stretch; }
.studio-form {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: var(--s-6);
}
.studio-form .btn.primary.lg { margin-top: auto; }
.studio.wide { grid-template-columns: minmax(0, 1fr) 400px; }
.studio.wide .studio-preview { aspect-ratio: 16 / 9; max-width: none; }
.studio.wide .studio-form { max-width: none; }

@media (max-width: 900px) {
  .studio.wide { grid-template-columns: 1fr; }
  .studio.wide .studio-form { max-width: none; }
}

/* 视频固有尺寸不能撑开预览框（否则会压到右侧卡片） */
.studio-preview { position: relative; min-width: 0; }
.studio-preview video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

/* 预览框宽度严格跟随网格轨道，避免被视频固有尺寸撑开 */
.studio-preview { width: 100%; min-width: 0; }
.studio-form { min-width: 0; }

/* 预览按视频真实比例，关键帧固定 5 列不换行 */
.studio-preview { aspect-ratio: var(--tpl-ar, 9 / 16); }
.kfs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); }
.kf { width: auto; }

/* 关键帧缩略图限宽，别把卡片撑变形 */
.kfs { grid-template-columns: repeat(5, minmax(0, 76px)); justify-content: start; }
.kf { width: 100%; }

/* 关键帧放大成两行（3+2），看得清脸；点选不影响左侧播放 */
.studio, .studio.wide { grid-template-columns: minmax(0, 1fr) minmax(400px, 520px); }
.kfs { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: start; }
.kf { width: 100%; max-width: 170px; }
.kf .t { font-size: 11px; line-height: 18px; padding: 0 6px; }

/* 布局收敛：竖版预览 340、横版预览占主区；关键帧自适应列宽 */
.studio, .studio.wide { gap: var(--s-5); }
.studio { grid-template-columns: 340px minmax(0, 1fr); }
.studio.wide { grid-template-columns: minmax(0, 1fr) minmax(420px, 540px); }
.kfs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.kf { max-width: 140px; }

/* 竖版卡片宽度够 5 张一行时，不要折成 4+1 */
.kfs { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

.kfs { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.kf { max-width: 132px; }

/* 横版卡片收窄，关键帧一行刚好排满 */
.studio.wide { grid-template-columns: minmax(0, 1fr) 470px; }

/* 选中的关键帧要一眼看出来：其余弱化，选中放大提亮 */
.kf { transition: opacity .18s ease, filter .18s ease, transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.kf:not(.on) { opacity: .42; filter: saturate(.55); }
.kf:not(.on):hover { opacity: .85; filter: none; }
.kf.on { opacity: 1; filter: none; transform: scale(1.03); }
.kf.on::after {
  content: "已选"; position: absolute; right: 5px; top: 5px;
  background: var(--brand); color: #fff; font-size: 10px; line-height: 16px;
  padding: 0 6px; border-radius: 999px;
}

/* 关键帧提示条 */
.kf-tip {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 9px 12px; margin-bottom: 12px;
  background: var(--warn-soft); border: 1px solid rgba(180, 83, 9, .25);
  border-radius: var(--r-md);
  color: #7a4c05; font-size: 13px; line-height: 1.55;
}
.kf-tip b { color: #8a5a00; }
.kf-tip u { text-decoration: none; font-weight: 650; border-bottom: 1.5px solid rgba(180, 83, 9, .45); }
.kf-tip .ico {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--warn); color: #fff; font-size: 12px; font-weight: 750;
  display: grid; place-items: center;
}

/* ---------- 创作页：上视频、下表单 ---------- */
.stage {
  position: relative; display: grid; place-items: center;
  min-height: 240px; padding: 16px; margin-bottom: var(--s-4);
  background: #0b0b10; border-radius: var(--r-lg); overflow: hidden;
}
.stage video { max-width: 100%; max-height: 56vh; border-radius: var(--r-sm); }
.stage .badge {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: var(--r-pill);
}

.create-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: var(--s-6);
}
.create-head { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-5); }
.create-head h1 { margin: 0; font-size: 22px; letter-spacing: -.3px; }
.price-tag { color: var(--brand); font-size: 13px; font-weight: 650; }

/* 全宽 5 列，缩略图更大 */
.kfs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kf { max-width: none; }

.create-actions { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-4); }
.create-actions .foot-hint { flex: 1; margin: 0; text-align: left; }
.create-actions .btn { min-width: 260px; }

@media (max-width: 900px) {
  .kfs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .create-actions { flex-direction: column; align-items: stretch; }
  .create-actions .foot-hint { text-align: center; }
  .create-actions .btn { width: 100%; }
  .stage { padding: 10px; }
  .stage video { max-height: 42vh; }
}

/* 播放区控制按钮 */
.stage-ctrl { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.ctrl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 12.5px; cursor: pointer; backdrop-filter: blur(6px);
  transition: background .15s ease, border-color .15s ease;
}
.ctrl-btn:hover { background: rgba(0, 0, 0, .72); border-color: rgba(255, 255, 255, .3); }
.ctrl-btn span { font-size: 12.5px; }

/* ---------- 顶栏右侧高频入口 + 任务详情弹窗 ---------- */
.top-action {
  height: var(--h-sm); padding: 0 14px;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.top-action:hover { background: var(--surface-3); color: var(--text); }
.top-action.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }

.job-modal-card {
  position: relative; width: min(760px, 100%); max-height: 88vh; overflow: auto;
  padding: var(--s-6); background: var(--surface);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
}
.job-modal-card .panel { margin: 0; border: 0; box-shadow: none; padding: 0; }

/* 顶栏「我的作品」更像入口；任务弹窗里的视频与关闭按钮更清楚 */
.top-action { color: var(--text); }
.top-action:hover { background: var(--brand-soft); color: var(--brand); }

.job-modal-card .modal-x {
  background: var(--surface-3); color: var(--text);
  top: var(--s-2); right: var(--s-2);
}
.job-modal-card .modal-x:hover { background: var(--line-strong); }

.job-modal-card video {
  display: block; width: auto; max-width: 100%; max-height: 58vh;
  margin: 0 auto; border-radius: var(--r-md); background: #000;
}
.job-modal-card .result { text-align: center; }

/* 弹窗标题行给关闭按钮留位置，日期不要被压住 */
.job-modal-card .panel-head { padding-right: 44px; }

/* ---------- 动作库分页器 ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  margin-top: var(--s-6);
}
.pg, .pg-num {
  height: var(--h-sm); min-width: var(--h-sm); padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  font-size: 13px; cursor: pointer; transition: .15s ease;
}
.pg:hover:not(:disabled), .pg-num:hover { border-color: var(--line-strong); background: var(--surface-2); }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg-nums { display: flex; gap: var(--s-1); }
.pg-num.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }

/* ---------- 上传区：正经的拖拽区 ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 176px; padding: var(--s-6); text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.drop-ico { font-size: 26px; line-height: 1; }
.drop-title { font-size: 14.5px; font-weight: 650; color: var(--text); }
.drop:hover .drop-title, .drop.over .drop-title { color: var(--brand); }
.drop-sub { font-size: 12.5px; }

.portrait {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
}
.portrait img { width: 96px; height: 96px; border-radius: var(--r-md); object-fit: cover; }
.portrait .name { font-weight: 650; }
.ok-tag { color: var(--ok); background: var(--ok-soft); font-size: 12px; padding: 2px 9px; border-radius: var(--r-pill); }

/* ---------- 生成中：液态流动进度 ---------- */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar i {
  background: linear-gradient(90deg, #6d5cff, #a855f7, #38bdf8, #a855f7, #6d5cff);
  background-size: 300% 100%;
  animation: liquid 3s linear infinite;
  box-shadow: 0 0 14px rgba(124, 92, 255, .55);
}
@keyframes liquid { from { background-position: 0% 50% } to { background-position: -300% 50% } }

.panel.loading { position: relative; overflow: hidden; }
.panel.loading::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 200px at 18% 0%, rgba(124, 92, 255, .18), transparent 62%),
    radial-gradient(520px 200px at 82% 100%, rgba(56, 189, 248, .14), transparent 62%);
  animation: breathe 4.2s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: .5 } to { opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  .bar i, .panel.loading::before { animation: none; }
}

/* 选中关键帧后的确认提示 */
.kf-status { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.kf-status b { color: var(--brand); font-variant-numeric: tabular-nums; }
.kf.on::after { content: "✓ 已选"; }

/* ---------- 换脸确认：步骤提示 + 两个大按钮 ---------- */
.confirm-head {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-2); font-size: 16px; font-weight: 700;
}
.step-chip {
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: var(--r-pill);
}
.confirm-sub { margin-top: var(--s-2); font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.confirm-sub b { color: var(--text); }

.confirm-actions { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.confirm-actions .btn {
  flex: 1; height: 56px; font-size: 15.5px; border-radius: var(--r-lg);
}
.confirm-actions .btn.primary { box-shadow: 0 10px 26px rgba(91, 75, 255, .28); }

@media (max-width: 640px) {
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; }
}

/* ---------- 创作页：步骤条 / 行标题 / 底部提示 ---------- */
.csteps { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s-5); }
.cstep {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--muted); font-size: 12.5px;
  transition: .18s ease;
}
.cstep i {
  font-style: normal; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, .07); display: grid; place-items: center;
  font-size: 10px; font-weight: 750;
}
.cstep.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.cstep.on i { background: var(--brand); color: #fff; }
.cstep.done { color: var(--ok); background: var(--ok-soft); }
.cstep.done i { background: var(--ok); color: #fff; font-size: 0; }
.cstep.done i::before { content: "✓"; font-size: 10px; }

.crow-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: 9px; }
.crow-title { font-size: 13.5px; font-weight: 650; }
.crow-head .kf-status { margin: 0; }

.create-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-4); }
.gen-hint { font-size: 12.5px; color: var(--muted); }

.err-more { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.err-more summary { cursor: pointer; }
.err-more .mono {
  margin-top: var(--s-2); padding: 10px; border-radius: var(--r-sm);
  background: var(--surface-3); font-size: 11.5px; word-break: break-all;
}

.kf-hint { font-size: 12.5px; color: var(--muted); }

/* ---------- 动作库卡片：角标 / 复刻次数 / 轻微氛围 ---------- */
.vc { position: relative; }
.vc:hover { border-color: rgba(91, 75, 255, .35); box-shadow: 0 14px 34px rgba(23, 23, 40, .10); }

/* 封底压暗，保证角标和次数清晰 */
.vc-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(8, 8, 14, .55) 0%, rgba(8, 8, 14, 0) 42%),
    linear-gradient(to bottom, rgba(8, 8, 14, .30) 0%, rgba(8, 8, 14, 0) 30%);
}

.vc-badge {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; letter-spacing: .3px; color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.vc-badge.hot { background: linear-gradient(135deg, #ff9a3d, #ff4d6d); }
.vc-badge.new { background: linear-gradient(135deg, #6d5cff, #a855f7); }

.vc-uses {
  position: absolute; right: 9px; bottom: 9px; z-index: 3;
  height: 22px; display: inline-flex; align-items: center; padding: 0 9px;
  border-radius: var(--r-pill);
  background: rgba(12, 12, 18, .42);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  color: rgba(255, 255, 255, .94); font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.vc-dur { z-index: 3; background: rgba(12, 12, 18, .42); border: 1px solid rgba(255, 255, 255, .12); }

/* 第一名：金色 TOP 1；其余热门用橙红 */
.vc-badge.top {
  background: linear-gradient(135deg, #ffe08a, #ffb340);
  color: #4a2c00; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 4px 16px rgba(255, 179, 64, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.vc-badge.hot { box-shadow: 0 4px 14px rgba(255, 77, 109, .28), inset 0 1px 0 rgba(255, 255, 255, .3); }

/* 第一名卡片：极淡的金色描边，不抢内容 */
.vc.top1 { border-color: rgba(255, 179, 64, .42); }
.vc.top1:hover { border-color: rgba(255, 179, 64, .7); box-shadow: 0 14px 34px rgba(255, 150, 40, .16); }

/* ---------- 我的作品：列表 ---------- */
.job-item {
  display: flex; align-items: center; gap: var(--s-4);
  padding: 10px var(--s-3) 10px 10px; margin-bottom: var(--s-2);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.job-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.ji-thumb {
  width: 54px; height: 68px; flex: none; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-3);
}
.ji-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ji-main { flex: 1; min-width: 0; }
.ji-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ji-title span { color: var(--muted); font-weight: 400; font-size: 13px; }
.ji-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

/* ---------- 我的作品：详情 ---------- */
.jd { display: flex; flex-direction: column; gap: var(--s-4); }
.jd-head { display: flex; align-items: center; gap: var(--s-3); }
.jd-thumb {
  width: 48px; height: 60px; flex: none; border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-3);
}
.jd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jd-info { flex: 1; min-width: 0; }
.jd-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.jd-title span { color: var(--muted); font-weight: 500; font-size: 13px; }
.jd-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

.jd-chip {
  flex: none; height: 24px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 650; display: inline-flex; align-items: center;
}
.jd-chip.run { color: var(--brand); background: var(--brand-soft); }
.jd-chip.wait { color: #8a5a00; background: var(--warn-soft); }
.jd-chip.ok { color: var(--ok); background: var(--ok-soft); }
.jd-chip.err { color: var(--danger); background: var(--danger-soft); }
.jd-chip.mut { color: var(--muted); background: var(--surface-3); }

.jd-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-3); aspect-ratio: 16 / 10;
  display: grid; place-items: center;
}
.jd-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jd-stage.live img { filter: saturate(.9) brightness(.72); }
.jd-stage-empty { color: var(--muted); font-size: 13.5px; }
.jd-live {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  background: rgba(10, 10, 16, .5); backdrop-filter: blur(10px);
  color: #fff; font-size: 12.5px; font-weight: 600;
}
.jd-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #7cf7c4;
  box-shadow: 0 0 0 0 rgba(124, 247, 196, .7); animation: jdPulse 1.8s infinite;
}
@keyframes jdPulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 247, 196, .55); }
  70% { box-shadow: 0 0 0 7px rgba(124, 247, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(124, 247, 196, 0); }
}

.jd-video video { width: 100%; max-height: 56vh; border-radius: var(--r-lg); background: #000; display: block; }

.jd-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.jd-compare figure { margin: 0; }
.jd-compare img { width: 100%; border-radius: var(--r-lg); display: block; }
.jd-compare figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; }

.jd-steps { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.jd-step {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
}
.jd-step i {
  width: 18px; height: 18px; border-radius: 50%; font-style: normal;
  display: grid; place-items: center; font-size: 10px; font-weight: 750;
  background: var(--surface-3); color: var(--muted);
}
.jd-step.on { color: var(--brand); font-weight: 650; }
.jd-step.on i { background: var(--brand); color: #fff; animation: jdPulse 2s infinite; }
.jd-step.done { color: var(--ok); }
.jd-step.done i { background: var(--ok); color: #fff; }
.jd-arrow { width: 14px; height: 1px; background: var(--line-strong); display: inline-block; }

.jd-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.jd-actions { display: flex; gap: var(--s-3); }
.jd-actions .btn { flex: 1; }

/* ---------- 我的作品：作品墙 ---------- */
.job-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); }
.job-card {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.job-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.jc-media { position: relative; aspect-ratio: 3 / 4; background: var(--surface-3); overflow: hidden; }
.jc-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.job-card:hover .jc-media img { transform: scale(1.03); }
.jc-media .jd-chip { position: absolute; top: 8px; left: 8px; backdrop-filter: blur(8px); }
.jc-cta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(to top, rgba(8, 8, 14, .72), transparent);
  opacity: 0; transform: translateY(6px); transition: .2s ease;
}
.job-card:hover .jc-cta { opacity: 1; transform: none; }
.jc-body { padding: 10px 12px 14px; }

/* 详情里的媒体：保持原比例，不裁切 */
.jd-stage { background: #0b0b10; aspect-ratio: auto; }
.jd-stage img { object-fit: contain; max-height: 46vh; width: auto; margin: 0 auto; }
.jd-actions .btn:only-child { flex: none; min-width: 180px; margin-left: auto; }

/* 作品墙：加载更多 */
.load-more { display: flex; align-items: center; justify-content: center; gap: var(--s-3); margin-top: var(--s-5); }
.load-more .btn { min-width: 160px; }

@media (max-width: 1080px) { .job-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px) { .job-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .job-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 选画面：主标题 + 同级别副标题（加粗黑体） */
.crow-sub {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  display: inline-flex; align-items: center;
}
.crow-sub::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: var(--line-strong); margin: 0 9px 0 2px;
}

/* 生成按钮上方：本次消耗 */
.create-actions { align-items: flex-end; justify-content: space-between; }
.gen-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.gen-cost { font-size: 12.5px; color: var(--muted); }
.gen-cost b { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 消耗信息独占一行，放在生成按钮上方 */
.create-cost {
  display: flex; justify-content: flex-end;
  margin-top: var(--s-5); padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.create-cost:empty { display: none; }
.create-cost b { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.gen-cost { display: none; }

/* 生成按钮：两行，上面小字消耗，下面大字操作 */
.gen-btn {
  flex-direction: column; gap: 1px; height: 58px; line-height: 1.2;
  padding: 0 26px; min-width: 180px;
}
.gen-btn .gb-cost { font-size: 11.5px; font-weight: 500; opacity: .8; }
.gen-btn .gb-label { font-size: 15px; font-weight: 650; }
.gen-btn:disabled .gb-cost { opacity: .65; }
.create-cost { display: none; }

/* 工作台内嵌的详情：不要铺满整行，居中收窄 */
.jd-inline { max-width: 560px; margin: 0 auto; }
.jd-inline .jd-stage img { max-height: 300px; }
.jd-inline .jd-compare { gap: var(--s-3); }
.jd-inline .jd-compare img { max-height: 260px; object-fit: contain; background: var(--surface-3); }
.jd-inline .jd-video video { max-height: 320px; }
.jd-inline .jd-head { padding-bottom: 2px; }

/* 工作台内嵌详情：本身也要像一张卡片 */
.jd-inline {
  max-width: 620px; margin: var(--s-5) auto 0; padding: var(--s-5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.jd-inline .jd-compare img { width: 100%; }

/* ---------- 详情：媒体 + 侧栏 ---------- */
.jd-body { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
.jd-side { display: flex; flex-direction: column; gap: var(--s-3); }
.jd-media { min-width: 0; }

/* 工作台内嵌：和上面的创作卡同宽，内部左右两栏 */
.jd-inline { max-width: none; margin: var(--s-4) 0 0; }
.jd-inline .jd-body { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-5); align-items: start; }
.jd-inline .jd-media img { max-height: 340px; }
.jd-inline .jd-compare img { max-height: 340px; }
.jd-inline .jd-video video { max-height: 340px; }
.jd-inline .jd-actions { flex-direction: column; }
.jd-inline .jd-actions .btn { width: 100%; flex: none; margin-left: 0; }
.jd-inline .jd-stage { max-height: 340px; }
.jd-inline .jd-stage img { max-height: 340px; }

@media (max-width: 900px) {
  .jd-inline .jd-body { grid-template-columns: 1fr; }
}

/* 无画面的状态：浅底 + 最小高度，不要塌成一条黑边 */
.jd-stage { min-height: 200px; }
.jd-stage.plain { background: var(--surface-2); border: 1px dashed var(--line); }
.jd-stage.plain .jd-stage-empty { color: var(--muted); font-weight: 600; }

/* ---------- 充值 ---------- */
.bal-chip {
  height: var(--h-sm); display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand); font-size: 13px;
}
.bal-chip b { font-size: 15px; font-variant-numeric: tabular-nums; }

.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
.pack {
  position: relative; padding: var(--s-5) var(--s-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-align: center; transition: .18s ease;
}
.pack:hover { border-color: rgba(91, 75, 255, .4); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pack.hot { border-color: var(--brand); box-shadow: 0 10px 30px rgba(91, 75, 255, .16); }
.pk-badge {
  position: absolute; top: -1px; left: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #6d5cff, #a855f7); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 3px 12px; border-radius: var(--r-pill);
  box-shadow: 0 6px 16px rgba(109, 92, 255, .35);
}
.pk-name { font-size: 14px; color: var(--muted); font-weight: 600; }
.pk-credits { margin: var(--s-3) 0 4px; font-size: 30px; font-weight: 750; letter-spacing: -.5px; }
.pk-credits span { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.pk-desc { font-size: 12.5px; color: var(--muted); min-height: 18px; }
.pk-price { margin: var(--s-4) 0 var(--s-3); font-size: 18px; font-weight: 700; color: var(--text); }
.pack .btn { width: 100%; }

.pay-card {
  position: relative; width: min(420px, 100%); padding: var(--s-6);
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  text-align: center;
}
.pay-title { font-size: 18px; font-weight: 700; }
.pay-amount { margin: var(--s-3) 0 var(--s-5); color: var(--muted); }
.pay-qr-box {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  margin: 0 0 var(--s-5);
}
.pay-qr-box img {
  width: 200px; height: 200px; padding: var(--s-2); background: #fff;
  border-radius: var(--r-md); border: 1px solid var(--line); object-fit: contain;
}
.pay-qr-tip { font-size: 12px; color: var(--muted); }
.pay-card .btn.block { display: block; width: 100%; margin-bottom: var(--s-3); }
.pay-hint { font-size: 12.5px; }
.pay-hint.ok { color: var(--ok); }

/* ---------- 账单列表 ---------- */
.bill-list { display: flex; flex-direction: column; }
.bill-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.bill-row:last-child { border-bottom: 0; }
.bill-main { flex: 1; min-width: 0; }
.bill-title { font-size: 13.5px; font-weight: 600; }
.bill-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.bill-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bill-amount.plus { color: var(--ok); }
.bill-amount.minus { color: var(--muted); }
.bill-balance { font-size: 11.5px; color: var(--muted); min-width: 76px; text-align: right; }
.bill-empty { padding: 18px 0; color: var(--muted); font-size: 13px; }
.bill-more { margin-top: var(--s-3); text-align: center; }

/* 菜单里的充值入口：淡淡强调 + 小角标，不抢戏 */
.um-item.promo { color: var(--brand); font-weight: 650; }
.um-item.promo:hover { background: var(--brand-soft); }
.um-tag {
  margin-left: 8px; padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  color: #6a4300;
  background: linear-gradient(135deg, #ffe6a6, #ffc65c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* ---------- 充值：竖版定价卡 ---------- */
.packs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5); align-items: stretch; max-width: 980px;
}
.pack {
  position: relative; display: flex; flex-direction: column;
  min-height: 460px; padding: 34px 28px 26px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
  border: 1px solid var(--line); border-radius: 20px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pack:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(23, 23, 40, .10); border-color: var(--line-strong); }

.pack.pk-hot { }
.pack.hot {
  background: linear-gradient(165deg, #1b1733 0%, #2a2150 55%, #3a2a6b 100%);
  border-color: transparent; color: #fff;
  box-shadow: 0 26px 60px rgba(58, 42, 107, .32);
}
.pack.hot:hover { box-shadow: 0 30px 70px rgba(58, 42, 107, .4); }

.pk-name {
  font-size: 13px; font-weight: 650; letter-spacing: 2px;
  color: var(--muted); text-transform: uppercase;
}
.pack.hot .pk-name { color: rgba(255, 255, 255, .62); }

.pk-credits {
  margin-top: 26px; font-size: 46px; font-weight: 650; line-height: 1;
  letter-spacing: -1.5px; font-variant-numeric: tabular-nums;
}
.pk-credits span { margin-left: 6px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.pack.hot .pk-credits span { color: rgba(255, 255, 255, .55); }

.pk-desc { margin-top: 10px; font-size: 13px; color: var(--muted); }
.pack.hot .pk-desc { color: rgba(255, 255, 255, .55); }

.pk-perks {
  margin-top: 26px; padding-top: 22px; display: flex; flex-direction: column; gap: 11px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--text);
}
.pack.hot .pk-perks { border-top-color: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .82); }
.pk-perks span { position: relative; padding-left: 18px; }
.pk-perks span::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  font-size: 12px; font-weight: 700; color: var(--brand);
}
.pack.hot .pk-perks span::before { color: #b7a6ff; }

.pk-price { margin-top: auto; padding: 26px 0 18px; }
.pk-price b {
  font-size: 30px; font-weight: 700; letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
}
.pack.hot .pk-price b { color: #fff; }

.pk-badge {
  position: absolute; top: 22px; right: 22px;
  padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: #4a2c00;
  background: linear-gradient(135deg, #ffe6a6, #ffc65c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

.btn.inverse {
  background: #fff; color: #221a44; border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.btn.inverse:hover { background: #f3f0ff; }
.btn.block { display: block; width: 100%; }

@media (max-width: 900px) {
  .packs { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .pack { min-height: 0; padding: 26px 22px 22px; }
  .pk-credits { font-size: 38px; margin-top: 18px; }
}

/* 权益列表：整块居中、内部左对齐，勾选对齐成一列 */
.pk-perks { align-items: flex-start; width: max-content; margin-left: auto; margin-right: auto; }
.pk-perks span { text-align: left; }
.pk-perks span::before { position: absolute; }
/* 角标改成像挂在卡片顶边的丝带 */
.pk-badge {
  top: 0; right: auto; left: 50%; transform: translate(-50%, -50%);
  padding: 4px 14px;
}

/* 定价卡再收一收：居中、字号、质感 */
.packs { margin: 0 auto; }
.pk-credits { font-size: 50px; font-weight: 600; letter-spacing: -2px; }
.pack:not(.hot) { box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(23, 23, 40, .03); }
.pack:not(.hot):hover { box-shadow: 0 20px 44px rgba(23, 23, 40, .10); }
.pk-price b { font-size: 28px; }

.pay-note {
  max-width: 980px; margin: var(--s-5) auto 0;
  font-size: 12.5px; color: var(--muted); text-align: center; letter-spacing: .2px;
}
