/* index.css —— 由 index.html 的内联 <style> 拆分而来（原第 8~2319 行）
 * 全文无外部 url() 资源引用（仅 data: URI 与 SVG 片段 url(#id)），置于 css/ 子目录不影响解析基准 */
  :root {
    /* 背景：深蓝紫渐变体系 */
    --bg: #0a0c1c;
    --bg-deep: #0a0618;
    --bg-glow-1: rgba(124, 90, 248, 0.20);
    --bg-glow-2: rgba(79, 108, 255, 0.16);
    --bg-glow-3: rgba(180, 120, 250, 0.12);

    /* 表面 / 卡片 */
    --surface: rgba(28, 26, 52, 0.94); /* 去毛玻璃化:提不透明度补偿原0.62(背景纯色,blur无视觉价值且吃渲染) */
    --surface-2: rgba(36, 33, 66, 0.66);
    --surface-deep: rgba(16, 15, 34, 0.55);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(150, 130, 255, 0.32);

    /* 文字 */
    --text: #eef0fb;
    --text-strong: #ffffff;
    --muted: #c7cce6;
    --muted-2: #a6abc9;

    /* 主色：亮紫 + 蓝紫渐变 */
    --accent: #8b5cf6;
    --accent-2: #4f7cff;
    --accent-3: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.45);
    --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #6d5df6 45%, #4f7cff 100%);
    --grad-btn: linear-gradient(135deg, #9a6cf9 0%, #7c5cf6 40%, #5674ff 100%);

    /* 语义色 */
    --green: #4ade80;
    --red: #fb7185;
    --amber: #fbbf24;
    --yellow: #fde68a;

    --radius: 20px;
    --radius-sm: 12px;
    --radius-pill: 999px;
    --shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.65);
    --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 12px 34px -12px rgba(139, 92, 246, 0.55);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  /* 滚动条美化（2026-10-16）：浏览器默认滚动条在深色页面上是一道刺眼的"白光"，
     真机预览（iframe）里尤其明显 —— 全站统一成细线半透明款，低调不抢视线 */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 99px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
  ::-webkit-scrollbar-corner { background: transparent; }
  /* Firefox 属性（对弹层等嵌套滚动容器同样生效；.qs-chips 的 scrollbar-width:none 优先级更高，不受影响） */
  * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }

  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  /* 深蓝紫渐变背景 + 星点光晕 */
  body::before {
    content: "";
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -2;
    background:
      radial-gradient(1100px 800px at 12% -10%, var(--bg-glow-1), transparent 60%),
      radial-gradient(900px 700px at 95% 5%, var(--bg-glow-2), transparent 55%),
      radial-gradient(1000px 800px at 50% 115%, var(--bg-glow-3), transparent 60%),
      linear-gradient(160deg, #101334 0%, #0d1029 45%, #0a0a1e 100%);
  }
  body::after {
    content: "";
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    background-image:
      radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.45), transparent),
      radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.35), transparent),
      radial-gradient(1.5px 1.5px at 88% 60%, rgba(200,160,255,.3), transparent),
      radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.25), transparent);
    background-repeat: repeat;
    background-size: 260px 260px;
    opacity: .4;
    pointer-events: none;
  }

  .wrap { max-width: 1180px; margin: 0 auto; padding: 40px 28px 150px; }

  /* ---------- 头部 ---------- */
  header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
  }
  .brand { display: flex; flex-direction: column; gap: 4px; }
  .brand .brand-row { display: flex; align-items: center; gap: 12px; }
  .model-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    font-size: 12.5px;
    color: var(--muted-2);
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
  }
  .brand h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .h1-sub { display: none; }   /* 手机端顶栏双行 lockup 的副题，桌面不显示 */
  /* 品牌 Logo：Lottie 动画容器（替换原 conic-gradient 圆形图标） */
  .brand .logo {
    width: 68px; height: 68px; flex-shrink: 0;
    position: relative;
    display: block;
    line-height: 0;
  }
  .brand .logo svg {
    width: 100% !important;
    height: 100% !important;
  }

  /* ---------- 玻璃拟态卡片 ---------- */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
  }

  .cfg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
  }

  /* ============================================================
   * 首页：场景货架（2026-09-21 改版）
   * 定位从「选工具」变成「选场景」——首屏直接给带封面的场景卡，
   * 自由创作降级成场景下面的一条虚线入口。
   * 路由：#/ 首页 · #/scenes 场景库 · #/free 自由创作
   * 场景数据来自 GET /api/scenes，分类与「一键生成/去制作」的判定都由服务端算好；
   * 首页只取管理员设了 is_home=1 的那些（上不上首页由后台分配，不由场景类型决定）。
   * ============================================================ */
  .hero { padding: 18px 4px 22px; }
  .hero-t { font-size: 25px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 8px; }
  .hero-d { font-size: 13.5px; color: var(--muted-2); margin-bottom: 0; }

  .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
  .sec-t { font-size: 14.5px; font-weight: 700; color: var(--text-strong); letter-spacing: .2px; }
  .sec-more { background: none; border: none; padding: 2px 0; font-family: inherit; font-size: 12.5px; color: var(--accent-3); cursor: pointer; transition: color .18s; }
  .sec-more:hover { color: #c4b5fd; }

  /* 场景卡：封面 + 名称 + 一句说明 + 操作按钮 */
  .scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 16px; }
  .scene-card {
    display: flex; flex-direction: column; overflow: hidden; text-align: left;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--surface); cursor: pointer; font-family: inherit; color: inherit;
    box-shadow: var(--shadow-soft); transition: transform .22s, border-color .22s, box-shadow .22s;
  }
  .scene-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 24px 48px -24px rgba(139,92,246,.9); }
  /* 2026-10-20：改成**固定像素高度**。之前用 aspect-ratio / 百分比 padding 撑高，
     在安卓套壳 App 的 WebView 上都被算成 0（封面区整块消失），而百分比 padding 那版
     在桌面浏览器上又因为和 JS 内联垫子叠加导致异常。固定高度是所有内核都 100% 成立的写法，
     代价只是比例不再随卡片宽度变化 —— 图片统一 object-fit:cover 裁切，观感不受影响。 */
  .sc-cover { display: block; position: relative; height: 150px; overflow: hidden; background: #12142e; flex: none; }
  .sc-cover img { display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
  /* 还没有成图时用渐变占位（比灰块好看）：色相由场景 id 决定，同一场景每次都是同一个颜色 */
  .sc-ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; }
  .sc-ph span { font-size: 15px; font-weight: 700; color: rgba(255,255,255,.94); letter-spacing: 3px; text-shadow: 0 3px 14px rgba(0,0,0,.4); }
  .sc-cover::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: linear-gradient(to top, rgba(8,8,22,.42), transparent 38%); }
  .sc-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .sc-name { font-size: 15px; font-weight: 700; color: var(--text-strong); letter-spacing: .2px; }
  .sc-meta { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; flex: 1; }
  .sc-warn { font-size: 11px; color: var(--amber); }
  .sc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600;
  }
  /* 零输入场景 = 一键生成（实心，全页最重的按钮）；要填内容的是「去制作」（描边） */
  .sc-btn.one { background: var(--grad-btn); color: #fff; box-shadow: 0 10px 22px -12px rgba(124,90,248,.9), inset 0 1px 0 rgba(255,255,255,.2); }
  .sc-btn.fill { background: rgba(139,92,246,.12); color: var(--accent-3); border: 1px solid rgba(139,92,246,.34); }
  .scene-card:hover .sc-btn.fill { background: rgba(139,92,246,.2); }

  /* 自由创作：降级入口（虚线，视觉权重低于场景卡） */
  .free-entry {
    margin-top: 20px; width: 100%; text-align: left;
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; border-radius: var(--radius);
    border: 1px dashed rgba(150,130,255,.34);
    background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(79,124,255,.07));
    cursor: pointer; transition: all .22s; font-family: inherit; color: inherit;
  }
  .free-entry:hover { border-color: rgba(150,130,255,.62); background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(79,124,255,.12)); }
  .fe-ico {
    width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
    background: var(--grad-btn); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px -12px rgba(139,92,246,.95);
  }
  .fe-txt { flex: 1; min-width: 0; }
  .fe-txt b { display: block; font-size: 14.5px; font-weight: 700; color: var(--text-strong); margin-bottom: 2px; }
  .fe-txt span { display: block; font-size: 12.5px; color: var(--muted-2); }
  .fe-go { font-size: 12.5px; color: var(--accent-3); flex-shrink: 0; }

  /* 场景库：分类 tab + 二级 chips */
  .catbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .cat-tab {
    padding: 9px 18px; border-radius: var(--radius-pill); font-family: inherit;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .2s;
  }
  .cat-tab:hover { color: var(--text); border-color: var(--border-strong); }
  .cat-tab.on { background: var(--grad-btn); border-color: transparent; color: #fff; box-shadow: 0 12px 26px -14px rgba(124,90,248,.9); }
  .chipbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
  .chip {
    padding: 6px 14px; border-radius: var(--radius-pill); font-family: inherit;
    border: 1px solid var(--border); background: rgba(255,255,255,.05);
    color: var(--muted-2); font-size: 12.5px; cursor: pointer; transition: all .18s;
  }
  .chip:hover { color: var(--text); }
  .chip.on { background: rgba(139,92,246,.2); border-color: rgba(150,130,255,.55); color: #d9d0ff; }
  .empty-hint { padding: 34px 0; text-align: center; font-size: 13px; color: var(--muted-2); line-height: 1.8; }

  .works {
    margin-top: 18px; width: 100%; text-align: left;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 18px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: rgba(255,255,255,.03);
    cursor: pointer; transition: all .2s; font-family: inherit; color: inherit;
  }
  .works:hover { border-color: var(--border-strong); background: rgba(139,92,246,.1); }
  .works .w-l { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text); }
  .works .w-ico {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    background: rgba(139,92,246,.18); color: var(--accent-3);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .works .w-r { font-size: 12.5px; color: var(--muted-2); }

  /* 板块顶部返回栏：原生返回键的兜底，任何情况下用户都得有路回入口页 */
  .backbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .back-btn {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 8px 15px 8px 12px; border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong); background: rgba(255,255,255,.05);
    color: var(--text); font-size: 13.5px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all .2s;
  }
  .back-btn:hover { border-color: var(--accent); background: rgba(139,92,246,.16); }
  .crumb { font-size: 13px; color: var(--muted-2); }
  .crumb b { color: var(--text); font-weight: 600; }

  /* 生成按钮容器：桌面正常流内（按钮靠左）；手机由下方断点改成固定吸底 */
  .sticky-actions { margin-top: 22px; }
  .sticky-actions .actions { margin-top: 0; }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field.full { grid-column: 1 / -1; }
  .field label { font-size: 13px; color: var(--muted-2); display:flex; align-items:center; gap:6px; font-weight: 500; }
  .field label .req { color: var(--red); }

  input[type="text"], input[type="password"], textarea, select {
    background: var(--surface-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
  }
  textarea { resize: none; min-height: 216px; line-height: 1.55; }
  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  }
  select { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a6abc9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
  select option { background: #14162e; color: var(--text); }

  .row { display: flex; align-items: center; gap: 10px; }
  .input-group { display: flex; gap: 8px; flex: 1; }
  .input-group input { flex: 1; }
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    user-select: none;
  }
  .btn:hover { border-color: var(--border-strong); background: rgba(58,54,96,.7); }
  .btn:active { transform: translateY(1px); }
  .btn.primary {
    background: var(--grad-btn);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-glow);
    letter-spacing: .2px;
  }
  .btn.primary:hover { filter: brightness(1.08); }
  .btn.primary:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
  .btn.sm { padding: 8px 12px; font-size: 13px; }
  .btn.ghost { background: transparent; }

  /* ---------- 鉴权 ---------- */
  .auth-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--accent-3);
    background: rgba(139,92,246,.12);
    border: 1px solid rgba(139,92,246,.24);
    padding: 3px 10px; border-radius: var(--radius-pill);
    margin-top: 8px;
  }

  /* ---------- 参考图上传（紧凑横向） ---------- */
  .ref-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }
  .upload-zone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    width: 74px; height: 74px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    color: var(--muted-2);
    font-size: 11px;
    cursor: pointer;
    transition: all .2s;
    background: var(--surface-deep);
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
  }
  .upload-zone:hover { border-color: var(--accent); color: var(--text); background: rgba(139,92,246,.08); }
  .upload-zone .u-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(139,92,246,.18);
    color: var(--accent-3);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; line-height: 1;
    margin: 0;
  }
  .thumbs { display: contents; }
  .thumb {
    position: relative;
    width: 74px; height: 74px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 6px 16px -8px rgba(0,0,0,.7);
    flex-shrink: 0;
  }
  .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .thumb .idx {
    position: absolute; left: 4px; bottom: 4px;
    background: rgba(139,92,246,.9);
    color: #fff; font-size: 10px; font-weight: 600;
    padding: 1px 5px; border-radius: 5px;
    font-family: "SF Mono", Menlo, monospace;
    letter-spacing: .2px;
  }
  .thumb .rm {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px;
    background: rgba(0,0,0,.72);
    color: #fff; border: none; border-radius: 50%;
    font-size: 11px; line-height: 1; cursor: pointer;
    display: none; align-items: center; justify-content: center;
  }
  .thumb:hover .rm { display: flex; }
  .thumb { cursor: zoom-in; }
  .thumb:hover { border-color: var(--accent); box-shadow: 0 6px 18px -6px rgba(139,92,246,.5); }
  .ref-hint { font-size: 11.5px; color: var(--muted-2); margin-top: 8px; }
  /* 限额提示单独一行（紧贴上一行），超限时转红 */
  #refQuota { margin-top: 3px; }
  #refQuota b { color: var(--muted); font-weight: 600; }
  #refQuota.over, #refQuota.over b { color: #fb7185; }
  .hint { font-size: 12px; color: var(--muted-2); margin-top: 8px; }

  /* 预计算力消耗提示 */
  .cost-hint {
    font-size: 12px; color: var(--muted-2); margin-top: 2px;
    display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  }
  .cost-hint b { color: var(--accent-3); font-weight: 600; }

  /* 参考图放大预览 */
  .img-lightbox {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999;
    background: rgba(5,6,16,.9);
    display: none; align-items: center; justify-content: center;
    padding: 24px;
  }
  .img-lightbox.show { display: flex; }
  .img-lightbox img {
    max-width: 92vw; max-height: 82vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* 显式允许长按：微信「保存图片」走系统原生 touch-callout，
       被任何一条规则禁掉都会表现为「长按没反应」，而这是微信里唯一的保存路径 */
    -webkit-touch-callout: default;
    -webkit-user-select: auto; user-select: auto;
  }
  .img-lightbox .lb-close {
    position: absolute; top: 20px; right: 24px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  .img-lightbox .lb-close:hover { background: rgba(255,255,255,.22); }
  .img-lightbox .lb-cap {
    position: absolute; top: 22px; left: 24px;
    max-width: calc(100% - 110px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--muted-2); font-size: 12.5px;
  }
  /* 放大弹窗底部操作条：提示词 + 继续生成 / 删除 */
  .img-lightbox .lb-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 26px 18px calc(14px + env(safe-area-inset-bottom));
    display: none; align-items: center; gap: 12px;
    /* 允许换行：微信的「长按保存」提示要独占一行，不换行会把它挤成一条 */
    flex-wrap: wrap;
    background: linear-gradient(to top, rgba(5,6,16,.94) 55%, transparent);
  }
  /* 微信长按保存提示：flex-basis 100% 独占一行，只在 .wx 下显示 */
  .img-lightbox .lb-tip {
    display: none;
    flex-basis: 100%;
    font-size: 12.5px; line-height: 1.6;
    color: var(--yellow); text-align: left;
  }
  .img-lightbox .lb-tip b { color: var(--text-strong); font-weight: 600; }
  .img-lightbox.wx .lb-tip { display: block; }
  .img-lightbox .lb-prompt {
    flex: 1; min-width: 0;
    font-size: 12px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: left;
  }
  .img-lightbox .lb-btns { display: flex; gap: 8px; flex-shrink: 0; }
  .lb-remix {
    display: none; align-items: center; gap: 6px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: 1px solid transparent;
    font-weight: 600;
    padding: 8px 14px; border-radius: 10px;
    font-size: 12.5px; cursor: pointer;
    font-family: inherit;
    transition: filter .15s;
    white-space: nowrap;
  }
  .lb-remix:hover { filter: brightness(1.14); }
  .lb-dl {
    display: none; align-items: center; gap: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, .08);
    border: 1px solid var(--border);
    padding: 8px 14px; border-radius: 10px;
    font-size: 12.5px; cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
  }
  .lb-dl:hover { border-color: var(--accent); color: var(--accent-3); }
  .lb-del {
    display: none; align-items: center; gap: 6px;
    color: #fb7185;
    background: rgba(244, 63, 94, .13);
    border: 1px solid rgba(244, 63, 94, .42);
    padding: 8px 14px; border-radius: 10px;
    font-size: 12.5px; cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
  }
  .lb-del:hover { background: rgba(244, 63, 94, .25); color: #f43f5e; }

  /* ---------- 动作区 ---------- */
  .actions {
    display: flex; gap: 12px; align-items: center;
    margin-top: 22px; flex-wrap: wrap;
  }
  .foot-row {
    display: flex; align-items: center; gap: 12px;
    margin-left: auto;
  }
  .status-dot {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--muted-2);
    margin-left: auto;
  }
  .status-dot .d { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
  .status-dot.busy .d { background: var(--amber); animation: pulse 1.2s infinite; box-shadow: 0 0 8px rgba(251,191,36,.6); }
  .status-dot.ok .d { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,.6); }
  .status-dot.err .d { background: var(--red); box-shadow: 0 0 8px rgba(251,113,133,.6); }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

  /* 告警气泡 */
  .banner {
    display: none;
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.6;
    border: 1px solid;
  }
  .banner.show { display: block; }
  .banner.error { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.32); color: #fda4af; }
  .banner.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); color: #fcd34d; }
  .banner.success { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.34); color: #86efac; }
  .banner b { font-weight: 600; }

  /* ---------- 轻提示 toast：瞬时事件（保存/复制/完成），堆叠不阻塞 ---------- */
  .toast-wrap {
    position: fixed; right: 20px; bottom: 24px; z-index: 1300;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
    max-width: min(370px, calc(100vw - 32px));
  }
  .toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 12px 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: rgba(24, 22, 48, .97);
    color: var(--text);
    font-size: 13px; line-height: 1.55;
    box-shadow: 0 14px 36px -12px rgba(0, 0, 0, .8);
    animation: toastIn .24s cubic-bezier(.2, .8, .2, 1);
  }
  .toast.out { animation: toastOut .18s ease-in forwards; }
  /* 图标改成统一线性 SVG（原先用字符 ✓ ✕ ! i，粗细与基线都不齐） */
  .toast .t-ico { flex: 0 0 auto; margin-top: 1px; display: flex; }
  .toast .t-msg { flex: 1; min-width: 0; word-break: break-word; }
  .toast .t-msg b { font-weight: 600; color: var(--text-strong); }
  /* 同内容 1.5s 内重复：不重复弹，改为角标计数（防连点刷屏） */
  .toast .t-badge {
    flex: 0 0 auto; font-size: 11px; font-weight: 700; font-family: monospace;
    padding: 1px 6px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); color: var(--muted);
  }
  .toast .t-x {
    flex: 0 0 auto; margin: -2px -2px 0 0;
    width: 22px; height: 22px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--muted-2);
    cursor: pointer; padding: 0;
  }
  .toast .t-x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
  .toast.success { border-color: rgba(52, 211, 153, .38); }
  .toast.success .t-ico { color: var(--green); }
  .toast.error { border-color: rgba(244, 63, 94, .42); }
  .toast.error .t-ico { color: var(--red); }
  .toast.warn { border-color: rgba(251, 191, 36, .4); }
  .toast.warn .t-ico { color: var(--amber); }
  .toast.info .t-ico { color: var(--accent-3); }
  @keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

  /* ---------- 按钮等待态：转圈（尺寸与文案同高，不撑高按钮） ---------- */
  .spin {
    width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
    border: 2px solid currentColor; border-top-color: transparent;
    animation: spin .7s linear infinite; display: inline-block;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---------- 批量进度（多张参考图逐个读盘时用，单张不显示避免闪跳） ---------- */
  .pg-wrap { margin-top: 10px; }
  .pg-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
  .pg-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
  .pg-num { font-size: 12px; color: var(--muted-2); font-family: monospace; }
  .pg { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
  .pg > i {
    display: block; height: 100%; border-radius: 999px;
    background: var(--grad-primary);
    transition: width .28s cubic-bezier(.4, 0, .2, 1);
  }
  .pg-note { margin-top: 6px; font-size: 12px; color: var(--muted-2); }

  /* ---------- 确认弹窗（自绘，替代原生 confirm） ---------- */
  /* 与管理端 .dlg-* 同名同结构，只有色值走深色变量 */
  .dlg-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1250;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(6, 8, 20, .62);
    opacity: 0; transition: opacity .18s;
  }
  .dlg-mask.show { opacity: 1; }
  .dlg-box {
    width: 100%; max-width: 340px;
    background: rgba(28, 26, 52, .98);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 22px 20px 18px; text-align: center;
    box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .8);
    transform: translateY(10px) scale(.97);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
  }
  .dlg-mask.show .dlg-box { transform: none; }
  .dlg-ico {
    width: 44px; height: 44px; margin: 0 auto 13px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(167, 139, 250, .14); color: var(--accent-3);
  }
  .dlg-box.danger .dlg-ico { background: rgba(244, 63, 94, .14); color: var(--red); }
  .dlg-title { font-size: 15.5px; font-weight: 700; color: var(--text-strong); line-height: 1.4; }
  .dlg-desc { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.7; white-space: pre-line; }
  .dlg-acts { display: flex; gap: 10px; margin-top: 20px; }
  .dlg-b {
    flex: 1; padding: 10px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    transition: border-color .15s, filter .15s;
  }
  .dlg-b:hover { border-color: var(--border-strong); }
  .dlg-ok { background: var(--grad-btn); border-color: transparent; color: #fff; }
  .dlg-ok:hover { filter: brightness(1.08); }
  .dlg-box.danger .dlg-ok { background: #e11d48; border-color: transparent; }
  .dlg-box.danger .dlg-ok:hover { background: #f43f5e; }

  /* ---------- 提示词敏感词警告条（贴输入框，含定位） ---------- */
  .prompt-warn {
    display: none;
    margin-top: 10px; padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(244, 63, 94, .38);
    background: rgba(244, 63, 94, .1);
    color: #fda4af; font-size: 12.5px; line-height: 1.6;
    align-items: flex-start; gap: 10px;
  }
  .prompt-warn.show { display: flex; }
  .prompt-warn .pw-body { flex: 1; min-width: 0; }
  .prompt-warn .pw-hit {
    display: inline-block; padding: 1px 6px; margin: 0 2px;
    border-radius: 5px; background: rgba(244, 63, 94, .24);
    color: #ffe4e6; font-weight: 600;
    font-family: "SF Mono", Menlo, monospace;
  }
  .prompt-warn .pw-ctx { color: var(--muted-2); font-family: "SF Mono", Menlo, monospace; }
  .prompt-warn .pw-acts { flex: 0 0 auto; display: flex; gap: 6px; }

  /* ---------- 提交后撤销条（防"清空后想再改一版"） ---------- */
  .undo-bar {
    display: none;
    margin-top: 10px; padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    background: var(--surface-deep);
    color: var(--muted-2); font-size: 12.5px;
    align-items: center; gap: 10px;
  }
  .undo-bar.show { display: flex; }
  .undo-bar .ub-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .undo-bar .ub-txt b { color: var(--muted); font-weight: 500; }
  .undo-bar .ub-act {
    flex: 0 0 auto; background: none; border: none; cursor: pointer;
    color: var(--accent-3); font-size: 12.5px; padding: 2px 4px;
  }
  .undo-bar .ub-act:hover { text-decoration: underline; }

  /* ---------- 诊断信息面板 ---------- */
  .diag-sec { margin-bottom: 18px; }
  .diag-sec h4 {
    font-size: 12px; font-weight: 600; color: var(--muted-2);
    letter-spacing: .5px; margin-bottom: 8px;
  }
  .diag-kv {
    display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
    font-size: 12.5px; color: var(--muted);
  }
  .diag-kv dt { color: var(--muted-2); white-space: nowrap; }
  .diag-kv dd { font-family: "SF Mono", Menlo, monospace; word-break: break-all; color: var(--text); }
  .diag-pre {
    margin: 0; padding: 12px;
    max-height: 260px; overflow: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(10, 9, 24, .72);
    font-family: "SF Mono", Menlo, monospace;
    font-size: 11.5px; line-height: 1.7; color: var(--muted);
    white-space: pre-wrap; word-break: break-all;
  }
  .diag-pre .dl-err { color: var(--red); }
  .diag-pre .dl-warn { color: var(--amber); }
  .diag-pre .dl-ok { color: var(--green); }
  .diag-pre .dl-sys { color: var(--accent-3); }
  .diag-pre .dl-t { color: var(--muted-2); }

  /* ---------- 任务区标题（生成任务 + 进行中徽标） ---------- */
  .section-title {
    font-size: 15px; color: var(--muted-2);
    margin: 34px 0 4px;
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 500;
  }
  /* 标题左侧：科幻全息图标 + 文案 */
  .section-title .st-left {
    display: flex; align-items: center; gap: 8px;
    color: var(--text); font-weight: 600; letter-spacing: .3px;
  }
  .section-title .st-ico {
    width: 22px; height: 22px; flex: 0 0 auto;
    filter: drop-shadow(0 0 6px rgba(139,92,246,.6));
  }

  /* ---------- 任务区（仅进行中 / 失败任务卡，成功作品自动进底部图库） ---------- */
  .tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 14px;
  }

  .result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform .25s, box-shadow .25s, border-color .25s;
    position: relative;
  }
  .result-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
  }
  /* 失败卡片操作条：重新提交 */
  .result-card .err-acts {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .result-card .err-acts button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: 1px solid rgba(139, 92, 246, .6);
    border-radius: 9px;
    padding: 8px 14px;
    cursor: pointer;
    transition: filter .15s, opacity .15s;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
  }
  .result-card .err-acts button:hover { filter: brightness(1.14); }
  .result-card .err-acts button:disabled { opacity: .55; cursor: default; filter: none; }

  /* ============================================================
   * 底部固定 · 图片资产入口（成功作品全部收进这里）
   * ============================================================ */
  .asset-fab {
    position: fixed;
    left: 50%;
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    transform: translateX(-50%);
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #9a6cf9 0%, #7c5cf6 45%, #5674ff 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 20px 12px 15px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 14px 34px -10px rgba(124, 90, 248, .8), inset 0 1px 0 rgba(255, 255, 255, .22);
    transition: transform .18s, box-shadow .18s, opacity .2s;
    user-select: none;
  }
  .asset-fab:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 18px 40px -10px rgba(124, 90, 248, .9); }
  .asset-fab:active { transform: translateX(-50%) translateY(0); }
  .asset-fab .af-ico { display: inline-flex; align-items: center; color: rgba(255,255,255,.92); }
  .asset-fab .af-cnt {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(10, 8, 30, .38);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-family: "SF Mono", Menlo, monospace;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
  }

  /* ---------- 图片资产弹层（底部升起面板） ---------- */
  .asset-mask, .tile-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(5, 6, 16, .74);
    opacity: 0; visibility: hidden;
    transition: opacity .25s;
  }
  .asset-mask { z-index: 940; }
  .tile-mask { z-index: 960; }
  .asset-mask.show, .tile-mask.show { opacity: 1; visibility: visible; }
  .asset-panel {
    position: fixed;
    z-index: 950;
    left: 50%; bottom: 0;
    width: min(940px, calc(100% - 16px));
    height: min(80vh, 820px);
    max-height: 92vh;
    background: rgba(22, 20, 44, .97);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    transform: translateX(-50%) translateY(105%);
    transition: transform .32s cubic-bezier(.2, .8, .2, 1);
    display: flex; flex-direction: column;
    box-shadow: 0 -24px 60px -18px rgba(0, 0, 0, .75);
    overflow: hidden;
  }
  .asset-panel.show { transform: translateX(-50%) translateY(0); }
  .ap-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px 13px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .ap-title {
    flex: 1;
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 600;
    color: var(--text-strong); letter-spacing: .3px;
  }
  .ap-title .at-ico { width: 20px; height: 20px; display: inline-flex; color: var(--accent-3); filter: drop-shadow(0 0 6px rgba(139,92,246,.6)); }
  .ap-count {
    font-size: 12px; color: var(--accent-3);
    background: rgba(139, 92, 246, .13);
    border: 1px solid rgba(139, 92, 246, .28);
    padding: 2px 11px; border-radius: 999px;
    font-family: "SF Mono", Menlo, monospace;
  }
  .ap-close {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    color: var(--text); font-size: 16px; line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
  }
  .ap-close:hover { background: rgba(255, 255, 255, .15); }
  .ap-body { flex: 1; overflow-y: auto; padding: 16px 20px 26px; -webkit-overflow-scrolling: touch; }

  /* 资产工具条：搜索 + 时间筛选 + 批量 */
  .ap-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 12px; }
  .ap-tools input[type="text"] {
    flex: 1; min-width: 150px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text); font-size: 12.5px;
    padding: 8px 13px; outline: none;
    transition: border-color .15s;
  }
  .ap-tools input[type="text"]:focus { border-color: var(--accent-3); }
  .ap-tools input::placeholder { color: var(--muted-2); }
  .range-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.04); }
  .range-seg button {
    background: transparent; color: var(--muted);
    font-size: 11.5px; padding: 7px 12px;
    border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
  }
  .range-seg button + button { border-left: 1px solid var(--border); }
  .range-seg button.on { background: rgba(139,92,246,.18); color: var(--accent-3); font-weight: 700; }
  .ap-tools .btn.sm { font-size: 12px; padding: 7px 12px; }
  .ap-tools .btn.sm.on { background: rgba(139,92,246,.2); border-color: rgba(139,92,246,.5); color: #c4b5fd; }

  /* 批量操作条 */
  .ap-selbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 20px 12px; padding: 9px 12px;
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(139,92,246,.3);
    border-radius: 12px;
  }
  .ap-selbar .sel-cnt { flex: 1; font-size: 12.5px; color: var(--accent-3); font-weight: 700; }
  .ap-selbar .btn { font-size: 12px; padding: 5px 11px; }
  .ap-selbar .btn.sel-del { color: #fb7185; border-color: rgba(244,63,94,.4); }

  /* 多选模式网格 */
  .asset-panel.managing .asset-tile { cursor: pointer; }
  .asset-tile .at-check {
    position: absolute; right: 6px; top: 6px; z-index: 2;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.75);
    background: rgba(6,7,18,.8);
    display: none; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; font-weight: 800;
  }
  .asset-panel.managing .at-check { display: inline-flex; }
  .asset-tile.picked { border-color: var(--accent-3); box-shadow: 0 0 0 2px rgba(139,92,246,.55); }
  .asset-tile.picked .at-check { background: var(--accent-3); border-color: var(--accent-3); }

  /* ---------- 参考图 · 素材库导入 ---------- */
  /* 参考图条上的来源角标：一眼区分手传图与素材库导入（两种来源的原图取法不同） */
  .thumb .src {
    position: absolute; left: 3px; top: 3px; z-index: 2;
    font-size: 9px; line-height: 1;
    padding: 2px 5px; border-radius: 4px;
    background: rgba(6, 7, 18, .82);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, .45);
    pointer-events: none;
  }
  /* 素材库弹层：点一下即勾选（无需先进批量模式），勾选框常显 */
  #libPanel .asset-tile { cursor: pointer; }
  #libPanel .asset-tile .at-check { display: inline-flex; }
  /* 单选模式（场景填写的照片位）：一个勾选框都没有意义，每张图右上角顶个空圈
   * 反而像「已全选」。直接收起来，选中态靠边框高亮表达。 */
  #libPanel.single .asset-tile .at-check { display: none; }
  #libPanel.single .asset-tile:hover { border-color: var(--accent); }
  #libPanel .asset-tile .at-bad {
    max-width: calc(100% - 40px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* 算力引导条 */
  .quota-help {
    margin: 0 20px 14px; padding: 11px 14px;
    border-radius: 12px; font-size: 12.5px; line-height: 1.6;
    display: flex; align-items: center; gap: 9px;
  }
  .quota-help.hungry {
    background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.35); color: #fcd34d;
  }
  .quota-help.broke {
    background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.4); color: #fda4af;
  }
  .quota-help.frozen {
    background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.4); color: #fda4af;
  }

  /* 4x4 图库网格：正方形 1:1 缩略图 */
  .asset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  .asset-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #12142e;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: transform .18s, border-color .18s, box-shadow .18s;
  }
  .asset-tile:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 26px -10px rgba(139, 92, 246, .55);
  }
  .asset-tile img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    opacity: 0;
    transition: opacity .25s;
  }
  .asset-tile img.loaded { opacity: 1; }
  .asset-tile .at-bad {
    position: absolute; left: 5px; bottom: 5px;
    font-size: 10px; line-height: 1;
    padding: 2px 6px; border-radius: 5px;
    background: rgba(6, 7, 18, .85);
    color: var(--muted);
    font-family: "SF Mono", Menlo, monospace;
    pointer-events: none;
  }
  .asset-tile.broken .at-bad { display: none; }
  .asset-tile .at-broken {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted-2);
  }
  .asset-empty {
    padding: 48px 10px;
    text-align: center;
    color: var(--muted-2);
    font-size: 13px;
  }

  /* ---------- 失败记录（图库「失败」视图，2026-10-16） ----------
     失败卡是列表形态（失败行没有图片），跨会话可回看：原因 + 「重新生成」。
     列表容器在 grid 里跨满整行（asset-grid / gal-grid 都是 grid）。 */
  .fjob-list {
    grid-column: 1 / -1;
    display: flex; flex-direction: column; gap: 10px;
    animation: fjobIn .24s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes fjobIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .fjob {
    border: 1px solid rgba(244, 63, 94, .26);
    background: rgba(244, 63, 94, .055);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 7px;
  }
  .fjob-head { display: flex; align-items: center; gap: 9px; }
  .fjob-badge { font-size: 11.5px; font-weight: 700; color: var(--red); display: inline-flex; align-items: center; }
  .fjob-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 6px; flex-shrink: 0; }
  .fjob-back { font-size: 11.5px; color: var(--green); }
  .fjob-back::before { content: "✓"; margin-right: 2px; font-weight: 700; }
  .fjob-time { margin-left: auto; font-size: 11px; color: var(--muted-2); font-family: "SF Mono", Menlo, monospace; }
  .fjob-p {
    font-size: 12.5px; color: var(--text); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-word;
  }
  .fjob-r {
    font-size: 12px; color: var(--muted); line-height: 1.55;
    padding: 7px 10px; border-radius: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-word;
  }
  .fjob-acts { display: flex; gap: 8px; }
  .fjob-acts:empty { display: none; }
  .fjob-again {
    font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 6px 14px; border-radius: 8px;
    color: #c4b5fd; border: 1px solid rgba(139, 92, 246, .45); background: rgba(139, 92, 246, .14);
    display: inline-flex; align-items: center; gap: 5px;
    transition: background .18s, border-color .18s;
  }
  .fjob-again:hover { background: rgba(139, 92, 246, .26); border-color: rgba(139, 92, 246, .7); }
  .fjob-again:disabled { opacity: .55; cursor: default; }

  /* ---------- 缩略图点开后的操作面板 ---------- */
  .tile-sheet {
    position: fixed;
    z-index: 970;
    left: 50%; bottom: 0;
    width: min(580px, calc(100% - 16px));
    transform: translateX(-50%) translateY(105%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    background: rgba(24, 22, 48, .98);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 15px 16px calc(16px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 -24px 60px -18px rgba(0, 0, 0, .8);
  }
  .tile-sheet.show { transform: translateX(-50%) translateY(0); }
  .ts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .ts-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
  .ts-img {
    display: flex; align-items: center; justify-content: center;
    background: #0e1026;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    min-height: 130px;
    max-height: 46vh;
  }
  .ts-img img { display: block; max-width: 100%; max-height: 46vh; object-fit: contain; }
  .ts-prompt {
    font-size: 12px; color: var(--muted);
    background: var(--surface-deep);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 11px;
    max-height: 74px;
    overflow-y: auto;
    line-height: 1.55;
    word-break: break-all;
  }
  .ts-prompt:empty { display: none; }
  .ts-acts { display: flex; gap: 8px; }
  .ts-acts .btn { flex: 1; justify-content: center; }
  .ts-acts .btn.primary { flex: 1.45; }
  .ts-acts .ts-del {
    flex: 0 0 auto;
    color: #fb7185;
    background: rgba(244, 63, 94, .09);
    border-color: rgba(244, 63, 94, .38);
  }
  .ts-acts .ts-del:hover { color: #f43f5e; border-color: #fb7185; background: rgba(244, 63, 94, .18); }

  /* ---------- 照片来源选择（点「＋照片」后先问来源，不直接叫系统相册） ----------
     外壳复用 .tile-sheet（同款底部抽屉定位/动效），这里只写内容行样式 */
  .pick-sub {
    margin: -4px 0 2px;
    font-size: 12px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pick-list { display: flex; flex-direction: column; gap: 8px; }
  .pick-row {
    display: flex; align-items: center; gap: 11px;
    width: 100%; text-align: left;
    padding: 12px 13px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface-deep);
    color: var(--text);
    font-family: inherit; font-size: 13.5px;
    cursor: pointer; transition: border-color .16s, background .16s;
  }
  .pick-row:hover { border-color: var(--accent); background: rgba(139, 92, 246, .09); }
  .pick-row .pk-ico {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(139, 92, 246, .13); color: var(--accent-3);
  }
  .pick-row .pk-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .pick-row .pk-tx b { font-size: 13.5px; font-weight: 600; }
  .pick-row .pk-tx span { font-size: 11.5px; color: var(--muted-2); }
  .pick-row .arr { margin-left: auto; color: var(--muted-2); font-size: 15px; }

  /* 素材库单选模式的顶部提示条（替代「加入参考图」那一栏） */
  .lib-tip {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; color: var(--accent-3);
    background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .3);
    border-radius: 10px;
    padding: 8px 11px;
  }
  /* 素材库现在也能从场景填写弹层（.ftp-panel = 960）里打开：
   * 层级必须压过它，否则用户选完图看不到素材库，还会误点到下面那层表单。 */
  #libMask { z-index: 980; }
  #libPanel { z-index: 985; }

  /* ---------- 加载进度环（替代骨架） ---------- */
  .result-card.loading { min-height: 240px; display: flex; flex-direction: column; }

  /* ---------- 完成态卡片：环形动画就地换成缩略图 ---------- */
  .result-card.done { min-height: 0; display: block; cursor: pointer; transition: border-color .2s, transform .2s; }
  .result-card.done:hover { border-color: var(--accent); transform: translateY(-2px); }
  .result-card.done .rc-thumb {
    position: relative; aspect-ratio: 1 / 1; overflow: hidden;
    background: rgba(255, 255, 255, .04);
  }
  .result-card.done .rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .result-card.done .rc-badge {
    position: absolute; left: 8px; top: 8px;
    font-size: 10.5px; font-weight: 600; line-height: 1;
    padding: 3px 8px; border-radius: 6px;
    background: rgba(6, 20, 12, .82); color: var(--green);
    border: 1px solid rgba(74, 222, 128, .45);
  }
  .result-card.done .rc-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 12px; font-size: 12px; color: var(--muted-2);
  }
  .result-card.done .rc-open { color: var(--accent-3); }
  /* 成功卡片上的「再次生成」：刚出图时最常"不太满意，再抽一张"，
     这一下不必绕去图库。按钮独立成行 —— rc-foot 是 space-between 两栏，
     塞第三个元素会被挤成一团。 */
  .result-card.done .rc-acts { padding: 0 12px 10px; display: flex; justify-content: flex-end; }
  .result-card.done .rc-again {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px; font-size: 12px; font-weight: 600; font-family: inherit;
    color: var(--accent-3);
    background: rgba(139, 92, 246, .10);
    border: 1px solid rgba(139, 92, 246, .30);
    border-radius: 8px; cursor: pointer;
    transition: background .15s, border-color .15s;
  }
  .result-card.done .rc-again:hover { background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .5); }
  .result-card.done .rc-again:disabled { opacity: .6; cursor: default; }
  .result-card.loading .ld-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    min-height: 210px;
  }
  .ld-ring {
    position: relative;
    width: 84px; height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ld-ring svg { transform: rotate(-90deg); width: 84px; height: 84px; }
  .ld-ring .bgc { fill: none; stroke: rgba(139,92,246,.14); stroke-width: 7; }
  .ld-ring .fgc {
    fill: none; stroke: var(--accent); stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset .35s linear, stroke .35s;
    filter: drop-shadow(0 0 6px rgba(139,92,246,.6));
  }
  .ld-ring .pct {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700;
    color: var(--text);
    font-family: "SF Mono", Menlo, monospace;
    letter-spacing: -0.3px;
  }
  .ld-label { font-size: 12.5px; color: var(--muted-2); text-align: center; }
  .ld-tip { font-size: 12px; color: var(--accent-3); text-align: center; }

  /* 失败态：卡片内常驻错误提示 */
  .result-card .err-box {
    margin: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(244,63,94,.12);
    border: 1px solid rgba(244,63,94,.34);
    font-size: 12.5px;
    line-height: 1.65;
    color: #fda4af;
    word-break: break-word;
  }
  .result-card .err-box .err-t {
    font-weight: 700;
    color: #fb7185;
    display: block;
    margin-bottom: 4px;
  }
  .result-card .err-box .err-code {
    display: inline-block;
    margin-top: 8px;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 11px;
    background: rgba(244,63,94,.14);
    border-radius: 6px;
    padding: 2px 6px;
  }

  @keyframes shimmer { 0% {background-position: 200% 0} 100% {background-position: -200% 0} }

  /* 阶段提示 */
  .phase-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; padding: 4px 10px; border-radius: var(--radius-pill);
    background: rgba(139,92,246,.12);
    border: 1px solid rgba(139,92,246,.26);
    color: var(--accent-3);
  }

  .tooltip { position: relative; cursor: help; }
  .tooltip .tip {
    visibility: hidden;
    width: 240px;
    background: #191b3a; color: var(--text);
    text-align: left;
    border-radius: 10px; padding: 10px 12px;
    position: absolute; bottom: 130%; left: 0;
    box-shadow: var(--shadow); font-size: 12px; line-height: 1.5;
    border: 1px solid var(--border);
    z-index: 20;
    opacity: 0; transition: opacity .2s;
  }
  .tooltip:hover .tip { visibility: visible; opacity: 1; }

  /* ---------- 提示词增强 ---------- */
  .enh-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .tier-select {
    width: auto;
    min-width: 118px;
    padding: 8px 34px 8px 14px;
    font-size: 13px;
    background-position: right 12px center;
    border-radius: var(--radius-pill);
  }
  /* 提示词模版：下拉 + 管理按钮 */
  .pt-tpl { display: inline-flex; align-items: center; gap: 6px; }
  .pt-tpl select {
    width: auto;
    min-width: 156px;
    max-width: 260px;
    padding: 8px 34px 8px 14px;
    font-size: 13px;
    background-position: right 12px center;
    border-radius: var(--radius-pill);
  }
  .pt-tpl .btn { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
  .enh-status {
    font-size: 12px;
    color: var(--muted-2);
    margin-left: auto;
  }
  .enh-status.busy { color: var(--amber); }
  .enh-status.ok { color: var(--green); }
  .enh-status.err { color: var(--red); }

  .enh-result {
    margin-top: 14px;
    border: 1px solid rgba(139,92,246,.28);
    background: rgba(20,18,40,.6);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: none;
  }
  .enh-result.show { display: block; }
  .enh-result .enh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }
  .enh-result .enh-head .tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--accent-3);
    background: rgba(139,92,246,.12);
    border: 1px solid rgba(139,92,246,.26);
    padding: 3px 10px; border-radius: var(--radius-pill);
  }
  .enh-result .enh-head .acts { display: flex; gap: 6px; }
  .enh-result pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
  }
  .enh-skel {
    display: none;
    font-size: 12.5px;
    color: var(--muted);
  }
  .enh-skel.show { display: block; }
  /* 骨架屏（通用）：增强面板与列表加载共用同一套。
     原先这条绑死在 .enh-skel 下，列表型加载用不上；提升为通用类后增强面板继续复用。 */
  .sk-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(100deg, #181a3c 40%, #212452 50%, #181a3c 60%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite linear;
    margin-bottom: 8px;
  }
  .sk-list { display: flex; flex-direction: column; gap: 12px; }
  .sk-row { display: flex; align-items: center; gap: 12px; }
  .sk-ava { height: 34px; width: 34px; border-radius: 10px; flex: 0 0 auto; margin-bottom: 0; }

  .enh-note {
    font-size: 12px; color: var(--muted-2);
    margin-top: 8px;
  }

  /* ---------- 提示词模版 · 管理弹层（底部升起） ---------- */
  .tpl-panel {
    position: fixed; z-index: 950;
    left: 50%; bottom: 0;
    width: min(760px, calc(100% - 16px));
    height: min(80vh, 760px);
    max-height: 92vh;
    background: rgba(22,20,44,.97);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    transform: translateX(-50%) translateY(105%);
    transition: transform .32s cubic-bezier(.2,.8,.2,1);
    display: flex; flex-direction: column;
    box-shadow: 0 -24px 60px -18px rgba(0,0,0,.75);
    overflow: hidden;
  }
  .tpl-panel.show { transform: translateX(-50%) translateY(0); }
  .tpl-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px 13px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .tpl-head .tp-title {
    flex: 1;
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 600; color: var(--text-strong);
  }
  .tpl-head .tp-title .tp-ico { width: 20px; height: 20px; display: inline-flex; color: var(--accent-3); filter: drop-shadow(0 0 6px rgba(139,92,246,.6)); }
  .tpl-body { flex: 1; overflow-y: auto; padding: 14px 18px 16px; }
  .tpl-list { display: flex; flex-direction: column; gap: 10px; }
  .tpl-item {
    background: rgba(255,255,255,.035);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color .15s;
  }
  .tpl-item:hover { border-color: var(--border-strong); }
  .tpl-item .ti-top { display: flex; align-items: center; gap: 10px; }
  .tpl-item .ti-name { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tpl-item .ti-scope {
    font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill);
    color: var(--accent-3); background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.26);
    flex-shrink: 0;
  }
  .tpl-item .ti-body {
    font-size: 12.5px; color: var(--muted-2); line-height: 1.6; margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .tpl-item .ti-acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
  .tpl-empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 40px 0; }
  .tpl-form { display: flex; flex-direction: column; gap: 8px; }
  .tpl-form label { font-size: 12.5px; color: var(--muted-2); }
  .tpl-form textarea { min-height: 168px; font-size: 13.5px; }
  .tpl-form .tf-tools { display: flex; justify-content: flex-end; margin-bottom: 2px; }
  .tpl-foot {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .tpl-foot .grow { flex: 1; }

  /* ============================================================
   * 固定模版 · 填写弹层（选中「固定模版」后弹出；字段默认值已预填）
   * 复用 .tpl-head / .tpl-foot 的骨架，仅换主体与尺寸
   * ============================================================ */
  .ftp-panel {
    position: fixed; z-index: 960;
    left: 50%; bottom: 0;
    width: min(620px, calc(100% - 16px));
    height: min(78vh, 700px);
    max-height: 92vh;
    background: rgba(22,20,44,.97);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    transform: translateX(-50%) translateY(105%);
    transition: transform .32s cubic-bezier(.2,.8,.2,1);
    display: flex; flex-direction: column;
    box-shadow: 0 -24px 60px -18px rgba(0,0,0,.75);
    overflow: hidden;
  }
  .ftp-panel.show { transform: translateX(-50%) translateY(0); }
  .ftp-body { flex: 1; overflow-y: auto; padding: 14px 18px 16px; }
  .ftp-fields { display: flex; flex-direction: column; gap: 11px; }
  .ftp-fld { display: flex; flex-direction: column; gap: 5px; }
  .ftp-fld label { font-size: 12.5px; color: var(--muted-2); display: flex; align-items: center; gap: 6px; }
  .ftp-fld label .req { color: #fb7185; font-size: 11px; }
  .ftp-fld input, .ftp-fld textarea {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,.045);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 9px 13px;
    color: var(--text-strong); font-size: 13.5px; font-family: inherit;
    outline: none; transition: border-color .15s;
  }
  .ftp-fld input:focus, .ftp-fld textarea:focus { border-color: var(--accent); }
  .ftp-fld textarea { min-height: 66px; resize: vertical; line-height: 1.55; }
  .ftp-fld.missing input, .ftp-fld.missing textarea { border-color: #fb7185; }
  .ftp-refs { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 13px; }
  .ftp-refs-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--muted-2); margin-bottom: 9px;
  }
  .ftp-refs-head .lk { color: var(--accent-3); font-size: 11px; border: 1px solid rgba(139,92,246,.3); background: rgba(139,92,246,.12); border-radius: var(--radius-pill); padding: 2px 8px; }
  .ftp-refs-head .grow { flex: 1; }
  .ftp-refs-strip { display: flex; gap: 9px; flex-wrap: wrap; }
  .ftp-ref-item { text-align: center; }
  .ftp-ref-item img {
    width: 66px; height: 66px; object-fit: cover; border-radius: 11px;
    border: 1px solid var(--border); background: rgba(255,255,255,.05); display: block;
  }
  .ftp-ref-item .no { font-size: 11px; color: var(--muted-2); margin-top: 4px; }
  .ftp-ref-none { font-size: 12.5px; color: var(--muted-2); }
  /* 模版缺参考图：这是配错了，得让用户一眼看到并知道找谁，不能跟「本就没配图」同一副灰字 */
  .ftp-ref-none.warn { color: var(--amber); line-height: 1.6; display: block; }
/* ---------- 人员组（用户可动态增删 + 上传人物照片） ----------
   角色定义由后台下发（fields 里 type:'people'），这里只负责渲染与交互。 */
.ppl-group { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 13px; }
.ppl-group:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.ppl-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-2); margin-bottom: 9px; }
.ppl-head .p-name { color: var(--text-strong); font-size: 13.5px; font-weight: 600; }
.ppl-head .p-req { color: #fb7185; font-size: 11px; border: 1px solid rgba(251,113,133,.35); background: rgba(251,113,133,.1); border-radius: var(--radius-pill); padding: 1px 7px; }
.ppl-head .p-cap { font-size: 11px; color: var(--muted-2); }
.ppl-head .grow { flex: 1; }
.ppl-head .p-cnt { font-size: 11.5px; color: var(--accent-3); font-family: var(--adm-mono, ui-monospace), Menlo, Consolas, monospace; }
.ppl-row {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.035); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px 10px; margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.ppl-row:hover { border-color: var(--border-strong); }
.ppl-row.missing { border-color: rgba(251,113,133,.55); background: rgba(251,113,133,.06); }
.ppl-idx {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace;
  background: rgba(255,255,255,.07); color: var(--muted-2);
}
.ppl-row input.p-name-i {
  flex: 1; min-width: 0; box-sizing: border-box;
  background: rgba(255,255,255,.045); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; color: var(--text-strong);
  font-size: 13.5px; font-family: inherit; outline: none; transition: border-color .15s;
}
.ppl-row input.p-name-i:focus { border-color: var(--accent); }
.ppl-photo {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px;
  border-radius: 11px; cursor: pointer; overflow: hidden;
  border: 1px dashed rgba(255,255,255,.22); background: rgba(255,255,255,.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; transition: border-color .15s, background .15s; color: var(--muted-2);
}
.ppl-photo:hover { border-color: var(--accent); background: rgba(139,92,246,.1); color: var(--accent-3); }
.ppl-photo .ph-t { font-size: 15px; line-height: 1; }
.ppl-photo .ph-s { font-size: 9.5px; line-height: 1; }
.ppl-photo.filled { border-style: solid; border-color: rgba(139,92,246,.5); }
.ppl-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ppl-photo .ph-x {
  position: absolute; right: 1px; top: 1px; width: 16px; height: 16px;
  border-radius: 50%; background: rgba(10,10,20,.86); color: #fff;
  border: none; font-size: 10px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.ppl-photo.filled:hover .ph-x { opacity: 1; }
.ppl-del {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px;
  border: 1px solid var(--border); background: transparent; color: var(--muted-2);
  font-size: 14px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.ppl-del:hover { color: var(--red); border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.08); }
.ppl-add {
  width: 100%; justify-content: center;
  border: 1px dashed rgba(255,255,255,.22); background: rgba(255,255,255,.02);
  color: var(--muted-2); border-radius: 12px; padding: 9px; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-family: inherit; transition: border-color .15s, color .15s, background .15s;
}
.ppl-add:hover { border-color: var(--accent); color: var(--accent-3); background: rgba(139,92,246,.1); }
.ppl-add:disabled { opacity: .4; cursor: not-allowed; border-color: var(--border); color: var(--muted-2); background: transparent; }
.ppl-hint { font-size: 11.5px; color: var(--muted-2); margin-top: -2px; margin-bottom: 5px; line-height: 1.55; }
.ppl-hint.warn { color: var(--amber); }

/* ---------- 参考图槽位：可点击更换的预设图（LOGO 这类） ---------- */
.ftp-ref-item.slot { cursor: pointer; }
.ftp-ref-item.slot .slot-box { position: relative; display: block; }
.ftp-ref-item.slot:hover .slot-box img { border-color: var(--accent); }
.ftp-ref-item.slot.open .slot-box img { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,92,246,.35); }
.ftp-ref-item.slot .no { color: var(--accent-3); }
.slot-edit {
  position: absolute; right: 3px; bottom: 3px; width: 17px; height: 17px;
  border-radius: 6px; background: rgba(10,10,20,.82); color: #fff;
  font-size: 10px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.slot-flag {
  position: absolute; left: 3px; top: 3px; font-size: 9px; padding: 1px 5px;
  border-radius: var(--radius-pill); background: rgba(139,92,246,.92); color: #fff;
}
.slot-picker {
  margin-top: 11px; padding: 12px; border-radius: 12px;
  background: rgba(139,92,246,.09); border: 1px solid rgba(139,92,246,.28);
}
.sp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sp-head .sp-t { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.sp-head .sp-badge { font-size: 10.5px; color: var(--accent-3); border: 1px solid rgba(139,92,246,.35); background: rgba(139,92,246,.14); border-radius: var(--radius-pill); padding: 1px 7px; }
.sp-head .grow { flex: 1; }
.sp-x { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--muted-2); font-size: 14px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s; }
.sp-x:hover { color: var(--text); border-color: var(--border-strong); }
.sp-sub { font-size: 11.5px; color: var(--muted-2); margin-bottom: 8px; }
.sp-strip { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 11px; }
.sp-item { text-align: center; cursor: pointer; }
.sp-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.05); display: block; transition: border-color .15s; }
.sp-item:hover img { border-color: var(--accent); }
.sp-item .no { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-up, .sp-def { flex: 1; min-width: 128px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; cursor: pointer; font-family: inherit; transition: all .15s; }
.sp-up { border: 1px dashed rgba(139,92,246,.5); background: rgba(139,92,246,.1); color: var(--accent-3); }
.sp-up:hover { background: rgba(139,92,246,.2); }
.sp-def { border: 1px solid var(--border); background: transparent; color: var(--muted-2); }
.sp-def:hover { color: var(--text); border-color: var(--border-strong); }
.sp-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.sp-note svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent-3); }
/* 编号说明：用户看到一张自己没传的图会疑惑，这里一次说清「谁配的、能不能换」 */
.ref-note {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 11px; padding: 9px 11px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.65;
}
.ref-note .rn-ico { flex: 0 0 auto; margin-top: 1px; color: var(--accent-3); }
.ref-note b { color: var(--text); }
.ref-note .rn-line + .rn-line { margin-top: 3px; display: block; }
  /* 尺寸 / 质量（模版预设，用户可改；改完按新参数计费） */
  .ftp-params {
    margin-top: 16px; border-top: 1px solid var(--border); padding-top: 13px;
    display: grid; grid-template-columns: 2fr 1fr; gap: 11px;
  }
  .ftp-params .fp-item { display: flex; flex-direction: column; gap: 5px; }
  .ftp-params label { font-size: 12.5px; color: var(--muted-2); }
  .ftp-params select {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,.045);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 9px 12px;
    color: var(--text-strong); font-size: 13px; font-family: inherit;
    outline: none; transition: border-color .15s;
  }
  .ftp-params select:focus { border-color: var(--accent); }
  .ftp-cost {
    margin-top: 12px; font-size: 12.5px; color: var(--muted-2);
    background: rgba(255,255,255,.03); border: 1px solid var(--border);
    border-radius: 11px; padding: 9px 13px;
  }
  .ftp-cost b { color: var(--accent-3); font-weight: 700; }
  .ftp-cost.warn { color: #fbbf24; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.08); }
  .ftp-cost.warn b { color: #fbbf24; }
  @media (max-width: 600px) {
    .ftp-params { grid-template-columns: 1fr; }
  }

  /* ============================================================
   * 响应式布局：手机 / 平板 / 电脑
   * ============================================================ */
  /* 平板（≤1024px）：两列网格，配置区收紧 */
  @media (max-width: 1024px) {
    .wrap { padding: 28px 20px 140px; }
    .tasks-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .cfg-grid { gap: 14px 16px; }
    .card { padding: 20px; }
    header { gap: 18px; }
  }

  /* 小平板/大手机（≤768px） */
  @media (max-width: 768px) {
    .brand h1 { font-size: 22px; }
    header { flex-direction: column; align-items: flex-start; }
    .cfg-grid { grid-template-columns: 1fr; } /* 表单单列 */
    .field.full { grid-column: auto; }
    .actions { flex-wrap: wrap; }
    .actions .btn { flex: 1 1 auto; }
  }

  /* 手机（≤600px）：双列网格，图片突出、操作区紧凑 */
  @media (max-width: 600px) {
    /* 顶栏通栏吸顶后，.wrap 顶部内边距会让顶栏上方露一条底色空隙 → 归零，
       首屏间距交给各页自己的 padding */
    .wrap { padding: 0 12px calc(150px + env(safe-area-inset-bottom)); }
    .page { padding-top: 12px; }
    /* 轻提示坐在底部导航之上。原先挪到顶部是因为「底部被图库入口大按钮占据」，
       而该按钮在手机端已撤销（.asset-fab display:none），约束已不存在；
       顶部反而被「生成完成」通知卡占住（#notifyWrap top:10px，z-index 970），
       toast 层级更高（1300）会直接压住通知的缩略图与「查看」按钮。
       放回底部后两者彻底分离：通知钉顶、轻提示钉底。
       滑入方向随之下移 → 沿用基础 keyframes 的 +12px/+8px，不再单独覆盖。 */
    .toast-wrap {
      left: 12px; right: 12px; max-width: none;
      top: auto; bottom: calc(58px + env(safe-area-inset-bottom) + 12px);
    }
    /* 关闭按钮热区撑到 44×44（触屏最小点击区），视觉仍保持 22×22 */
    .toast .t-x { width: 44px; height: 44px; margin: -14px -8px -14px 0; }
    .prompt-warn { flex-wrap: wrap; }
    .diag-kv { grid-template-columns: 1fr; gap: 2px; }
    .diag-kv dt { margin-top: 6px; }
    /* 任务双列网格：列宽精确，避免 iOS 多列裁剪 bug */
    .tasks-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
    /* ★ 手机端顶栏 v2（设计稿 2026-09-22）：通栏 58px 吸顶 = 品牌 lockup + 算力胶囊。
       账号/退出/装饰 chip 全部撤出头部（导航交给底部 tab，入口挪进「我的」页）。
       负边距抵消 .wrap 的 12px 内边距 → 通栏；底缘用紫光渐变线替代生硬分隔线 */
    header {
      position: sticky; top: 0; z-index: 50;
      flex-direction: row; align-items: center; flex-wrap: nowrap;
      gap: 11px; height: 58px; margin: 0 -12px 0; padding: 0 14px;
      background: linear-gradient(180deg, rgba(17,19,42,.95), rgba(11,13,30,.9));
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid rgba(255,255,255,.06);
    }
    header::after {
      content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
      background: linear-gradient(90deg, rgba(139,92,246,.55), rgba(79,108,255,.2) 45%, transparent 80%);
    }
    .brand { flex: 1; min-width: 0; }
    .brand .brand-row { gap: 11px; }
    /* 双行 lockup：主标题 + 小字副题 */
    .brand h1 {
      display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
      font-size: 16.5px; line-height: 1.15; letter-spacing: -.2px;
      white-space: nowrap; overflow: hidden;
    }
    .h1-suffix { display: none; }   /* 桌面用的「 · 图片创作台」后缀，手机端换成 h1-sub */
    .h1-sub {
      display: block; font-size: 9.5px; font-weight: 400;
      letter-spacing: 2.5px; color: var(--muted-2);
    }
    /* Logo 用回 Lottie 动画（老板定）：loop 常转 + 切后台自动暂停的逻辑在
       initLottieLogos 里，未改动。顶栏 58px 无纵向内边距 → logo 拉满等高顶天立地，
       Lottie 画布自带留白用 scale 补偿让可见球体充满 */
    .brand .logo { width: 58px; height: 58px; flex-shrink: 0; margin: 0 -4px; }
    .brand .logo svg { transform: scale(1.25); transform-origin: center; }
    .head-right { flex-wrap: nowrap; }
    .head-right .model-chip, .head-right .u-avatar, .head-right .u-name, .head-right .btn.logout { display: none; }
    /* 算力胶囊 v2：玻璃质感 + 内高光 + 绿光外晕 */
    .head-right .u-quota {
      height: 32px; padding: 0 13px; border-radius: 999px;
      font-size: 14px; font-weight: 800; gap: 5px;
    }
    .head-right .u-quota:not(.low):not(.empty) {
      background: linear-gradient(180deg, rgba(74,222,128,.17), rgba(74,222,128,.06));
      border-color: rgba(74,222,128,.32);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 4px 16px -6px rgba(74,222,128,.4);
    }
    .card { padding: 14px; border-radius: 14px; }
    .section-title { flex-wrap: wrap; gap: 8px; margin: 22px 0 2px; }

    /* 紧凑收紧：让提示词+生成按钮尽早进首屏 */
    .cfg-grid { gap: 10px 12px; }
    .field { gap: 4px; }
    .field label { font-size: 12.5px; }
    textarea { min-height: 156px; font-size: 13.5px; }
    .actions { margin-top: 14px; gap: 10px; }

    /* 输入框 / 按钮 / 行布局全部纵向 */
    .row { flex-wrap: wrap; }
    .input-group { width: 100%; }
    .input-group input { min-width: 0; }
    .input-group .btn { flex: 0 0 auto; }

    /* 提示词工具条：模版占整行，档位+增强按钮并一行 */
    .enh-bar { margin-top: 10px !important; gap: 6px; flex-wrap: wrap; }
    .pt-tpl { flex: 1 1 100%; }
    .pt-tpl select { flex: 1; min-width: 0; }
    .tier-select { flex: 1 1 auto; min-width: 0; padding: 8px 30px 8px 12px; font-size: 12.5px; }
    #btnEnhance { flex: 1 1 auto; padding: 8px 12px; font-size: 12.5px; }
    .enh-status { margin-left: 0; width: 100%; text-align: right; }
    .tpl-body { padding: 12px 12px 14px; }
    .tpl-foot { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }

    /* 动作区：手机上固定在视口底部（吸底），但坐在底部导航条上方 —— 生成与导航互不遮挡。
       排成一行（主按钮 + 状态）而不是竖排 —— 竖排吸底条会高到盖住内容。
       容器 .wrap 底部已预留让位，滚到底的内容不会被遮。 */
    .sticky-actions {
      position: fixed; left: 0; right: 0;
      bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 40;
      margin: 0;
      padding: 10px 12px 10px;
      background: rgba(12, 14, 30, .97);
      border-top: 1px solid var(--border);
      box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .9);
    }
    .sticky-actions .actions { flex-direction: row; align-items: center; gap: 10px; margin: 0; }
    .sticky-actions .actions .btn.primary { flex: 1 1 auto; width: auto; padding: 13px 18px; font-size: 15px; }
    .sticky-actions .actions .foot-row { flex: 0 0 auto; width: auto; margin-left: 0; gap: 8px; }
    .sticky-actions .actions .foot-row .status-dot { margin-left: 0; }
    /* 提示条被吸底条压住的话看不到，给它留出吸底条的高度 */
    .banner.show { margin-bottom: 74px; }

    /* 入口页：手机上两个入口竖排，热区拉满 */
    .hero { padding: 12px 2px 16px; }
    .hero-t { font-size: 22px; letter-spacing: -.4px; }
    .hero-d { font-size: 12.5px; }
    /* 手机端两列：第一屏就能把常用场景铺满 */
    .scene-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .sc-cover { height: 118px; }
    .sc-body { padding: 10px 11px 12px; gap: 6px; }
    .sc-name { font-size: 13.5px; }
    .sc-meta { font-size: 10.5px; line-height: 1.45; }
    .sc-btn { padding: 8px 10px; font-size: 12px; }
    .sec-head { margin-bottom: 11px; }
    .free-entry { margin-top: 16px; padding: 14px 16px; gap: 12px; }
    .fe-ico { width: 38px; height: 38px; border-radius: 12px; }
    .fe-go { display: none; }
    .cat-tab { padding: 8px 15px; font-size: 13px; }
    .chipbar { margin-bottom: 13px; }
    /* 「我的作品」入口手机端撤销：图库已是底部导航「图片」tab，不再重复占首页空间 */
    .works { display: none; }

    /* 板块返回栏：底部 tab 承担导航后，手机端不再需要页面内返回栏 */
    .backbar { display: none; }
    .back-btn { padding: 7px 14px 7px 11px; font-size: 13px; }

    /* 参考图上传 */
    .upload-zone { width: 58px; height: 58px; font-size: 10px; }
    .thumbs { gap: 8px; }
    .thumb { width: 58px; height: 58px; }
    .enh-result { padding: 10px 10px; }
    .enh-result pre { font-size: 12.5px; }

    /* 任务卡：双列紧凑 */
    .result-card { border-radius: 12px; margin-bottom: 10px; }
    .result-card .err-box { margin: 10px; padding: 10px 12px; }

    /* ★ 悬浮「图片资产」大按钮在手机端整体撤销：图库升级为底部导航「图片」整页，
       数量改为 tab 角标 —— 不再遮挡内容、不再抢视觉。桌面端保留原按钮。 */
    .asset-fab { display: none; }
    .asset-panel { width: 100%; height: 78vh; border-radius: 18px 18px 0 0; }
    .ap-head { padding: 14px 14px 11px; }
    .ap-body { padding: 12px 10px 20px; }
    .asset-grid { gap: 6px; }
    .asset-tile { border-radius: 8px; }
    .tile-sheet { padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); }
    .ts-img { max-height: 40vh; min-height: 100px; }
    .ts-img img { max-height: 40vh; }
    .ts-acts { flex-wrap: wrap; }
    .ts-acts .ts-remix { flex: 1 1 100%; }
    .ts-acts .ts-del { flex: 1 1 100%; }
    .img-lightbox .lb-bar { flex-wrap: wrap; padding: 24px 12px calc(10px + env(safe-area-inset-bottom)); }
    .img-lightbox .lb-prompt { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .img-lightbox .lb-btns { width: 100%; justify-content: flex-end; }

    /* 下拉 / 警告 紧凑 */
    select { font-size: 13px; }
    .hint { font-size: 11.5px; margin-top: 6px; }
  }

  /* 超小屏（≤380px）：进一步压缩 */
  @media (max-width: 380px) {
    .brand h1 { font-size: 17px; }
    .btn { padding: 9px 12px; font-size: 13px; }
  }

  /* ============================================================
   * ★ 手机端专属：底部导航 + 「图片」整页 + 「我的」整页
   * 2026-09-22 重设计：桌面端不用这些组件（下方 601px 守卫强制隐藏），
   * 手机端由底部 tab 统一承担导航（首页/场景/创作/图片/我的）。
   * ============================================================ */

  /* 桌面守卫：这几个手机端组件绝不允许在 >600px 出现（防止 hash 直入泄漏） */
  @media (min-width: 601px) {
    #tabbar, #pageGallery, #pageMine, #qsMask, #quickSheet { display: none !important; }
  }

  @media (max-width: 600px) {
    /* ---------- 页面切换动效：纯淡入，消掉生硬的瞬时切换 ----------
     * 页面靠 display 显隐切换，display:none → '' 时动画自动重放，
     * 所以 renderRoute 每次切页都会自然播一遍；桌面端不套（在媒体块内）。
     * ⚠ 刻意不带 transform：动画运行期间含 transform 的元素会成为 containing block，
     *   页内 position:fixed 的吸底生成条（.sticky-actions，手机端才 fixed）
     *   会瞬间改以本页为定位基准 → 生成按钮可见地跳一下。纯透明度不影响定位。 */
    @keyframes mPageIn {
      from { opacity: .45; }
      to { opacity: 1; }
    }
    .page, .m-page { animation: mPageIn .26s cubic-bezier(.2, .8, .2, 1); }
    @media (prefers-reduced-motion: reduce) {
      .page, .m-page { animation: none; }
    }

    /* 生成中横幅的手机端适配在基础规则（.gnb-banner 定义处）之后统一覆盖 */

    /* ---------- 快速生图面板（中间凸起「生图」按钮弹出，覆盖 tabbar） ---------- */
    .qs-mask {
      position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70;
      background: rgba(5,6,16,.6);
      opacity: 0; visibility: hidden;
      transition: opacity .25s, visibility .25s;
    }
    .qs-mask.show { opacity: 1; visibility: visible; }
    .quick-sheet {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
      border-radius: 22px 22px 0 0;
      background: linear-gradient(180deg, #171936, #101230 55%, #0d0f26);
      border: 1px solid var(--border-strong); border-bottom: none;
      padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
      transform: translateY(102%);
      transition: transform .32s cubic-bezier(.2,.8,.2,1);
      box-shadow: 0 -20px 60px -20px rgba(0,0,0,.7);
    }
    .quick-sheet.show { transform: none; }
    .quick-sheet .grab {
      width: 40px; height: 4px; border-radius: 999px;
      background: rgba(255,255,255,.18); margin: 0 auto 12px;
    }
    .qs-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
    .qs-head b { font-size: 17px; color: var(--text-strong); }
    .qs-head .qs-sub { font-size: 11px; color: var(--muted-2); }
    .qs-head .qs-adv { margin-left: auto; font-size: 12px; color: #a78bfa; background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; }
    .qs-input {
      width: 100%; min-height: 92px; resize: none;
      background: rgba(8,10,26,.6); border: 1px solid var(--border);
      border-radius: 14px; padding: 12px 13px;
      color: var(--text); font-size: 15px; line-height: 1.6; font-family: inherit;
    }
    .qs-input:focus { outline: none; border-color: rgba(139,92,246,.55); box-shadow: 0 0 0 3px rgba(139,92,246,.14); }
    .qs-chips { display: flex; gap: 7px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
    .qs-chips::-webkit-scrollbar { display: none; }
    /* 快速面板里的参考图缩略图行：与创作页共用同一份 state.images 和 .thumb 样式，
       只把尺寸收到 46px 以适配面板密度；「×」常显规则在文末的触屏媒体块里，两处共用。
       空态用 :empty 收起 —— 没选图时不占高度 */
    .qs-refs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
    .qs-refs:empty { display: none; }
    .qs-refs .thumb { width: 46px; height: 46px; border-radius: 10px; }
    .qs-chip {
      flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px;
      padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
      border: 1px solid var(--border-strong); color: var(--muted);
      background: none; font-family: inherit; cursor: pointer;
    }
    .qs-chip.hot { background: var(--grad-btn); color: #fff; border: none; }
    .qs-opts { display: flex; gap: 8px; margin-bottom: 14px; }
    .qs-opt {
      flex: 1; display: flex; flex-direction: column; gap: 2px;
      padding: 9px 12px; border-radius: 12px; text-align: left;
      border: 1px solid var(--border); background: var(--surface);
      font-family: inherit; cursor: pointer;
    }
    .qs-opt small { font-size: 10px; color: var(--muted-2); }
    .qs-opt b { font-size: 12.5px; color: var(--text); font-weight: 600; }
    .qs-go {
      width: 100%; padding: 14px; border-radius: 14px;
      background: var(--grad-btn); color: #fff; border: none; cursor: pointer;
      font-size: 15.5px; font-weight: 800; letter-spacing: 1px; font-family: inherit;
      box-shadow: 0 14px 30px -12px rgba(124,90,248,.95);
    }
    .qs-go:active { transform: scale(.98); }
    .qs-go .qs-cost { font-weight: 500; font-size: 12px; opacity: .85; letter-spacing: 0; }

    /* ---------- 底部导航（5 tab，毛玻璃吸底 + 安全区） ---------- */
    .tabbar {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
      height: calc(58px + env(safe-area-inset-bottom));
      padding-bottom: env(safe-area-inset-bottom);
      display: flex; align-items: stretch;
      background: rgba(12, 14, 32, .92);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-top: 1px solid var(--border);
    }
    .tab {
      flex: 1; min-width: 0; position: relative;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
      color: var(--muted-2); cursor: pointer; font-family: inherit;
      background: none; border: none; padding: 0;   /* 按钮自带 UA 白底，不重置会把整条导航染白 */
      -webkit-tap-highlight-color: transparent;
    }
    .tab svg { display: block; }
    .tab .tab-lb { font-size: 10px; line-height: 1; }
    .tab.on { color: #c4b5fd; }
    .tab.on svg { color: #a78bfa; }
    /* 「图片」tab 的数量角标：小圆点，替代原悬浮大按钮 */
    .tab .tab-bdg {
      position: absolute; top: 8px; left: calc(50% + 4px);
      min-width: 16px; height: 16px; padding: 0 4px;
      border-radius: 999px;
      background: var(--grad-btn); color: #fff;
      font-size: 9.5px; font-weight: 700; font-style: normal;
      display: none; align-items: center; justify-content: center;
      border: 2px solid #101228;
      box-shadow: 0 4px 10px -3px rgba(124, 90, 248, .9);
    }
    .tab .tab-bdg.show { display: inline-flex; }
    /* 中间「创作」凸起主按钮 */
    .tab.tab-center { flex: 1.15; }
    .tab.tab-center .tab-fab {
      margin-top: -16px;
      width: 48px; height: 48px; border-radius: 50%;
      display: grid; place-items: center;
      background: var(--grad-btn); color: #fff;
      border: 3px solid #101228;
      box-shadow: 0 12px 26px -8px rgba(124, 90, 248, .95);
    }
    .tab.tab-center .tab-fab:active { transform: scale(.94); }
    .tab.tab-center .tab-lb { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; color: #c4b5fd; }

    /* ---------- 「图片」整页（原图片资产弹层内容的平移升级） ---------- */
    .m-page { padding: 4px 14px 0; }
    .msec-head { display: flex; align-items: baseline; gap: 8px; padding: 14px 2px 12px; }
    .msec-head .t { font-size: 18px; font-weight: 700; color: var(--text-strong); }
    .msec-head .cnt { font-size: 12px; color: var(--muted-2); }
    .msec-head .gal-seg { margin-left: auto; align-self: center; }
    .gal-days { font-size: 11.5px; color: var(--muted-2); margin: 12px 2px 8px; }
    .gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .gal-grid .g {
      position: relative; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden;
      background: #12142e; cursor: pointer;
    }
    .gal-grid .g img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .gal-empty {
      text-align: center; color: var(--muted-2); font-size: 13px;
      padding: 56px 0 20px; line-height: 2;
    }

    /* ---------- 「我的」整页：账号 / 算力明细 / 模版 / 退出 归位 ---------- */
    .me-card {
      display: flex; align-items: center; gap: 13px;
      padding: 16px 15px; border-radius: 16px; margin-top: 8px;
      border: 1px solid var(--border); background: var(--surface);
      box-shadow: var(--shadow-soft);
    }
    .me-card .me-ava {
      width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
      display: grid; place-items: center;
      background: var(--grad-primary); color: #fff; font-size: 20px; font-weight: 700;
      box-shadow: 0 10px 24px -8px rgba(124, 90, 248, .8);
    }
    .me-card .me-nm { font-size: 16px; font-weight: 700; color: var(--text-strong); }
    .me-card .me-sub { display: block; font-size: 12px; color: var(--muted-2); margin-top: 3px; }
    .me-quota {
      width: 100%; margin-top: 12px; padding: 15px 16px; border-radius: 16px;
      display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
      border: 1px solid rgba(74, 222, 128, .22);
      background: linear-gradient(135deg, rgba(74, 222, 128, .09), rgba(79, 108, 255, .07));
      font-family: inherit;
    }
    .me-quota .q-num { font-size: 26px; font-weight: 800; color: #4ade80; font-family: "SF Mono", Menlo, monospace; }
    .me-quota .q-lab { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
    .me-quota .q-go { margin-left: auto; font-size: 16px; color: #c4b5fd; }
    .me-list { margin-top: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
    .me-row {
      width: 100%; display: flex; align-items: center; gap: 12px;
      padding: 14px 15px; text-align: left; font-size: 14px; cursor: pointer;
      background: none; border: none; border-bottom: 1px solid var(--border);
      color: var(--text); font-family: inherit;
    }
    .me-row:last-child { border-bottom: none; }
    .me-row .ico {
      width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
      display: grid; place-items: center;
      background: rgba(139, 92, 246, .14); color: #a78bfa;
    }
    .me-row .arr { margin-left: auto; color: var(--muted-2); font-size: 15px; }
    .me-logout {
      width: 100%; margin-top: 16px; padding: 13px; border-radius: 13px; cursor: pointer;
      border: 1px solid rgba(251, 113, 133, .3); color: #fb7185;
      font-size: 14px; font-weight: 600; background: rgba(251, 113, 133, .06);
      font-family: inherit;
    }
  }

  /* 详细提示词 · 底部弹层（80% 高） */
  .quick-mask {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 998;
    background: rgba(5,6,16,.72);
    opacity: 0; visibility: hidden;
    transition: opacity .25s;
  }
  .quick-mask.show { opacity: 1; visibility: visible; }
  .quick-panel {
    position: fixed; bottom: 0; z-index: 999;
    left: 50%;
    max-width: 760px;
    width: calc(100% - 32px);
    height: 80vh;
    background: rgba(20,18,40,.96);
    border: 1px solid var(--border-strong);
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    transform: translateX(-50%) translateY(100%);
    transition: transform .32s cubic-bezier(.2,.8,.2,1);
    display: flex; flex-direction: column;
    box-shadow: 0 -20px 60px -20px rgba(0,0,0,.7);
    overflow: hidden;
  }
  .quick-panel.show { transform: translateX(-50%) translateY(0); }
  .quick-panel .qp-head {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
  }
  .quick-panel .qp-head .qp-title { font-size: 15px; font-weight: 500; color: var(--text); flex: 1; }
  .quick-panel .qp-head .qp-count { font-size: 12px; color: var(--muted-2); }
  .quick-panel textarea {
    flex: 1;
    width: auto;             /* 覆盖全局 textarea 的 width:100%，否则与左右 22px 外边距叠加、右侧溢出被裁 */
    margin: 14px 22px;
    min-height: 0;
    resize: none;
    background: var(--surface-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
  }
  .quick-panel textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
  .quick-panel .qp-foot {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 22px 22px;
  }
  .quick-panel .qp-foot .btn { flex: 1; }
  .quick-panel .qp-foot .btn.primary { flex: 1.6; }

  /* ---------- 头部用户态（账号中心登录后显示） ---------- */
  .head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .user-area { display: flex; align-items: center; }
  .user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 5px 6px 5px 8px;
    box-shadow: var(--shadow-soft);
  }
  .u-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--grad-primary);
    color: #fff; font-size: 13px; font-weight: 700;
  }
  .u-name { font-size: 13px; color: var(--text); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .u-quota {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 8px; font-size: 12px; font-weight: 600;
    border-radius: var(--radius-pill); white-space: nowrap;
    color: #4ade80;
    background: rgba(74,222,128,.1);
    border: 1px solid rgba(74,222,128,.28);
  }
  .u-quota.low { color: #fbbf24; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); }
  .u-quota.empty { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); }
  .u-quota.clickable { transition: box-shadow .15s, transform .12s; }
  .u-quota.clickable:hover { box-shadow: 0 0 0 3px rgba(139,92,246,.18); transform: translateY(-1px); }

  /* ---------- 算力消耗明细弹窗 ---------- */
  .quota-ledger { display: flex; flex-direction: column; gap: 10px; }
  .quota-ledger .q-item {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color .15s;
  }
  .quota-ledger .q-item:hover { border-color: var(--border-strong); }
  .quota-ledger .q-l { flex: 1; min-width: 0; }
  .quota-ledger .q-reason { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
  .quota-ledger .q-note { font-size: 11.5px; font-weight: 400; color: var(--muted-2); margin-left: 8px; }
  .quota-ledger .q-time { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; font-family: "SF Mono", Menlo, monospace; }
  .quota-ledger .q-r { text-align: right; flex-shrink: 0; }
  .quota-ledger .q-delta { font-family: "SF Mono", Menlo, monospace; font-weight: 700; font-size: 14px; }
  .quota-ledger .q-delta.in { color: #4ade80; }
  .quota-ledger .q-delta.out { color: #fb7185; }
  .quota-ledger .q-bal { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; font-family: "SF Mono", Menlo, monospace; }
  .btn.logout { padding: 5px 10px; font-size: 12px; background: transparent; border-color: var(--border); color: var(--muted-2); }
  .btn.logout:hover { color: var(--red); border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.08); }

  /* ---------- 生成结果动态通知（顶部滑入卡，8s 自动消失，双端通用） ---------- */
  #notifyWrap {
    position: fixed; top: 10px; left: 12px; right: 12px; z-index: 970;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
  }
  .gen-notify {
    pointer-events: auto; width: 100%; max-width: 460px;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(24,28,54,.97), rgba(15,17,38,.97));
    border: 1px solid rgba(74,222,128,.35);
    box-shadow: 0 18px 44px -14px rgba(0,0,0,.8), 0 6px 22px -8px rgba(74,222,128,.4);
    position: relative; overflow: hidden;
    animation: gnIn .45s cubic-bezier(.2,.9,.25,1.2);
  }
  .gen-notify.bad {
    border-color: rgba(251,113,133,.4);
    box-shadow: 0 18px 44px -14px rgba(0,0,0,.8), 0 6px 22px -8px rgba(251,113,133,.35);
  }
  @keyframes gnIn {
    0% { opacity: 0; transform: translateY(-110%) scale(.96); }
    70% { transform: translateY(4px); }
    100% { opacity: 1; transform: none; }
  }
  .gen-notify .gn-thumb {
    width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
    object-fit: cover; background: #12142e;
    animation: gnThumb .5s .15s cubic-bezier(.2,.9,.3,1.3) backwards;
  }
  @keyframes gnThumb { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
  .gen-notify .gn-ico {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 20px;
    background: rgba(74,222,128,.14); color: var(--green);
  }
  .gen-notify.bad .gn-ico { background: rgba(251,113,133,.14); color: #fb7185; }
  .gen-notify .gn-txt { flex: 1; min-width: 0; }
  .gen-notify .gn-t { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-strong); }
  .gen-notify .gn-d {
    display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .gen-notify .gn-go {
    flex-shrink: 0; padding: 7px 13px; border-radius: 999px;
    font-size: 12px; font-weight: 700; color: #fff;
    background: var(--grad-btn); border: none; cursor: pointer; font-family: inherit;
  }
  .gen-notify.bad .gn-go { background: rgba(251,113,133,.16); color: #fb7185; }
  .gen-notify .gn-bar {
    position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%;
    /* 曾写成 var(--grad) —— :root 里从来没定义过这个变量，声明整体失效、进度条透明
       （失败卡另有 .bad 的独立背景，所以只有成功卡缺条）。改用已定义的 --grad-btn */
    background: var(--grad-btn); transform-origin: left;
    animation: gnBar 8s linear forwards;
  }
  .gen-notify.bad .gn-bar { background: linear-gradient(90deg, #fb7185, #f43f5e); }
  @keyframes gnBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

  /* ---------- 生成中横幅（方案 A：有任务在跑时显示） ---------- */
  /* 不吸顶。原先 position:sticky + top:58px 会让它停在顶栏下方，
     后面滚上来的内容被它盖住（首页「今天想做什么图？」标题被压掉一半就是这个）。
     回到文档流后它固定在顶栏正下方，随页面一起滚走，不遮挡任何内容。 */
  .gnb-banner {
    /* position:relative 不可省：.gnb-shim 是绝对定位的流光条，必须让横幅成为它的
       包含块，下面那句 overflow:hidden 才裁得住它。漏掉这行时流光条会以「初始包含块」
       为参考系（html/body 都没有定位），width:60% + translateX(320%) 直接把页面撑宽
       → 生成期间底部冒出横向滚动条、来回变长变短（2026-09-23 修）。 */
    position: relative;
    margin: 12px 0 0; padding: 10px 12px 12px;
    border-radius: 14px; overflow: hidden;
    display: flex; gap: 10px; align-items: center;
    background: linear-gradient(135deg, rgba(124,90,248,.26), rgba(79,108,255,.2));
    border: 1px solid rgba(139,92,246,.6);
    animation: gnbGlow 1.8s ease-in-out infinite;
  }
  @keyframes gnbGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,0);} 50% { box-shadow: 0 0 22px -2px rgba(139,92,246,.65);} }
  .gnb-sp { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(196,181,253,.3); border-top-color: #c4b5fd; animation: gnbSpin 1s linear infinite; flex-shrink: 0; }
  @keyframes gnbSpin { to { transform: rotate(360deg); } }
  .gnb-tx { flex: 1; min-width: 0; }
  .gnb-tx b { font-size: 15px; color: var(--text-strong); }
  .gnb-tx .gnb-sub { display: block; font-size: 12px; color: #b9aefc; margin-top: 3px; }
  .gnb-go { font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(255,255,255,.16); border-radius: 999px; padding: 7px 15px; border: none; cursor: pointer; font-family: inherit; flex-shrink: 0; }
  .gnb-go:active { transform: scale(.96); }
  .gnb-shim { position: absolute; bottom: 0; left: 0; height: 3px; width: 60%;
    background: linear-gradient(90deg, transparent, #a78bfa, transparent); animation: gnbShim 1.1s linear infinite; }
  @keyframes gnbShim { from { transform: translateX(-120%);} to { transform: translateX(320%);} }
  /* 手机端：横幅在顶栏下方，不再吸顶（原 top:58px 的吸顶定位已随 position 一起移除） */
  @media (max-width: 600px) {
    .gnb-banner { margin: 10px 0 0; }
  }

  /* ---------- 账号中心登录门（Task 10） ---------- */
  .login-overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background:
      radial-gradient(1000px 700px at 15% -5%, rgba(124,90,248,.22), transparent 60%),
      radial-gradient(900px 700px at 105% 10%, rgba(79,108,255,.18), transparent 55%),
      linear-gradient(160deg, #101334 0%, #0d1029 45%, #0a0a1e 100%);
    padding: 20px;
  }
  .login-card {
    width: min(400px, 100%);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    padding: 36px 34px 26px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    animation: loginPop .35s cubic-bezier(.2,.9,.3,1.15);
  }
  @keyframes loginPop {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: none; }
  }
  .login-brand { display: flex; justify-content: center; margin-bottom: 18px; }
  /* 登录卡 Logo：Lottie 动画容器（替换原 conic-gradient 圆形图标） */
  .login-logo {
    width: 116px; height: 116px;
    position: relative;
    display: block;
    line-height: 0;
  }
  .login-logo svg {
    width: 100% !important;
    height: 100% !important;
  }
  .login-card h2 { text-align: center; font-size: 20px; letter-spacing: -.2px; color: var(--text-strong); }
  .login-sub { text-align: center; font-size: 12.5px; color: var(--muted-2); margin: 6px 0 22px; }
  .login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .login-field label { font-size: 13px; color: var(--muted); }
  .login-err {
    background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.35);
    color: #fda4af; font-size: 13px; border-radius: var(--radius-sm);
    padding: 9px 12px; margin-bottom: 14px;
  }
  .login-opt { display: flex; align-items: center; justify-content: flex-end; margin: -4px 0 16px; }
  .login-opt .remember { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted-2); cursor: pointer; user-select: none; }
  .login-opt input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
  .login-btn { width: 100%; padding: 12px; font-size: 15px; }
  .login-btn.loading { opacity: .6; pointer-events: none; }
  .login-foot { text-align: center; font-size: 11.5px; color: var(--muted-2); margin-top: 16px; }
  /* 登录按钮下方的注册入口：跳益康账号中心注册页。
     用同页跳转而不是 target="_blank" —— 微信内置浏览器对 _blank 行为不一致，
     而且注册完本来就要回到这里登录，同页跳更符合预期 */
  .login-reg { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--muted-2); }
  .login-reg .reg-link { color: var(--accent-3); font-weight: 600; text-decoration: none; }
  .login-reg .reg-link:hover { color: #c4b5fd; text-decoration: underline; }

  /* ============================================================
   * 触屏设备（无 hover）：把「只在 :hover 出现」的按钮改为常显
   * 2026-09-23 静态审查发现：.thumb .rm 与 .ppl-photo .ph-x 都靠 :hover 显隐 ——
   * 手机/平板上既看不到按钮，又因为 opacity:0 不影响命中测试而会被误触
   * （点照片右上角静默清空照片）。热区同时补到接近拇指尺寸。
   * 条件写 (hover:none) ∪ (max-width:600px)：前者覆盖平板这类宽屏触屏设备，
   * 后者覆盖窄窗口的鼠标环境，两种情形表现一致。
   * ============================================================ */
  @media (hover: none), (max-width: 600px) {
    /* 参考图缩略图 58×58：×常显，热区 18→28。
       热区会被 .thumb 的 overflow:hidden 裁切在缩略图内，不会侵入「点图看原图」的中间区域 */
    .thumb .rm { display: flex; width: 20px; height: 20px; font-size: 12px; }
    .thumb .rm::before { content: ""; position: absolute; top: -5px; right: -5px; bottom: -5px; left: -5px; }
    /* 人物照片 46×46：×常显，热区只向外扩 4px 且不越出照片框，
       避免碰到紧邻的姓名输入框造成新的误触 */
    .ppl-photo.filled .ph-x { opacity: 1; width: 18px; height: 18px; font-size: 11px; }
    .ppl-photo.filled .ph-x::before { content: ""; position: absolute; top: -4px; right: -4px; bottom: -4px; left: -4px; }
    /* 删除类按钮补足热区（相邻元素只有文字，外扩安全） */
    .ppl-del { width: 32px; height: 32px; }
    .sp-x { width: 30px; height: 30px; }
    .ap-close { width: 36px; height: 36px; }
    /* 触屏点一次会把 :hover 粘住不还原，装饰性位移一律禁用 */
    .asset-tile:hover { transform: none; }
  }

  /* ============================================================
   * 真机预览 / 桌面视图切换（2026-10-16）
   * 桌面浏览器专属：点左下角按钮把页面装进「手机壳」里看（iframe 真机视口预览）。
   * 壳的口径对齐对口型项目的「手机机身框」：浅紫渐变底 + 黑边圆角机身。
   * ⚠ 手机（≤600px）上不需要：入口隐藏；预览中途缩窗口由 JS 自动退出。
   * ============================================================ */
  .view-switch {
    position: fixed;
    left: 18px;
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
    z-index: 950;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: rgba(28, 26, 52, .88);
    color: #c4b5fd;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform .18s, border-color .18s, background .18s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .view-switch:hover { transform: translateY(-2px); border-color: rgba(150, 130, 255, .62); background: rgba(36, 33, 66, .95); }
  .view-switch:active { transform: translateY(0); }
  .view-switch .vs-ico { display: inline-flex; align-items: center; }

  /* 预览覆盖层：浅紫渐变底 + 手机机身框，iframe 即真机视口（393px） */
  .dev-preview {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #e3e6f7 0%, #f2f0fb 50%, #e8e4f8 100%);
  }
  .dev-preview.show { display: flex; animation: devFade .24s cubic-bezier(.2, .8, .2, 1); }
  @keyframes devFade { from { opacity: 0; } to { opacity: 1; } }
  .dev-frame {
    width: 393px;
    height: calc(100dvh - 48px);
    min-height: 560px;
    max-height: 852px;
    border-radius: 42px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 30px 80px rgba(40, 34, 100, .25), 0 0 0 10px #17171f, 0 0 0 12px #3a3a48;
  }
  .dev-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #0a0c1c; }
  .dev-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1501;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(40, 34, 100, .22);
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #3c3489;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px -10px rgba(40, 34, 100, .35);
    transition: transform .15s, background .15s;
  }
  .dev-close:hover { transform: translateY(-1px); background: #fff; }
  @media (max-width: 600px) {
    .view-switch { display: none !important; }
  }

  /* ---------- 自绘下拉（ui-select.js 增强器） ----------
     触发器外观照抄 281-299 行的 select 基座，单击后的浮层面板挂 body 下。
     ⚠ 三处特例（.tier-select / .pt-tpl / .ftp-params）集中在本段照抄原值 ——
       与既有段落的特异性/顺序依赖全部收敛在这一段里，日后好维护。 */
  .ui-sel {
    display: block;
    width: 100%;
    background-color: var(--surface-deep);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a6abc9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 40px 11px 14px;
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .2s, box-shadow .2s;
  }
  .ui-sel .v { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ui-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
  .ui-sel:disabled { opacity: .5; cursor: not-allowed; }

  /* 特例：照抄各处既有 select 值（连宽度策略一起） */
  .tier-select.ui-sel {
    width: auto;
    min-width: 118px;
    padding: 8px 34px 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-pill);
  }
  .pt-tpl .ui-sel {
    width: auto;
    min-width: 156px;
    max-width: 260px;
    padding: 8px 34px 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-pill);
  }
  .ftp-params .ui-sel {
    width: 100%; box-sizing: border-box;
    background-color: rgba(255,255,255,.045);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 9px 30px 9px 12px;
    color: var(--text-strong); font-size: 13px;
    transition: border-color .15s;
  }
  .ftp-params .ui-sel:focus { border-color: var(--accent); box-shadow: none; }

  /* 浮层（挂 body 下，避免被任何 overflow:hidden 容器裁剪） */
  .uis-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1600; display: none; }
  .uis-layer.show { display: block; animation: uisFade .18s ease-out; }
  .uis-panel {
    position: fixed;
    display: flex; flex-direction: column;
    background: rgba(28, 26, 52, .98);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 26px 60px -18px rgba(0, 0, 0, .8);
    padding: 6px;
    animation: uisPanel .2s cubic-bezier(.2, .8, .2, 1);
  }
  .uis-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .uis-head { display: none; }
  .uis-opt {
    display: flex; align-items: center; gap: 8px;
    width: 100%; height: 36px; padding: 0 12px;
    background: transparent; border: 0; border-radius: 8px;
    color: var(--text); font-size: 13.5px; font-family: inherit; text-align: left;
    cursor: pointer;
    transition: background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none; user-select: none;
  }
  .uis-opt:hover { background: rgba(255, 255, 255, .06); }
  .uis-opt:disabled { opacity: .4; cursor: not-allowed; }
  .uis-opt:disabled:hover { background: transparent; }
  .uis-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .uis-opt .tx { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .uis-opt.on { background: rgba(139, 92, 246, .16); color: var(--text-strong); font-weight: 600; }
  .uis-opt.on::after {
    content: ''; flex: 0 0 auto; width: 14px; height: 14px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
  }
  /* 分组：整组（标题 + 选项）用一个浅色容器「框住」，未分组的裸选项直接排在框外 */
  .uis-grp {
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 10px;
    padding: 2px 4px 4px;
    margin-top: 8px;
  }
  .uis-list > .uis-grp:first-child { margin-top: 0; }
  .uis-lab {
    display: flex; align-items: center;
    height: 28px; padding: 0 8px;
    font-size: 12.5px; font-weight: 600; color: var(--accent-3);
    letter-spacing: .3px;
  }

  @keyframes uisFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes uisPanel { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes uisSheet { from { transform: translateY(100%); } to { transform: none; } }

  /* 手机端：底部 sheet（与项目 600px 断点一致；真机预览 iframe 里自动生效） */
  @media (max-width: 600px) {
    .uis-layer.show { background: rgba(6, 8, 20, .62); }
    .uis-panel {
      position: absolute; left: 0; right: 0; bottom: 0;
      max-height: 62vh;
      border-radius: 18px 18px 0 0;
      border-left: 0; border-right: 0; border-bottom: 0;
      padding: 0 8px calc(12px + env(safe-area-inset-bottom));
      animation: uisSheet .26s cubic-bezier(.2, .8, .2, 1);
    }
    .uis-head {
      display: block; padding: 8px 2px 10px; margin-bottom: 4px;
      border-bottom: 1px solid rgba(255, 255, 255, .06);
    }
    .uis-bar { display: block; width: 36px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); margin: 0 auto 10px; }
    .uis-title { display: block; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
    .uis-opt { height: 50px; font-size: 14.5px; border-radius: 10px; }
    .uis-lab { font-size: 13px; }
    .ui-sel { font-size: 13px; }                    /* 照抄手机端 select 字号 */
    .pt-tpl .ui-sel { flex: 1; min-width: 0; }      /* 照抄 .pt-tpl select 手机规则 */
    .tier-select.ui-sel { min-width: 0; padding: 8px 30px 8px 12px; font-size: 12.5px; }  /* 照抄 .tier-select 手机规则 */
  }