:root {
  --bg: #0c0c0e;
  --bg2: #14141a;
  --panel: #1a1a20;
  --panel2: #25252c;
  --border: #2e2e37;
  --border2: #3f3f4a;
  --text: #f4f4f5;
  --muted: #a8a8b1;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 12px;
  --sidebar-w: 224px;
  --chat-w: 860px;        /* 对话列统一宽度：与首页 hero-box 的 860px 一致，消息区/进度/输入框三者左右边缘对齐 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; }

/* ---------- 通用 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border2);
  background: var(--panel2); color: var(--text); cursor: pointer;
  font-size: 14px; transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04231a; font-weight: 600; }
.btn-primary:hover { background: var(--accent2); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

.input, textarea.input, select.input {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border2); background: var(--bg2); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 90px; resize: vertical; }
label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; border: 1px solid var(--border2); color: var(--muted);
}
.badge-green { color: #34d399; border-color: #0f766e; background: rgba(16,185,129,.1); }
.badge-accent { color: #a5b4fc; border-color: #4338ca; background: rgba(99,102,241,.15); }
.badge-amber { color: #fbbf24; border-color: #92400e; background: rgba(245,158,11,.1); }
.badge-red { color: #f87171; border-color: #7f1d1d; background: rgba(239,68,68,.1); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:hover td { background: rgba(255,255,255,.02); }

.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.pre {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 18px; border-radius: 8px; z-index: 999; display: none;
  max-width: 80vw; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.show { display: block; animation: fade .2s; }
.toast.err { border-color: var(--danger); }
@keyframes fade { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; } }

/* ---------- Landing ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--border); background: rgba(11,11,12,.8);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 10;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.logo .mark {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-weight: 800;
}
.hero { text-align: center; padding: 72px 24px 40px; }
.hero h1 { font-size: 40px; margin-bottom: 16px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0 auto 28px; }
.section { padding: 40px 32px; max-width: 1120px; margin: 0 auto; width: 100%; }
.section-title { text-align: center; margin-bottom: 28px; }
.section-title h2 { font-size: 26px; }
.footer {
  border-top: 1px solid var(--border); padding: 24px 32px; color: var(--muted);
  text-align: center; font-size: 13px; margin-top: auto;
}

.skill-card { display: flex; flex-direction: column; gap: 10px; }
.skill-card .price { font-size: 22px; font-weight: 700; color: var(--accent); }
.skill-card .desc { color: var(--muted); min-height: 44px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; transition: border-color .15s, transform .15s; }
.step:hover { border-color: var(--border2); transform: translateY(-3px); }
.step .n {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 14px; font-size: 15px;
}

/* ---------- 控制台 ---------- */
.console { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--bg2); border-right: 1px solid var(--border);
  padding: 16px 12px; position: fixed; top: 0; bottom: 0; overflow-y: auto;
}
.sidebar .logo { padding: 4px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.nav-group { margin-bottom: 8px; }
.nav-title { font-size: 11px; color: var(--muted); padding: 8px; text-transform: uppercase; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--muted); cursor: pointer; text-decoration: none; font-size: 14px;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel2); color: var(--text); border-left: 3px solid var(--accent); }
.nav-item .ic { width: 18px; text-align: center; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 24px;
  border-bottom: 1px solid var(--border); background: rgba(11,18,32,.7); position: sticky; top: 0;
  z-index: 5; backdrop-filter: blur(6px);
}
.content { padding: 24px; flex: 1; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 700; }

/* ---------- 认证 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .hero h1 { font-size: 30px; }
}

/* ---------- 落地页 hero 输入框 ----------
   外壳不再自己画框：内部就是创作页那块共用的 .chat-composer，视觉完全一致 */
.hero-box { max-width: 760px; margin: 24px auto 0; text-align: left; }
.hero-box .chat-composer { max-width: none; box-shadow: 0 10px 44px rgba(0,0,0,.42); }
.create-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.16), 0 10px 44px rgba(0,0,0,.38);
}

/* ================= 动画 ================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(99,102,241,.35); }
  50% { box-shadow: 0 6px 30px rgba(99,102,241,.6); }
}

.hero { animation: fadeUp .6s ease both; }
.hero-box { animation: fadeUp .7s ease .08s both; }
.section { animation: fadeUp .6s ease both; }
.section:nth-of-type(2) { animation-delay: .1s; }
.hero .btn-primary { animation: glowPulse 3s ease-in-out infinite; }
.logo .mark { animation: floaty 3s ease-in-out infinite; }

.work-card { transition: transform .18s, border-color .18s, box-shadow .18s; }
.work-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(0,0,0,.42), 0 0 0 1px rgba(99,102,241,.3);
}
.work-play { transition: opacity .2s, transform .2s; }
.work-card:hover .work-play { opacity: 1; transform: scale(1.06); }
.work-cover { transition: transform .4s; }
.work-card:hover .work-cover { transform: scale(1.04); }

/* ---------- 作品墙 ---------- */
.work-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.work-card { padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s; }
.work-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.work-thumb { position: relative; aspect-ratio: 16/10; background: var(--bg2); overflow: hidden; }
.work-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; opacity: 0; transition: opacity .15s;
  background: rgba(0,0,0,.25);
}
.work-card:hover .work-play { opacity: 1; }
.work-dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff;
  padding: 1px 7px; border-radius: 6px; font-size: 12px;
}
.work-body { padding: 12px 14px; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--panel); border: 1px solid var(--border2); border-radius: 16px;
  width: 100%; max-width: 760px; max-height: 90vh; overflow: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 16px;
}
.modal-x { cursor: pointer; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px; }
.modal-video { width: 100%; border-radius: 10px; background: #000; max-height: 60vh; }
.work-card.work-card { display: block; }

/* 中间书调试（管理员） */
.dbg-step { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.dbg-step summary { cursor: pointer; color: var(--text); font-weight: 500; }
.dbg-step summary .muted { font-weight: 400; }
.dbg-step .pre { margin-top: 8px; max-height: 320px; overflow: auto; }

/* ---------- 顶部导航布局（即梦式） ---------- */
.console { display: block; min-height: 100vh; }
.main { margin-left: 0 !important; }
.topnav {
  display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 60px;
  border-bottom: 1px solid var(--border); background: rgba(11,11,12,.85);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.topnav .logo { border: none; margin: 0; padding: 0; text-decoration: none; color: var(--text); }
.topnav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.tn-link {
  padding: 8px 14px; border-radius: 8px; color: var(--muted); cursor: pointer;
  text-decoration: none; font-size: 14px; background: none; border: none; font-family: inherit;
}
.tn-link:hover { color: var(--text); background: var(--panel); }
.tn-link.active { color: var(--text); background: var(--panel2); }
.topnav-right { display: flex; align-items: center; gap: 10px; }
.tn-user { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-drop { position: relative; }
.tn-menu {
  position: absolute; top: 40px; right: 0; background: var(--panel); border: 1px solid var(--border2);
  border-radius: 10px; padding: 6px; min-width: 150px; display: none; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.tn-menu.open { display: block; }
.tn-menu .tn-link { display: block; width: 100%; text-align: left; }

/* ---------- 创作页（居中大输入框） ---------- */
.create-wrap { max-width: 720px; margin: 0 auto; padding: 40px 16px 20px; }
.create-title { text-align: center; margin-bottom: 20px; font-size: 24px; }
.create-box { background: var(--panel); border: 1px solid var(--border2); border-radius: 16px; padding: 12px; }
.create-input {
  width: 100%; background: transparent; border: none; outline: none; color: var(--text);
  font-size: 15px; padding: 12px; resize: none; min-height: 110px; font-family: inherit;
}
.create-input::placeholder { color: var(--muted); }
.create-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; border-top: 1px solid var(--border); padding: 14px 16px; }
.create-go { min-height: 40px; padding: 0 26px; white-space: nowrap; }

/* 控件（时长/比例/参考图） */
.ctl { display: flex; flex-direction: column; gap: 7px; }
.ctl-label { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.ctl-slider { display: flex; align-items: center; gap: 9px; }
.ctl-val { font-size: 13px; min-width: 32px; color: var(--text); }

/* 分段按钮（比例） */
.seg { display: flex; background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-btn {
  padding: 5px 11px; border: none; background: none; color: var(--muted); font-size: 12px;
  border-radius: 7px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--panel2); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* 图片上传按钮 */
.img-btn {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px dashed var(--border2);
  border-radius: 9px; color: var(--muted); font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.img-btn:hover { border-color: var(--accent); color: var(--text); }

/* 背景视频管理 */
.bg-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.bg-thumb { width: 140px; height: 78px; object-fit: cover; border-radius: 6px; background: #000; }
.bg-meta { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.bg-meta .mono { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 充值档位 */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tier {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 8px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; color: var(--text); font-family: inherit;
  transition: border-color .15s, background .15s;
}
.tier b { font-size: 16px; }
.tier span { font-size: 12px; color: var(--muted); }
.tier:hover { border-color: var(--border2); }
.tier.sel { border-color: var(--accent); background: rgba(99,102,241,.12); }
.tier.sel span { color: #a5b4fc; }

/* 滑块美化 */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; background: var(--border2); border-radius: 4px; outline: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid #fff; margin-top: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid #fff;
}

/* ================= UI 精修 ================= */
body {
  background-color: #0a0a10;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.028) 1px, transparent 1px),
    radial-gradient(1150px 560px at 50% -80px, rgba(99,102,241,.22), transparent 62%),
    radial-gradient(820px 460px at 6% -40px, rgba(139,92,246,.16), transparent 58%),
    radial-gradient(780px 420px at 94% -20px, rgba(56,189,248,.10), transparent 55%),
    linear-gradient(180deg, #0d0d16 0%, #0a0a0f 45%, #0a0a0f 100%);
  background-size: 26px 26px, auto, auto, auto, auto;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(99,102,241,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3b4a66; }
::-webkit-scrollbar-track { background: transparent; }

/* 主按钮：渐变 + 投影 + 悬浮上浮 */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; color: #fff; font-weight: 600;
  box-shadow: 0 4px 18px rgba(99,102,241,.35);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 26px rgba(99,102,241,.48); filter: brightness(1.08); text-decoration: none; }
.btn-primary:active { transform: translateY(0); }
.btn { transition: transform .12s, border-color .12s, background .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); text-decoration: none; border-color: var(--accent); }

/* 卡片：更圆润 + 阴影 + 悬浮高亮 */
.card {
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 2px 10px rgba(0,0,0,.22);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { border-color: var(--border2); }

/* 输入框聚焦光圈 */
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}

/* 顶部导航 */
.topnav { box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 24px rgba(0,0,0,.25); }
.logo .mark { box-shadow: 0 4px 14px rgba(99,102,241,.42); }

/* 落地页 hero */
.hero { padding: var(--hero-top, 170px) 24px 64px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px;
  border: 1px solid var(--border2); border-radius: 999px; font-size: 13px; color: #c7d2fe;
  background: rgba(99,102,241,.12); margin-bottom: 18px;
}
.hero h1 {
  font-size: var(--title-size, 54px);
  margin-bottom: var(--title-gap, 30px);
  letter-spacing: -.5px; line-height: 1.2; color: #fff;
  background: linear-gradient(115deg, #ffffff 0%, #e0e7ff 55%, #a5b4fc 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-title.sans { font-family: "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif; font-weight: 900; }
.hero-title.rounded { font-family: "Varela Round", "YouYuan", "幼圆", "Noto Sans SC", "PingFang SC", sans-serif; font-weight: 600; }
.hero-title.serif { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "宋体", serif; font-weight: 900; }
.hero p { font-size: 17px; color: #bdbdc7; }

/* 首页 hero 视频背景轮播 */
.hero { position: relative; overflow: hidden; }
.hero.has-bg {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  padding: var(--hero-top, 170px) 24px 70px;
}
.hero.has-bg .hero-content { width: 100%; }
.hero-videos { position: absolute; inset: 0; z-index: 0; }
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1s ease;
}
.hero-video.active { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(10,10,16,.22) 0%,
    rgba(10,10,16,.32) 45%,
    rgba(10,10,16,.52) 72%,
    rgba(10,10,16,.82) 92%,
    #0a0a10 100%);
}
.hero-content { position: relative; z-index: 2; }
.hero-content p { text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.hero-badge { text-shadow: 0 1px 8px rgba(0,0,0,.5); }

/* 创作页大输入框 */
.create-box { box-shadow: 0 10px 44px rgba(0,0,0,.32); }
.create-title { font-size: 26px; }

/* 区块标题 */
.section-title h2 { font-size: 26px; letter-spacing: -.3px; }
.section-title p { font-size: 14px; }

/* 统计数值 */
.stat .v { font-size: 28px; letter-spacing: -.3px; }

/* 弹窗 */
.modal { box-shadow: 0 24px 70px rgba(0,0,0,.55); }

/* 导航左右内边距 */
.landing .nav { padding: 18px 40px; }

/* 徽章更精致 */
.badge { font-weight: 500; letter-spacing: .2px; }

/* 表格表头 */
th { text-transform: none; letter-spacing: .3px; }

/* hero 引导字 */
.hero-hint { font-size: 14px; color: #b0b0ba; }
.hero-hint a { color: #a5b4fc; text-decoration: none; }
.hero-hint a:hover { text-decoration: underline; }

/* 作品墙占位 */
.work-ph { pointer-events: none; }
.work-ph .work-thumb { display: flex; align-items: center; justify-content: center; background: var(--panel2); }
.work-ph-txt { color: var(--border2); font-size: 26px; }
.ph-line { height: 10px; border-radius: 5px; background: var(--panel2); }

/* ---------- 多会话工作台 ---------- */
.ws { display: flex; gap: 16px; align-items: flex-start; }
.ws-side { width: 240px; flex: 0 0 240px; position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow-y: auto; }
.ws-main { flex: 1; min-width: 0; }
.ws-new { width: 100%; margin-bottom: 12px; background: transparent; border: 1px solid var(--border2); color: #c9c9d1; font-weight: 500; justify-content: flex-start; text-align: left; }
.ws-new:hover { background: var(--panel); border-color: #4a4a55; color: var(--text); }
.ws-title { font-size: 11.5px; color: #6f6f79; padding: 4px 10px 6px; letter-spacing: .3px; }
.ws-list { display: flex; flex-direction: column; gap: 2px; }

.ws-item { position: relative; padding: 9px 10px; border-radius: 10px; cursor: pointer; background: transparent; overflow: hidden; transition: background .15s; }
.ws-item:hover { background: var(--panel); }
.ws-item.active { background: var(--panel2); }
.ws-item-main, .ws-item-ops { position: relative; z-index: 2; }

/* 会话进度：底色从左侧逐渐铺满 + 右缘一条亮线（这条亮线才是"进度"的语义来源）。
   宽度由本地估算器每 250ms 推一次，配合 .3s linear 过渡就是连续流动的填充。 */
.ws-fill { position: absolute; top: 0; bottom: 0; left: 0; pointer-events: none; z-index: 1; display: none; width: calc(var(--p, 0) * 1%); background: linear-gradient(90deg, rgba(99,102,241,.06), rgba(99,102,241,.22)); transition: width .3s linear; }
.ws-fill::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1.5px; background: rgba(180,190,255,.85); box-shadow: 0 0 11px 1.5px rgba(99,102,241,.6); }
.ws-item.st-running .ws-fill { display: block; }

/* 运行中的会话：一道柔光循环扫过整行。
   为什么需要它：进度是按"第几步"估算的，某一步跑得久时估算会顶到上限（比如 18.5%）然后停住，
   那一行就会完全静止、看着像卡死。这道扫光与真实进度无关，只负责表达"还在干活"。 */
.ws-sweep { position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; z-index: 1; pointer-events: none; display: none;
  background: linear-gradient(90deg, transparent, rgba(184,194,255,.38), transparent); }
.ws-item.st-running .ws-sweep { display: block; animation: wsSweep 2.2s linear infinite; }
@keyframes wsSweep { from { left: -40%; } to { left: 104%; } }

.ws-item-title { font-size: 13.5px; font-weight: 500; color: #dcdce2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 62px; }
.ws-item.active .ws-item-title { color: var(--text); }

/* 状态：一个 5px 小圆点 + 中性灰小字。着色只在圆点上，整行彩色药丸才是"跳"的根源 */
.ws-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: #6f6f79; }
/* 圆点只给"需要注意"的状态（生成中/失败/已停止）。完成是默认态，不该再占一个视觉标记 */
.ws-dot { display: none; flex: none; width: 5px; height: 5px; border-radius: 50%; background: #45454f; }
.ws-item.st-running .ws-dot, .ws-item.st-error .ws-dot, .ws-item.st-stopped .ws-dot { display: block; }
.ws-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pct { margin-left: auto; flex: none; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: #9a9aa6; }
.ws-item.st-running .ws-meta { color: #a3aeff; }
.ws-item.st-running .ws-dot { background: #7c86ff; animation: dotPulse 1.5s ease-in-out infinite; }
.ws-item.st-running .ws-pct { color: #c3caff; }
.ws-item.st-error .ws-meta { color: #b98a88; }
.ws-item.st-error .ws-dot { background: #e5484d; }
.ws-item.st-stopped .ws-meta { color: #6f6f79; }
@keyframes dotPulse { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.12); } }
.ws-item-ops { position: absolute; top: 6px; right: 6px; display: none; gap: 2px; }
.ws-item:hover .ws-item-ops { display: flex; }
.ws-op { border: none; background: transparent; color: #7c7c86; cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 5px; line-height: 1; transition: background .12s, color .12s; }
.ws-op:hover { background: rgba(255,255,255,.08); color: var(--text); }
.ws-form { padding-top: 12px; }
.ws-model { min-width: 170px; }

/* 对话框左下角那排控件：功能 / 模型 / 参数（参数是按技能声明动态渲染的） */
.chip-group { display: inline-flex; align-items: center; gap: 8px; }
.chip-group:empty { display: none; }

/* ==========================================================================
   创作页：整页不滚动。
   之前的问题：.console / .main 都是 min-height:100vh，再加上 60px 的顶栏，
   文档永远比视口高 60px+，所以页面永远有滚动条 —— 滚鼠标时输入框和左侧列表全都跟着跑。
   现在改成：页面本身固定不动，只有"消息区"和"左侧会话列表"各自内部滚动，
   输入框永远钉在底部。
   ========================================================================== */
.console.con-full { height: 100vh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.console.con-full .main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.console.con-full .content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 16px 24px; }
.console.con-full .ws { flex: 1; min-height: 0; align-items: stretch; }
/* 左侧会话列表：自己滚（鼠标放上去滚才动它），不再跟页面一起跑 */
.console.con-full .ws-side { position: static; top: auto; max-height: none; min-height: 0; overflow-y: auto; }
.console.con-full .ws-main { min-height: 0; display: flex; flex-direction: column; }
.console.con-full .chat-wrap { flex: 1; height: auto; min-height: 0; }

/* 对话式创作界面（参考即梦：单容器 composer，工具条在框内） */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 460px; }
.chat-msgs { flex: 1; overflow-y: auto; }
.chat-msgs-inner { max-width: var(--chat-w); margin: 0 auto; padding: 22px 14px 10px; }
.chat-empty { text-align: center; color: #6f6f79; padding: 90px 0; font-size: 13.5px; }
.chat-msg { display: flex; margin-bottom: 16px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.ai { justify-content: flex-start; }
.chat-bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; word-break: break-word; }
.chat-msg.user .chat-bubble { background: #262629; border: 1px solid #323238; color: var(--text); }
.chat-msg.ai .chat-bubble { background: transparent; border: none; padding: 0 2px; max-width: 100%; }
.chat-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; line-height: 1.7; }
/* 进度：3px 细线 + 移动亮点 + 柔和流光。
   之前是「7px 粗条 + 斜向条纹」——斜条纹正是"施工围栏/理发店转筒"的视觉原型，是廉价感的来源 */
.chat-progress { max-width: var(--chat-w); margin: 0 auto 14px; padding: 0 14px; }
.pbar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.pbar-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7c86ff; animation: dotPulse 1.5s ease-in-out infinite; }
.pbar-label { flex: 1; min-width: 0; font-size: 12.5px; color: #9a9aa6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar-meta { flex: none; font-size: 12px; font-weight: 500; color: #8f8f9c; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.pbar-track { position: relative; height: 3px; border-radius: 999px; background: rgba(255,255,255,.07); }
.pbar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, rgba(99,102,241,.7), rgba(139,92,246,.92)); }
.pbar-shine { position: absolute; top: 0; bottom: 0; width: 38%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: pbShine 2.8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes pbShine { 0% { left: -40%; } 100% { left: 102%; } }
.pbar-tip { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #cfd2ff; opacity: 0; box-shadow: 0 0 10px 2px rgba(124,134,255,.7); transition: opacity .2s; }
.chat-progress.done .pbar-dot { animation: none; background: #6ee7a8; }
.chat-progress.done .pbar-shine { display: none; }
.chat-progress.done .pbar-tip { background: #a7f3cf; box-shadow: 0 0 10px 2px rgba(110,231,168,.6); }
/* 中间书浮窗（仅管理员，右下角，可最小化成小图标） */
.ipanel { position: fixed; right: 20px; bottom: 20px; width: 430px; max-width: calc(100vw - 32px); height: 56vh; max-height: 620px; z-index: 70; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border2); border-radius: 16px; box-shadow: 0 18px 48px rgba(0,0,0,.55); overflow: hidden; }
.ipanel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel2); border-bottom: 1px solid var(--border); }
.ipanel-head h4 { margin: 0; font-size: 13px; font-weight: 600; flex: none; }
.ipanel-head .muted { flex: 1; font-size: 11px; }
.ipanel-ico { font-size: 13px; }
.ipanel-btn { flex: none; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 8px; border-radius: 7px; }
.ipanel-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.ipanel-body { flex: 1; overflow-y: auto; padding: 10px 12px; }
.ipanel-fab { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border2); background: var(--panel2); color: var(--text); font-size: 19px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 28px rgba(0,0,0,.5); transition: transform .12s, border-color .15s; }
.ipanel-fab:hover { transform: scale(1.06); border-color: var(--accent); }

.chat-input-box { width: 100%; padding: 8px 14px 16px; background: var(--bg); }
.chat-composer { width: 100%; max-width: var(--chat-w); margin: 0 auto; background: rgba(26,26,29,.94); border: 1px solid rgba(255,255,255,.12); border-radius: 15px; padding: 10px 12px 8px; box-shadow: 0 18px 64px rgba(0,0,0,.28); transition: border-color .15s, box-shadow .15s; }
.chat-composer:focus-within { border-color: rgba(196,181,253,.62); box-shadow: 0 0 0 3px rgba(167,139,250,.09), 0 18px 64px rgba(0,0,0,.3); }
/* 参考图缩略图：序号=图内下缘暗角上的小号数字；删除键 hover 才出现（触屏常驻） */
.chat-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chat-imgs:empty { display: none; }
.img-chip { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); background: var(--bg2); transition: transform .14s ease-out, border-color .14s ease-out; }
.img-chip:hover { transform: scale(1.05); border-color: rgba(255,255,255,.26); }
.img-chip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.img-chip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; background: linear-gradient(to top, rgba(0,0,0,.74), transparent); pointer-events: none; }
.img-no { position: absolute; left: 0; right: 0; bottom: 4px; z-index: 2; text-align: center; font-size: 11px; font-weight: 500; color: rgba(255,255,255,.92); font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.85); pointer-events: none; }
/* 删除键：桌面 hover 才出现（热区 20px），触屏没 hover 所以常驻半透明 */
.img-del { position: absolute; top: 4px; right: 4px; z-index: 3; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: #f0f0f4; font-size: 10px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s, background .15s; }
.img-chip:hover .img-del { opacity: 1; }
.img-del:hover { background: rgba(229,72,77,.92); }
@media (hover: none) { .img-del { opacity: .5; } }

/* 已发送的参考图不再显示缩略图，只在输入框里留一行说明，避免"图一直赖在框里" */
.imgs-hint { font-size: 11.5px; color: #6f6f79; line-height: 1.55; padding: 2px 2px 4px; }

/* 消息里回显的参考图：只出现在"当时附了图的那条"用户消息上 */
.msg-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.msg-imgs img { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); cursor: zoom-in; transition: transform .12s, border-color .15s; }
.msg-imgs img:hover { transform: scale(1.06); border-color: rgba(255,255,255,.28); }
/* 分镜图是成品，给大一点的缩略图；参考图仍是小方块 */
.msg-imgs.msg-imgs-out img { width: 168px; height: 95px; border-radius: 10px; }
/* 点缩略图后的全屏看图 */
.lightbox { position: fixed; inset: 0; z-index: 9000; background: rgba(6,6,7,.9); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 26px; animation: viewIn .14s ease both; }
.lightbox img { max-width: 94vw; max-height: 82vh; object-fit: contain; border-radius: 12px; box-shadow: 0 26px 80px rgba(0,0,0,.66); background: #111; }
.lightbox-bar { display: flex; align-items: center; gap: 10px; }
.lightbox-title { color: var(--muted); font-size: 12.5px; }

/* AI 回复下方的操作行（在新对话重跑） */
.msg-acts { margin-top: 12px; display: flex; gap: 8px; }
.msg-act { border: 1px solid var(--border2); background: transparent; color: #9a9aa3; font-size: 12px; font-family: inherit; padding: 5px 11px; border-radius: 8px; cursor: pointer; transition: background .14s, color .14s, border-color .14s; }
.msg-act:hover { background: var(--panel2); color: var(--text); border-color: #4a4a55; }
.msg-act:active { transform: scale(.98); }

/* 长内容默认收起：只露大约 6 行，末尾渐隐（避免一条回复铺满整屏、把多轮对话挤没） */
.msg-clamp { position: relative; max-height: 148px; overflow: hidden; }
.msg-clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 54px; pointer-events: none; }
.chat-msg.ai .msg-clamp::after { background: linear-gradient(to top, var(--bg), transparent); }
.chat-msg.user .msg-clamp::after { background: linear-gradient(to top, #262629, transparent); }
.msg-more { display: inline-block; margin-top: 9px; border: 1px solid var(--border2); background: transparent; color: #a3aeff; font-size: 12px; font-family: inherit; padding: 4px 11px; border-radius: 8px; cursor: pointer; transition: background .14s, border-color .14s, color .14s; }
.msg-more:hover { background: var(--panel2); border-color: #4a4a55; color: #fff; }
.msg-more:active { transform: scale(.98); }

/* 用户消息保留自己敲的换行（贴剧本时不然会挤成一整坨） */
.chat-msg.user .chat-bubble { white-space: pre-wrap; }

/* 看完整内容的弹窗：宽 760、内容区自己滚，按钮常驻底部 */
.modal.modal-msg { overflow: hidden; display: flex; flex-direction: column; }
.modal.modal-msg .modal-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.msg-scroll { overflow-y: auto; max-height: 60vh; min-height: 0; }
.msg-scroll .pre { margin: 0; }
.chat-composer-body { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.chat-plus { flex: none; width: 40px; height: 40px; border: 1px solid var(--border2); border-radius: 12px; background: var(--panel2); color: #b6b6bd; font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s; }
.chat-plus:hover { background: #2b2b31; color: #fff; border-color: #4a4a55; }
.chat-input { flex: 1; min-height: 40px; max-height: 200px; resize: none; padding: 9px 2px; border: none; background: transparent; color: var(--text); font-size: 14.5px; line-height: 1.6; font-family: inherit; }
.chat-input:focus { outline: none; }
.chat-input::placeholder { color: #6b6b74; }
.chat-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.chat-bar-l { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.chat-bar-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: max-content; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: none; border-radius: 9px; background: transparent; color: #9a9aa3; font-size: 12.5px; font-family: inherit; cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { background: var(--panel2); color: var(--text); }
.chip-lead { font-size: 12px; opacity: .85; pointer-events: none; }
.chip-val { color: inherit; font-size: 12.5px; font-weight: 600; min-width: 26px; }
.chip-range { width: 68px; cursor: pointer; }
.chip-wrap { position: relative; display: inline-flex; align-items: center; height: 28px; border-radius: 9px; transition: background .15s; }
.chip-wrap:hover { background: var(--panel2); }
.chip-wrap .chip-lead { position: absolute; left: 9px; }
.chip-wrap .caret { position: absolute; right: 9px; width: 0; height: 0; font-size: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid #7a7a84; pointer-events: none; transition: transform .15s; }
.chip-wrap:hover .caret { border-top-color: var(--text); }
.chip-sel { -webkit-appearance: none; appearance: none; height: 28px; padding: 0 22px 0 24px; border: none; border-radius: 9px; background: transparent; color: #9a9aa3; font-size: 12.5px; font-family: inherit; cursor: pointer; }
.chip-sel::-ms-expand { display: none; }
.chip-wrap:hover .chip-sel { color: var(--text); }
.chip-sel option { background: var(--panel2); color: var(--text); }
/* 「占位隐藏」：visibility:hidden 仍占着位置，开关切换时输入条宽度/比例不变 */
.chip.param-hidden, .chip-wrap.param-hidden { visibility: hidden; pointer-events: none; }
/* 开关型 chip（如「分镜预览」）：关=灰、开=高亮，一眼看出这次会不会生图 */
.chip-toggle { position: relative; user-select: none; margin: 0; }
.chip-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none; }
.chip-toggle-label { font-size: 12.5px; }
.chip-toggle::after { content: ""; width: 22px; height: 12px; border-radius: 999px; background: #3a3a41; position: relative; transition: background .15s; flex: none; }
.chip-toggle::before { content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #8a8a92; transition: transform .15s, background .15s; z-index: 1; }
.chip-toggle:hover { background: var(--panel2); color: var(--text); }
.chip-toggle.on { color: var(--text); background: rgba(110, 92, 255, .14); }
.chip-toggle.on::after { background: var(--accent); }
.chip-toggle.on::before { background: #fff; transform: translateX(10px); }
.chip-toggle.on:hover { background: rgba(110, 92, 255, .22); }
.chat-send { flex: none; width: 34px; height: 34px; border: none; border-radius: 50%; background: var(--panel2); color: #8a8a92; font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, transform .12s; }
.chat-send.ready, .chat-send.running { background: var(--accent); color: #fff; }
.chat-send.ready:hover:not(:disabled), .chat-send.running:hover:not(:disabled) { background: var(--accent2); transform: scale(1.07); }
.chat-send:disabled { opacity: .5; cursor: not-allowed; }
/* 生成中：同一个按钮切成「停止」态 —— 和发送同色（主题紫），图标换成白色圆角方块 */
.chat-send .chat-send-ico { display: block; width: 17px; height: 17px; line-height: 0; }
.chat-send .chat-send-ico svg { display: block; width: 100%; height: 100%; }
.chat-send.running .chat-send-ico { width: 12px; height: 12px; background: #fff; border-radius: 3px; }
.chat-send.running .chat-send-ico svg { display: none; }
@media (max-width: 760px) {
  .ws { flex-direction: column; }
  .ws-side { width: 100%; flex: none; position: static; max-height: none; }
}

/* 窄屏下保持底部参数控件的完整宽度，避免开关文字被 flex 压成竖排。 */
@media (max-width: 760px) {
  .chat-bar-l { flex-wrap: wrap; row-gap: 2px; }
  .chat-bar-l > .bubble-picker,
  .chat-bar-l > .chip-group,
  .chip-group > * { flex: 0 0 auto; }
}

/* ==========================================================================
   动效层：统一、克制、快速（都在 .2s 左右，不拖慢操作手感）
   注意：这里只对叶子节点做 transform 动画，绝不给 #app 加 transform/filter，
   否则会让内部 position:fixed 的元素（中间书浮窗）失去视口定位。
   ========================================================================== */
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .45; } 50% { opacity: .72; } }

/* 路由切换：整页轻微淡入（只用 opacity，安全） */
#app.view-in { animation: viewIn .28s ease; }

/* 气泡、卡片、表单行：依次轻微上浮 */
.chat-msg { animation: riseIn .2s ease both; }
.chat-composer { animation: riseIn .24s ease both; }
.workspace-main .chat-composer { animation: none; }

/* 弹窗 / 浮窗 */
.modal-overlay { animation: viewIn .16s ease both; }
.modal { animation: popIn .22s cubic-bezier(.2,.8,.3,1) both; }
.ipanel { animation: popIn .22s cubic-bezier(.2,.8,.3,1) both; }
.ipanel-fab { animation: scaleIn .18s ease both; }
.toast.show { animation: popIn .2s ease; }

/* 折叠面板展开时内容淡入 */
.dbg-step[open] > .pre, .dbg-step[open] > div { animation: riseIn .18s ease both; }

/* 按钮按压反馈 */
.btn:active { transform: translateY(0) scale(.975); }
.chat-send.ready:active, .chat-send.running:active { transform: scale(.93); }
.chat-plus:active { transform: scale(.93); }
.chip:active, .seg-btn:active, .nav-item:active, .ws-item:active, .ws-op:active { transform: scale(.985); }
.ipanel-btn:active, .modal-x:active { transform: scale(.9); }

/* 运行中：发送键呼吸，让"正在干活"一眼可见 */
.chat-send:disabled:not(.running) { animation: breathe 1.7s ease-in-out infinite; }

/* 表格行 / 列表项统一轻量过渡 */
tbody tr { transition: background .14s; }
.tier, .skill-card, .work-card, .nav-item, .btn, .ws-op, .chip, .ipanel-btn { transition-duration: .14s; }

/* 尊重系统"减少动态效果"设置。
   注意：这里原来用的是一刀切的 `* { animation-duration: .01ms !important }`，
   结果只要 Windows 关掉「动画效果」，全站动画（进度流光、进度条扫光、状态圆点呼吸）全部消失，
   界面看起来就"很生硬、像卡死"。
   现在只关掉【装饰性】动画（入场、弹出、呼吸），【状态反馈】类动画保留但放慢、减弱 ——
   因为一个完全静止的进度条等于没有反馈，那本身也是个可访问性问题。 */
@media (prefers-reduced-motion: reduce) {
  #app.view-in,
  .chat-msg, .chat-composer, .card, .skill-card, .step, .tier,
  .modal-overlay, .modal, .ipanel, .ipanel-fab, .toast.show,
  .dbg-step[open] > .pre, .dbg-step[open] > div {
    animation: none !important;
  }
  .btn, .chip, .ws-op, .ipanel-btn, .msg-act, .msg-more, .chat-send, .chat-plus, .img-chip { transition-duration: .01ms !important; }
  /* 下面这些是"还在干活"的反馈：保留，只放慢 */
  .ws-item.st-running .ws-sweep { animation-duration: 4.5s !important; }
  .ws-item.st-running .ws-dot { animation-duration: 3s !important; }
  .pbar-dot { animation-duration: 3s !important; }
  .pbar-shine { animation-duration: 5s !important; }
  .chat-send:disabled { animation-duration: 3.4s !important; }
}

/* ========================================================================
   Workspace redesign: a quiet, dark creative workspace.  These overrides
   preserve the existing components and routes while replacing the old
   dashboard chrome with a left work-area rail and a generous content column.
   ======================================================================== */
:root {
  --workspace-rail: 240px;
  --bg: #101011;
  --bg2: #171719;
  --panel: #1b1b1e;
  --panel2: #252529;
  --border: rgba(255, 255, 255, .075);
  --border2: rgba(255, 255, 255, .14);
  --text: #f5f5f6;
  --muted: #929298;
  --accent: #a78bfa;
  --accent2: #c4b5fd;
  --radius: 14px;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #101011;
}

.btn { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.055); border-radius: 10px; }
.btn:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.085); text-decoration: none; }
.btn-primary { background: #eee9ff; border-color: #eee9ff; color: #262037; }
.btn-primary:hover { background: #fff; border-color: #fff; color: #262037; }
.card { background: #1a1a1d; border-color: rgba(255,255,255,.075); box-shadow: none; }
.input, textarea.input, select.input { background: #151517; border-color: rgba(255,255,255,.12); border-radius: 10px; }
.input:focus { border-color: rgba(196,181,253,.75); box-shadow: 0 0 0 3px rgba(167,139,250,.1); }

/* Shared left rail */
.workspace-shell { display: block; min-height: 100vh; }
.workspace-rail, .landing-rail {
  position: fixed; z-index: 20; inset: 0 auto 0 0; width: var(--workspace-rail);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
  background: #151516; border-right: 1px solid rgba(255,255,255,.07);
}
.rail-brand { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; color: #f4f4f5; font-size: 16px; font-weight: 650; letter-spacing: -.2px; text-decoration: none; }
.rail-brand:hover { color: #fff; text-decoration: none; }
.rail-brand .mark { display: block; width: 28px; height: 28px; object-fit: contain; }
.logo .mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #eee9ff; color: #302744; font-size: 14px; font-weight: 800; animation: none; }
.rail-nav { display: flex; flex: 1; flex-direction: column; gap: 3px; margin-top: 32px; overflow-y: auto; }
.rail-group { display: flex; flex-direction: column; gap: 3px; margin: 0 0 18px; }
.rail-group-title { padding: 0 10px 8px; color: #76767d; font-size: 11px; font-weight: 550; letter-spacing: .65px; text-transform: uppercase; }
.rail-link { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 8px; color: #a8a8ae; font-size: 13.5px; text-decoration: none; transition: color .16s ease, background .16s ease; }
.rail-link:hover { background: rgba(255,255,255,.055); color: #f1f1f3; text-decoration: none; }
.rail-link.active { background: rgba(255,255,255,.09); color: #fff; font-weight: 550; }
.rail-dot { width: 7px; height: 7px; border: 1px solid #77777e; border-radius: 50%; transition: background .16s, border-color .16s; }
.rail-link:hover .rail-dot { border-color: #d7ccff; }
.rail-link.active .rail-dot { background: #c4b5fd; border-color: #c4b5fd; box-shadow: 0 0 0 3px rgba(196,181,253,.1); }
.rail-admin { padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); }
.rail-account { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 6px 8px; border-top: 1px solid rgba(255,255,255,.07); }
.rail-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #302d37; color: #e9e1ff; font-size: 12px; font-weight: 700; }
.rail-account-info { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.25; }
.rail-account-info b { overflow: hidden; color: #e9e9eb; font-size: 12.5px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.rail-account-info span { margin-top: 3px; color: #77777f; font-size: 11px; }
.rail-logout { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: #8a8a90; cursor: pointer; font-size: 15px; transition: background .15s, color .15s; }
.rail-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

/* Signed-in pages */
.workspace-main { min-height: 100vh; margin-left: var(--workspace-rail); }
.workspace-main > .main { min-height: auto; margin-left: 0; }
.workspace-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 15px clamp(24px, 4vw, 56px); background: rgba(16,16,17,.78); border-bottom: 1px solid rgba(255,255,255,.055); backdrop-filter: blur(18px); }
.workspace-crumb { display: block; margin-bottom: 1px; color: #77777e; font-size: 11px; }
.workspace-topbar h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.25px; }
.workspace-topbar-right { display: flex; align-items: center; gap: 8px; }
.workspace-topbar .badge { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.055); color: #b9b9c0; }
.workspace-main .content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 32px clamp(24px, 4vw, 56px) 56px; }
.workspace-main .stat { padding: 20px; background: #1a1a1d; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; }
.workspace-main .stat .v { font-size: 25px; letter-spacing: -.4px; }

/* The creative console needs an independent scrolling center column. */
.workspace-shell.con-full { display: block; height: 100vh; min-height: 0; overflow: hidden; }
.workspace-shell.con-full .workspace-main { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.workspace-shell.con-full .workspace-topbar { flex: 0 0 auto; }
.workspace-shell.con-full .main { flex: 1; min-height: 0; overflow: hidden; }
.workspace-shell.con-full .content { display: flex; flex: 1; min-height: 0; overflow: hidden; max-width: none; padding: 20px clamp(20px, 3vw, 44px); }
.workspace-shell.con-full .ws { flex: 1; min-height: 0; gap: 24px; }
.workspace-shell.con-full .ws-side { top: auto; width: 224px; flex-basis: 224px; }

/* Landing page */
.landing-app { display: block; min-height: 100vh; background: #101011; }
.landing-main { min-height: 100vh; margin-left: var(--workspace-rail); overflow: hidden; }
.landing-topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; max-width: 1160px; margin: 0 auto; padding: 0 clamp(24px, 4vw, 56px); color: #898991; font-size: 12px; }
.landing-topbar a, .section-link { color: #dcd5ff; font-size: 12.5px; text-decoration: none; }
.landing-topbar a:hover, .section-link:hover { color: #fff; text-decoration: none; }
.landing-rail-bottom { margin-top: auto; display: grid; gap: 8px; padding: 10px 4px 0; }
.landing-login, .landing-register { width: 100%; }
.landing-account { margin: 0; border-top: 0; border-radius: 10px; text-decoration: none; transition: background .15s; }
.landing-account:hover { background: rgba(255,255,255,.055); text-decoration: none; }
.hero { position: relative; display: flex; align-items: center; justify-content: center; min-height: min(620px, calc(100vh - 64px)); padding: 88px clamp(24px, 5vw, 80px) 76px; text-align: left; animation: riseIn .48s ease both; }
.hero::before { content: ""; position: absolute; inset: 9% 10% auto; height: 260px; pointer-events: none; background: radial-gradient(ellipse, rgba(119,91,212,.13), transparent 68%); filter: blur(8px); }
.hero.has-bg { min-height: min(640px, calc(100vh - 64px)); border: 0; background: transparent; }
.hero-overlay {
  /* 背景视频的暗度由后台「站点设置 → 背景视频 → 暗度」控制（--hero-dim，0~1）。
     越低视频越清晰，但标题白字会越难看清。默认 .55。 */
  --hd: var(--hero-dim, .55);
  background: linear-gradient(90deg, rgba(16,16,17, var(--hd)), rgba(16,16,17, calc(var(--hd) * .82)) 48%, rgba(16,16,17, calc(var(--hd) * .95))), linear-gradient(0deg, #101011 0%, transparent 26%, transparent 70%, rgba(16,16,17, calc(var(--hd) * .65)));
}
.hero-content { width: min(960px, 100%); margin: 0 auto; }
.hero-badge { display: inline-flex; margin-bottom: 18px; padding: 4px 9px; border: 1px solid rgba(218,205,255,.2); border-radius: 99px; background: rgba(208,193,255,.07); color: #dcd3ff; font-size: 12px; }
.hero h1, .hero .hero-title { max-width: 780px; margin: 0 0 18px; font-size: clamp(32px, 4vw, 52px) !important; font-weight: 600; line-height: 1.2; letter-spacing: -1.4px; }
.hero-box { max-width: 860px; margin: 28px 0 0; animation: none; }
.hero-box .chat-composer { border-color: rgba(255,255,255,.12); border-radius: 15px; background: rgba(26,26,29,.94); box-shadow: 0 18px 64px rgba(0,0,0,.28); }
.hero-box .chat-composer:focus-within { border-color: rgba(196,181,253,.62); box-shadow: 0 0 0 3px rgba(167,139,250,.09), 0 18px 64px rgba(0,0,0,.3); }
.hero-hint { margin-left: 2px; color: #83838a; font-size: 12px; }
.hero-hint a { color: #cfc6f5; }
.work-section, .start-section { max-width: 1080px; padding: 68px clamp(24px, 4vw, 56px); animation: riseIn .44s ease both; }
.section-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 22px; text-align: left; }
.section-title h2 { margin: 3px 0 2px; font-size: 25px; letter-spacing: -.4px; }
.section-title p { margin: 0; }
.section-eyebrow { color: #9c8ad6; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.work-wall { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.work-card { overflow: hidden; border-radius: 12px; background: #19191c; border-color: rgba(255,255,255,.07); }
.work-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.18); box-shadow: 0 14px 28px rgba(0,0,0,.2); }
.work-thumb { aspect-ratio: 1.38; }
.work-body { padding: 12px 13px 13px; }
.work-play { background: rgba(255,255,255,.9); color: #25232d; }
.steps { gap: 12px; }
.step { min-height: 170px; padding: 22px; border-color: rgba(255,255,255,.07); border-radius: 12px; background: #19191c; }
.step:hover { border-color: rgba(255,255,255,.17); transform: translateY(-2px); }
.step .n { width: 30px; height: 30px; margin-bottom: 24px; border-radius: 8px; background: rgba(196,181,253,.12); color: #d7ccff; font-size: 13px; }
.step h4 { margin-bottom: 5px; font-size: 15px; }
.footer { max-width: 1080px; margin: 0 auto; padding: 28px clamp(24px, 4vw, 56px) 42px; border-top-color: rgba(255,255,255,.06); text-align: left; }

@media (max-width: 900px) {
  .workspace-rail, .landing-rail { display: none; }
  .workspace-main, .landing-main { margin-left: 0; }
  .workspace-main .content { padding: 24px; }
  .workspace-shell.con-full .ws-side { display: none; }
  .work-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .workspace-topbar { min-height: 64px; padding: 11px 18px; }
  .workspace-topbar-right { display: none; }
  .workspace-main .content { padding: 18px; }
  .landing-topbar { padding: 0 20px; }
  .hero { min-height: 520px; padding: 60px 20px; }
  .hero h1, .hero .hero-title { font-size: 34px !important; letter-spacing: -.8px; }
  .work-section, .start-section { padding: 48px 20px; }
  .section-title { align-items: start; }
  .section-link { display: none; }
  .work-wall { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer { padding: 24px 20px 32px; }
}

/* Center the prompt like the reference workspace: the side rail belongs to
   navigation, while the creation decision stays visually in the viewport's
   center. */
.landing-app .hero { text-align: center; }
.landing-app .hero-content { display: flex; flex-direction: column; align-items: center; }
.landing-app .hero h1, .landing-app .hero .hero-title { margin-right: auto; margin-left: auto; text-align: center; }
.landing-app .hero-box { width: min(860px, 100%); margin-right: auto; margin-left: auto; }
.landing-app .hero-hint { margin-right: auto; margin-left: auto; }

/* Composer controls: compact bubbles with a custom animated menu.  The
   native select remains in the DOM as the source of truth for existing code. */
.chat-composer { overflow: visible; }
.chat-bar { position: relative; height: 44px; padding-top: 0; }
.chat-bar-l { gap: 5px; }
@media (max-width: 760px) {
  .chat-bar { height: auto; min-height: 44px; }
}
@media (max-width: 620px) {
  .chat-bar { grid-template-columns: 1fr; row-gap: 4px; }
  .chat-bar-l { width: 100%; }
  .chat-bar-l > .chip-group {
    width: 100%; min-width: 0; flex: 1 1 100%; flex-wrap: wrap; row-gap: 2px;
  }
  .chat-bar-r { justify-content: flex-end; }
}
.chip-wrap.bubble-picker { position: relative; isolation: isolate; height: 28px; }
.bubble-picker .chip-sel { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bubble-picker > .chip-lead, .bubble-picker > .caret { display: none; }
.bubble-trigger {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 28px;
  padding: 0 9px 0 8px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: #a7a7ad; font: 12.5px/1 inherit; cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.bubble-trigger:focus { outline: none; }
.bubble-trigger:focus-visible { border-color: rgba(213,201,255,.72); box-shadow: 0 0 0 3px rgba(181,160,255,.16); }
.bubble-trigger:hover, .bubble-picker.open .bubble-trigger {
  border-color: rgba(255,255,255,.105); background: rgba(255,255,255,.07); color: #f3f1f7;
}
.bubble-picker.open .bubble-trigger { box-shadow: inset 0 0 0 1px rgba(203,190,255,.06); }
.bubble-trigger:active { transform: scale(.975); }
.bubble-icon { display: grid; place-items: center; width: 13px; color: #bcaeff; font-size: 12px; }
.bubble-label { overflow: hidden; max-width: 150px; text-overflow: ellipsis; white-space: nowrap; }
.bubble-chevron { display: inline-block; margin: -3px 0 0 1px; color: #85858d; font-size: 15px; line-height: 1; transition: transform .2s cubic-bezier(.2,.8,.3,1), color .16s; }
.bubble-picker.open .bubble-chevron { transform: rotate(180deg); color: #ddd5fb; }
.bubble-menu {
  position: absolute; z-index: 50; bottom: calc(100% + 9px); left: 0; min-width: max(172px, 100%); max-width: min(330px, 78vw);
  display: grid; gap: 2px; padding: 5px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px;
  background: rgba(38,38,42,.98); box-shadow: 0 18px 42px rgba(0,0,0,.42); backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden; transform: translateY(7px) scale(.96); transform-origin: left bottom;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2,.8,.3,1), visibility 0s linear .18s;
}
.bubble-picker.open .bubble-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition-delay: 0s; }
.bubble-option {
  width: 100%; padding: 8px 9px; border: 0; border-radius: 8px; background: transparent; color: #b5b5bb;
  font: 12.5px/1.35 inherit; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(4px); transition: background .14s ease, color .14s ease, opacity .18s ease, transform .18s ease;
}
.bubble-picker.open .bubble-option { opacity: 1; transform: translateY(0); }
.bubble-picker.open .bubble-option:nth-child(2) { transition-delay: .02s; }
.bubble-picker.open .bubble-option:nth-child(3) { transition-delay: .04s; }
.bubble-picker.open .bubble-option:nth-child(4) { transition-delay: .06s; }
.bubble-picker.open .bubble-option:nth-child(5) { transition-delay: .08s; }
.bubble-option:hover { background: rgba(255,255,255,.085); color: #fff; }
.bubble-option.selected { background: rgba(194,180,255,.13); color: #e6defe; }
.chat-plus { transition: color .17s ease, background .17s ease, border-color .17s ease, transform .2s cubic-bezier(.2,.8,.3,1); }
.chat-plus:hover { transform: rotate(90deg); border-color: rgba(210,197,255,.6); background: rgba(191,175,255,.12); color: #e8e1ff; }
.chat-send.ready { background: #eee9ff; color: #2b243f; box-shadow: 0 3px 14px rgba(187,166,255,.18); }
.chat-send.ready:hover:not(:disabled) { background: #fff; color: #2b243f; transform: translateY(-1px) scale(1.06); }
.work-card { transition: transform .26s cubic-bezier(.2,.8,.3,1), border-color .2s ease, box-shadow .26s ease; }
.work-card:hover .work-cover { transform: scale(1.065); }
.work-card:hover .work-play { transform: scale(1.08); }
.rail-link { transition: color .18s ease, background .18s ease, transform .18s ease; }
.rail-link:hover { transform: translateX(2px); }
.modal-overlay { padding: 20px; background: rgba(7,7,8,.68); backdrop-filter: blur(8px); }
.modal { border-color: rgba(255,255,255,.12); box-shadow: 0 28px 86px rgba(0,0,0,.62); }

@media (prefers-reduced-motion: reduce) {
  .bubble-menu, .bubble-option, .bubble-trigger, .chat-plus, .rail-link { transition: none !important; }
}

/* Account entry: keep the workspace header clean. Identity details only
   appear after the user deliberately opens the avatar menu. */
.workspace-topbar-right, .landing-topbar-actions { display: flex; align-items: center; gap: 14px; }
.account-credit { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 99px; background: rgba(255,255,255,.045); color: #d8d1f1; font-size: 12px; font-variant-numeric: tabular-nums; }
.account-credit span { color: #c5b5ff; font-size: 12px; }
.user-menu { position: relative; z-index: 40; }
.user-menu-trigger {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer;
  transition: transform .2s cubic-bezier(.2,.8,.3,1), background .16s ease, border-color .16s ease;
}
.user-menu-trigger:hover, .user-menu.open .user-menu-trigger { border-color: rgba(226,217,255,.34); background: rgba(255,255,255,.065); transform: translateY(-1px); }
.user-menu-trigger:focus { outline: none; }
.user-menu-trigger:focus-visible { box-shadow: 0 0 0 3px rgba(190,173,255,.2); }
.user-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(145deg, #d8cfff, #9578d9); color: #2c2540; font-size: 12px; font-weight: 800; box-shadow: inset 0 1px 1px rgba(255,255,255,.4); }
.user-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 218px; padding: 7px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(35,35,38,.98);
  box-shadow: 0 20px 52px rgba(0,0,0,.42); backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden; transform: translateY(-7px) scale(.96); transform-origin: right top;
  transition: opacity .17s ease, transform .2s cubic-bezier(.2,.8,.3,1), visibility 0s linear .2s;
}
.user-menu.open .user-menu-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); transition-delay: 0s; }
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 9px 8px 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.user-menu-head .user-avatar { width: 32px; height: 32px; font-size: 13px; }
.user-menu-head div { display: flex; min-width: 0; flex-direction: column; line-height: 1.25; }
.user-menu-head b { overflow: hidden; color: #f5f4f7; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head span { margin-top: 4px; color: #909097; font-size: 11px; }
.user-menu-links { display: grid; gap: 1px; padding: 6px 0; }
.user-menu-links a, .user-menu-logout { display: flex; align-items: center; width: 100%; min-height: 34px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: #b9b9bf; font: 12.5px/1 inherit; text-align: left; text-decoration: none; cursor: pointer; transition: color .14s ease, background .14s ease, transform .16s ease; }
.user-menu-links a:hover, .user-menu-logout:hover { background: rgba(255,255,255,.075); color: #fff; text-decoration: none; transform: translateX(2px); }
.user-menu-logout { border-top: 1px solid rgba(255,255,255,.075); color: #aa9da8; }
.user-menu-logout:hover { color: #ffc3cb; background: rgba(255,100,120,.08); }

@media (prefers-reduced-motion: reduce) {
  .user-menu-trigger, .user-menu-panel, .user-menu-links a, .user-menu-logout { transition: none !important; }
}

/* 对话框右下角「本次 XX 积分」：跟着功能/模型切换实时变 */
.cost-hint { margin-right: 4px; color: #8a8a93; font-size: 12px; white-space: nowrap; transition: color .16s ease; }
.cost-hint.free { color: #6fcf97; }

/* --------------------------------------------------------------------------
   修复：勾选「分镜预览」后再点生成，开关文字被挤成竖排、跑出框。
   原因：生成时右侧同时多出「停止」按钮 + 变长的价格提示（＋分镜预览2张…），
        而 .chat-bar-r 不收缩、左侧参数又不许换行，开关文字就被压成一列。
   规则：参数控件和开关文字永不换行、不被压缩；空间不够时优先让价格提示收尾。
   -------------------------------------------------------------------------- */
.chip-group { flex: 0 0 auto; }
.chip-group > * { flex: 0 0 auto; }
.chip-toggle { flex: 0 0 auto; }
.chip-toggle-label, .chip-val, .chip-sel { white-space: nowrap; }
.chat-bar-r { flex: 0 1 auto; min-width: 0; }
.chat-bar-r > .btn, .chat-bar-r > .chat-send { flex: 0 0 auto; }
.chat-bar-r > .cost-hint { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 价格为 0 的技能统一显示「免费」 */
.free-tag { color: #6fcf97; font-size: 15px; font-weight: 600; }

/* ==========================================================================
   站点设置：宽屏自动两列（每张卡片一个主题），窄屏自动变回一列
   —— 以前是单列 640px，在宽屏上浪费 2/3 宽度、还拉得很长
   ========================================================================== */
.admin-head { max-width: 1200px; margin: 0 auto 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 18px; align-items: start; max-width: 1200px; margin: 0 auto; }
.admin-grid > .card { margin: 0; }
.admin-grid > .span-all { grid-column: 1 / -1; }
.admin-foot { max-width: 1200px; margin: 18px auto 0; }

/* 背景视频「暗度」滑块 + 实时预览 */
.dim-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.dim-row input[type=range] { flex: 1; accent-color: #a78bfa; }
.dim-row b { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.dim-preview { position: relative; height: 150px; margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #101011; }
.dim-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dim-preview .hero-overlay { position: absolute; inset: 0; }
.dim-preview .dim-sample { position: absolute; left: 14px; bottom: 12px; z-index: 2; color: #fff; font-size: 19px; font-weight: 700; letter-spacing: -.3px; text-shadow: 0 1px 4px rgba(0,0,0,.55); }
.dim-preview .dim-tag { position: absolute; top: 9px; right: 11px; z-index: 2; font-size: 11px; color: rgba(255,255,255,.8); }
