/* ============ 基础 ============ */
:root {
  color-scheme: dark;   /* 原生控件（select 下拉/滚动条）跟随深色，修复下拉列表发白 */
  --bg: #0a0b14;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #1a1a26;   /* 浮动弹层实色底（右键菜单/@引用/参考图管理） */
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-hover: rgba(255, 255, 255, 0.07);
  --text: #e8eaf6;
  --text-dim: #9aa0b8;
  --text-faint: #5d6379;
  --accent: #7c6cff;
  --accent-2: #2fd4c6;
  --accent-grad: linear-gradient(135deg, #7c6cff 0%, #4a8cff 55%, #2fd4c6 100%);
  --danger: #ff5c7a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --preview-col: 1fr;
  --stage-min: 340px;
}

/* ============ 白天主题 ============ */
[data-theme="light"] {
  color-scheme: light;
  --bg: #edf0f9;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-border: rgba(30, 42, 90, 0.12);
  --panel-hover: rgba(255, 255, 255, 0.95);
  --text: #1b2138;
  --text-dim: #586080;
  --text-faint: #98a0bc;
  --shadow: 0 18px 50px rgba(70, 90, 170, 0.16);
}
[data-theme="light"] .aurora { opacity: .14; }
[data-theme="light"] #particle-canvas { opacity: .4; }

/* ============ 少女主题（樱花粉） ============ */
[data-theme="girly"] {
  --bg: #fff0f5;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #fff7fa;
  --panel-border: rgba(255, 143, 179, 0.28);
  --panel-hover: rgba(255, 228, 238, 0.95);
  --text: #5c2e46;
  --text-dim: #b06a86;
  --text-faint: #d9a8bb;
  --accent: #ff6b9d;
  --accent-2: #ffa3c7;
  --accent-grad: linear-gradient(135deg, #ff8fb3 0%, #ff6b9d 55%, #ffb6d5 100%);
  --danger: #f0426e;
  --shadow: 0 18px 50px rgba(255, 107, 157, 0.18);
}
[data-theme="girly"] .aurora { opacity: .12; filter: hue-rotate(300deg); }
[data-theme="girly"] #particle-canvas { opacity: .35; }

/* ============ 卡通主题（糖果蓝黄） ============ */
[data-theme="cartoon"] {
  --bg: #eaf6ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #f2faff;
  --panel-border: rgba(46, 118, 199, 0.22);
  --panel-hover: rgba(224, 242, 255, 0.95);
  --text: #173a5e;
  --text-dim: #4f7ea8;
  --text-faint: #93b8d6;
  --accent: #ff9f1c;
  --accent-2: #2ec4f1;
  --accent-grad: linear-gradient(135deg, #ffb347 0%, #ff9f1c 45%, #2ec4f1 100%);
  --danger: #ff5a5f;
  --shadow: 0 14px 40px rgba(46, 118, 199, 0.2);
}
[data-theme="cartoon"] .aurora { opacity: .1; filter: hue-rotate(160deg); }
[data-theme="cartoon"] #particle-canvas { opacity: .3; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color .45s ease, color .45s ease;
}
.panel, .topbar, .stage, .chat-panel, .chip-opt, .mode-switch,
textarea, input, .chip, .example-chip, .shot-card, .coll-group {
  transition: background-color .4s ease, border-color .4s ease, color .4s ease;
}

::selection { background: rgba(124, 108, 255, 0.35); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 背景层 ============ */
/* 静态背景：纯色基调 + 极微弱品牌色光晕；纯 CSS 渲染，无任何图片/视频请求，
   百分比定位随视口等比缩放，任意分辨率下均无拉伸或裁切问题。
   不使用 inset 简写，兼容 iOS 12 / Android 8.0 旧版浏览器。 */
.static-bg {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(62% 46% at 50% -8%, rgba(124, 108, 255, .14) 0%, rgba(124, 108, 255, 0) 70%),
    radial-gradient(56% 42% at 100% 108%, rgba(47, 212, 198, .10) 0%, rgba(47, 212, 198, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .02) 0%, rgba(0, 0, 0, .10) 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* 首屏淡入：背景出现时平滑过渡，避免突兀 */
  opacity: 0;
  animation: staticBgIn .6s ease-out forwards;
  transition: background-color .45s ease;
}
html.jm[data-theme="light"] .static-bg {
  background-image:
    radial-gradient(62% 46% at 50% -8%, rgba(124, 108, 255, .10) 0%, rgba(124, 108, 255, 0) 70%),
    radial-gradient(56% 42% at 100% 108%, rgba(47, 212, 198, .10) 0%, rgba(47, 212, 198, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .35) 0%, rgba(210, 218, 240, .18) 100%);
}
@keyframes staticBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#particle-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .32;
  z-index: 0;
  pointer-events: none;
  /* 性能：去掉持续漂移动画——110px 大模糊全屏重绘是掉帧主因，静态光斑视觉几乎无差 */
}
.aurora-1 {
  width: 560px; height: 560px;
  left: -160px; top: -180px;
  background: radial-gradient(circle, #5b45f0 0%, transparent 65%);
}
.aurora-2 {
  width: 640px; height: 640px;
  right: -220px; bottom: -240px;
  background: radial-gradient(circle, #0f8f86 0%, transparent 65%);
  animation-delay: -9s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, 34px) scale(1.12); }
}

/* ============ 动态视频背景（首页氛围层，可关闭） ============
   层级：static-bg(-2) < video-bg(-1) < 粒子/极光(0) < UI(1+)
   设计原则：视频只做氛围，不当主角 —— 视频自身压暗降饱和 + 整屏深色纱幕，
   创作 UI 再叠加深毛玻璃（见 body.bgv-active 段），文字始终清晰，
   但面板保持半透，视频在卡片间隙与玻璃后隐约可见。 */
.video-bg {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .7s ease;
}
body.bgv-active .video-bg { opacity: 1; }
html.bgv-off .video-bg { opacity: 0 !important; }
.video-bg-media {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  /* 轻微放大，避免视口边缘露黑边 */
  transform: scale(1.03);
  /* 压暗 48% + 降饱和：防止高动态画面抢创作焦点 */
  filter: brightness(.52) saturate(.82) contrast(1.03);
}
.video-bg-scrim {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    linear-gradient(180deg, rgba(9, 11, 19, .60) 0%, rgba(9, 11, 19, .36) 36%, rgba(9, 11, 19, .60) 100%),
    radial-gradient(130% 90% at 50% 38%, rgba(9, 11, 19, .10) 0%, rgba(9, 11, 19, .46) 100%);
}
/* 白天主题：浅色纱幕 + 稍亮画面，保持明亮观感 */
html.jm[data-theme="light"] .video-bg-media { filter: brightness(.82) saturate(.72); }
html.jm[data-theme="light"] .video-bg-scrim {
  background:
    linear-gradient(180deg, rgba(240, 242, 249, .62) 0%, rgba(240, 242, 249, .38) 36%, rgba(240, 242, 249, .64) 100%),
    radial-gradient(130% 90% at 50% 38%, rgba(240, 242, 249, .16) 0%, rgba(240, 242, 249, .5) 100%);
}
/* 少女/卡通主题沿用深色纱幕（本身为深色基调），仅微调色调 */
html.jm[data-theme="girly"] .video-bg-scrim {
  background:
    linear-gradient(180deg, rgba(24, 12, 26, .60) 0%, rgba(24, 12, 26, .36) 36%, rgba(24, 12, 26, .60) 100%),
    radial-gradient(130% 90% at 50% 38%, rgba(24, 12, 26, .12) 0%, rgba(24, 12, 26, .46) 100%);
}
html.jm[data-theme="cartoon"] .video-bg-scrim {
  background:
    linear-gradient(180deg, rgba(10, 16, 22, .58) 0%, rgba(10, 16, 22, .34) 36%, rgba(10, 16, 22, .58) 100%),
    radial-gradient(130% 90% at 50% 38%, rgba(10, 16, 22, .1) 0%, rgba(10, 16, 22, .44) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .video-bg { transition: none; }
}

/* ---- 视频开启时：创作 UI 防打扰强化（加深毛玻璃，仍保留透感） ---- */
/* 粒子在视频上会显杂乱，进一步压淡 */
html.jm body.bgv-active #particle-canvas { opacity: .08; }
html.jm body.bgv-active .aurora { opacity: .05; }
/* 侧边栏：10px 轻磨砂 → 18px 深磨砂 */
html.jm body.bgv-active .jm-sidebar {
  background: rgba(13, 15, 23, .46);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
html.jm[data-theme="light"] body.bgv-active .jm-sidebar {
  background: rgba(243, 244, 250, .58);
}
/* 创作卡片：明显加深，输入/参数区是视觉焦点，保证任何视频帧上都可读 */
html.jm body.bgv-active .jm-composer.jm-card {
  background: rgba(16, 18, 26, .44);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
html.jm[data-theme="light"] body.bgv-active .jm-composer.jm-card {
  background: rgba(255, 255, 255, .52);
}
/* 卡片外的问候语：直接压在视频上，补一层深色投影保证可读 */
html.jm body.bgv-active .jm-hello {
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65), 0 1px 3px rgba(0, 0, 0, .5);
}
html.jm[data-theme="light"] body.bgv-active .jm-hello {
  text-shadow: 0 1px 10px rgba(255, 255, 255, .9);
}

/* ---- 右上角动态背景开关（紧邻个人中心头像） ---- */
html.jm .jm-bg-toggle {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(20, 22, 32, .42);
  color: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .18s ease;
}
html.jm .jm-bg-toggle:hover {
  background: rgba(52, 56, 78, .62);
  color: #fff;
  transform: translateY(-1px);
}
html.jm .jm-bg-toggle:active { transform: translateY(0) scale(.94); }
html.jm .jm-bg-toggle svg { width: 15px; height: 15px; }
/* 默认（开启）：显暂停图标；关闭态显播放三角 */
html.jm .jm-bg-toggle .bgv-ico-play { display: none; }
html.jm .jm-bg-toggle.is-off .bgv-ico-play,
html.bgv-off .jm-bg-toggle .bgv-ico-play { display: block; }
html.jm .jm-bg-toggle.is-off .bgv-ico-pause,
html.bgv-off .jm-bg-toggle .bgv-ico-pause { display: none; }
html.jm .jm-bg-toggle.is-off,
html.bgv-off .jm-bg-toggle {
  color: rgba(255, 255, 255, .55);
  background: rgba(20, 22, 32, .3);
}
/* 白天主题开关 */
html.jm[data-theme="light"] .jm-bg-toggle {
  background: rgba(255, 255, 255, .55);
  border-color: rgba(30, 42, 90, .14);
  color: #3a3f55;
  box-shadow: 0 3px 12px rgba(30, 42, 90, .12);
}
html.jm[data-theme="light"] .jm-bg-toggle:hover { background: rgba(255, 255, 255, .8); color: #23273a; }
html.jm[data-theme="light"] .jm-bg-toggle.is-off,
html.jm[data-theme="light"].bgv-off .jm-bg-toggle { color: rgba(58, 63, 85, .5); }

/* ============ 顶栏 ============ */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center;
  height: 64px; padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(14px);
}

.logo { display: flex; align-items: center; gap: 11px; }
.logo-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(124,108,255,.12);
  border: 1px solid rgba(124,108,255,.35);
  border-radius: 11px;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.logo-mark svg { width: 21px; height: 21px; }
.logo-mark .logo-img {
  width: 26px; height: 26px;
  object-fit: contain;
  display: block;
}
.logo:hover .logo-mark { transform: rotate(180deg) scale(1.08); }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-name { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.logo-sub {
  font-size: 9.5px; letter-spacing: 2.6px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.topnav { display: flex; gap: 6px; margin-left: 44px; }
.topnav a {
  position: relative;
  padding: 7px 16px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s;
  user-select: none;
}
.topnav a:hover { color: var(--text); background: rgba(128,128,160,.12); }
.topnav a.active { color: #fff; background: rgba(124,108,255,.22); }
[data-theme="light"] .topnav a.active { color: var(--accent); }
[data-theme="light"] .topnav a:hover { background: rgba(30,42,90,.07); }

/* 主题切换按钮 */
.theme-toggle {
  margin-left: 20px;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .3s;
  flex: 0 0 auto;
  position: relative;
}
.theme-toggle:hover { color: var(--accent); border-color: rgba(124,108,255,.5); transform: rotate(15deg); }
.theme-toggle svg { width: 18px; height: 18px; position: absolute; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ============ 布局 ============ */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--creator-col, minmax(430px, 520px)) var(--preview-col, 1fr);
  gap: 22px;
  padding: 22px 28px 34px;
  max-width: var(--layout-max, 1480px);
  margin: 0 auto;
  animation: rise .6s cubic-bezier(.2,.8,.2,1);
  transition: grid-template-columns .4s cubic-bezier(.2,.8,.2,1), max-width .4s cubic-bezier(.2,.8,.2,1);
}

/* 画幅联动：竖版/方形时预览列收窄并贴右边缘，创作列拉伸填满剩余空间，布局撑满视口 */
body[data-ratio="1:1"]  { --creator-col: minmax(430px, 1fr); --preview-col: 600px; --stage-min: 540px; --layout-max: 100%; }
body[data-ratio="3:4"]  { --creator-col: minmax(430px, 1fr); --preview-col: 520px; --stage-min: 580px; --layout-max: 100%; }
body[data-ratio="9:16"] { --creator-col: minmax(430px, 1fr); --preview-col: 470px; --stage-min: 640px; --layout-max: 100%; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h3 {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.hint { font-size: 11.5px; color: var(--text-faint); }

/* ============ 模式切换 ============ */
.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 20px;
}
.mode-thumb {
  position: absolute;
  top: 5px; left: 5px;
  height: calc(100% - 10px);
  width: calc((100% - 10px) / 3);
  background: var(--accent-grad);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(94,110,255,.4);
  transition: transform .38s cubic-bezier(.34,1.4,.4,1);
}
.mode-switch[data-index="1"] .mode-thumb { transform: translateX(100%); }
.mode-switch[data-index="2"] .mode-thumb { transform: translateX(200%); }

.mode-btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 4px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 10px;
  transition: color .3s;
}
.mode-btn svg { width: 17px; height: 17px; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { color: #fff; }
.mode-btn.disabled { opacity: .38; cursor: not-allowed; }
.mode-btn.disabled:hover { color: inherit; }

/* ============ 上传区 ============ */
.upload-section { margin-bottom: 18px; }
.upload-section.hidden { display: none; }

.tag {
  font-size: 10.5px; font-weight: 700;
  padding: 2.5px 8px; border-radius: 6px;
  letter-spacing: .5px;
}
.tag-pos { color: #8f7dff; background: rgba(124,108,255,.14); border: 1px solid rgba(124,108,255,.3); }
.tag-neg { color: #ff7d9c; background: rgba(255,92,122,.12); border: 1px solid rgba(255,92,122,.3); }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 10px;
}

.upload-zone {
  border: 1.5px dashed rgba(255,255,255,.16);
  border-radius: 13px;
  padding: 14px;
  transition: border-color .3s, background .3s, transform .3s;
}
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(124,108,255,.07);
  transform: scale(1.01);
}
.upload-zone.hide-dash { border-style: solid; }

.upload-add {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  min-height: 96px;
  border: 1.5px dashed rgba(255,255,255,.2);
  border-radius: 11px;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  transition: all .28s;
  user-select: none;
}
.upload-add svg { width: 22px; height: 22px; transition: transform .3s; }
.upload-add:hover, .upload-add:focus-visible {
  color: #a99bff;
  border-color: rgba(124,108,255,.6);
  background: rgba(124,108,255,.08);
  outline: none;
}
.upload-add:hover svg { transform: translateY(-2px) scale(1.1); }

/* 图片卡片 */
.img-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  animation: pop .32s cubic-bezier(.34,1.5,.5,1);
}
@keyframes pop {
  from { opacity: 0; transform: scale(.7); }
  to { opacity: 1; transform: scale(1); }
}
.img-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.img-card:hover img { transform: scale(1.08); }
.img-card .cover-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(47,212,198,.9);
  color: #04211e;
  letter-spacing: 1px;
}
.img-card .remove-btn {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.62);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  opacity: .9;
  z-index: 10;
  transition: opacity .2s, background .2s, transform .2s;
}
.img-card:hover .remove-btn { opacity: 1; }
.img-card .remove-btn:hover { background: var(--danger); transform: scale(1.1); }
.img-card .remove-btn svg { width: 11px; height: 11px; }
.img-card .img-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 7px 5px;
  font-size: 10px;
  color: #dfe2f3;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 参考图编号徽标 + 引用按钮 */
.img-card .pic-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(124,108,255,.92);
  color: #fff;
  letter-spacing: .5px;
  z-index: 2;
}
.img-card.ref { cursor: zoom-in; }
.img-card.ref::after {
  content: "🔍 点击放大";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(10,12,28,.5);
  color: #fff; font-size: 11px; font-weight: 600;
  opacity: 0; transition: opacity .2s;
  z-index: 1;
  pointer-events: none; /* 纯提示层，不拦截任何点击（删除按钮始终可点） */
}
.img-card.ref:hover::after { opacity: 1; }

/* 参考图放大预览灯箱 */
.ref-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,7,16,.88);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s;
  cursor: zoom-out;
}
.ref-lightbox[hidden] { display: none; }
.ref-lightbox.show { opacity: 1; }
.ref-lightbox img {
  max-width: 90vw; max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  user-select: none;
}
.ref-lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s;
  z-index: 2;
}
.ref-lb-close:hover { background: rgba(255,80,120,.6); }
.ref-lb-close svg { width: 16px; height: 16px; }
.ref-lb-name {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  max-width: 80vw;
  color: rgba(255,255,255,.85);
  font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ref-pick {
  position: absolute; bottom: 5px; right: 5px;
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: var(--accent-2);
  color: #04211e;
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 3;
}
.img-card:hover .ref-pick, .audio-row:hover .ref-pick { opacity: 1; }
.ref-pick:hover { transform: scale(1.12); }
.ref-pick svg { width: 12px; height: 12px; }

/* ============ 首尾帧（keyframe） ============ */
.kf-slots {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 4px;
}
.kf-connect {
  display: grid; place-items: center;
  color: var(--text-faint);
}
.kf-connect svg { width: 22px; height: 22px; }
.kf-slot {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  border: 1.5px dashed rgba(255,255,255,.2);
  background: rgba(255,255,255,.03);
  cursor: pointer;
  overflow: hidden;
  transition: all .25s;
}
.kf-slot:hover, .kf-slot:focus-visible {
  border-color: rgba(124,108,255,.6);
  background: rgba(124,108,255,.07);
  outline: none;
}
.kf-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  color: var(--text-faint);
}
.kf-empty svg { width: 24px; height: 24px; }
.kf-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.kf-empty em { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.kf-preview { position: absolute; inset: 0; }
.kf-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kf-tag {
  position: absolute; top: 7px; left: 7px;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  background: rgba(124,108,255,.92); color: #fff;
}
.kf-remove {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.62);
  color: #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s;
}
.kf-remove:hover { background: var(--danger); }
.kf-remove svg { width: 11px; height: 11px; }

/* ============ 参考音频 ============ */
.audio-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.audio-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  transition: all .22s;
  animation: pop .3s cubic-bezier(.34,1.5,.5,1);
}
.audio-row:hover { border-color: rgba(124,108,255,.5); background: rgba(124,108,255,.08); }
.audio-idx {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  background: rgba(47,212,198,.18);
  color: var(--accent-2);
  flex: 0 0 auto;
}
.audio-ico { width: 18px; height: 18px; color: var(--text-dim); flex: 0 0 auto; }
.audio-name {
  flex: 1; min-width: 0;
  font-size: 12.5px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.audio-row .ref-pick {
  position: static;
  opacity: 1;
  width: 24px; height: 24px;
  flex: 0 0 auto;
}
.audio-remove {
  width: 24px; height: 24px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--text-dim);
  cursor: pointer;
  display: grid; place-items: center;
  flex: 0 0 auto;
  transition: all .2s;
}
.audio-remove:hover { background: var(--danger); color: #fff; }
.audio-remove svg { width: 11px; height: 11px; }
.audio-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1.5px dashed rgba(255,255,255,.2);
  border-radius: 10px;
  background: transparent;
  color: var(--text-faint);
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: all .25s;
}
.audio-add svg { width: 18px; height: 18px; }
.audio-add:hover {
  color: var(--accent-2);
  border-color: rgba(47,212,198,.55);
  background: rgba(47,212,198,.06);
}

/* 白天主题：首尾帧/音频 */
[data-theme="light"] .kf-slot { border-color: rgba(30,42,90,.22); background: rgba(30,42,90,.03); }
[data-theme="light"] .audio-row { background: rgba(30,42,90,.04); }
[data-theme="light"] .audio-add { border-color: rgba(30,42,90,.25); }
[data-theme="light"] .audio-remove { background: rgba(30,42,90,.1); }

/* ============ 视频参考 URL 输入 ============ */
.vid-ref-area { margin-top: 12px; }
.vid-ref-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.vid-ref-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}
.vid-ref-row input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text-main); font-size: 12px; font-family: inherit;
}
.vid-ref-row input::placeholder { color: var(--text-faint); }
.vid-ref-remove {
  flex-shrink: 0; width: 22px; height: 22px;
  border: none; border-radius: 6px;
  background: rgba(255,80,80,.12); color: #ff5050;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.vid-ref-remove:hover { background: rgba(255,80,80,.22); }
.vid-ref-remove svg { width: 11px; height: 11px; }
.vid-ref-btns { display: flex; gap: 8px; }
.vid-ref-btns .vid-ref-add { flex: 1; min-width: 0; }
.vid-ref-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px;
  border: 1.5px dashed rgba(255,255,255,.2); border-radius: 10px;
  background: transparent; color: var(--text-faint);
  font-size: 12px; font-family: inherit; cursor: pointer; transition: all .25s;
}
.vid-ref-add svg { width: 18px; height: 18px; }
.vid-ref-add:hover { color: var(--accent-2); border-color: rgba(47,212,198,.55); background: rgba(47,212,198,.06); }
[data-theme="light"] .vid-ref-row { border-color: rgba(30,42,90,.22); background: rgba(30,42,90,.03); }
[data-theme="light"] .vid-ref-add { border-color: rgba(30,42,90,.25); }

/* 视频参考：缩略图卡片（本地待上传 / 已上传 OSS），点击弹窗播放 */
.vid-ref-card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.vid-ref-thumb-wrap {
  position: relative; flex: none;
  width: 88px; height: 50px; border-radius: 8px; overflow: hidden;
  background: #000; border: 1px solid rgba(255,255,255,.14);
}
.vid-ref-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-ref-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0,0,0,.28); pointer-events: none;
}
.vid-ref-play svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.vid-ref-card:hover .vid-ref-play { background: rgba(0,0,0,.12); }
.vid-ref-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vid-ref-info .vid-ref-name {
  font-size: 12px; color: var(--text-main); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vid-ref-info .vid-ref-meta { font-size: 11px; color: var(--text-faint); }

/* 上传进度卡（视频/音频通用） */
.vid-ref-card.up-card { cursor: default; }
.vid-ref-card.up-err { opacity: .85; }
.vid-ref-thumb-wrap.up-thumb {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1f3a, #0f1326);
}
.up-thumb .up-icon { width: 22px; height: 22px; color: #8a93b8; }
.up-err .up-thumb .up-icon { color: #ff6b6b; }
.up-progress {
  display: block; width: 100%; height: 4px; margin-top: 4px;
  border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden;
}
.up-progress-bar {
  display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #5b8cff, #7c5bff);
  transition: width .2s ease;
}
.up-err .up-progress-bar { background: linear-gradient(90deg, #ff6b6b, #ff8e53); }

/* 视频预览弹窗 */
.vid-preview-mask {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.82); backdrop-filter: blur(4px);
}
.vid-preview-mask[hidden] { display: none; }
.vid-preview-mask video {
  max-width: 86vw; max-height: 82vh;
  border-radius: 12px; background: #000;
  box-shadow: 0 18px 60px rgba(0,0,0,.6);
}
.vid-preview-close {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff;
  font-size: 16px; cursor: pointer; transition: background .2s;
}
.vid-preview-close:hover { background: rgba(255,255,255,.24); }

/* ================= 积分余额徽章：首页头像旁 / 画布顶栏 / 会员中心 ================= */
.jm-credit-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 10px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(124,108,255,.45); background: rgba(124,108,255,.12);
  color: var(--text-main, #e8eaf2); font-size: 12px; line-height: 1;
  cursor: pointer; transition: background .2s, border-color .2s; white-space: nowrap;
}
.jm-credit-badge b { color: #b9a8ff; font-weight: 700; }
.jm-credit-badge:hover { background: rgba(124,108,255,.22); border-color: rgba(124,108,255,.7); }
[data-theme="light"] .jm-credit-badge { border-color: rgba(30,42,90,.25); background: rgba(30,42,90,.05); }
[data-theme="light"] .jm-credit-badge b { color: #5a3fd6; }

.ctb-credit-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid rgba(124,108,255,.45); background: rgba(124,108,255,.12);
  color: #e8eaf2; font-size: 12px; line-height: 1;
  cursor: pointer; transition: background .2s, border-color .2s; white-space: nowrap;
}
.ctb-credit-badge b { color: #b9a8ff; font-weight: 700; }
.ctb-credit-badge:hover { background: rgba(124,108,255,.22); border-color: rgba(124,108,255,.7); }

/* 充值按钮（紧跟积分徽章） */
.ctb-recharge-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; padding: 0 14px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #7c6cff, #5a3fd6);
  color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; transition: opacity .2s, transform .1s; white-space: nowrap;
}
.ctb-recharge-btn:hover { opacity: .88; }
.ctb-recharge-btn:active { transform: scale(.96); }

.member-credits { margin: 10px 0 0; font-size: 13px; color: var(--text-dim, #9aa0b4); }
.member-credits b { color: #b9a8ff; font-weight: 700; font-size: 15px; }
.member-recharge-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 12px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #7c6cff, #5a3fd6);
  color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: opacity .2s, transform .1s; vertical-align: middle; margin-left: 8px;
}
.member-recharge-btn:hover { opacity: .88; }
.member-recharge-btn:active { transform: scale(.96); }

/* 支付 iframe 弹窗：隐藏滚动条 */
#payFrameModal ::-webkit-scrollbar { display: none; }
#payFrame { scrollbar-width: none; -ms-overflow-style: none; }
#payFrame::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 积分账单 */
.credit-bill-section {
  margin-top: 16px;
  border-top: 1px solid rgba(124, 108, 255, .18);
  padding-top: 12px;
}
.credit-bill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e8eaf2);
}
.credit-bill-header .btn-text {
  background: none;
  border: none;
  color: #b9a8ff;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.credit-bill-header .btn-text:hover {
  background: rgba(124, 108, 255, .12);
}
.credit-logs-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid rgba(124, 108, 255, .12);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}
.credit-log-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim, #9aa0b4);
  font-size: 12px;
}
.credit-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(124, 108, 255, .08);
  font-size: 12px;
}
.credit-log-item:last-child {
  border-bottom: none;
}
.credit-log-main {
  flex: 1;
  min-width: 0;
}
.credit-log-remark {
  color: var(--text, #e8eaf2);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.credit-log-meta {
  display: flex;
  gap: 8px;
  color: var(--text-dim, #9aa0b4);
  font-size: 11px;
}
.credit-log-type {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.credit-log-type.recharge { background: rgba(143, 211, 168, .15); color: #8fd3a8; }
.credit-log-type.consume { background: rgba(255, 92, 122, .15); color: #ff5c7a; }
.credit-log-type.refund { background: rgba(255, 193, 94, .15); color: #ffc15e; }
.credit-log-type.adjust { background: rgba(124, 108, 255, .15); color: #b9a8ff; }
.credit-log-amount {
  font-weight: 700;
  font-size: 13px;
  margin-left: 12px;
  white-space: nowrap;
}
.credit-log-amount.positive { color: #8fd3a8; }
.credit-log-amount.negative { color: #ff5c7a; }
.credit-logs-more {
  margin-top: 8px;
  text-align: center;
}
.credit-logs-more .btn-text {
  background: none;
  border: 1px solid rgba(124, 108, 255, .3);
  color: #b9a8ff;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.credit-logs-more .btn-text:hover {
  background: rgba(124, 108, 255, .1);
}
[data-theme="light"] .credit-logs-list {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(30, 42, 90, .1);
}
[data-theme="light"] .credit-bill-header {
  color: var(--text, #1e2a5a);
}
[data-theme="light"] .credit-log-remark {
  color: var(--text, #1e2a5a);
}

/* 积分账单弹窗 */
.credit-bill-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(124, 108, 255, .15);
}
.credit-bill-balance {
  font-size: 13px;
  color: var(--text-dim, #9aa0b4);
}
.credit-bill-balance b {
  color: #b9a8ff;
  font-size: 16px;
  font-weight: 700;
}
.credit-bill-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.credit-bill-actions .btn-primary {
  background: linear-gradient(135deg, #7c6cff, #5a3fd6);
  border: none;
  color: #fff;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.credit-bill-actions .btn-primary:hover {
  opacity: .9;
}
.credit-bill-toolbar .btn-text {
  background: none;
  border: 1px solid rgba(124, 108, 255, .3);
  color: #b9a8ff;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.credit-bill-toolbar .btn-text:hover {
  background: rgba(124, 108, 255, .1);
}

/* 充值弹窗 */
.recharge-section {
  margin-bottom: 20px;
}
.recharge-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim, #9aa0b4);
  margin-bottom: 10px;
}
.recharge-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.recharge-tier {
  background: rgba(124, 108, 255, .08);
  border: 2px solid rgba(124, 108, 255, .2);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: var(--text, #e8eaf2);
}
.recharge-tier:hover {
  border-color: rgba(124, 108, 255, .5);
  background: rgba(124, 108, 255, .15);
}
.recharge-tier.selected {
  border-color: #7c6cff;
  background: rgba(124, 108, 255, .2);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, .15);
}
.tier-money {
  font-size: 20px;
  font-weight: 700;
  color: #b9a8ff;
  margin-bottom: 4px;
}
.tier-desc {
  font-size: 12px;
  color: var(--text-dim, #9aa0b4);
  margin-bottom: 2px;
}
.tier-credits {
  font-size: 13px;
  color: #8fd3a8;
  font-weight: 600;
}
.tier-bonus {
  font-size: 10px;
  color: #ffc15e;
  margin-top: 2px;
}
.recharge-custom {
  background: rgba(124, 108, 255, .06);
  border: 1px solid rgba(124, 108, 255, .15);
  border-radius: 12px;
  padding: 16px;
}
.custom-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(124, 108, 255, .2);
  border-radius: 8px;
  padding: 0 12px;
}
.custom-prefix {
  color: #b9a8ff;
  font-size: 16px;
  font-weight: 600;
}
.custom-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text, #e8eaf2);
  font-size: 16px;
  padding: 12px 8px;
  outline: none;
}
.custom-input-wrap input::placeholder {
  color: #5a5f75;
}
.custom-preview {
  margin-top: 10px;
  font-size: 14px;
  color: #8fd3a8;
  font-weight: 600;
}
.custom-tip {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim, #9aa0b4);
}
.pay-methods {
  display: flex;
  gap: 12px;
}
.pay-method {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(124, 108, 255, .08);
  border: 2px solid rgba(124, 108, 255, .2);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all .2s;
}
.pay-method:hover {
  border-color: rgba(124, 108, 255, .4);
}
.pay-method input[type="radio"] {
  display: none;
}
.pay-method input[type="radio"]:checked + .pay-method-icon,
.pay-method:has(input[type="radio"]:checked) {
  border-color: #7c6cff;
  background: rgba(124, 108, 255, .15);
}
.pay-method-icon {
  font-size: 20px;
}
.recharge-submit {
  width: 100%;
  background: linear-gradient(135deg, #7c6cff, #5a3fd6);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 8px;
  transition: all .2s;
}
.recharge-submit:hover {
  opacity: .9;
  transform: translateY(-1px);
}
.recharge-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
[data-theme="light"] .recharge-tier {
  background: rgba(30, 42, 90, .05);
  border-color: rgba(30, 42, 90, .15);
  color: var(--text, #1e2a5a);
}
[data-theme="light"] .recharge-tier.selected {
  border-color: #5a3fd6;
  background: rgba(90, 63, 214, .1);
}
[data-theme="light"] .custom-input-wrap {
  background: rgba(0, 0, 0, .05);
}
[data-theme="light"] .custom-input-wrap input {
  color: var(--text, #1e2a5a);
}

/* ============ @ 引用选择浮层 ============ */
.mention-pop {
  position: fixed;
  z-index: 80;
  width: 288px;
  max-height: 264px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(16, 18, 34, .97);
  border: 1px solid rgba(124, 108, 255, .4);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  backdrop-filter: blur(18px);
  animation: pop .18s ease-out;
}
.mention-pop[hidden] { display: none; }
.mention-group {
  font-size: 10px; font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 1.5px;
  padding: 6px 8px 3px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
}
.mention-item.active { background: rgba(124, 108, 255, .3); }
.mention-thumb {
  width: 34px; height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--panel-border);
}
.mention-aico {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(47, 212, 198, .15);
  color: var(--accent-2);
  flex: 0 0 auto;
}
.mention-aico svg { width: 18px; height: 18px; }
.mention-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(124, 108, 255, .25);
  color: #b3a8ff;
  flex: 0 0 auto;
}
.mention-item.active .mention-badge { background: rgba(124, 108, 255, .55); color: #fff; }
.mention-name {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mention-token {
  font-size: 10.5px;
  color: var(--accent-2);
  font-family: Consolas, Menlo, monospace;
  flex: 0 0 auto;
}
.mention-empty { padding: 12px 10px; font-size: 12px; color: var(--text-faint); text-align: center; }

[data-theme="light"] .mention-pop {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(30, 42, 90, .15);
  box-shadow: 0 18px 50px rgba(70, 90, 170, .22);
}
[data-theme="light"] .mention-item.active { background: rgba(124, 108, 255, .16); }
[data-theme="light"] .mention-badge { background: rgba(124, 108, 255, .14); color: #5747d6; }
[data-theme="light"] .mention-item.active .mention-badge { background: rgba(124, 108, 255, .4); color: #fff; }

/* ============ 提示词 ============ */
.prompt-section { margin-bottom: 16px; }
.prompt-box { position: relative; }
.prompt-box::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: calc(var(--radius-sm) + 1px);
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.prompt-box:focus-within::before { opacity: .55; }
.prompt-box textarea {
  position: relative; z-index: 1;
  width: 100%;
  resize: none;
  background: rgba(10, 12, 22, .52);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  padding: 13px 15px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 2px 12px rgba(0, 0, 0, .55);
  transition: border-color .3s, background .3s;
}
.prompt-box textarea::placeholder { color: rgba(228, 231, 243, .78); text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 2px 12px rgba(0, 0, 0, .55); }
.prompt-box textarea:focus { outline: none; border-color: rgba(124, 108, 255, .45); background: rgba(10, 12, 22, .58); }

/* ---- 富文本提示框：<Picture N>/<Audio N> 以内联缩略芯片显示 ---- */
.prompt-box .rich-prompt {
  position: relative; z-index: 1;
  width: 100%;
  min-height: 98px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(10, 12, 22, .52);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.9;
  padding: 11px 15px;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  transition: border-color .3s;
}
.prompt-box .rich-prompt:focus { outline: none; border-color: rgba(124, 108, 255, .45); background: rgba(12, 14, 26, .4); }
.prompt-box .rich-prompt.empty::before {
  content: attr(data-placeholder);
  color: rgba(224, 227, 240, .62);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.rp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  margin: 0 3px;
  padding: 2px 7px 2px 3px;
  height: 26px;
  border-radius: 8px;
  background: rgba(124, 108, 255, .16);
  border: 1px solid rgba(124, 108, 255, .38);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  cursor: default;
}
.rp-chip.pic img {
  width: 20px; height: 20px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
}
.rp-chip.audio svg {
  width: 15px; height: 15px;
  color: #8f86ff;
  flex: none;
}
.rp-chip-badge { color: #c9c2ff; font-weight: 600; }
[data-theme="light"] .rp-chip { background: rgba(124, 108, 255, .1); border-color: rgba(124, 108, 255, .32); }
[data-theme="light"] .rp-chip-badge { color: #5747d6; }
[data-theme="light"] .rp-chip.audio svg { color: #6a5ae0; }

/* ============ 生成按钮 ============ */
.generate-btn {
  position: relative;
  width: 100%;
  margin-top: 6px;
  padding: 15px;
  border: none;
  border-radius: 14px;
  background: var(--accent-grad);
  background-size: 160% 160%;
  color: #fff;
  font-size: 15.5px; font-weight: 700;
  font-family: inherit;
  letter-spacing: 3px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, background-position .6s;
  box-shadow: 0 10px 32px rgba(94,110,255,.35);
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.generate-btn:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0 16px 40px rgba(94,110,255,.5);
}
.generate-btn:active { transform: translateY(0) scale(.985); }
.generate-btn:disabled {
  cursor: not-allowed;
  filter: saturate(.6) brightness(.85);
  transform: none;
}
.generate-btn .icon-play { width: 19px; height: 19px; }
.btn-glow {
  position: absolute; top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-22deg);
  transition: none;
  pointer-events: none;
}
.generate-btn:hover .btn-glow {
  animation: sheen .85s ease;
}
@keyframes sheen { to { left: 130%; } }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 生成计时 */
.gen-timer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
}
.timer-clock {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(47,212,198,.5);
  animation: timerPulse 1.2s ease-out infinite;
}
@keyframes timerPulse {
  0% { box-shadow: 0 0 0 0 rgba(47,212,198,.55); }
  70% { box-shadow: 0 0 0 8px rgba(47,212,198,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,212,198,0); }
}
.gen-timer.done { color: #a9f0cd; }
.gen-timer.done .timer-clock {
  background: #35e08c;
  animation: none;
  box-shadow: 0 0 8px rgba(53,224,140,.6);
}

/* ============ 预览区 ============ */
.preview { display: flex; flex-direction: column; }

/* 预览框容器：负责按画幅比例居中舞台；竖版时整体加高，画布更大 */
.stage-holder {
  flex: 1;
  min-height: var(--stage-min);
  display: grid;
  place-items: center;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(124,108,255,.09), transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(47,212,198,.07), transparent 55%),
    #080912;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  overflow: hidden;
  transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1);
}

/* 空状态 */
.stage-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
}
.orbit {
  position: relative;
  width: 96px; height: 96px;
  margin-bottom: 14px;
}
.orbit-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.1);
}
.orbit-ring.r1 {
  animation: rotate 9s linear infinite;
  border-top-color: rgba(124,108,255,.75);
  border-style: dashed;
}
.orbit-ring.r2 {
  inset: 12px;
  animation: rotate 6s linear infinite reverse;
  border-bottom-color: rgba(47,212,198,.75);
}
@keyframes rotate { to { transform: rotate(360deg); } }
.orbit-core {
  position: absolute; inset: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(124,108,255,.1);
  border: 1px solid rgba(124,108,255,.3);
  color: #a99bff;
  animation: breathe 3.2s ease-in-out infinite;
}
.orbit-core svg { width: 30px; height: 30px; }
@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124,108,255,.25); }
  50% { transform: scale(1.06); box-shadow: 0 0 34px 4px rgba(124,108,255,.28); }
}
.empty-title { font-size: 14.5px; font-weight: 600; color: var(--text-dim); }
.empty-sub { font-size: 12px; color: var(--text-faint); }

/* 生成中 */
.stage-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
.scan-frame {
  position: relative;
  width: 58%; aspect-ratio: 16/9;
  max-width: 420px;
}
.corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 2.5px solid var(--accent);
  opacity: .9;
}
.corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.scan-line {
  position: absolute; left: 4%; right: 4%; top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  border-radius: 3px;
  filter: drop-shadow(0 0 8px var(--accent-2));
  animation: scan 2.1s ease-in-out infinite;
}
@keyframes scan {
  0% { top: 4%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}
.loading-text { font-size: 13.5px; color: var(--text-dim); letter-spacing: 1px; }
.progress {
  width: 46%; height: 5px;
  background: rgba(255,255,255,.09);
  border-radius: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0%;
  background: var(--accent-grad);
  border-radius: 5px;
  transition: width .3s ease;
}
.loading-pct {
  font-size: 12px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

/* ============ 生成等待：能量球假进度 / 趣味文案 / 成片入口 ============ */
html.jm .gen-busy {
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
}
html.jm .gen-orb {
  position: relative;
  width: 132px; height: 132px;
  display: grid; place-items: center;
}
html.jm .gen-orb-ring { position: absolute; inset: 0; border-radius: 50%; }
html.jm .gen-orb-ring.r1 {
  background: conic-gradient(from 0deg,
    transparent 0 16%,
    rgba(124, 108, 255, .95) 40%,
    transparent 62%,
    rgba(47, 212, 198, .85) 86%,
    transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: genSpin 2.6s linear infinite;
}
html.jm .gen-orb-ring.r2 {
  inset: 13px;
  border: 1.5px dashed rgba(47, 212, 198, .5);
  animation: genSpin 7s linear infinite reverse;
}
@keyframes genSpin { to { transform: rotate(360deg); } }
html.jm .gen-orb-core {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, rgba(124, 108, 255, .32), rgba(10, 12, 24, .88) 72%);
  border: 1px solid rgba(124, 108, 255, .45);
  box-shadow: 0 0 26px rgba(124, 108, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: genCorePulse 2.4s ease-in-out infinite;
}
@keyframes genCorePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(124, 108, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .12); }
  50% { transform: scale(1.05); box-shadow: 0 0 38px rgba(47, 212, 198, .4), inset 0 1px 0 rgba(255, 255, 255, .16); }
}
html.jm .gen-orb-core .loading-pct {
  font-size: 20px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(92deg, #b3a7ff, #5fe6d8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* 环绕小星芒 */
html.jm .gen-spark {
  position: absolute;
  width: 6px; height: 6px;
  background: radial-gradient(circle, #fff 0%, rgba(168, 155, 255, .9) 40%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: genSpark 3.2s ease-in-out infinite;
}
html.jm .gen-spark.s1 { top: 4%; left: 22%; }
html.jm .gen-spark.s2 { top: 18%; right: 0; width: 5px; height: 5px; animation-delay: 1.1s; }
html.jm .gen-spark.s3 { bottom: 6%; left: 10%; width: 4px; height: 4px; animation-delay: 2.1s; }
@keyframes genSpark {
  0%, 100% { opacity: 0; transform: translateY(6px) scale(.6); }
  45% { opacity: 1; transform: translateY(-4px) scale(1); }
}
/* 进度条：加宽 + 流光 */
html.jm .stage-loading .progress { width: 54%; height: 6px; }
html.jm .progress-bar { position: relative; box-shadow: 0 0 12px rgba(124, 108, 255, .55); }
html.jm .progress-bar::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: genShimmer 1.6s linear infinite;
}
@keyframes genShimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
/* 趣味等待文案 */
html.jm .loading-fun {
  min-height: 18px;
  font-size: 12.5px;
  color: #b8b2e8;
  letter-spacing: .5px;
}
html.jm .loading-fun.swap { animation: genFunIn .5s ease; }
@keyframes genFunIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 成片入口：脉冲光环 + 大播放钮 */
html.jm .gen-ready {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  animation: grIn .55s cubic-bezier(.22, 1.2, .36, 1) both;
}
html.jm .gen-ready[hidden] { display: none; }
@keyframes grIn {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to { opacity: 1; transform: none; }
}
html.jm .stage-loading.ready .gen-busy { display: none; }
html.jm .gen-ready-btn {
  position: relative;
  width: 108px; height: 108px;
  border: none; border-radius: 50%;
  background: transparent; cursor: pointer;
  display: grid; place-items: center;
  animation: grFloat 3s ease-in-out infinite;
}
@keyframes grFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
html.jm .gr-disc {
  position: relative; z-index: 2;
  width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7c6cff, #2fd4c6);
  box-shadow: 0 10px 30px rgba(124, 108, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .2s;
}
html.jm .gr-disc svg { width: 30px; height: 30px; margin-left: 4px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
html.jm .gen-ready-btn:hover .gr-disc { transform: scale(1.08); }
html.jm .gen-ready-btn:active .gr-disc { transform: scale(.95); }
html.jm .gr-halo {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(124, 108, 255, .55);
  animation: grHalo 2.4s ease-out infinite;
}
html.jm .gr-halo.h2 { border-color: rgba(47, 212, 198, .5); animation-delay: 1.2s; }
@keyframes grHalo {
  0% { transform: scale(.72); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
html.jm .gr-title {
  font-size: 17px; font-weight: 800;
  background: linear-gradient(92deg, #b3a7ff, #62e9da);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
html.jm .gr-sub { font-size: 12.5px; color: var(--text-dim); }

/* 生成失败提示：展示中文失败原因 + 重试按钮，不隐藏生成界面 */
.gen-fail {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 16px; text-align: center;
}
.gen-fail[hidden] { display: none; }
.gf-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px;
  background: rgba(255, 92, 92, .12);
  border: 1px solid rgba(255, 92, 92, .3);
  color: #ff6b6b;
  margin-bottom: 4px;
}
.gf-title {
  font-size: 17px; font-weight: 800; color: #ff8a8a; margin: 0;
}
.gf-reason {
  font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
  max-width: 320px; margin: 0; word-break: break-word;
}
.gf-retry {
  margin-top: 6px;
  padding: 9px 26px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #7c6cff, #2fd4c6);
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(124,108,255,.35);
}
.gf-retry:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,108,255,.5); }
.gf-retry:active { transform: translateY(0); }

/* 结果 */
.stage-result { position: absolute; inset: 0; }
.stage-result video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
/* 结果角标按钮（无方框文字，悬停浮现） */
.result-actions {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 8px;
  z-index: 5;
  opacity: .65;
  transition: opacity .25s;
}
.stage-result:hover .result-actions { opacity: 1; }
.r-icon {
  width: 36px; height: 36px;
  border: none; border-radius: 10px;
  background: rgba(8, 10, 20, .55);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.9);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .25s, transform .25s, color .25s;
}
.r-icon:hover { background: rgba(124,108,255,.85); transform: translateY(-1px); }
.r-icon svg { width: 18px; height: 18px; }
.r-icon.on { background: var(--accent-2); color: #052220; opacity: 1; }
.r-icon[hidden] { display: none; }
.chip {
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
  color: var(--accent-2);
  border-color: rgba(47,212,198,.35);
  transition: all .25s;
  font-family: inherit;
}
.chip-btn svg { width: 13px; height: 13px; }
.chip-btn:hover { background: rgba(47,212,198,.12); }

/* ============ 历史记录（合集分组） ============ */
.history { margin-top: 18px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 6px;
}
.history-empty {
  flex: 1;
  display: grid; place-items: center;
  min-height: 84px;
  border: 1.5px dashed rgba(255,255,255,.1);
  border-radius: 12px;
  font-size: 12px; color: var(--text-faint);
}

/* 合集组 */
.coll-group {
  border: 1px solid rgba(124,108,255,.22);
  background: linear-gradient(180deg, rgba(124,108,255,.07), rgba(124,108,255,.02));
  border-radius: 14px;
  padding: 11px 12px 12px;
  animation: pop .32s cubic-bezier(.34,1.5,.5,1);
}
.coll-group.singles {
  border-color: var(--panel-border);
  background: rgba(255,255,255,.02);
}
.coll-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.coll-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.coll-icon { font-size: 15px; flex: 0 0 auto; }
.coll-name {
  font-size: 13px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.coll-count {
  flex: 0 0 auto;
  font-size: 10.5px; color: var(--text-faint);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  font-variant-numeric: tabular-nums;
}
.coll-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.coll-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px;
  font-size: 11.5px; font-weight: 700; font-family: inherit;
  color: #04211e;
  background: var(--accent-2);
  border: none; border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.coll-btn svg { width: 12px; height: 12px; }
.coll-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* 自动连播开关 */
.autoplay-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer;
  user-select: none;
}
.autoplay-toggle input { display: none; }
.switch-track {
  width: 32px; height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  position: relative;
  transition: background .25s;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #cfd3ea;
  transition: transform .25s cubic-bezier(.34,1.5,.5,1), background .25s;
}
.autoplay-toggle input:checked + .switch-track { background: var(--accent-2); }
.autoplay-toggle input:checked + .switch-track .switch-knob {
  transform: translateX(14px);
  background: #04211e;
}
.ap-label { font-size: 11.5px; color: var(--text-dim); }
.autoplay-toggle input:checked ~ .ap-label { color: #7fe8dd; }

.coll-items {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.history-item {
  position: relative;
  flex: 0 0 148px;
  aspect-ratio: 16/10;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  cursor: pointer;
  animation: pop .32s cubic-bezier(.34,1.5,.5,1);
  transition: transform .25s, border-color .25s;
}
.history-item:hover { transform: translateY(-3px); border-color: rgba(124,108,255,.55); }
.history-item.in-coll:hover { border-color: rgba(47,212,198,.6); }
.history-item img, .history-item video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.history-item .hi-badge {
  position: absolute; left: 6px; top: 6px;
  font-size: 9px; padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0,0,0,.6);
  color: #cfd3ea;
  backdrop-filter: blur(4px);
}
.history-item .hi-badge.ep {
  background: rgba(124,108,255,.75);
  color: #fff;
  font-weight: 700;
}
.history-item .hi-time {
  position: absolute; right: 6px; top: 6px;
  font-size: 9px; padding: 2px 7px;
  border-radius: 5px;
  background: rgba(47,212,198,.22);
  border: 1px solid rgba(47,212,198,.4);
  color: #7fe8dd;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
/* 种子徽章（可点击填入生成设置） */
.history-item .hi-seed {
  position: absolute; left: 6px; top: 25px;
  font-size: 9px; padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(124,108,255,.45);
  color: #b9b1ff;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.history-item .hi-seed:hover {
  background: rgba(124,108,255,.85);
  color: #fff;
  border-color: transparent;
}
.history-item .hi-prompt {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 8px 6px;
  font-size: 10.5px; color: #e6e8f5;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 历史记录：单条删除按钮 ===== */
.history-item .hi-del {
  position: absolute; right: 6px; top: 6px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.62);
  color: #ffb3c2;
  font-size: 11px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .18s, transform .18s, background .18s;
  z-index: 3;
}
.history-item:hover .hi-del { opacity: 1; transform: scale(1); }
.history-item .hi-del:hover { background: rgba(255,80,120,.85); color: #fff; }
.history-item.batching .hi-del { display: none; }

/* ===== 历史记录：批量模式 ===== */
.history-item.batching { cursor: pointer; }
.history-item.batching img, .history-item.batching video { filter: brightness(.55); }
.history-item.batching.selected { border-color: rgba(124,108,255,.9); box-shadow: 0 0 0 2px rgba(124,108,255,.35); }
.history-item.batching.selected img, .history-item.batching.selected video { filter: brightness(.85); }
.history-item .hi-check {
  display: none;
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.75);
  background: rgba(0,0,0,.35);
  z-index: 4;
  transition: background .15s, border-color .15s;
}
.history-item.batching .hi-check { display: block; }
.history-item .hi-check.on {
  background: #7c6cff;
  border-color: #7c6cff;
}
.history-item .hi-check.on::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}

/* ===== 批量进度面板（生成记录上方，卡片样式与生成记录一致） ===== */
.batch-progress { flex: 0 0 auto; margin-top: 14px; }
.batch-progress[hidden] { display: none; }
.bp-list {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}
.bp-card {
  cursor: default;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 7px;
  border-color: rgba(124,108,255,.4);
  background: linear-gradient(160deg, rgba(124,108,255,.12), rgba(47,212,198,.05));
}
.bp-card .hi-badge { position: absolute; top: 6px; left: 6px; z-index: 2; }
.bp-body {
  display: flex; align-items: center; gap: 7px;
  width: calc(100% - 22px);
  margin-top: 12px;
}
.bp-bar {
  flex: 1; height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
}
.bp-bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c6cff, #2fd4c6);
  transition: width .5s ease;
}
.bp-pct {
  min-width: 32px; text-align: right;
  font-size: 11px; font-weight: 700; color: #cfd3ea;
  font-variant-numeric: tabular-nums;
}
.bp-status { font-size: 10.5px; color: var(--text-dim); }
.bp-card.done {
  cursor: pointer;
  border-color: rgba(47,212,198,.55);
  background: rgba(255,255,255,.02);
}
.bp-card.done video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.bp-card.done .hi-time { z-index: 2; }
.bp-card.fail { border-color: rgba(255,90,120,.5); background: rgba(255,80,120,.07); }
.bp-card.fail .bp-bar i { background: #ff5a78; }
.bp-card.fail .bp-status { color: #ff7b95; font-weight: 700; }
[data-theme="light"] .bp-card { border-color: rgba(30,42,90,.22); background: linear-gradient(160deg, rgba(124,108,255,.09), rgba(47,212,198,.06)); }
[data-theme="light"] .bp-bar { background: rgba(30,42,90,.14); }
[data-theme="light"] .bp-pct { color: #3a4265; }

/* ===== 批量管理工具条 ===== */
.hist-batch-btn {
  margin-left: auto;
  font-size: 11px; font-family: inherit; font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(124,108,255,.45);
  background: rgba(124,108,255,.12);
  color: #b9b1ff;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.hist-batch-btn:hover { background: rgba(124,108,255,.3); color: #fff; }
.hist-batch-btn[hidden] { display: none; }
.hist-batch-bar {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.hist-batch-bar[hidden] { display: none; }
.hb-count { font-size: 11.5px; color: #b9b1ff; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb-btn {
  font-size: 11px; font-family: inherit; font-weight: 600;
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,.06);
  color: var(--text-dim);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.hb-btn:hover { background: rgba(124,108,255,.25); color: #fff; border-color: rgba(124,108,255,.5); }
.hb-btn.danger { border-color: rgba(255,90,120,.5); background: rgba(255,90,120,.12); color: #ff9fb4; }
.hb-btn.danger:hover { background: rgba(255,80,120,.75); color: #fff; }
.hb-btn:disabled { opacity: .45; cursor: not-allowed; }
.hb-btn:disabled:hover { background: rgba(255,90,120,.12); color: #ff9fb4; }

/* 预览区自动连播芯片 */
.ap-chip .ap-state { font-style: normal; opacity: .75; margin-left: 2px; }
.ap-chip.on {
  color: #04211e;
  background: var(--accent-2);
  border-color: var(--accent-2);
}
.ap-chip.on .ap-state { opacity: 1; font-weight: 700; }

/* ============ Toast（右上角 · 暗色玻璃 · 全站统一） ============ */
:root { color-scheme: dark; }   /* 原生控件（select弹层/滚动条/日历等）统一暗色，杜绝白底下拉 */
.toast {
  position: fixed;
  right: 20px; top: 20px;
  left: auto; bottom: auto;
  transform: translateX(16px);
  z-index: 999;
  padding: 11px 20px 11px 40px;
  background: linear-gradient(135deg, rgba(30,41,59,.96), rgba(16,24,40,.96));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  font-size: 13px;
  color: #E5E7EB;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(12px);
  max-width: min(420px, calc(100vw - 40px));
}
.toast::before {
  content: "ℹ";
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: .9;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success, .toast.ok {
  background: linear-gradient(135deg, rgba(0,168,110,.92), rgba(0,196,140,.85));
  border-color: rgba(0,255,187,.4);
  color: #eafff6;
  box-shadow: 0 8px 28px rgba(0,196,140,.25);
}
.toast.success::before, .toast.ok::before { content: "✓"; font-weight: 700; }
.toast.error {
  background: linear-gradient(135deg, rgba(196,74,32,.94), rgba(255,106,0,.82));
  border-color: rgba(255,150,80,.45);
  color: #fff3ea;
  box-shadow: 0 8px 28px rgba(255,106,0,.22);
  animation: toast-shake .4s ease;
}
.toast.error::before { content: "⚠"; }
@keyframes toast-shake {
  0%, 100% { margin-right: 0; }
  20% { margin-right: 5px; }
  40% { margin-right: -4px; }
  60% { margin-right: 3px; }
  80% { margin-right: -2px; }
}

/* ============ 生成设置 ============ */
.settings-section {
  margin-bottom: 6px;
  padding: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}
.settings-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.settings-row + .settings-row { margin-top: 12px; }
.field-label { font-size: 12.5px; color: var(--text-dim); flex: 0 0 auto; }

.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-opt {
  padding: 5.5px 12px;
  font-size: 12px; font-family: inherit;
  color: var(--text-dim);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.chip-opt:hover { color: var(--text); border-color: rgba(124,108,255,.5); }
.chip-opt.active {
  color: #fff;
  background: rgba(124,108,255,.28);
  border-color: rgba(124,108,255,.75);
  box-shadow: 0 0 12px rgba(124,108,255,.25);
}

/* 模型选择器 */
.model-switch { display: flex; gap: 8px; flex-wrap: wrap; }
/* 刷新模型按钮（与下拉同排，强制回源模型清单） */
.model-refresh-btn {
  height: 34px; padding: 0 12px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: var(--text-dim);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border);
  border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; transition: all .2s;
}
.model-refresh-btn:hover {
  color: #fff;
  border-color: rgba(124,108,255,.55);
  background: rgba(124,108,255,.14);
}
.model-refresh-btn:disabled { opacity: .55; cursor: not-allowed; }
.model-select {
  min-width: 210px; max-width: 280px; height: 34px; padding: 0 30px 0 12px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: var(--text);
  background: rgba(255,255,255,.05) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a0a0c0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; transition: all .25s; outline: none;
}
.model-select:hover { border-color: rgba(124,108,255,.5); }
.model-select:focus { border-color: rgba(124,108,255,.75); box-shadow: 0 0 12px rgba(124,108,255,.25); }
.model-select option, .model-select optgroup { background: #1b1b2e; color: #e8e8f4; }
.model-select option:disabled { color: #666680; font-style: italic; }
[data-theme="light"] .model-select { background-color: rgba(30,42,90,.05); }
[data-theme="light"] .model-select option, [data-theme="light"] .model-select optgroup { background: #fff; color: #222; }
.model-opt {
  padding: 6px 14px;
  font-size: 12px; font-family: inherit; font-weight: 600;
  color: var(--text-dim);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .22s;
}
.model-opt:hover { color: var(--text); border-color: rgba(124,108,255,.5); }
.model-opt.active {
  color: #fff;
  background: rgba(124,108,255,.28);
  border-color: rgba(124,108,255,.75);
  box-shadow: 0 0 12px rgba(124,108,255,.25);
}

input[type="range"] {
  flex: 1;
  min-width: 110px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 10%), rgba(255,255,255,.12) var(--fill, 10%));
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(124,108,255,.5);
  transition: transform .2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.duration-val {
  font-size: 12.5px; color: var(--accent-2);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  min-width: 38px;
}
.seed-input {
  width: 150px;
  padding: 7px 11px;
  font-size: 12px; font-family: inherit;
  color: var(--text);
  background: #0d0e1c;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .25s;
  margin-left: auto;
}
.seed-input::placeholder { color: var(--text-faint); }
.seed-input:focus { border-color: rgba(124,108,255,.65); }
.seed-input::-webkit-outer-spin-button,
.seed-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.seed-input:disabled { opacity: .45; cursor: not-allowed; }

/* 沿用上次种子开关 */
.seed-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seed-hint.on { color: #7fe8dd; }

/* ============ API 设置弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0;
  z-index: 50;
  display: grid; place-items: center;
  background: rgba(4,5,12,.68);
  backdrop-filter: blur(8px);
  animation: fadeIn .25s;
}
.modal-mask[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(430px, calc(100vw - 40px));
  background: #12131f;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: pop .32s cubic-bezier(.34,1.4,.5,1);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
  border: none; border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .22s;
}
.modal-close:hover { background: rgba(255,92,122,.18); color: #fff; }
.modal-close svg { width: 14px; height: 14px; }

.modal-field { display: block; margin-bottom: 14px; }
.modal-field > span {
  display: block;
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 7px;
}
.modal-field input {
  width: 100%;
  padding: 10px 13px;
  font-size: 13px; font-family: inherit;
  color: var(--text);
  background: #0d0e1c;
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  outline: none;
  transition: border-color .25s;
}
.modal-field input:focus { border-color: rgba(124,108,255,.65); }
.key-wrap { position: relative; }
.key-wrap input { padding-right: 44px; }
.key-eye {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: none; border: none;
  color: var(--text-faint);
  cursor: pointer;
  transition: color .2s;
}
.key-eye:hover { color: var(--text); }
.key-eye svg { width: 16px; height: 16px; }

.modal-tip {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 4px 0 16px;
}
.modal-actions { display: flex; }
.modal-save {
  flex: 1;
  padding: 12px;
  border: none; border-radius: 11px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 14px; font-weight: 700;
  font-family: inherit;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
  box-shadow: 0 8px 24px rgba(94,110,255,.32);
}
.modal-save:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(94,110,255,.45); }

/* ============ 会员中心 ============ */
.member-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,108,255,.14), rgba(47,212,198,.10));
  border: 1px solid rgba(124,108,255,.28);
  margin-bottom: 12px;
}
.member-crown { width: 34px; height: 34px; color: #f0b13e; flex: none; }
.member-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.member-account {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-badge {
  align-self: flex-start;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  letter-spacing: .5px;
}
.member-badge.on { color: #35d49a; background: rgba(53,212,154,.14); border: 1px solid rgba(53,212,154,.35); }
.member-badge.off { color: var(--text-faint); background: rgba(150,150,170,.12); border: 1px solid rgba(150,150,170,.25); }
.member-expire { font-size: 12px; color: var(--text-dim); margin: 0 2px 14px; }
.redeem-btn {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  padding: 6px 14px;
  border: none; border-radius: 8px;
  background: var(--accent-grad);
  color: #fff; font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.redeem-btn:hover { transform: translateY(-50%) scale(1.05); }
.redeem-btn:disabled { opacity: .55; cursor: not-allowed; }
.key-wrap .redeem-btn { position: absolute; }
#redeemInput { padding-right: 70px; }

/* ============ 后台管理 ============ */
.admin-main {
  position: relative; z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(14px);
}
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.admin-head h2 { font-size: 17px; font-weight: 700; }
.admin-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px; font-family: inherit;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.admin-refresh:hover { color: var(--text); border-color: rgba(124,108,255,.5); }
.admin-refresh svg { width: 14px; height: 14px; }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--panel-border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.admin-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,.03);
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  color: var(--text-dim);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,.025); }
.cell-account { color: var(--text); font-weight: 600; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.cell-code { color: var(--text); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; letter-spacing: .5px; white-space: nowrap; }
.cell-code .card-code-text { margin-right: 8px; }
.copy-code-btn {
  display: inline-block;
  vertical-align: middle;
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; font-family: inherit;
  color: #c7cbff;
  background: rgba(124, 108, 255, .14);
  border: 1px solid rgba(124, 108, 255, .4);
  border-radius: 7px;
  cursor: pointer;
  transition: all .18s;
}
.copy-code-btn:hover {
  color: #fff;
  background: rgba(124, 108, 255, .35);
  border-color: rgba(124, 108, 255, .7);
}
.copy-code-btn:active { transform: scale(.94); }
.table-empty { text-align: center; padding: 28px !important; color: var(--text-faint) !important; }

.state {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2.5px 9px; border-radius: 999px;
  white-space: nowrap;
}
.state.on { color: #35d49a; background: rgba(53,212,154,.13); }
.state.expired { color: #f0b13e; background: rgba(240,177,62,.13); }
.state.danger { color: var(--danger); background: rgba(255,92,122,.12); }
.state.used { color: var(--text-faint); background: rgba(150,150,170,.12); }
.state.none { color: var(--text-faint); background: rgba(150,150,170,.1); }
.state.admin { color: #7c9cff; background: rgba(124,156,255,.13); }

/* 画布权限开关按钮 */
.canvas-on, .canvas-off {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2.5px 9px; border-radius: 999px;
  white-space: nowrap;
  border: none; cursor: pointer;
  transition: filter .15s;
  font-family: inherit;
}
.canvas-on  { color: #35d49a; background: rgba(53,212,154,.13); }
.canvas-off { color: var(--text-faint); background: rgba(150,150,170,.1); }
.canvas-on:hover, .canvas-off:hover { filter: brightness(1.15); }
.canvas-on:disabled, .canvas-off:disabled { opacity: .5; cursor: not-allowed; }

.cell-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.cell-actions button {
  padding: 4.5px 10px;
  border-radius: 7px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 11.5px; font-family: inherit;
  cursor: pointer;
  transition: color .18s, border-color .18s, background-color .18s;
  white-space: nowrap;
}
.cell-actions button:hover { color: var(--text); border-color: rgba(124,108,255,.55); background: rgba(124,108,255,.1); }
.cell-actions button:disabled { opacity: .45; cursor: not-allowed; }
.cell-actions button.warn:hover { color: var(--danger); border-color: rgba(255,92,122,.55); background: rgba(255,92,122,.08); }

/* ---------- 用户筛选 / 查找栏 ---------- */
.user-filters {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,.025);
}
.uf-search {
  position: relative;
  flex: 1 1 210px;
  min-width: 190px;
  display: flex; align-items: center;
}
.uf-search > svg {
  position: absolute; left: 11px;
  width: 14px; height: 14px;
  color: var(--text-faint);
  pointer-events: none;
}
.uf-search input {
  width: 100%;
  padding: 8.5px 12px 8.5px 33px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.uf-search input::placeholder { color: var(--text-faint); }
.uf-search input:focus {
  border-color: rgba(124,108,255,.65);
  box-shadow: 0 0 0 3px rgba(124,108,255,.13);
}
/* 去掉 search 输入框原生清除按钮（用 Esc / 清除筛选 统一交互） */
.uf-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.uf-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.uf-select {
  padding: 8.5px 30px 8.5px 12px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background-color: rgba(0,0,0,.18);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa0b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text);
  font-size: 12.5px; font-family: inherit;
  outline: none;
  cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  transition: border-color .18s;
}
.uf-select:focus { border-color: rgba(124,108,255,.65); }
.uf-select option { background: var(--panel-solid); color: var(--text); }

.uf-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.uf-count { font-size: 12px; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.uf-reset {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: color .18s, border-color .18s, background-color .18s;
}
.uf-reset:hover { color: var(--danger); border-color: rgba(255,92,122,.5); }
.uf-empty-actions { margin-top: 10px; }
.uf-empty-actions .uf-reset:hover { color: var(--text); border-color: rgba(124,108,255,.55); background: rgba(124,108,255,.1); }

/* 浅色类主题（白天 / 少女 / 卡通）：输入控件改用浅底 */
[data-theme="light"] .uf-search input, [data-theme="light"] .uf-select,
[data-theme="girly"] .uf-search input, [data-theme="girly"] .uf-select,
[data-theme="cartoon"] .uf-search input, [data-theme="cartoon"] .uf-select {
  background-color: rgba(255,255,255,.72);
}

.admin-tip { font-size: 11.5px; color: var(--text-faint); line-height: 1.6; margin-top: 14px; }

.gen-form {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed var(--panel-border);
  margin-bottom: 16px;
}
.gen-field { display: flex; flex-direction: column; gap: 6px; }
.gen-field > span { font-size: 11.5px; color: var(--text-faint); letter-spacing: 1px; }
.gen-field input {
  width: 110px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,.18);
  color: var(--text);
  font-size: 13px; font-family: inherit;
  outline: none;
}
.gen-field input:focus { border-color: rgba(124,108,255,.65); }
.gen-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.gen-presets button {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px; font-family: inherit;
  cursor: pointer;
  transition: color .18s, border-color .18s, background-color .18s;
  white-space: nowrap;
}
.gen-presets button:hover { color: var(--text); border-color: rgba(124,108,255,.55); background: rgba(124,108,255,.1); }
.admin-btn {
  padding: 9.5px 18px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.admin-btn.primary {
  border: none;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(94,110,255,.3);
}
.admin-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(94,110,255,.42); }
.admin-btn.small { padding: 6px 12px; font-size: 12px; }
.admin-btn:disabled { opacity: .55; cursor: not-allowed; }

.gen-result {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(47,212,198,.3);
  background: rgba(47,212,198,.06);
}
.gen-result-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--text-dim);
  margin-bottom: 10px;
}
.gen-result-head b { color: var(--accent-2); }
#genCodes {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,.22);
  color: var(--text);
  font-size: 12.5px;
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1.7;
  outline: none;
}
[data-theme="light"] .gen-field input, [data-theme="light"] #genCodes { background: rgba(255,255,255,.7); }
[data-theme="light"] .admin-table th { background: rgba(30,42,90,.04); }
[data-theme="light"] .admin-table td { border-bottom-color: rgba(30,42,90,.07); }

/* ============ 整页翻页（scroll-snap） ============ */
html {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}
.snap-page {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
}
/* 第一页：视频生成（吸附点在页顶 → 顶栏始终可见） */
.page-gen {
  min-height: 100vh;
}
/* 第二页：聊天（整页） */
.page-chat {
  min-height: 100vh;
  padding: 0 28px 24px;
}
.page-chat .chat-panel {
  height: calc(100vh - 24px);
}

/* 翻页提示（第一页底部、聊天页露出区域上方） */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 142px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 2px;
  pointer-events: none;
  animation: hintFloat 1.8s ease-in-out infinite;
}
.scroll-hint svg { width: 22px; height: 22px; color: var(--accent-2); }
@keyframes hintFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ============ AI 分镜助手（聊天面板） ============ */
.chat-panel {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 560px;
  animation: rise .6s cubic-bezier(.2,.8,.2,1);
}

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
}
.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.chat-avatar svg { width: 21px; height: 21px; }
.chat-avatar.ai {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(94,110,255,.35);
}
.chat-name { font-size: 14.5px; font-weight: 700; }
.chat-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.chat-clear {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.chat-clear svg { width: 14px; height: 14px; }
.chat-clear:hover { color: #ffb3c2; border-color: rgba(255,92,122,.4); background: rgba(255,92,122,.08); }

/* 消息区 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg { display: flex; gap: 10px; animation: msgIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.msg .mini-avatar {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  font-size: 13px; font-weight: 700;
}
.msg-ai .mini-avatar {
  background: var(--accent-grad);
  color: #fff;
  font-size: 10px;
  letter-spacing: .2px;
}
.msg-user { flex-direction: row-reverse; }
.msg-user .mini-avatar {
  background: rgba(255,255,255,.1);
  border: 1px solid var(--panel-border);
  color: var(--text);
}

.bubble {
  max-width: min(760px, 82%);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.75;
  word-break: break-word;
}
.msg-ai .bubble {
  background: rgba(255,255,255,.055);
  border: 1px solid var(--panel-border);
  border-top-left-radius: 4px;
  color: var(--text);
}
.msg-user .bubble {
  background: linear-gradient(135deg, rgba(124,108,255,.32), rgba(74,140,255,.28));
  border: 1px solid rgba(124,108,255,.35);
  border-top-right-radius: 4px;
  color: #fff;
}
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: 4px 0 8px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble b { color: #cfc8ff; }
.msg-user .bubble b { color: #fff; }
.bubble code {
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  background: rgba(124,108,255,.18);
  padding: 1px 6px;
  border-radius: 5px;
}
.shots-loading {
  display: flex; align-items: center; gap: 9px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* 欢迎示例 */
.chat-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.example-chip {
  padding: 6px 13px;
  font-size: 12px; font-family: inherit;
  color: var(--text-dim);
  background: rgba(124,108,255,.1);
  border: 1px solid rgba(124,108,255,.3);
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.example-chip:hover {
  color: #fff;
  background: rgba(124,108,255,.28);
  border-color: rgba(124,108,255,.6);
  transform: translateY(-1px);
}

/* 打字光标 */
.typing-cursor {
  display: inline-block;
  width: 7px; height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--accent-2);
  border-radius: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  animation: dotBounce 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* 分镜卡片 */
.shots-wrap { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.shot-card {
  background: rgba(0,0,0,.28);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .25s;
}
.shot-card:hover { border-color: rgba(124,108,255,.4); }
.shot-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 8px;
}
.shot-no {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 12px; font-weight: 700;
}
.shot-title { font-size: 13.5px; font-weight: 700; color: #fff; flex: 1; }
.shot-duration {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(47,212,198,.1);
  border: 1px solid rgba(47,212,198,.35);
  border-radius: 999px;
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
}
.shot-duration b { color: #7fe8dd; font-size: 12.5px; }
.shot-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-faint);
  margin-bottom: 8px;
}
.shot-meta span b { color: var(--text-dim); font-weight: 600; }
.shot-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 9px; }

.shot-prompt-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 1px;
  margin-bottom: 5px;
  display: flex; align-items: center; gap: 5px;
}
.shot-prompt {
  position: relative;
  font-size: 12.5px;
  line-height: 1.7;
  color: #dfe3f7;
  background: rgba(124,108,255,.08);
  border: 1px solid rgba(124,108,255,.22);
  border-radius: 9px;
  padding: 9px 12px;
  padding-bottom: 38px;
}
.shot-actions {
  position: absolute;
  right: 8px; bottom: 8px;
  display: flex; gap: 6px;
}
.shot-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  font-size: 11px; font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,.07);
  color: var(--text-dim);
}
.shot-btn svg { width: 12px; height: 12px; }
.shot-btn:hover { color: #fff; background: rgba(255,255,255,.14); }
.shot-btn.use {
  color: #04211e;
  background: var(--accent-2);
  border-color: var(--accent-2);
  font-weight: 700;
}
.shot-btn.use:hover { filter: brightness(1.1); }

/* 输入区 */
.chat-input-area {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--panel-border);
}
.chat-input-wrap {
  display: flex; gap: 10px; align-items: flex-end;
  background: #0d0e1c;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  transition: border-color .25s, box-shadow .25s;
}
.chat-input-wrap:focus-within {
  border-color: rgba(124,108,255,.6);
  box-shadow: 0 0 0 3px rgba(124,108,255,.12);
}
.chat-input-wrap textarea {
  flex: 1;
  resize: none;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  max-height: 130px;
  padding: 4px 0;
}
.chat-input-wrap textarea::placeholder { color: var(--text-faint); }

.chat-send {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border: none; border-radius: 10px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 13px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .22s;
  box-shadow: 0 6px 18px rgba(94,110,255,.3);
}
.chat-send svg { width: 15px; height: 15px; }
.chat-send:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(94,110,255,.45); }
.chat-send:disabled {
  cursor: not-allowed;
  filter: saturate(.5) brightness(.8);
  transform: none;
}

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .topnav { display: none; }
}
@media (max-width: 560px) {
  .layout { padding: 14px; }
  .panel { padding: 16px; }
  .mode-btn span { font-size: 12px; }
}

/* ============ 白天主题：组件级覆盖 ============ */
[data-theme="light"] .topbar { border-bottom-color: rgba(30,42,90,.1); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(30,42,90,.18); }
[data-theme="light"] .prompt-box textarea,
[data-theme="light"] .prompt-box .rich-prompt,
[data-theme="light"] .seed-input,
[data-theme="light"] .chat-input-wrap,
[data-theme="light"] .modal { background: rgba(255, 255, 255, .45); }
[data-theme="light"] .prompt-box textarea,
[data-theme="light"] .prompt-box .rich-prompt,
[data-theme="light"] .seed-input,
[data-theme="light"] .chat-input-wrap { border-color: rgba(30,42,90,.18); }
[data-theme="light"] .prompt-box textarea,
[data-theme="light"] .prompt-box .rich-prompt { text-shadow: none; }
[data-theme="light"] .prompt-box textarea::placeholder { color: rgba(40, 48, 72, .5); text-shadow: none; }
[data-theme="light"] .prompt-box .rich-prompt.empty::before { color: rgba(40, 48, 72, .5); text-shadow: none; }
[data-theme="light"] .modal-mask { background: rgba(200,210,235,.5); }
[data-theme="light"] .modal-close { background: rgba(30,42,90,.07); }
[data-theme="light"] .modal-close:hover { color: var(--danger); }
[data-theme="light"] .chip-opt { background: rgba(30,42,90,.05); color: var(--text-dim); }
[data-theme="light"] .chip-opt.active { color: #fff; }
[data-theme="light"] .mode-switch { background: rgba(30,42,90,.06); }
[data-theme="light"] .mode-thumb { box-shadow: 0 4px 14px rgba(80,90,180,.35); }
[data-theme="light"] .switch-track { background: rgba(30,42,90,.18); }
[data-theme="light"] .switch-knob { background: #fff; }
[data-theme="light"] .upload-zone,
[data-theme="light"] .upload-drag { border-color: rgba(30,42,90,.25); }
[data-theme="light"] .history-empty { border-color: rgba(30,42,90,.2); }
[data-theme="light"] .settings-section { background: rgba(30,42,90,.045); }
[data-theme="light"] .coll-group { background: linear-gradient(180deg, rgba(124,108,255,.12), rgba(124,108,255,.04)); border-color: rgba(124,108,255,.35); }
[data-theme="light"] .coll-group.singles { background: rgba(30,42,90,.04); border-color: var(--panel-border); }
[data-theme="light"] .coll-name { color: var(--text); }
[data-theme="light"] .coll-count { background: rgba(30,42,90,.07); }
[data-theme="light"] .hi-badge { background: rgba(30,42,90,.72); color: #fff; }
[data-theme="light"] .hi-badge.ep { background: rgba(47,212,198,.92); color: #052220; }
[data-theme="light"] .hi-time { background: rgba(30,42,90,.6); color: #fff; }
[data-theme="light"] .history-item .hi-seed { background: rgba(30,42,90,.6); color: #dcd8ff; }
[data-theme="light"] .history-item .hi-seed:hover { background: rgba(124,108,255,.9); color: #fff; }
[data-theme="light"] .hi-prompt { color: #fff; }
[data-theme="light"] input[type="range"] { background: rgba(30,42,90,.14); }
[data-theme="light"] .msg-user .mini-avatar { background: rgba(30,42,90,.08); }
[data-theme="light"] .msg-ai .bubble { background: rgba(30,42,90,.05); }
[data-theme="light"] .bubble b { color: #5747d6; }
[data-theme="light"] .example-chip { color: #5747d6; background: rgba(124,108,255,.1); }
[data-theme="light"] .example-chip:hover { color: #fff; }
[data-theme="light"] .shot-prompt { color: #333a55; }
[data-theme="light"] .shot-card { background: rgba(30,42,90,.04); }
[data-theme="light"] .shot-btn { background: rgba(30,42,90,.06); color: var(--text-dim); }
[data-theme="light"] .shot-btn:hover { background: rgba(30,42,90,.14); color: var(--text); }
[data-theme="light"] .chat-clear { color: var(--text-dim); background: rgba(30,42,90,.06); }
[data-theme="light"] .chat-clear:hover { color: var(--danger); background: rgba(255,92,122,.12); }
[data-theme="light"] .chat-sub,
[data-theme="light"] .logo-sub { color: var(--text-faint); }
[data-theme="light"] .settings-link { color: var(--text-dim); }
[data-theme="light"] .toast { background: rgba(255,255,255,.95); color: var(--text); border: 1px solid var(--panel-border); box-shadow: var(--shadow); }


/* ============ 登录页 ============ */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}
.login-bg { position: fixed; inset: 0; pointer-events: none; }
.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .35;
}
.orb-a { width: 420px; height: 420px; background: #7c6cff; top: -120px; left: -100px; }
.orb-b { width: 380px; height: 380px; background: #2fd4c6; bottom: -140px; right: -80px; opacity: .22; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,108,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,108,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.login-card {
  position: relative; z-index: 1;
  width: min(400px, calc(100vw - 40px));
  padding: 44px 38px 30px;
  border-radius: 22px;
  background: rgba(16, 18, 34, .82);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
[data-theme="light"] .login-card { background: rgba(255,255,255,.9); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-logo .logo-mark { width: 42px; height: 42px; }
.login-logo .logo-mark svg { width: 100%; height: 100%; }
.login-logo .logo-name { font-size: 19px; font-weight: 800; letter-spacing: .5px; display: block; }
.login-logo .logo-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 2.5px; }
.login-title { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 28px; }
.login-field {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding: 0 14px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  transition: border-color .25s, background .25s;
}
.login-field:focus-within { border-color: rgba(124,108,255,.65); background: rgba(124,108,255,.06); }
.login-field svg { width: 17px; height: 17px; color: var(--text-faint); flex: none; }
.login-field input {
  flex: 1; min-width: 0;
  padding: 13px 0;
  font-size: 14px; font-family: inherit;
  color: var(--text);
  background: transparent; border: none; outline: none;
}
.login-field input::placeholder { color: var(--text-faint); }
.login-eye {
  flex: none; display: flex; padding: 4px;
  background: none; border: none; color: var(--text-faint);
  cursor: pointer;
}

/* ============ AI 提示词助手（提示词旁内嵌面板，视频/图片共用） ============ */
.ai-prompt-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 10px;
  padding: 3px 11px 3px 8px;
  font-size: 12px; font-weight: 600; line-height: 1.5;
  color: #c9c2ff;
  background: linear-gradient(135deg, rgba(124,108,255,.18), rgba(47,212,198,.12));
  border: 1px solid rgba(124,108,255,.4);
  border-radius: 999px; cursor: pointer;
  transition: all .22s ease;
  vertical-align: middle;
}
.ai-prompt-toggle svg { width: 13px; height: 13px; }
.ai-prompt-toggle:hover {
  color: #fff;
  border-color: rgba(124,108,255,.8);
  box-shadow: 0 0 14px rgba(124,108,255,.35);
  transform: translateY(-1px);
}
.ai-prompt-toggle.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,108,255,.42), rgba(47,212,198,.28));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(124,108,255,.45);
}
[data-theme="light"] .ai-prompt-toggle {
  color: #5b4bd6;
  background: linear-gradient(135deg, rgba(124,108,255,.1), rgba(47,212,198,.08));
}
[data-theme="light"] .ai-prompt-toggle:hover,
[data-theme="light"] .ai-prompt-toggle.active { color: #fff; }

/* 面板：高度/透明度过渡，展开时有仪式感 */
.ai-prompt-panel {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(124,108,255,.28);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(124,108,255,.1), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, rgba(47,212,198,.07), transparent 55%),
    var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(10,8,40,.28), inset 0 1px 0 rgba(255,255,255,.05);
  animation: aiPanelIn .3s cubic-bezier(.22,1,.36,1);
}
.ai-prompt-panel[hidden] { display: none; }
/* 视频页：面板打开/收起由 JS WAAPI 做「缩进到 AI 按钮」的变形动画，关闭内置入场避免双重动画 */
html.ai-morph .ai-prompt-panel {
  animation: none;
  transform-origin: 100% 0;
  will-change: transform, opacity;
}
@keyframes aiPanelIn {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="light"] .ai-prompt-panel {
  box-shadow: 0 8px 24px rgba(60,70,130,.12);
}

.ai-prompt-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--text);
  margin-bottom: 9px;
}
.ai-prompt-head .ai-spark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 7px;
  background: var(--accent-grad); color: #fff; flex: none;
  box-shadow: 0 2px 8px rgba(124,108,255,.5);
}
.ai-prompt-head .ai-spark svg { width: 12px; height: 12px; }
.ai-prompt-head em {
  font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-dim);
}

.ai-prompt-input-row { display: flex; gap: 8px; }
.ai-prompt-input-row textarea {
  flex: 1; min-width: 0; resize: none;
  max-height: 90px;
  padding: 9px 12px;
  font-size: 13px; line-height: 1.55; font-family: inherit;
  color: var(--text);
  background: rgba(12, 14, 26, .32);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px; outline: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
[data-theme="light"] .ai-prompt-input-row textarea { background: rgba(255, 255, 255, .45); border-color: rgba(30,42,90,.18); text-shadow: none; }
.ai-prompt-input-row textarea:focus {
  border-color: rgba(124,108,255,.6);
  box-shadow: 0 0 0 3px rgba(124,108,255,.14);
}
.ai-prompt-input-row textarea::placeholder { color: var(--text-faint); }

.ai-prompt-go {
  flex: none; align-self: stretch;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 15px;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--accent-grad);
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  box-shadow: 0 4px 14px rgba(124,108,255,.4);
}
.ai-prompt-go:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,108,255,.55); }
.ai-prompt-go:active { transform: translateY(0); }
.ai-prompt-go:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.ai-prompt-go svg { width: 14px; height: 14px; }
.ai-prompt-go.spinning svg { animation: aiSpin 1s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }

/* 结果区 */
.ai-prompt-result {
  display: none;
  margin-top: 10px;
  padding: 11px 13px;
  font-size: 13px; line-height: 1.7; color: var(--text);
  background: rgba(0,0,0,.16);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 200px; overflow-y: auto;
}
[data-theme="light"] .ai-prompt-result { background: rgba(255,255,255,.7); }
.ai-prompt-result.show { display: block; animation: aiPanelIn .25s ease; }
.ai-prompt-result.thinking { color: var(--text-dim); border-left-color: var(--accent); }
.ai-prompt-result.error { color: #ff8aa0; border-left-color: #ff5a78; background: rgba(255,90,120,.07); }
.ai-cursor {
  display: inline-block; width: 7px; height: 15px; margin-left: 2px;
  vertical-align: -2px; border-radius: 2px;
  background: var(--accent-2);
  animation: aiBlink .8s steps(1) infinite;
}
@keyframes aiBlink { 50% { opacity: 0; } }

.ai-prompt-actions {
  display: none; gap: 8px; margin-top: 10px;
}
.ai-prompt-actions.show { display: flex; }
.ai-prompt-use {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: var(--accent-grad);
  border: none; border-radius: 9px; cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  box-shadow: 0 3px 12px rgba(47,212,198,.35);
}
.ai-prompt-use:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(47,212,198,.5); }
.ai-prompt-use svg { width: 13px; height: 13px; }
.ai-prompt-again {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 9px; cursor: pointer;
  transition: all .18s;
}
.ai-prompt-again:hover { color: var(--text); border-color: rgba(124,108,255,.5); background: rgba(124,108,255,.08); }
.ai-prompt-again:disabled { opacity: .5; cursor: not-allowed; }
.ai-prompt-again svg { width: 13px; height: 13px; }

.ai-prompt-tip {
  margin-top: 8px; font-size: 11px; color: var(--text-faint);
  display: flex; align-items: center; gap: 4px;
}
.login-eye:hover { color: var(--accent); }
.login-eye svg { width: 17px; height: 17px; }
.login-error {
  font-size: 12.5px; color: var(--danger);
  margin: -4px 0 12px;
}

/* =====================================================================
   即梦风格工作台（仅首页 html.jm 生效，不影响 image.html / admin.html）
   ===================================================================== */

/* ---------- 设计变量 ---------- */
html.jm {
  scroll-snap-type: none;
  --jm-side: #101114;
  --jm-main: #16171b;
  --jm-card: #1d1e23;
  --jm-card-2: rgba(0, 0, 0, .28);
  --jm-line: rgba(255, 255, 255, .07);
  --jm-nav-idle: #9b9eab;
  --jm-track: #26272c;
  /* 创作卡毛玻璃令牌（夜间） */
  --jm-glass-bg: rgba(23, 24, 30, .52);
  --jm-glass-line: rgba(255, 255, 255, .1);
  --jm-glass-blur: 22px;
  --jm-glass-c1: rgba(124, 108, 255, .30);  /* 品牌紫 */
  --jm-glass-c2: rgba(47, 212, 198, .20);   /* 青 */
  --jm-glass-c3: rgba(91, 138, 255, .24);   /* 蓝 */
  --jm-glass-shadow: 0 20px 60px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .1);
}
html.jm[data-theme="light"] {
  --jm-side: #f3f4f9;
  --jm-main: #eceef5;
  --jm-card: #ffffff;
  --jm-card-2: rgba(30, 42, 90, .05);
  --jm-line: rgba(30, 42, 90, .1);
  --jm-nav-idle: #6b7188;
  --jm-track: #e4e7f0;
  /* 创作卡毛玻璃令牌（白天） */
  --jm-glass-bg: rgba(255, 255, 255, .58);
  --jm-glass-line: rgba(30, 42, 90, .12);
  --jm-glass-blur: 22px;
  --jm-glass-c1: rgba(124, 108, 255, .16);
  --jm-glass-c2: rgba(20, 160, 180, .13);
  --jm-glass-c3: rgba(91, 138, 255, .15);
  --jm-glass-shadow: 0 20px 56px rgba(30, 42, 90, .14), inset 0 1px 0 rgba(255, 255, 255, .75);
}
html.jm body { background: var(--jm-main); }
html.jm #particle-canvas { opacity: .22; }
html.jm .aurora { opacity: .1; }
html.jm .jm-hide { display: none !important; }
/* 本项目无全局 [hidden] 兜底，jm 布局里带 display 的类较多，统一保证 hidden 属性生效 */
html.jm [hidden] { display: none !important; }

/* ---------- 应用骨架 ---------- */
html.jm .jm-shell {
  position: relative; z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧边栏 ---------- */
html.jm .jm-sidebar {
  position: sticky; top: 0;
  flex: 0 0 218px;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  background: rgba(18, 20, 28, .08);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border-right: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 1px 0 0 rgba(255,255,255,.04) inset, -1px 0 18px rgba(0,0,0,.18);
  transform: translateZ(0);
}
html.jm[data-theme="light"] .jm-sidebar {
  background: rgba(245, 246, 252, .18);
  border-right: 1px solid rgba(30, 42, 90, .12);
  box-shadow: -1px 0 18px rgba(30, 42, 90, .08);
}
/* 收起/展开过渡 */
html.jm .jm-sidebar {
  transition: flex-basis .28s cubic-bezier(.2,.8,.2,1), padding .28s ease;
}
/* 展开/收起按钮（贴在侧栏右缘中间） */
html.jm .jm-side-toggle {
  position: absolute;
  top: 50%; right: -13px;
  z-index: 30;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(32, 34, 48, .9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .2s ease, color .2s ease;
}
html.jm .jm-side-toggle:hover { background: rgba(72, 76, 110, .95); }
html.jm .jm-side-toggle svg {
  width: 14px; height: 14px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
/* 收起态：箭头朝右 > */
html.jm .jm-sidebar.collapsed .jm-side-toggle svg { transform: rotate(180deg); }
html.jm[data-theme="light"] .jm-side-toggle {
  background: rgba(255, 255, 255, .9);
  color: #2a2d3a;
  border-color: rgba(30, 42, 90, .15);
}
/* 收起态：窄栏、仅显图标 */
html.jm .jm-sidebar.collapsed {
  flex: 0 0 70px;
  padding-left: 8px;
  padding-right: 8px;
}
html.jm .jm-sidebar.collapsed .jm-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
html.jm .jm-sidebar.collapsed .logo-text { display: none; }
html.jm .jm-sidebar.collapsed .jm-nav a,
html.jm .jm-sidebar.collapsed .jm-nav-foot a,
html.jm .jm-sidebar.collapsed .jm-theme {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
html.jm .jm-sidebar.collapsed .jm-nav a span,
html.jm .jm-sidebar.collapsed .jm-nav-foot a span,
html.jm .jm-sidebar.collapsed .jm-theme span { display: none; }
html.jm .jm-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 20px;
}
html.jm .jm-brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
}
html.jm .jm-brand .logo-mark svg { width: 20px; height: 20px; }
html.jm .jm-brand .logo-name { font-size: 15px; }
html.jm .jm-brand .logo-sub { font-size: 9px; letter-spacing: 2px; }

html.jm .jm-nav,
html.jm .jm-nav-foot { display: flex; flex-direction: column; gap: 3px; }
html.jm .jm-nav-foot { margin-top: auto; }
html.jm .jm-nav a,
html.jm .jm-nav-foot a,
html.jm .jm-theme {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: none; border-radius: 10px;
  background: transparent;
  color: var(--jm-nav-idle);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s;
  text-align: left;
}
html.jm .jm-nav a svg,
html.jm .jm-nav-foot a svg,
html.jm .jm-theme svg { width: 19px; height: 19px; flex: none; }
html.jm .jm-nav a:hover,
html.jm .jm-nav-foot a:hover,
html.jm .jm-theme:hover { background: rgba(128, 130, 150, .12); color: var(--text); }
html.jm .jm-nav a.active {
  background: rgba(128, 130, 150, .16);
  color: var(--text);
  font-weight: 600;
}
html.jm .jm-theme .icon-sun { display: none; }
html.jm[data-theme="light"] .jm-theme .icon-sun { display: block; }
html.jm[data-theme="light"] .jm-theme .icon-moon { display: none; }
html.jm .jm-account {
  font-size: 12px;
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: default;
}
html.jm .jm-account:hover { background: transparent; color: var(--text-faint); }
html.jm .jm-logout { color: #ff8da2 !important; }

/* ---------- 主区域 ---------- */
html.jm .jm-main {
  flex: 1; min-width: 0;
  position: relative;
  isolation: isolate;
  padding: 14px 36px 0;
}
html.jm .jm-main::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(720px 320px at 50% -120px, rgba(94, 116, 255, .14), transparent 70%);
  pointer-events: none;
}
html.jm .jm-topstrip {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 12px;
  height: 42px;
}
html.jm .jm-vip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 196, 92, .45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 184, 88, .18), rgba(255, 138, 96, .12));
  color: #ffc66e;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
html.jm .jm-vip-btn svg { width: 13px; height: 13px; }
html.jm .jm-vip-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255, 170, 80, .22); }
html.jm .jm-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-grad);
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 14px rgba(94, 110, 255, .35);
}

html.jm .jm-compose { max-width: 920px; margin: 4px auto 0; }
html.jm .jm-hello {
  text-align: center;
  font-size: 28px; font-weight: 800;
  letter-spacing: 1px;
  margin: 14px 0 20px;
}

/* ---------- 视频/图片 大类切换（与创作卡同源毛玻璃 + 三色缓动） ---------- */
html.jm .jm-genre.genre-switch {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 280px;
  margin: 0 auto 20px;
  padding: 4px;
  background: var(--jm-glass-bg);
  -webkit-backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  border: 1px solid var(--jm-glass-line);
  border-radius: 999px;
  gap: 0;
  box-shadow: var(--jm-glass-shadow);
}
/* 与创作卡完全相同的三色渐变与动画（同时长 / 无延迟 → 节奏同步） */
html.jm .jm-genre.genre-switch::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(125deg,
    var(--jm-glass-c1) 0%,
    var(--jm-glass-c2) 34%,
    var(--jm-glass-c3) 67%,
    var(--jm-glass-c1) 100%);
  background-size: 300% 300%;
  filter: blur(12px);
  /* 性能：静态化流光（动画导致面板每帧重绘） */
}
html.jm .jm-genre .genre-opt {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--jm-nav-idle);
}
html.jm .jm-genre .genre-opt svg { width: 15px; height: 15px; }
/* 选中态：半透明磨砂白，三色微微透出，与卡片呼应 */
html.jm .jm-genre .genre-opt.active {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #1c1d22;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .9);
}
html.jm[data-theme="light"] .jm-genre .genre-opt.active {
  background: rgba(28, 29, 34, .9);
  color: #fff;
  box-shadow: 0 2px 10px rgba(30, 42, 90, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* ---------- 创作卡片（通透毛玻璃） ---------- */
html.jm .jm-composer.jm-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(23, 24, 30, .1);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid var(--jm-glass-line);
  border-radius: 20px;
  padding: 18px 20px 14px;
  box-shadow: var(--jm-glass-shadow);
  transform: translateZ(0);
  transition: box-shadow .35s ease, border-color .35s ease;
}
html.jm[data-theme="light"] .jm-composer.jm-card {
  background: rgba(255, 255, 255, .18);
}
html.jm .jm-composer.jm-card:hover {
  border-color: rgba(124, 108, 255, .35);
  box-shadow: var(--jm-glass-shadow), 0 0 0 1px rgba(124, 108, 255, .08);
}
/* 夜间：卡片内所有文字加暗色投影，保证在亮色视频画面上清晰可读 */
html.jm:not([data-theme="light"]) .jm-composer.jm-card {
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}
/* 白底选中项上的深色文字不需要投影 */
html.jm:not([data-theme="light"]) .jm-composer.jm-card .chip-opt.active,
html.jm:not([data-theme="light"]) .jm-composer.jm-card .genre-opt.active {
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  html.jm .jm-genre.genre-switch::before { animation: none; }
}

/* 上传区在卡片内更紧凑 */
html.jm .jm-composer .upload-section { margin-bottom: 10px; }
html.jm .jm-composer .upload-section:not([hidden]) {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--jm-line);
  margin-bottom: 12px;
}
html.jm .jm-composer .kf-slot { height: 118px; border-radius: 12px; }
html.jm .jm-composer .upload-zone { padding: 10px; border-radius: 12px; }
html.jm .jm-composer .upload-add { min-height: 78px; border-radius: 10px; }
html.jm .jm-composer .upload-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

/* ---------- 提示词 ---------- */
html.jm .jm-prompt-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
html.jm .jm-prompt-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
}
html.jm .jm-prompt-title em {
  font-style: normal; color: var(--text-faint); font-size: 11px; margin-left: 6px;
}
html.jm .jm-prompt-head .ai-prompt-toggle { margin-left: 0; }
html.jm .prompt-box::before { display: none; }
html.jm .prompt-box .rich-prompt {
  min-height: 82px; max-height: 240px;
  background: transparent;
  border: none;
  padding: 8px 2px 4px;
  font-size: 14px;
  line-height: 1.8;
}
html.jm .prompt-box .rich-prompt:focus { border: none; }

/* AI 面板在卡片内收边 */
html.jm .jm-composer .ai-prompt-panel {
  margin-top: 8px;
  border-radius: 14px;
}

/* ---------- 高级设置 ---------- */
html.jm .jm-adv {
  border-top: 1px solid var(--jm-line);
  margin-top: 6px;
}
html.jm .jm-adv summary {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 2px 9px;
  list-style: none;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
html.jm .jm-adv summary::-webkit-details-marker { display: none; }
html.jm .jm-adv summary svg { width: 14px; height: 14px; }
html.jm .jm-adv[open] summary { color: var(--text); }
html.jm .jm-adv-body { padding: 2px 0 12px; }
html.jm .jm-adv-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px;
}
html.jm #promptNegBox textarea {
  width: 100%; resize: none;
  background: var(--jm-card-2);
  border: 1px solid var(--jm-line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit; font-size: 12.5px; line-height: 1.7;
  padding: 10px 12px;
}
html.jm #promptNegBox textarea:focus { outline: none; border-color: rgba(124, 108, 255, .55); }
html.jm .jm-seed-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
}
html.jm .jm-seed-row .seed-input {
  width: 170px; margin-left: 0;
  background: var(--jm-card-2);
  border: 1px solid var(--jm-line);
  border-radius: 9px;
  color: var(--text);
}
html.jm .jm-seed-row .seed-hint { margin-left: 0; }

/* ---------- 底部工具条 ---------- */
html.jm .jm-toolbar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--jm-line);
}
html.jm .jm-mini-group {
  display: flex; align-items: center; gap: 2px;
  padding: 3px;
  background: var(--jm-card-2);
  border: 1px solid var(--jm-line);
  border-radius: 999px;
}
html.jm .jm-toolbar .chip-opt,
html.jm .jm-toolbar .model-opt {
  padding: 4px 10px;
  font-size: 11.5px; font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  color: var(--text-dim);
}
html.jm .jm-toolbar .chip-opt:hover,
html.jm .jm-toolbar .model-opt:hover { color: var(--text); border-color: transparent; }
html.jm .jm-toolbar .chip-opt.active,
html.jm .jm-toolbar .model-opt.active {
  background: rgba(124, 108, 255, .32);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

/* 模式切换：胶囊内嵌滑块 */
html.jm .jm-toolbar .mode-switch.jm-mini-switch {
  margin: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--jm-line);
  background: var(--jm-card-2);
  gap: 0;
}
html.jm .jm-mini-switch .mode-thumb {
  top: 3px; left: 3px;
  width: calc((100% - 6px) / 3);
  height: calc(100% - 6px);
  border-radius: 999px;
  box-shadow: none;
  background: rgba(124, 108, 255, .45);
}
html.jm .jm-mini-switch .mode-btn {
  padding: 5px 10px;
  font-size: 11.5px; font-weight: 500;
  border-radius: 999px;
  gap: 5px;
}
html.jm .jm-mini-switch .mode-btn svg { width: 13px; height: 13px; }
html.jm .jm-mini-switch .mode-btn.active { color: #fff; }

/* 图片尺寸组容器本身无背景（内部 chip-group 即可） */
html.jm .img-settings.jm-mini-group { background: transparent; border: none; padding: 0; }

/* 时长 */
html.jm .jm-dur { gap: 7px; padding: 5px 12px 5px 10px; }
html.jm .jm-dur svg { width: 14px; height: 14px; color: var(--text-faint); flex: none; }
html.jm .jm-dur input[type="range"] {
  flex: none; width: 78px; min-width: 78px;
  height: 3px;
}
html.jm .jm-dur input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; border-width: 2px; }
html.jm .jm-dur .duration-val { min-width: 34px; font-size: 11.5px; }

/* 完成邮件通知勾选 */
html.jm .jm-mail-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--jm-card-2);
  border: 1px solid var(--jm-line);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color .2s, color .2s, background .2s;
}
html.jm .jm-mail-opt:hover { border-color: var(--jm-main); color: var(--text); }
html.jm .jm-mail-opt svg { width: 14px; height: 14px; color: var(--text-faint); flex: none; }
html.jm .jm-mail-opt input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; margin: 0; flex: none;
  border: 1.5px solid var(--text-faint);
  border-radius: 4px;
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
html.jm .jm-mail-opt input[type="checkbox"]:checked {
  background: var(--jm-main);
  border-color: var(--jm-main);
}
html.jm .jm-mail-opt input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 0.5px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
html.jm .jm-mail-opt:has(input:checked) {
  border-color: color-mix(in srgb, var(--jm-main) 55%, transparent);
  color: var(--text);
}
html.jm .jm-mail-opt:has(input:checked) svg { color: var(--jm-main); }
html.jm .jm-mail-opt .jm-mail-text b {
  font-weight: 500;
  margin-left: 2px;
  color: var(--jm-main);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.jm .jm-mail-opt[hidden] { display: none; }

html.jm .jm-tb-spacer { flex: 1; }

/* 计时（工具条内） */
html.jm .jm-toolbar .gen-timer {
  margin: 0;
  font-size: 11.5px;
  background: var(--jm-card-2);
  border: 1px solid var(--jm-line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* 圆形发送按钮 */
html.jm .generate-btn {
  width: 38px; height: 38px;
  flex: none;
  margin: 0; padding: 0;
  border-radius: 50%;
  letter-spacing: 0;
  box-shadow: 0 6px 18px rgba(94, 110, 255, .45);
}
html.jm .generate-btn:hover { transform: none; }
html.jm .generate-btn .icon-play { width: 18px; height: 18px; }
html.jm .generate-btn .btn-text { display: none; }
html.jm .generate-btn .btn-loading { font-size: 0; display: inline-flex; align-items: center; }
html.jm .generate-btn .btn-loading .spinner { width: 16px; height: 16px; border-width: 2px; }

/* ---------- 快捷技能 chips ---------- */
html.jm .jm-skills {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
  margin: 20px 0 4px;
}
html.jm .skill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  background: transparent;
  border: 1px solid var(--jm-line);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
html.jm .skill-chip:hover {
  color: var(--text);
  border-color: rgba(124, 108, 255, .55);
  background: rgba(124, 108, 255, .08);
}
html.jm .skill-chip .tag-new,
html.jm .skill-chip .tag-hot {
  font-style: normal; font-size: 9.5px; font-weight: 800;
  padding: 1px 5px; border-radius: 5px;
  letter-spacing: .3px;
}
html.jm .skill-chip .tag-new { color: #4aa8ff; background: rgba(74, 168, 255, .12); }
html.jm .skill-chip .tag-hot { color: #ff8a3d; background: rgba(255, 138, 61, .12); }

/* ---------- 预览舞台 ---------- */
html.jm .jm-stage-wrap { display: none; margin-top: 26px; }
html.jm .jm-stage-wrap.active { display: block; animation: rise .4s cubic-bezier(.2, .8, .2, 1); }
html.jm #stageHolder {
  flex: none; min-height: 0;
  height: clamp(380px, 62vh, 680px);
  max-width: 980px;
  margin: 0 auto;
}
html.jm #stageHolder .stage { border-radius: 18px; }

/* ---------- 批量进度 ---------- */
html.jm #batchProgress {
  flex: none;
  max-width: 980px;
  margin: 20px auto 0;
  padding: 16px 18px;
  background: var(--jm-card);
  border: 1px solid var(--jm-line);
  border-radius: 16px;
}
html.jm #batchProgress .bp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 0;
}
html.jm #batchProgress .bp-card {
  flex: none;
  aspect-ratio: 16 / 11;
  border-radius: 12px;
}

/* ---------- 作品库弹窗（毛玻璃 + 淡三色缓动，与创作卡同源） ---------- */
html.jm .works-modal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(960px, calc(100vw - 48px));
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  background: var(--jm-glass-bg);
  -webkit-backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  border: 1px solid var(--jm-glass-line);
  box-shadow: var(--jm-glass-shadow);
}
/* 弹窗内容浮于动态层之上 */
html.jm .works-modal > * { position: relative; z-index: 1; }
/* 同款紫青蓝三色缓动，弹窗内容较多，降到 45% 浓度做氛围底 */
html.jm .works-modal::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(125deg,
    var(--jm-glass-c1) 0%,
    var(--jm-glass-c2) 34%,
    var(--jm-glass-c3) 67%,
    var(--jm-glass-c1) 100%);
  background-size: 300% 300%;
  opacity: .45;
  filter: blur(20px);
  /* 性能：静态化流光 */
}
html.jm .works-modal .modal-head { margin-bottom: 14px; flex: none; }
html.jm .works-modal .modal-head h3 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 17px;
}
html.jm .works-modal .modal-head h3 .hint { font-size: 12px; font-weight: 400; color: var(--text-faint); }

/* ---------- 作品流（位于弹窗内） ---------- */
html.jm .jm-works {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}
html.jm .jm-works-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  flex: none;
}
html.jm .jm-works #historyList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 6px 8px 2px;
}
html.jm .jm-works #historyList::-webkit-scrollbar { width: 6px; }
html.jm .jm-works #historyList::-webkit-scrollbar-thumb {
  background: rgba(124, 108, 255, .35);
  border-radius: 999px;
}
html.jm .jm-works .history-empty {
  grid-column: 1 / -1;
  padding: 72px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  border: 1.5px dashed var(--jm-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
}

html.jm #historyList { display: block; }
html.jm .coll-group {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 0 26px;
  backdrop-filter: none;
}
html.jm .coll-head {
  margin-bottom: 12px; padding: 0;
  background: transparent;
  border: none;
}
html.jm .coll-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 14px;
  overflow: visible;
  padding: 0;
}
html.jm .history-item {
  flex: none;
  aspect-ratio: 16 / 11;
  border-radius: 14px;
  background: var(--jm-card);
  border-color: var(--jm-line);
}
html.jm .history-item:hover { transform: translateY(-3px); border-color: rgba(124, 108, 255, .55); }
/* 弹窗内作品卡：半透明小玻璃片浮于流动底色之上 */
html.jm .works-modal .history-item {
  background: var(--jm-card-2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  html.jm .jm-sidebar.collapsed { padding: 18px 10px 14px; align-items: center; }
  html.jm .jm-sidebar.collapsed .jm-brand { flex-direction: column; gap: 6px; padding: 2px 0 16px; }
  html.jm .jm-main { padding: 14px 22px 0; }
}
/* ---------- 视频预览弹窗（毛玻璃，与作品库同源三色缓动） ---------- */
html.jm .video-modal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(860px, calc(100vw - 48px));
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  background: var(--jm-glass-bg);
  -webkit-backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--jm-glass-blur)) saturate(150%);
  border: 1px solid var(--jm-glass-line);
  box-shadow: var(--jm-glass-shadow);
}
html.jm .video-modal > * { position: relative; z-index: 1; }
html.jm .video-modal::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(125deg,
    var(--jm-glass-c1) 0%,
    var(--jm-glass-c2) 34%,
    var(--jm-glass-c3) 67%,
    var(--jm-glass-c1) 100%);
  background-size: 300% 300%;
  opacity: .35;
  filter: blur(20px);
  /* 性能：静态化流光 */
}
html.jm .video-modal .modal-head { margin-bottom: 12px; flex: none; }
html.jm .video-modal .modal-head h3 { font-size: 16px; }
html.jm .vp-body {
  position: relative;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
}
html.jm .vp-body video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}
html.jm .vp-status {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  z-index: 5;
  pointer-events: none;
}
html.jm .vp-status[hidden] { display: none; }
html.jm .vp-status-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(16, 18, 34, .85);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #e8eaf6;
  font-size: 13px;
}
html.jm .vp-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--accent, #7c6cff);
  border-radius: 50%;
  animation: vp-spin .8s linear infinite;
}
html.jm .vp-spinner[hidden] { display: none; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
html.jm .vp-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
html.jm .vp-prompt {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html.jm .vp-actions { flex: none; display: flex; align-items: center; gap: 10px; }
html.jm .vp-actions #autoplayChip {
  position: static;
  opacity: 1;
  width: auto;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, .07);
  backdrop-filter: none;
}
html.jm .vp-actions #autoplayChip svg { width: 15px; height: 15px; }
html.jm .vp-actions #autoplayChip .ap-state { font-size: 12px; }
html.jm .vp-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--accent-grad);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124, 108, 255, .45);
  transition: transform .18s, box-shadow .18s;
}
html.jm .vp-download:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(124, 108, 255, .6); }
html.jm .vp-download:active { transform: translateY(0); }
html.jm .vp-download svg { width: 15px; height: 15px; }
/* 复制提示词：次级按钮，弱化视觉权重 */
html.jm .vp-download.vp-copy {
  background: rgba(255,255,255,.08);
  color: #e6e8f5;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: none;
}
html.jm .vp-download.vp-copy:hover {
  background: rgba(255,255,255,.15);
  box-shadow: none;
}

@media (max-width: 720px) {
  html.jm .jm-hello { font-size: 22px; }
  html.jm .jm-composer.jm-card { padding: 14px; }
  html.jm .jm-toolbar { gap: 6px; }
  html.jm .jm-mini-switch .mode-btn span { display: none; }
  html.jm .coll-items,
  html.jm #batchProgress .bp-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  html.jm .works-modal {
    width: calc(100vw - 24px);
    max-height: 88vh;
    padding: 16px 14px;
  }
  html.jm .video-modal { width: calc(100vw - 24px); padding: 14px 12px; }
  html.jm .vp-foot { flex-wrap: wrap; }
  html.jm .vp-actions { width: 100%; justify-content: flex-end; }
}
.login-btn {
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  color: #fff;
  background: var(--accent-grad);
  border: none; border-radius: 12px;
  cursor: pointer;
  letter-spacing: 4px;
  transition: filter .2s, transform .15s;
}
.login-btn:hover:not(:disabled) { filter: brightness(1.12); }
.login-btn:active:not(:disabled) { transform: scale(.985); }
.login-btn:disabled { opacity: .65; cursor: not-allowed; }
.login-btn .login-btn-loading { letter-spacing: 1px; }
.login-foot {
  margin-top: 22px;
  font-size: 11.5px; color: var(--text-faint);
  text-align: center;
}
/* 账号注册器下载入口（登录页 / 登录弹窗共用） */
.login-register-entry {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; box-sizing: border-box;
  margin-top: 14px;
  padding: 11px 14px;
  font-size: 13px; font-weight: 700; font-family: inherit;
  line-height: 1.2;
  color: #c9c2ff; text-decoration: none;
  border: 1px solid rgba(124,108,255,.45);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,108,255,.16), rgba(47,212,198,.1));
  transition: color .2s, border-color .2s, box-shadow .25s, transform .15s;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
button.login-register-entry { outline: none; }
.login-register-entry svg { width: 16px; height: 16px; flex: none; }
.login-register-entry .reg-arrow {
  width: 14px; height: 14px; margin-left: 2px;
  transition: transform .2s;
}
.login-register-entry:hover {
  color: #fff;
  border-color: rgba(124,108,255,.85);
  box-shadow: 0 0 16px rgba(124,108,255,.35);
  transform: translateY(-1px);
}
.login-register-entry:hover .reg-arrow { transform: translateX(3px); }
.login-register-entry::after { /* 扫光 */
  content: ""; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-20deg);
  animation: regEntryShine 3.6s ease-in-out infinite;
}
@keyframes regEntryShine { 0%, 65% { left: -80%; } 100% { left: 150%; } }
[data-theme="light"] .login-register-entry { color: #5b4bd6; }
[data-theme="light"] .login-register-entry:hover { color: #fff; }
/* 顶栏登录账号 + 退出 */
.nav-account {
  max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--accent-2) !important;
  font-size: 12px;
}
#navLogout { color: var(--text-dim); }
#navLogout:hover { color: var(--danger); }

/* ===== 大类切换（视频 / 图片）===== */
.genre-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--panel-border, rgba(255,255,255,.08));
  border-radius: 10px;
  margin-bottom: 10px;
}
.genre-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-dim, #9aa0b4);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s;
}
.genre-opt svg { width: 16px; height: 16px; }
.genre-opt:hover { color: var(--text); }
.genre-opt.active {
  color: #fff;
  background: rgba(124,108,255,.3);
  box-shadow: 0 0 12px rgba(124,108,255,.25);
}

/* 图片预览 */
.stage-result #imagePlayer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: none;
}
.stage-result.img-mode #imagePlayer { display: block; }
.stage-result.img-mode #videoPlayer { display: none; }

/* 图片设置区 */
.img-settings { margin-bottom: 4px; }

/* 历史卡片里的图片缩略图 */
.history-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  display: block;
}

/* =====================================================================
   即梦风 · 图片生成模式（html.jm body[data-genre] 切换，不影响其它页面）
   ===================================================================== */

/* 模式按钮：视频/图片双套图标与文字 */
html.jm .jm-ic-image,
html.jm .jm-lbl-image { display: none; }
html.jm body[data-genre="image"] .jm-ic-video,
html.jm body[data-genre="image"] .jm-lbl-video { display: none; }
html.jm body[data-genre="image"] .jm-ic-image { display: block; }
html.jm body[data-genre="image"] .jm-lbl-image { display: inline; }

/* 图片模式：隐藏视频专属控件（模型选择 / 音频上传 / 随机种子 / 视频专属画幅） */
html.jm body[data-genre="image"] .audio-list,
html.jm body[data-genre="image"] #audioAdd,
html.jm body[data-genre="image"] #jmSeedRow,
html.jm body[data-genre="image"] .jm-sum-video { display: none !important; }
html.jm body[data-genre="video"] .jm-sum-image,
html.jm body[data-genre="video"] #imgFmtRow,
html.jm body[data-genre="video"] #imgAutoRatioRow,
html.jm body[data-genre="video"] .chip-opt[data-only="image"] { display: none !important; }

/* 自动匹配画幅开关行 */
html.jm .jm-auto-row {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  cursor: pointer; user-select: none;
}
html.jm .jm-auto-label { font-size: 11.5px; color: var(--text-dim); }

/* 输出像素提示胶囊 */
html.jm .jm-px-hint {
  flex: none;
  font-size: 10.5px; font-weight: 700;
  color: var(--accent-2);
  background: rgba(47, 212, 198, .1);
  border: 1px solid rgba(47, 212, 198, .25);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 高级设置：图片输出格式行 */
html.jm .jm-fmt-row {
  display: flex; align-items: center; gap: 16px;
  margin-top: 12px;
}
html.jm .jm-fmt-radio {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
  cursor: pointer;
}
html.jm .jm-fmt-radio input { accent-color: var(--accent); }

/* 图片结果可点击放大 */
html.jm #imagePlayer { cursor: zoom-in; }

/* 批量进度卡：图片缩略图（与 video 同构铺满） */
html.jm .bp-card.done img.bp-media-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* ============ 后台管理：手机 / 窄屏适配 ============ */
/* 通用响应式在 ≤1080px 隐藏了 .topnav，但后台的「用户管理/卡密管理」切换全靠它，后台页必须恢复 */
@media (max-width: 1080px) {
  body.admin-page .topnav { display: flex; }
}
@media (max-width: 760px) {
  body.admin-page { -webkit-text-size-adjust: 100%; }
  body.admin-page .topbar {
    position: relative;
    height: auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    /* standalone 下避开 iPhone 状态栏（时间/电量） */
    padding:
      calc(10px + env(safe-area-inset-top))
      calc(14px + env(safe-area-inset-right))
      10px
      calc(14px + env(safe-area-inset-left));
  }
  body.admin-page .logo-name { font-size: 14px; }
  body.admin-page .logo-sub { display: none; }
  body.admin-page .topnav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  body.admin-page .topnav::-webkit-scrollbar { display: none; }
  body.admin-page .topnav a {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 15px;
    font-size: 13px;
    white-space: nowrap;
  }
  body.admin-page .topnav a[hidden] { display: none; }
  body.admin-page .admin-main {
    padding:
      14px
      calc(12px + env(safe-area-inset-right))
      calc(28px + env(safe-area-inset-bottom))
      calc(12px + env(safe-area-inset-left));
  }
  body.admin-page .admin-panel { padding: 16px 13px; border-radius: 14px; }
  body.admin-page .admin-head { margin-bottom: 14px; gap: 10px; }
  body.admin-page .admin-refresh { flex: none; padding: 8px 12px; }
  body.admin-page .table-wrap { -webkit-overflow-scrolling: touch; }
  body.admin-page .admin-table { min-width: 600px; font-size: 12.5px; }
  body.admin-page .cell-actions button { min-height: 32px; }
  body.admin-page .gen-form {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
  }
  body.admin-page .gen-field { width: 100%; }
  body.admin-page .gen-field input { width: 100%; }
  body.admin-page .gen-presets button { flex: 1 0 auto; min-height: 36px; }
  body.admin-page .admin-btn { width: 100%; min-height: 42px; }
  body.admin-page .gen-result-head { flex-wrap: wrap; gap: 8px; }
  /* 筛选栏移动端：搜索框独占一行，三个下拉平分一行，计数与清除按钮占一行 */
  body.admin-page .user-filters { padding: 10px; gap: 10px; }
  body.admin-page .uf-search { flex: 1 1 100%; min-width: 0; }
  body.admin-page .uf-selects { width: 100%; }
  body.admin-page .uf-select { flex: 1 1 0; min-width: 0; padding-right: 28px; }
  body.admin-page .uf-meta { width: 100%; margin-left: 0; justify-content: space-between; }
}

/* =====================================================================
   2026-09 新增：后台用户作品库 / 强制下线弹窗 / 修改密码弹窗
   ===================================================================== */

/* ---- 后台：作品库 ---- */
.cell-actions button.primary {
  color: #fff;
  border-color: rgba(124,108,255,.6);
  background: var(--accent-grad);
  font-weight: 700;
}
.cell-actions button.primary:hover { color: #fff; background: var(--accent-grad); filter: brightness(1.1); }
.aw-counts { font-size: 12px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }

.modal.aw-modal {
  width: min(1080px, calc(100vw - 36px));
  max-height: calc(100vh - 60px);
  display: flex; flex-direction: column;
  padding: 22px 24px;
}
.aw-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.aw-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.aw-tab {
  padding: 7px 14px;
  font-size: 12.5px; font-family: inherit; font-weight: 600;
  color: var(--text-dim);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .22s;
}
.aw-tab b { font-weight: 700; color: var(--accent-2); margin-left: 2px; }
.aw-tab:hover { color: var(--text); border-color: rgba(124,108,255,.5); }
.aw-tab.active {
  color: #fff;
  background: rgba(124,108,255,.28);
  border-color: rgba(124,108,255,.6);
  box-shadow: 0 0 14px rgba(124,108,255,.25);
}
.aw-tab.active b { color: #fff; }
.aw-hint { font-size: 12px; color: var(--text-faint); }

.aw-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  padding-right: 4px;
  min-height: 180px;
  align-content: start;
}
.aw-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 48px 0;
}
.aw-card {
  background: #0d0e1c;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s, border-color .22s, box-shadow .22s;
  display: flex; flex-direction: column;
}
.aw-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124,108,255,.55);
  box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 18px rgba(124,108,255,.18);
}
.aw-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05060d;
}
.aw-thumb video, .aw-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.aw-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.aw-play::after {
  content: "";
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(10,12,26,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5-11-6.5Z' fill='%23fff'/%3E%3C/svg%3E") center/18px no-repeat;
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(2px);
  transition: transform .22s;
}
.aw-card:hover .aw-play::after { transform: scale(1.12); }
.aw-type {
  position: absolute; left: 8px; top: 8px;
  padding: 3px 9px;
  font-size: 11px; font-weight: 600;
  color: #fff;
  background: rgba(8,10,22,.66);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.aw-meta { padding: 9px 11px 0; font-size: 11.5px; color: var(--accent-2); font-weight: 600; }
.aw-model {
  display: inline-block;
  margin: 7px 11px 0;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(122, 108, 255, .13);
  border: 1px solid rgba(122, 108, 255, .35);
  border-radius: 999px;
  max-width: calc(100% - 22px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aw-prompt {
  padding: 6px 11px 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  min-height: 33px;
}
.aw-time { padding: 7px 11px 11px; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* 积分余额手动刷新按钮（可用积分右侧） */
.jm-credit-refresh {
  background: none;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  padding: 2px 7px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.jm-credit-refresh:hover { color: var(--accent-2); border-color: var(--accent-2); }
.jm-credit-refresh:disabled { opacity: .5; cursor: default; }
.jm-credit-refresh.spin { animation: jmCreditSpin .8s linear infinite; }
@keyframes jmCreditSpin { to { transform: rotate(360deg); } }

/* ============ 作品库分页控件（PC/移动端 + 后台通用风格） ============ */
.hist-pager, .aw-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 4px;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.hp-btn, .aw-pg-btn {
  padding: 6px 16px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: var(--text);
  background: rgba(124, 108, 255, .12);
  border: 1px solid rgba(124, 108, 255, .35);
  border-radius: 9px;
  cursor: pointer;
  transition: all .18s;
}
.hp-btn:hover:not(:disabled), .aw-pg-btn:hover:not(:disabled) {
  background: rgba(124, 108, 255, .28);
  border-color: rgba(124, 108, 255, .7);
  color: #fff;
}
.hp-btn:active:not(:disabled), .aw-pg-btn:active:not(:disabled) { transform: scale(.95); }
.hp-btn:disabled, .aw-pg-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.hp-info, .aw-pg-info {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: center;
}

/* ============ AI 工作流聊天面板 ============ */
.wf-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
  background: var(--glass-bg, rgba(15, 17, 28, .72));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  overflow: hidden;
}
.wf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.wf-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.wf-title svg { color: var(--accent, #7c6cff); }
.wf-model-badge {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-2, #a3a0ff);
  background: rgba(124, 108, 255, .12);
  border: 1px solid rgba(124, 108, 255, .3);
  border-radius: 999px;
}
.wf-clear {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-dim, #888);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s;
}
.wf-clear:hover { color: #fff; background: rgba(255, 80, 80, .15); border-color: rgba(255, 80, 80, .4); }

.wf-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wf-msg { display: flex; gap: 10px; max-width: 88%; }
.wf-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.wf-avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
}
.wf-msg.assistant .wf-avatar { background: rgba(124, 108, 255, .18); color: var(--accent-2, #a3a0ff); }
.wf-msg.user .wf-avatar { background: rgba(100, 200, 100, .15); color: #6c6; }
.wf-result-img {
  max-width: 280px;
  max-height: 280px;
  width: auto;
  height: auto;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: zoom-in;
  transition: transform .18s;
}
.wf-result-img:hover { transform: scale(1.02); }
.wf-result-video {
  max-width: 320px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 10px;
  margin-bottom: 6px;
  background: #000;
}

/* 长文本折叠（超过 5 行显示展开按钮） */
.wf-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.wf-msg.assistant .wf-content {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
}
.wf-msg.user .wf-content {
  background: rgba(124, 108, 255, .15);
  border: 1px solid rgba(124, 108, 255, .25);
}
.wf-content.collapsed {
  max-height: 120px;
  overflow: hidden;
  position: relative;
}
.wf-content.collapsed::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(20, 22, 35, .9));
  pointer-events: none;
  border-radius: 0 0 12px 12px;
}
.wf-content .wf-expand-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-2, #a3a0ff);
  cursor: pointer;
  user-select: none;
}
.wf-content .wf-expand-btn:hover { text-decoration: underline; }
.wf-img-count { color: var(--accent-2, #a3a0ff); font-size: 12px; }

/* 思考中动画 */
.wf-thinking .wf-content { display: flex; align-items: center; gap: 4px; }
.wf-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim, #666);
  animation: wf-bounce .1.4s infinite ease-in-out;
}
.wf-dot:nth-child(2) { animation-delay: .2s; }
.wf-dot:nth-child(3) { animation-delay: .4s; }
@keyframes wf-bounce {
  0%, 80%, 100% { transform: scale(.6); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}
.wf-poll-text { font-size: 13px; color: var(--text-dim, #888); }

/* 结果图片/视频 */
.wf-result-img { max-width: 100%; border-radius: 10px; margin-bottom: 6px; }
.wf-result-video { max-width: 100%; border-radius: 10px; margin-bottom: 6px; }

/* 已附图片缩略图 */
.wf-attached { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px; }
.wf-thumb {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
}
.wf-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wf-thumb-del {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  font-size: 10px;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
}

/* 输入区 */
.wf-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  flex-shrink: 0;
}
.wf-upload-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--text-dim, #888);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  flex-shrink: 0;
}
.wf-upload-btn:hover { color: var(--accent, #7c6cff); border-color: rgba(124, 108, 255, .4); }
.wf-input {
  flex: 1;
  resize: none;
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  outline: none;
  transition: border-color .18s;
  max-height: 120px;
  line-height: 1.5;
}
.wf-input:focus { border-color: rgba(124, 108, 255, .5); }
.wf-input::placeholder { color: var(--text-faint, #555); }
.wf-send {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7c6cff, #5b4ef0);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  flex-shrink: 0;
}
.wf-send:disabled { opacity: .3; cursor: not-allowed; }
.wf-send:not(:disabled):hover { transform: scale(1.06); box-shadow: 0 2px 12px rgba(124, 108, 255, .35); }

.aw-preview-mask {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(2,3,9,.88);
  backdrop-filter: blur(10px);
  animation: fadeIn .2s;
  padding: 30px;
}
.aw-preview-mask[hidden] { display: none; }
.aw-preview-close {
  position: fixed; top: 22px; right: 26px; z-index: 82;
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 17px;
  color: #fff;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  transition: all .22s;
}
.aw-preview-close:hover { background: rgba(255,92,122,.9); transform: rotate(90deg); }
.aw-preview-body { max-width: min(1100px, 92vw); max-height: 88vh; overflow: auto; text-align: center; }
.aw-preview-body video {
  width: 100%; max-height: 78vh;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
}
.aw-preview-body img {
  max-width: 100%; max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
}
.aw-preview-info {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 13px;
}
.aw-preview-prompt { color: var(--text-faint); font-size: 12px; margin-top: 6px; line-height: 1.7; }

/* ---- 强制下线弹窗 ---- */
.modal.kicked-modal { width: min(400px, calc(100vw - 40px)); text-align: center; padding: 34px 28px 28px; }
.kick-icon {
  width: 66px; height: 66px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,92,122,.22), rgba(255,160,60,.18));
  border: 1px solid rgba(255,92,122,.45);
  box-shadow: 0 0 34px rgba(255,92,122,.28);
  animation: kickPulse 1.8s ease-in-out infinite;
}
.kick-icon svg { width: 32px; height: 32px; color: #ff7a92; }
@keyframes kickPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255,92,122,.25); }
  50% { box-shadow: 0 0 44px rgba(255,92,122,.5); }
}
.kicked-modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 12px; color: #fff; }
.kick-msg { font-size: 13.5px; color: var(--text-dim); line-height: 1.9; margin-bottom: 6px; }
.kick-ip {
  display: inline-block;
  margin: 10px 0 4px;
  padding: 8px 16px;
  font-size: 15px; font-weight: 700;
  letter-spacing: .5px;
  color: #ff9db0;
  background: rgba(255,92,122,.1);
  border: 1px dashed rgba(255,92,122,.45);
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
}
.kicked-modal .modal-save { margin-top: 18px; }

/* ---- 上线公告弹窗 ---- */
.modal.announce-modal { width: min(400px, calc(100vw - 40px)); text-align: center; padding: 34px 28px 28px; }
.announce-icon {
  width: 66px; height: 66px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(94,110,255,.22), rgba(47,212,198,.18));
  animation: announcePulse 2.2s ease-in-out infinite;
}
.announce-icon svg { width: 32px; height: 32px; color: #7c6cff; }
@keyframes announcePulse {
  0%, 100% { box-shadow: 0 0 24px rgba(94,110,255,.25); }
  50% { box-shadow: 0 0 44px rgba(47,212,198,.45); }
}
.announce-modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 12px; color: #fff; }
.announce-msg { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 6px; }
.announce-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 6px; }
.announce-sub b { color: #7c6cff; font-weight: 700; }
.announce-modal .modal-save { margin-top: 18px; }

/* ---- 修改密码 ---- */
.member-change-pwd {
  width: 100%;
  margin: 2px 0 4px;
  padding: 10px;
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .22s;
}
.member-change-pwd:hover {
  color: #fff;
  border-color: rgba(124,108,255,.55);
  background: rgba(124,108,255,.14);
}

/* 会员中心：支付提示注明（卡密兑换下方） */
.member-pay-note {
  margin: 10px 0 2px;
  padding: 10px 12px;
  font-size: 12.5px; line-height: 2;
  color: #b9bdd6;
  background: rgba(255,176,32,.07);
  border: 1px dashed rgba(255,176,32,.35);
  border-radius: 10px;
}
.member-pay-note b { color: #ffcf70; font-weight: 600; }
.member-wechat-link {
  display: inline-block;
  margin-left: 2px;
  padding: 0;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  color: #7dd8ff;
  background: none; border: none;
  border-bottom: 1px dashed rgba(125,216,255,.55);
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.member-wechat-link:hover { color: #b0ecff; border-color: #b0ecff; }

/* 微信二维码弹窗 */
.wechat-qr-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 0 4px;
}
.wechat-qr-wrap img {
  width: 240px; height: 240px;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(124,108,255,.35);
}
.wechat-qr-tip {
  margin: 12px 0 2px;
  text-align: center;
  font-size: 12.5px; color: #b9bdd6;
}
.wechat-qr-tip b { color: #ffcf70; font-weight: 600; }
.pwd-code-row { display: flex; gap: 8px; }
.pwd-code-row input { flex: 1; }
.pwd-send-btn {
  flex: none;
  padding: 0 14px;
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  white-space: nowrap;
  color: #fff;
  background: rgba(124,108,255,.85);
  border: none; border-radius: 9px;
  cursor: pointer;
  transition: filter .2s, opacity .2s;
}
.pwd-send-btn:hover:not(:disabled) { filter: brightness(1.12); }
.pwd-send-btn:disabled { opacity: .5; cursor: not-allowed; }
.pwd-error {
  display: none;
  margin: 2px 0 10px;
  font-size: 12px;
  color: #ff7a92;
  line-height: 1.6;
}
.pwd-error.show { display: block; }
.pwd-email-accent { color: var(--accent-2); font-weight: 700; word-break: break-all; }

/* ============ 注册页（复用登录卡片，验证码后缀按钮 + 行内状态） ============ */
.reg-send {
  flex: none;
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
  color: #c9c2ff;
  background: linear-gradient(135deg, rgba(124,108,255,.18), rgba(47,212,198,.12));
  border: 1px solid rgba(124,108,255,.45);
  border-radius: 9px;
  cursor: pointer;
  transition: all .2s ease;
}
.reg-send:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(124,108,255,.85);
  box-shadow: 0 0 12px rgba(124,108,255,.3);
}

/* 登录弹窗：忘记密码入口（密码框下方右对齐） */
.mfg-entry-row {
  display: flex;
  justify-content: flex-end;
  margin: 2px 2px 12px;
}
.mfg-entry {
  appearance: none;
  border: none;
  background: none;
  padding: 2px 4px;
  font: inherit;
  font-size: 13px;
  color: #8b8fa8;
  cursor: pointer;
  transition: color .15s ease;
}
.mfg-entry:hover {
  color: #a99bff;
  text-shadow: 0 0 12px rgba(124,108,255,.45);
}

/* ============ 后台：画布实时监看（仅管理员） ============ */
#panelCanvasWrap { max-width: 1560px; }
.cm-head-status { font-size: 12px; color: var(--text-dim); margin-right: 10px; }
.cm-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - 230px);
  min-height: 480px;
  margin-top: 14px;
}
.cm-users {
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding-right: 4px;
}
.cm-empty {
  padding: 30px 14px; text-align: center;
  font-size: 12.5px; color: var(--text-faint);
}
.cm-user {
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  transition: all .18s;
}
.cm-user:hover { border-color: rgba(124,108,255,.55); background: rgba(124,108,255,.08); }
.cm-user.active {
  border-color: rgba(124,108,255,.9);
  background: rgba(124,108,255,.16);
  box-shadow: 0 0 0 1px rgba(124,108,255,.5), 0 6px 20px rgba(124,108,255,.18);
}
.cm-user-line1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cm-dot { flex: none; font-size: 11px; line-height: 1; }
.cm-account {
  font-size: 13px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cm-user-line2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 5px; padding-left: 20px;
  font-size: 11px; color: var(--text-dim);
}
.cm-badge {
  padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
}
.cm-badge.busy { background: rgba(255,196,77,.18); color: #ffc44d; }
.cm-badge.err { background: rgba(255,122,146,.18); color: #ff7a92; }

.cm-view {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  overflow: hidden;
}
.cm-view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,.03);
}
.cm-view-title { font-size: 13.5px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-view-time { flex: none; font-size: 11.5px; color: var(--text-dim); }
.cm-stage {
  position: relative; flex: 1; overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(124,108,255,.07), transparent 60%),
    #0e0e17;
}
.cm-stage-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13px;
}
.cm-world {
  position: absolute; left: 50%; top: 50%;
  transform-origin: center center;
}
.cm-edges { position: absolute; left: 0; top: 0; pointer-events: none; }
.cm-node {
  position: absolute;
  display: flex; flex-direction: column;
  border-radius: 12px;
  background: rgba(30,28,48,.96);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  overflow: hidden;
}
.cm-node-head {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 10px;
  font-size: 11.5px; font-weight: 700; color: #e9e7ff;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cm-node-head > span:first-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cm-t-image { border-color: rgba(74,158,255,.45); }
.cm-t-video, .cm-t-dvideo { border-color: rgba(255,110,199,.45); }
.cm-t-text { border-color: rgba(245,166,35,.45); }
.cm-t-audio { border-color: rgba(244,114,182,.45); }
.cm-s-error { border-color: rgba(255,90,110,.8) !important; box-shadow: 0 0 0 1px rgba(255,90,110,.4); }
.cm-s-loading { border-color: rgba(255,196,77,.65); }
.cm-node-st { flex: none; font-size: 10px; padding: 1px 7px; border-radius: 999px; }
.cm-node-st.loading { background: rgba(255,196,77,.2); color: #ffc44d; animation: cmPulse 1.2s ease-in-out infinite; }
.cm-node-st.queued { background: rgba(138,180,255,.2); color: #8ab4ff; }
.cm-node-st.error { background: rgba(255,90,110,.22); color: #ff8aa0; }
@keyframes cmPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.cm-media {
  display: block; width: 100%;
  max-height: 360px; object-fit: contain;
  background: #000; cursor: zoom-in;
}
.cm-audio-box {
  margin: 8px 10px 2px; padding: 8px 10px;
  font-size: 11.5px; color: #ffc2e2; word-break: break-all;
  background: rgba(244,114,182,.1);
  border: 1px solid rgba(244,114,182,.28);
  border-radius: 9px;
}
.cm-audio-box audio { display: block; width: 100%; margin-top: 6px; min-width: 0; }
.cm-prompt {
  padding: 8px 10px;
  font-size: 11.5px; line-height: 1.65; color: rgba(255,255,255,.88);
  white-space: pre-wrap; word-break: break-word;
  overflow: hidden;
}
.cm-meta { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 10px 8px; }
.cm-meta-i {
  font-size: 10px; color: var(--text-dim);
  padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.cm-err {
  margin: 0 10px 8px; padding: 6px 8px;
  font-size: 11px; line-height: 1.5; color: #ff9db0;
  background: rgba(255,90,110,.1);
  border-radius: 8px;
  word-break: break-word;
}
@media (max-width: 900px) {
  .cm-layout { grid-template-columns: 1fr; height: auto; }
  .cm-users { max-height: 220px; }
  .cm-view { height: 62vh; }
}
.reg-send:disabled { opacity: .55; cursor: not-allowed; }
.login-field input:disabled { opacity: .55; cursor: not-allowed; }
/* 登录弹窗内含注册视图（字段更多），小屏时允许弹窗内部滚动 */
.login-modal { max-height: 92vh; overflow-y: auto; }
.reg-status.is-info { color: var(--text-dim); }
.reg-status.is-info b { color: var(--accent-2, #2fd4c6); font-weight: 700; }

/* 注册视图：标题下方红色等待提示 */
.reg-warm-tip {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,92,122,.4);
  background: rgba(255,92,122,.1);
  color: #ff6b86;
  font-size: 12.5px; line-height: 1.55;
}

/* ================= 会员中心：视频完成邮件通知开关 ================= */
.member-mail-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 12px 0 10px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(124, 108, 255, .08);
  border: 1px solid rgba(124, 108, 255, .28);
  font-size: 13px;
  color: var(--text-dim, #a9a9c2);
  cursor: pointer;
  user-select: none;
  transition: border-color .2s, color .2s, background .2s;
}
.member-mail-opt:hover {
  border-color: rgba(124, 108, 255, .65);
  color: var(--text, #fff);
  background: rgba(124, 108, 255, .14);
}
.member-mail-opt input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin: 0;
  flex: none;
  border: 1.5px solid #7a7a96;
  border-radius: 5px;
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.member-mail-opt input[type="checkbox"]:checked {
  background: #7c6cff;
  border-color: #7c6cff;
}
.member-mail-opt input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.member-mail-opt small {
  color: var(--text-faint, #8a8aa3);
  font-size: 11px;
  margin-left: 4px;
}

/* ================= 下载进度圆球（悬浮在页面底部中间，不全屏、不遮挡操作） ================= */
.cn-dl-sphere-mask {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 100001; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: cnDlPop .24s ease;
}
.cn-dl-sphere {
  position: relative; width: 110px; height: 110px; border-radius: 50%;
  background: conic-gradient(from -90deg, #7dd3fc 0deg, #a78bfa 0deg, rgba(255,255,255,.06) 0deg);
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.55)) drop-shadow(0 0 18px rgba(125,211,252,.35));
  transition: background .15s linear;
}
.cn-dl-sphere::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 35%),
              radial-gradient(circle at 50% 80%, rgba(125,211,252,.28) 0%, rgba(125,211,252,0) 55%),
              radial-gradient(circle at 75% 55%, rgba(167,139,250,.22) 0%, rgba(167,139,250,0) 50%),
              linear-gradient(135deg, #0f1328, #07091a);
}
.cn-dl-sphere::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid rgba(125,211,252,.25);
  animation: cnDlSpin 6s linear infinite;
  pointer-events: none;
}
.cn-dl-sphere .cn-dl-inner { position: relative; z-index: 2; text-align: center; }
.cn-dl-sphere .cn-dl-pct {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, #e0f2fe 0%, #c4b5fd 60%, #fde68a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: -1px;
}
.cn-dl-sphere .cn-dl-label {
  margin-top: 4px; font-size: 8px; color: #7dd3fc; letter-spacing: 1.4px; text-transform: uppercase; opacity: .85;
}
.cn-dl-sub {
  max-width: 240px; text-align: center; font-size: 10px; line-height: 1.45; color: #9aa7c2;
  word-break: break-all; text-shadow: 0 1px 4px rgba(0,0,0,.9);
}
.cn-dl-sub .cn-dl-bytes { color: #7dd3fc; }
@keyframes cnDlSpin { to { transform: rotate(360deg); } }
@keyframes cnDlPop {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
