/* 原生端由 JS 根据 visualViewport 写入，用于覆盖层/底部 sheet 上顶，避免 IME 挡住输入 */
    @property --kb-vv-inset {
      syntax: '<length>';
      inherits: true;
      initial-value: 0px;
    }
    :root {
      --kb-vv-inset: 0px;
      --kb-pan-extra: 0px;
      /* 由 JS 按 visualViewport.height 写入，供原生壳内与 100dvh 漂移解耦（参考动态 vh 方案） */
      --app-vh: 1vh;
      --vv-offset-top: 0px;
      --vv-offset-left: 0px;
      --vv-layout-width: 100%;
      /* 原生端由 JS 根据 visualViewport 写入，用于覆盖层/底部 sheet 上顶，避免 IME 挡住输入 */
      --brand-grad: linear-gradient(135deg, #2ee6c9 0%, #5b8cff 100%);
      --brand-grad-light: linear-gradient(135deg, #0f766e 0%, #1d4ed8 100%);
    }
    :root { color-scheme: dark; }
    html:has(body.theme-light) {
      color-scheme: light;
    }
    html, body {
      width: 100%;
      height: 100%;
      margin: 0;
      background:#05070D;
    }
    body {
      font-family: 'Inter', 'PingFang SC', system-ui, sans-serif;
      color:#E8ECF2;
      -webkit-font-smoothing: antialiased;
    }
    .no-scrollbar::-webkit-scrollbar { display: none; }
    .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

    /* ====== 舞台 ====== */
    .stage {
      min-height: 100dvh;
      display: flex; align-items: center; justify-content: center;
      padding: 28px 18px;
    }

    /* ====== 设备 ====== */
    .device {
      position: relative; width: 390px; height: 844px;
      border-radius: 56px; padding: 12px;
      background: linear-gradient(160deg, #14181F, #0A0D14);
      box-shadow: 0 40px 90px rgba(0,0,0,0.55), 0 10px 28px rgba(0,0,0,0.35),
                  inset 0 0 0 1px rgba(255,255,255,0.05);
    }
    .device::before {
      content: ""; position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
      width: 120px; height: 30px; border-radius: 18px; background: #05070D;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
      z-index: 50;
    }
    .screen {
      position: relative; height: 100%; width: 100%;
      border-radius: 44px; overflow: hidden;
      background: radial-gradient(120% 80% at 50% -20%, #1B2238 0%, #0B0F1A 50%, #06080F 100%);
    }

    /* ====== 状态条 ====== */
    .statusbar {
      position: absolute; left: 0; right: 0; top: 0; height: 50px;
      display: flex; align-items: center; justify-content: space-between;
      padding: 18px 26px 0 26px; font-size: 13px; color: #C9D1DE; letter-spacing: .04em;
      z-index: 40; pointer-events: none; font-weight: 500;
    }

    /* ====== 页面区：app-shell = main + 底部文档流（避免 absolute 与键盘双补偿）====== */
    .app-shell {
      position: absolute;
      inset: 50px 0 0 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .pages {
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .page {
      display: none;
      animation: fade .25s cubic-bezier(.2,.8,.2,1) both;
    }
    .page.active {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
    }
    .page[data-page="agents"].active {
      display: flex;
      flex-direction: column;
    }
    .page[data-page="agents"].active #agentsDevPlaceholder {
      flex: 1 1 auto;
      min-height: 0;
    }
    .page[data-page="me"].active,
    .page[data-page="kb"].active {
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-x: none;
      touch-action: pan-y;
      max-width: 100%;
      -webkit-overflow-scrolling: touch;
    }
    /* 创作页：勿对整页纵向滚动（否则侧栏开关后易把顶栏「创作台」一起滚上去贴状态栏） */
    .page[data-page="create"].active {
      overflow: hidden;
      overflow-x: hidden;
      overscroll-behavior-y: none;
    }
    .page[data-page="create"].active > .topbar {
      flex: 0 0 auto;
      align-self: stretch;
    }
    .page[data-page="agents"].active.agents-in-chat {
      overflow: hidden;
    }
    /* 智能体对话态：让 agentsChatRoot 占满剩余高度，agentChatThread 在其内滚动 */
    .page[data-page="agents"].active.agents-in-chat #agentsHeadBand {
      flex: 0 0 auto;
    }
    .page[data-page="agents"].active.agents-in-chat #agentsChatRoot {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      position: relative;
    }
    .page[data-page="agents"].active.agents-in-chat #agentChatThread {
      flex: 1 1 auto;
      min-height: 0;
      /* 改为 block 布局（与首页 #homeScroll 一致）：
         flex 布局下 .agent-chat-msgs{flex:1 1 auto} 会把高度压缩到剩余空间，
         导致 scrollHeight === clientHeight，无法滚动。
         改为 block 后，内容自然堆叠，scrollHeight = 真实内容高度，padding-bottom 才能生效。 */
      display: block !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      width: 100%;
      box-sizing: border-box;
    }
    /* 首页：顶栏 + ego 介绍为「头带」，对话/场景为可压缩区（键盘态下头带 fixed 贴顶，参考 Kimi） */
    .page[data-page="home"].active > .home-head-band {
      flex: 0 0 auto;
      flex-shrink: 0;
      align-self: stretch;
      display: flex;
      flex-direction: column;
      min-height: 0;
      position: relative;
      z-index: 16;
    }
    .page[data-page="home"].active > .home-scroll {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .page[data-page="home"].active > .home-scroll > #sceneChips,
    .page[data-page="home"].active > .home-scroll > #sceneModule {
      flex: 0 0 auto;
    }
    .page[data-page="home"].active > .home-scroll > #chatThread {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }
    /* fixed 默认相对「布局视口」；键盘时 WebView 常把视觉视口下移，需用 visualViewport.offset* 贴齐可见区顶边 */
    body.native-app.keyboard-open .page[data-page="home"].active > .home-head-band {
      position: fixed;
      top: var(--vv-offset-top, 0px);
      left: var(--vv-offset-left, 0px);
      right: auto;
      width: var(--vv-layout-width, 100%);
      max-width: 100%;
      z-index: 22;
      background: linear-gradient(180deg, #0b101a 0%, #0a0e18 92%, rgba(10, 14, 24, 0.97) 100%);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    }
    body.native-app.keyboard-open .page[data-page="home"].active > .home-head-band .topbar {
      position: relative;
      top: auto;
    }
    body.theme-light.native-app.keyboard-open .page[data-page="home"].active > .home-head-band {
      background: linear-gradient(180deg, #f4f6fa 0%, #eef2f7 92%, rgba(244, 246, 250, 0.98) 100%);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }
    body.native-app.keyboard-open .page[data-page="home"].active > .home-scroll {
      padding-top: var(--home-head-offset, 168px);
    }
    @keyframes fade { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: translateY(0); } }

    /* ====== 顶栏 ====== */
    .topbar {
      padding: 8px 22px 0 22px;
      display:flex; align-items:center; justify-content:space-between;
      position: sticky;
      top: 0;
      z-index: 12;
    }
    .home-topbar {
      position: relative;
      z-index: 20;
      display: flex;
      align-items: center;
      min-height: 44px;
      padding-bottom: 8px;
    }
    /* 首页顶栏：安全区放在 head-band，顶栏本身保持紧凑，历史按钮不被顶到上方 */
    body.native-app .page[data-page="home"].active > .home-head-band {
      padding-top: max(env(safe-area-inset-top, 0px), 28px);
      box-sizing: border-box;
    }
    body.native-app .page[data-page="home"].active .home-topbar {
      padding-top: 4px !important;
      padding-bottom: 8px !important;
      min-height: 42px !important;
      align-items: center !important;
    }
    body.native-app.keyboard-open .page[data-page="home"].active > .home-head-band {
      padding-top: max(env(safe-area-inset-top, 0px), 8px) !important;
    }
    body.native-app.keyboard-open .page[data-page="home"].active > .home-head-band .home-topbar {
      padding-top: 6px !important;
      padding-bottom: 6px !important;
      min-height: 40px !important;
    }
    .page[data-page="home"].active .home-hist-robot-btn {
      align-self: center !important;
      margin-top: 0 !important;
      transform: none !important;
    }
    .home-hist-robot-btn .robot-figure,
    .home-hist-robot-figure.robot-figure {
      width: 28px !important;
      height: 26px !important;
      min-height: 0 !important;
      max-height: 28px !important;
      flex: 0 0 auto !important;
      display: block !important;
    }
    .home-ego-picker-slot {
      flex: 1;
      min-width: 0;
      display: flex;
      justify-content: flex-start;
      align-items: center;
    }
    .home-ego-picker-trigger {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      max-width: 100%;
      border: none;
      background: transparent;
      padding: 4px 8px;
      margin: 0;
      font-family: 'Noto Serif SC', serif;
      font-size: 17px;
      font-weight: 600;
      line-height: 1.25;
      color: #e8ecf2;
      letter-spacing: 0.02em;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .home-ego-picker-trigger[aria-expanded="true"] .home-ego-picker-chev {
      transform: rotate(180deg);
    }
    .home-ego-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .home-ego-ver {
      flex-shrink: 0;
      margin-left: 4px;
      font-size: 10px;
      font-weight: 400;
      letter-spacing: 0.02em;
      opacity: 0.65;
      align-self: center;
    }
    .home-ego-picker-chev {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      opacity: 0.55;
      transition: transform 0.2s ease;
    }
    .home-ego-picker-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 28;
      background: rgba(0, 0, 0, 0.18);
      pointer-events: none;
    }
    .home-ego-picker-backdrop.show {
      display: block;
      pointer-events: auto;
    }
    .home-ego-picker-menu {
      display: none;
      position: fixed;
      z-index: 29;
      left: 16px;
      transform: none;
      width: min(320px, calc(100vw - 32px));
      padding: 8px;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: #1a2030;
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    }
    .home-ego-picker-menu.show { display: block; }
    .home-ego-mode-opt {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      padding: 12px 12px;
      border: none;
      border-radius: 12px;
      background: transparent;
      text-align: left;
      cursor: pointer;
      color: #e8ecf2;
    }
    .home-ego-mode-opt:active,
    .home-ego-mode-opt.on { background: rgba(91, 140, 255, 0.12); }
    .home-ego-mode-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
    .home-ego-mode-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: #f1f5f9; }
    .home-ego-mode-desc { font-size: 12px; line-height: 1.45; color: #94a3b8; font-weight: 400; }
    .home-ego-mode-check {
      flex-shrink: 0;
      margin-top: 2px;
      color: #5b8cff;
      display: none;
    }
    .home-ego-mode-opt.on .home-ego-mode-check { display: block; }
    body.theme-light .home-ego-picker-trigger { color: #0f172a; }
    body.theme-light .home-ego-picker-menu {
      background: #ffffff;
      border-color: rgba(15, 23, 42, 0.1);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    }
    body.theme-light .home-ego-mode-opt { color: #0f172a; }
    body.theme-light .home-ego-mode-opt:active,
    body.theme-light .home-ego-mode-opt.on { background: rgba(91, 140, 255, 0.08); }
    body.theme-light .home-ego-mode-title { color: #0f172a; }
    body.theme-light .home-ego-mode-desc { color: #64748b; }
    .topbar .greeting {
      font-family: 'Noto Serif SC', serif;
      font-size: 18px; font-weight: 500;
      color:#E8ECF2; letter-spacing: .02em;
    }
    .topbar .iconbtn {
      width: 34px; height: 34px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#9AA3B2;
    }
    .topbar .iconbtn:active { background: rgba(255,255,255,0.04); }
    .agent-bubble {
      width: 32px; height: 32px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      font-family: 'Noto Serif SC', serif; font-size: 13px; color:#06121E;
      background: var(--brand-grad);
    }

    /* ====== 场景 chips ====== */
    .chips-bar {
      display:flex; align-items:center; gap: 6px;
      padding: 14px 22px 0 22px;
    }
    .chips-bar .chips {
      flex: 1; display:flex; gap: 6px;
      overflow-x: auto;
    }
    .chip {
      flex: 0 0 auto;
      padding: 7px 12px;
      font-size: 13px; color:#9AA3B2;
      border-radius: 999px;
      background: transparent;
      transition: color .2s, background .2s;
      white-space: nowrap;
    }
    .chip.on {
      color:#E8ECF2;
      background: rgba(255,255,255,0.06);
    }
    .chip-edit {
      flex: 0 0 auto;
      width: 30px; height: 30px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#6B7585; background: rgba(255,255,255,0.03);
    }

    /* ====== 通用：标题、行 ====== */
    .h-display {
      font-family: 'Noto Serif SC', serif;
      font-weight: 500; font-size: 26px; line-height: 1.25;
      color:#E8ECF2; letter-spacing: .01em;
    }
    .h-section {
      font-size: 12px; color:#6B7585; letter-spacing: .02em;
      text-transform: none; font-weight: 500;
    }
    .row {
      display:flex; align-items:center; gap: 10px;
      padding: 12px 0;
      border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .row:last-child { border-bottom: none; }
    .row .ttl { color:#E8ECF2; font-size: 14px; flex: 1; min-width: 0; }
    .row .ttl .truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .row .meta { color:#6B7585; font-size: 11.5px; }
    .row .lead {
      width: 28px; height: 28px; border-radius: 8px;
      display:flex; align-items:center; justify-content:center;
      color:#9AA3B2; flex: 0 0 28px;
    }

    /* 建议胶囊（日常） */
    .pill {
      display:flex; align-items:center; gap: 8px;
      padding: 11px 14px; border-radius: 14px;
      background: rgba(255,255,255,0.04);
      color:#E8ECF2; font-size: 13px;
      text-align: left;
      border: 1px solid rgba(255,255,255,0.05);
      transition: background .2s;
    }
    .pill:active { background: rgba(255,255,255,0.07); }
    .pill .ic-emoji { font-size: 15px; }

    /* 大块（多模态） */
    .big-tile {
      display:flex; flex-direction:column; align-items:center; justify-content:center;
      gap: 6px; padding: 18px 8px; border-radius: 16px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
      color:#E8ECF2; font-size: 12.5px;
    }
    .big-tile i { color:#9AA3B2; }
    .big-tile.accent { background: linear-gradient(180deg, rgba(46,230,201,0.10), rgba(91,140,255,0.06)); border-color: rgba(46,230,201,0.20); }
    .big-tile.accent i { color:#2EE6C9; }

    /* dropzone锛堟枃妗ｏ級 */
    .dropzone {
      width: 100%; padding: 22px 14px; border-radius: 16px;
      background: rgba(255,255,255,0.025);
      border: 1.5px dashed rgba(255,255,255,0.14);
      color:#E8ECF2; font-size: 14px;
      display:flex; flex-direction:column; align-items:center; gap: 8px;
    }
    .dropzone i { color:#5B8CFF; }
    .dropzone .sub { color:#6B7585; font-size: 11.5px; }

    .ghost-btn {
      padding: 11px 14px; border-radius: 12px;
      background: rgba(255,255,255,0.03);
      color:#E8ECF2; font-size: 13px;
      border: 1px solid rgba(255,255,255,0.05);
      display:flex; align-items:center; justify-content:center; gap: 6px;
    }
    .ghost-btn i { color:#9AA3B2; }

    /* 缂栫▼ */
    .code-h {
      font-family: 'JetBrains Mono', monospace;
      font-size: 22px; color:#E8ECF2; font-weight: 500;
    }
    .code-h .prompt { color:#3DD68C; }
    .code-h .caret {
      display:inline-block; width: 8px; height: 18px;
      background:#3DD68C; vertical-align: -2px; margin-left: 2px;
      animation: blink 1.1s infinite;
    }
    @keyframes blink { 50% { opacity: 0; } }
    .mono-row {
      font-family: 'JetBrains Mono', monospace;
      font-size: 12.5px; color:#E8ECF2;
    }
    .mono-meta {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px; color:#6B7585;
    }

    /* 鍖荤枟 */
    .med-tile {
      display:flex; flex-direction:column; gap: 4px;
      padding: 14px; border-radius: 16px;
      background: linear-gradient(180deg, rgba(91,208,199,0.08), rgba(91,208,199,0.02));
      border: 1px solid rgba(91,208,199,0.16);
      text-align: left;
    }
    .med-tile .t { color:#E8ECF2; font-size: 13.5px; }
    .med-tile .s { color:#9AA3B2; font-size: 11.5px; }
    .med-tile .ic-wrap {
      width: 28px; height: 28px; border-radius: 8px;
      display:flex; align-items:center; justify-content:center;
      background: rgba(91,208,199,0.15); color:#5BD0C7; margin-bottom: 4px;
    }

    /* 濞变箰 */
    .fun-tile {
      padding: 16px; border-radius: 18px;
      background: linear-gradient(135deg, rgba(196,155,255,0.18), rgba(255,110,138,0.10));
      border: 1px solid rgba(196,155,255,0.22);
      color:#E8ECF2; font-size: 14px; text-align: left;
      display:flex; flex-direction:column; gap: 4px;
    }
    .fun-tile .s { color: rgba(232,236,242,0.7); font-size: 11.5px; }

    /* ====== 底部 rail：composer + tabbar 文档流 ====== */
    .bottom-rail {
      flex: 0 0 auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 0 12px 12px;
      padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      z-index: 44;
    }
    /* APK：WebView 已贴边时勿再叠加 12px，否则 Tab 栏整体离系统底栏一大块空白（见 native-app-boot 同上） */
    /* APK：WebView 已贴边时勿再叠加 12px，否则 Tab 栏整体离系统底栏一大块空白（见 native-app-boot 同上） */
    .composer {
      position: relative;
      left: auto;
      right: auto;
      bottom: auto;
      width: 100%;
      min-height: 44px;
      border-radius: 18px;
      background: rgba(20,26,40,0.96);
      border: 1px solid rgba(255,255,255,0.08);
      display: flex;
      align-items: center;
      padding: 4px 6px 4px 10px;
      gap: 8px;
      flex-shrink: 0;
      box-sizing: border-box;
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
    }
    .composer .composer-input {
      flex: 1 1 auto;
      min-width: 0;
      background: transparent;
      outline: none;
      color: #E8ECF2;
      font-size: 16px;
      line-height: 1.3;
      padding: 2px 4px;
      border: none;
      resize: none;
      min-height: 22px;
      max-height: 96px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .composer-input:focus::placeholder,
    .name-input:focus::placeholder {
      color: transparent;
    }
    .composer .ico {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #9AA3B2;
    }
    .composer .stop {
      display: none;
      color: #FF6E8A;
      border: 1px solid rgba(255,110,138,0.35);
      background: rgba(255,110,138,0.10);
    }
    .composer.sending .stop { display: flex; }
    .composer.sending #composerSend,
    .composer.sending #composerMic,
    .composer.sending #composerKbBtn,
    .composer.sending #composerInsertBtn { display: none; }
    .bottom-rail:has(.composer.sending) .composer-deep-row { display: none !important; }
    /* 深度思考：紧贴输入条上方、在 composer 外 */
    .composer-deep-row {
      display: none;
      padding: 0 4px 2px;
      flex-shrink: 0;
    }
    .composer-deep-row.show { display: block; }
    .composer-attach-bar {
      display: none;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      padding: 0 4px 4px;
      flex-shrink: 0;
    }
    .composer-attach-bar.show { display: flex; }
    .composer-attach-bar .composer-attach-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      max-width: 100%;
      padding: 4px 8px 4px 6px;
      border-radius: 999px;
      font-size: 11px;
      color: #C5CDD9;
      background: rgba(91,140,255,0.12);
      border: 1px solid rgba(91,140,255,0.28);
    }
    .composer-attach-bar .composer-attach-chip button {
      color: #6B7585;
      padding: 0 2px;
      line-height: 1;
    }
    body.theme-light .composer-attach-bar .composer-attach-chip {
      background: rgba(91,140,255,0.10);
      border-color: rgba(91,140,255,0.22);
      color: #334155;
    }
    .composer-attach-chip--thumb {
      position: relative;
      padding: 0;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(0, 0, 0, 0.25);
    }
    body.theme-light .composer-attach-chip--thumb {
      border-color: rgba(15, 23, 42, 0.12);
      background: #e2e8f0;
    }
    .composer-attach-thumb {
      display: block;
      width: 56px;
      height: 56px;
      object-fit: cover;
      border-radius: 10px;
    }
    .composer-attach-thumb-rm {
      position: absolute;
      top: 2px;
      right: 2px;
      width: 22px;
      height: 22px;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      border: none;
      background: rgba(0, 0, 0, 0.55);
      color: #fff;
      line-height: 1;
    }
    body.theme-light .composer-attach-thumb-rm {
      background: rgba(15, 23, 42, 0.65);
    }
    .chat-msg-refs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 6px;
    }
    .chat-msg-ref-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 10.5px;
      color: #9AA3B2;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
    }
    .chat-msg-ref-thumb {
      display: block;
      max-width: min(72vw, 220px);
      max-height: 140px;
      border-radius: 10px;
      margin-bottom: 6px;
      object-fit: cover;
      border: 1px solid rgba(255,255,255,0.12);
    }
    body.theme-light .chat-msg-ref-chip {
      color: #475569;
      background: rgba(91,140,255,0.08);
      border-color: rgba(91,140,255,0.18);
    }
    .composer-deep-toggle {
      display: inline-flex;
      align-items: center;
      border: 1px solid rgba(255,255,255,0.10);
      background: rgba(255,255,255,0.04);
      padding: 5px 12px;
      font-size: 12px;
      line-height: 1.3;
      color: #9AA3B2;
      border-radius: 999px;
      cursor: pointer;
    }
    .composer-deep-toggle.on {
      color: #2EE6C9;
      border-color: rgba(46,230,201,0.40);
      background: rgba(46,230,201,0.12);
    }
    .composer .ico.kb-entry-ico {
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
    }
    .composer .ico.kb-entry-ico.on {
      color: #2EE6C9;
      border-color: rgba(46,230,201,0.45);
      background: rgba(46,230,201,0.12);
    }
    .composer .ico.kb-entry-ico .kb-count {
      position: absolute;
      top: -4px;
      right: -4px;
      min-width: 16px;
      height: 16px;
      padding: 0 4px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 600;
      display: none;
      align-items: center;
      justify-content: center;
      background: #2EE6C9;
      color: #06121E;
    }
    .composer .ico.kb-entry-ico.on .kb-count { display: flex; }
    .composer .ico.kb-entry-ico.disabled {
      opacity: 0.42;
      pointer-events: auto;
    }
    .composer .mic {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #9AA3B2;
      background: transparent;
      border: none;
      box-shadow: none;
    }
    body.theme-light .composer .mic { color: #64748B; }
    .composer.mono .composer-input { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

    /* ====== 首页对话消息（高度由父级 flex 分配，不写死 max-height）====== */
    .chat-thread {
      margin-top: 4px;
      min-height: 0;
      overflow-y: auto;
      overflow-x: hidden;
      overscroll-behavior-x: none;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
      padding: 0 16px 12px;
      scroll-padding-bottom: 12px;
    }
    .home-hero { padding-top: 2px; }
    .scene-strip {
      display: flex; gap: 6px; overflow-x: auto;
      padding: 0 20px 8px;
      -webkit-overflow-scrolling: touch;
    }
    .scene-strip button {
      flex: 0 0 auto;
      padding: 6px 12px;
      font-size: 12px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
      color: #9AA3B2;
    }
    .scene-strip button.on {
      color: #E8ECF2;
      background: rgba(91,140,255,0.16);
      border-color: rgba(91,140,255,0.35);
    }
    body.theme-light .scene-strip button { color: #64748B; border-color: rgba(15,23,42,0.08); background: rgba(15,23,42,0.03); }
    body.theme-light .scene-strip button.on { color: #0F172A; background: rgba(14,165,160,0.12); border-color: rgba(14,165,160,0.28); }
    .create-wrap { padding: 8px 20px 0; }
    .create-title { font-family: 'Noto Serif SC', serif; font-size: 22px; color:#E8ECF2; }
    .create-sub { font-size: 12px; color:#9AA3B2; margin-top: 4px; }
    .create-group { margin-top: 14px; }
    .create-group .label { font-size: 11px; color:#6B7585; letter-spacing:.08em; text-transform: uppercase; margin-bottom: 8px; }
    .create-chips { display:flex; flex-wrap:wrap; gap:8px; }
    .create-chip {
      padding: 6px 12px; border-radius: 999px; font-size: 12px;
      border:1px solid rgba(255,255,255,0.1); color:#A8B1C1; background: rgba(255,255,255,0.03);
    }
    .create-chip.on { color:#E8ECF2; border-color: rgba(91,140,255,0.35); background: rgba(91,140,255,0.16); }
    .create-cards { display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin-top: 10px; }
    .create-card {
      text-align:left; padding:10px 11px; border-radius: 14px; border:1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.03); color:#E8ECF2;
    }
    .create-card .t { font-size: 13px; margin-bottom: 2px; }
    .create-card .s { font-size: 11px; color:#8D97A9; line-height: 1.35; }
    .composer-attach-wrap {
      position: relative;
      flex: 0 0 auto;
      display: flex;
      align-items: center;
    }
    .attach-menu {
      position: absolute;
      left: 0;
      bottom: calc(100% + 8px);
      z-index: 80;
      display: none;
      min-width: 156px;
      background: rgba(9,14,24,0.97);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      padding: 6px;
      box-shadow: 0 12px 30px rgba(0,0,0,0.35);
      pointer-events: auto;
    }
    .attach-menu.show { display: block; }
    .attach-menu button {
      width: 100%;
      text-align: left;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      border-radius: 10px;
      color: #E8ECF2;
      font-size: 12.5px;
      touch-action: manipulation;
    }
    .attach-menu button:active { background: rgba(255,255,255,0.08); }
    .agent-pick-card {
      width: 100%; text-align:left; border-radius: 16px; border:1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.03); padding: 10px 10px 10px 12px; margin-bottom: 8px;
    }
    .agent-pick-head { display:flex; align-items:center; gap:10px; }
    .agent-avatar { width:42px; height:42px; border-radius: 12px; display:flex; align-items:center; justify-content:center; font-size: 20px; background: rgba(91,140,255,0.14); }
    .agent-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top: 8px; }
    .agent-tags span { font-size:11px; padding:4px 8px; border-radius:999px; border:1px solid rgba(255,255,255,0.1); color:#9AA3B2; }
    .agent-flow-mini { margin: 10px 0 0; border:1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 8px 10px; background: rgba(255,255,255,0.02); }
    .agent-flow-mini .f-title { font-size: 11px; color:#6B7585; margin-bottom:6px; }
    .agent-flow-mini .f-steps { display:flex; align-items:center; flex-wrap: wrap; gap:6px; }
    .agent-flow-mini .f-steps .s { font-size: 11px; padding:3px 8px; border-radius: 999px; background: rgba(91,140,255,0.14); color:#CFE0FF; }
    .agent-flow-mini .f-steps .a { color:#6B7585; font-size: 11px; }
    .novel-form { margin-top: 12px; border:1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 10px; background: rgba(255,255,255,0.03); }
    .novel-form textarea { width:100%; min-height:64px; resize: vertical; border-radius: 10px; padding:8px 10px; background: rgba(0,0,0,0.2); color:#E8ECF2; border:1px solid rgba(255,255,255,0.1); font-size:12px; }
    .novel-actions { margin-top: 10px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .novel-actions button { border:1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 10px; font-size:12px; color:#E8ECF2; background: rgba(255,255,255,0.03); text-align:left; }
    .login-badge { display:inline-flex; align-items:center; font-size: 10px; padding:2px 7px; border-radius:999px; margin-left: 6px; background: rgba(46,230,201,0.15); color:#2EE6C9; border:1px solid rgba(46,230,201,0.35); }
    body.theme-light .create-chip { color:#64748B; border-color: rgba(15,23,42,0.08); background: rgba(15,23,42,0.03); }
    body.theme-light .create-chip.on { color:#0F172A; border-color: rgba(14,165,160,0.28); background: rgba(14,165,160,0.12); }
    body.theme-light .create-title { color:#0F172A; }
    body.theme-light .create-sub { color:#475569; }
    body.theme-light .create-card { background:#FFFFFF; border-color: rgba(15,23,42,0.12); color:#0F172A; }
    body.theme-light .create-card .s { color:#64748B; }
    body.theme-light .attach-menu { background:#FFFFFF; border-color: rgba(15,23,42,0.14); }
    body.theme-light .attach-menu button { color:#0F172A; }
    body.theme-light .agent-pick-card { background:#FFFFFF; border-color: rgba(15,23,42,0.12); }
    body.theme-light .agent-tags span { color:#475569; border-color: rgba(15,23,42,0.12); background: rgba(15,23,42,0.03); }
    body.theme-light .agent-flow-mini { background:#FFFFFF; border-color: rgba(15,23,42,0.12); }
    body.theme-light .agent-flow-mini .f-title { color:#64748B; }
    body.theme-light .agent-flow-mini .f-steps .s { color:#1E3A8A; background: rgba(59,130,246,0.12); }
    body.theme-light .novel-form { background:#FFFFFF; border-color: rgba(15,23,42,0.12); }
    body.theme-light .novel-form textarea { color:#0F172A; background: rgba(15,23,42,0.03); border-color: rgba(15,23,42,0.12); }
    body.theme-light .novel-actions button { color:#0F172A; background:#FFFFFF; border-color: rgba(15,23,42,0.12); }

    /* ====== 首页机器人 + 打字行（无对话气泡框） ====== */
    /* ====== 首页 Live2D 机器人主区（全宽大尺寸展示） ====== */
    .robot-hero {
      position: relative;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      overflow: hidden;
      background: transparent;
    }
    .robot-hero.is-hidden,
    .home-robot-panel.is-hidden,
    #robotHero.is-hidden { display: none !important; }
    .robot-type-line {
      width: 100%;
      padding: 4px 16px 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      min-height: 36px;
    }
    .robot-type-text {
      margin: 0;
      font-size: 13px;
      line-height: 1.5;
      color: #C9D1DE;
      text-align: center;
    }
    .robot-type-text--intro {
      font-size: 13px;
      color: #9aa3b2;
      text-align: center;
      line-height: 1.5;
    }
    .robot-type-text--intro strong {
      color: #e8ecf2;
      font-weight: 600;
    }
    body.theme-light .robot-type-text { color: #475569; }
    body.theme-light .robot-type-text--intro { color: #64748b; }
    body.theme-light .robot-type-text--intro strong { color: #0f172a; }
    .robot-figure {
      --rm-fg: #E8ECF2;
      --rm-bg: #0A0E18;
      flex-shrink: 0;
      width: 100%;
      height: 260px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      position: relative;
      overflow: hidden;
      transform-origin: 50% 100%;
    }
    .robot-live2d-canvas {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      background: transparent !important;
      filter: none !important;
    }
    .home-robot-panel,
    .home-robot-panel .robot-figure {
      background: transparent !important;
    }
    .robot-figure.live2d-ready.live2d-painted .robot-mark,
    .robot-figure.live2d-ready.live2d-painted .robot-wordmark { opacity: 0; pointer-events: none; }
    .robot-mark.is-hidden { display: none !important; }
    .page[data-page="home"].active .home-robot-panel .robot-figure.live2d-loading .robot-mark {
      display: none !important;
    }
    body.theme-light .robot-figure {
      --rm-fg: #070A12;
      --rm-bg: #f4f6fa;
    }
    .robot-figure.thinking { animation: robot-nod 1.1s ease-in-out infinite; }
    .robot-figure.typing { animation: robot-sway 2.4s ease-in-out infinite; }
    .robot-figure.done { animation: robot-done-pop 0.55s ease-out 1; }
    @keyframes robot-done-pop {
      0% { transform: scale(1); }
      40% { transform: scale(1.03); }
      100% { transform: scale(1); }
    }
    @keyframes robot-nod {
      0%,100% { transform: translateY(0) rotate(0deg); }
      50% { transform: translateY(1px) rotate(-1.2deg); }
    }
    @keyframes robot-sway {
      0%,100% { transform: rotate(0deg); }
      25% { transform: rotate(1.5deg); }
      75% { transform: rotate(-1.5deg); }
    }
    /* 品牌扁平机器人（参考 logo：圆角方头、天线、侧耳、双眼、横嘴、肩颈与肩线高光） */
    .robot-mark {
      display: block;
      width: 72px;
      height: auto;
      flex-shrink: 0;
      margin-bottom: 12px;
    }
    .robot-mark .robot-svg-ear,
    .robot-mark .robot-svg-neck,
    .robot-mark .robot-svg-torso,
    .robot-mark .robot-svg-ant-dot { fill: var(--rm-fg); }
    .robot-mark .robot-svg-ant-line,
    .robot-mark .robot-svg-mouth { stroke: var(--rm-fg); }
    .robot-mark .robot-svg-head {
      fill: var(--rm-bg);
      stroke: var(--rm-fg);
      stroke-width: 3.2;
    }
    .robot-mark .robot-svg-eye { fill: var(--rm-fg); }
    .robot-mark .robot-svg-shoulder-line { stroke: var(--rm-bg); }
    .robot-svg-eye {
      transform-box: fill-box;
      transform-origin: 50% 50%;
      animation: robot-blink 4.2s ease-in-out infinite;
    }
    .robot-svg-eye.r { animation-delay: 0.05s; }
    @keyframes robot-blink {
      0%,96%,100% { transform: scaleY(1); }
      98% { transform: scaleY(0.15); }
    }
    .robot-figure.typing .robot-mark {
      animation: robot-logo-breathe 2.4s ease-in-out infinite;
    }
    @keyframes robot-logo-breathe {
      0%,100% { opacity: 1; }
      50% { opacity: 0.92; }
    }
    .robot-wordmark {
      font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Inter', sans-serif;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.02em;
      line-height: 1;
      color: var(--rm-fg);
      -webkit-user-select: none;
      user-select: none;
    }
    .robot-caret {
      display: inline-block;
      width: 2px;
      height: 1em;
      margin-left: 2px;
      vertical-align: -2px;
      background: rgba(232,236,242,.9);
      animation: robot-caret-blink 0.85s steps(1,end) infinite;
    }
    @keyframes robot-caret-blink { 50% { opacity: 0; } }
    .chat-empty {
      text-align: center;
      color: rgba(232,236,242,0.42);
      font-size: 12px;
      padding: 28px 12px;
      line-height: 1.5;
    }
    .chat-row { margin-bottom: 10px; display: flex; width: 100%; min-width: 0; box-sizing: border-box; }
    .chat-row.user { justify-content: flex-end; }
    .chat-row.assistant { justify-content: stretch; }
    #chatThread .chat-row .chat-bubble,
    #homeScroll .chat-row .chat-bubble,
    #agentChatThread .chat-row .chat-bubble,
    .agents-chat-msgs .chat-row .chat-bubble,
    #createResultThread .chat-row .chat-bubble,
    #createChatThread .chat-row .chat-bubble {
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
    }
    .chat-bubble {
      box-sizing: border-box;
      max-width: 100%;
      padding: 10px 12px;
      border-radius: 14px;
      font-size: 15px;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: break-word;
      line-break: loose;
      display: block;
    }
    .chat-row.user .chat-bubble {
      background: rgba(91,140,255,0.22);
      color: #E8ECF2;
      border: 1px solid rgba(91,140,255,0.22);
      text-align: left;
      width: auto;
      max-width: min(92%, 100%);
    }
    .chat-row.assistant .chat-bubble {
      background: rgba(255,255,255,0.08);
      color: #EEF1F6;
      border: 1px solid rgba(255,255,255,0.09);
    }
    .chat-row.streaming .chat-bubble::after {
      content: "";
      display: inline-block;
      width: 7px;
      height: 1em;
      margin-left: 2px;
      vertical-align: -2px;
      background: rgba(232,236,242,0.9);
      animation: stream-caret 1s steps(1, end) infinite;
    }
    .chat-row.streaming .chat-bubble.create-waiting::after {
      content: none;
    }
    .create-waiting {
      display: flex;
      align-items: center;
      gap: 10px;
      color: rgba(232,236,242,0.72);
      font-size: 13px;
    }
    .create-waiting-dots {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      flex-shrink: 0;
    }
    .create-waiting-dots i {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: linear-gradient(135deg, #54deff 0%, #a78bfa 100%);
      display: inline-block;
      animation: create-wait-dot 1.4s cubic-bezier(.4,0,.6,1) infinite;
      box-shadow: 0 0 7px rgba(84,222,255,0.55);
    }
    .create-waiting-dots i:nth-child(2){ animation-delay: .22s; }
    .create-waiting-dots i:nth-child(3){ animation-delay: .44s; }
    @keyframes create-wait-dot {
      0%, 70%, 100% { transform: scale(0.6) translateY(0); opacity: 0.35; }
      35% { transform: scale(1.15) translateY(-3px); opacity: 1; }
    }
    @keyframes stream-caret { 50% { opacity: 0; } }

    /* ===== 智能体回答加载动画 ===== */
    /* 三点跳动：等待模型第一个 token */
    @keyframes agent-dot-bounce {
      0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
      40%            { transform: translateY(-6px); opacity: 1; }
    }
    .agent-thinking {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 2px;
      min-height: 24px;
    }
    .agent-thinking-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: rgba(200, 215, 255, 0.85);
      animation: agent-dot-bounce 1.2s ease-in-out infinite;
    }
    .agent-thinking-dot:nth-child(2) { animation-delay: 0.18s; }
    .agent-thinking-dot:nth-child(3) { animation-delay: 0.36s; }
    /* 内容流入时气泡淡入 */
    @keyframes agent-bubble-in {
      from { opacity: 0; transform: translateY(6px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .chat-row.assistant.streaming .chat-bubble:not(:empty) {
      animation: agent-bubble-in 0.22s ease both;
    }
    /* 创作工作台：禁用气泡淡入动画，避免荣耀 WebView 滚动/结束帧整块闪没 */
    body.create-workbench-pane #createResultThread .chat-bubble,
    body.create-workbench-pane #createResultThread .chat-row.assistant .chat-bubble {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
    /* 智能体对话：流式输出时禁用气泡淡入，避免每帧重绘闪烁/跳动 */
    .page[data-page="agents"].active.agents-in-chat .agent-chat-msgs .chat-bubble,
    .page[data-page="agents"].active.agents-in-chat .agent-chat-msgs .chat-row.assistant .chat-bubble {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
    /* 首页日常对话：禁用 streaming 气泡淡入，避免 WebView 逐字输出时跳动 */
    body.page-home #chatThread .chat-bubble,
    body.page-home #chatThread .chat-row.assistant .chat-bubble {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
    /* light theme 三点颜色 */
    body.theme-light .agent-thinking-dot {
      background: rgba(30, 64, 175, 0.55);
    }
    .chat-bubble-stack {
      position: relative;
      max-width: 100%;
      width: auto;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .create-kb-ref-card {
      margin: 12px 0 10px;
      padding: 12px 12px 10px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.03);
    }
    .create-kb-ref-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .create-kb-ref-title { font-size: 13px; font-weight: 600; color: #E8ECF2; }
    .create-kb-ref-opt {
      font-size: 10px;
      color: #6B7585;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.08);
    }
    .create-kb-ref-sub { font-size: 11px; color: #6B7585; margin-top: 6px; line-height: 1.45; }
    .create-kb-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px;
      min-height: 28px;
      align-items: center;
    }
    .create-kb-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      max-width: 100%;
      padding: 4px 8px 4px 6px;
      border-radius: 999px;
      font-size: 11.5px;
      color: #C5CDD9;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.10);
    }
    .create-kb-chip button { color: #6B7585; padding: 0 2px; line-height: 1; }
    .create-kb-empty { font-size: 11px; color: #6B7585; }
    .create-kb-add {
      margin-top: 8px;
      font-size: 12px;
      color: #2EE6C9;
      padding: 4px 0;
      border: none;
      background: transparent;
    }
    body.theme-light .create-kb-ref-card {
      background: rgba(15,23,42,0.03);
      border-color: rgba(15,23,42,0.08);
    }
    body.theme-light .create-kb-ref-title { color: #0F172A; }
    body.theme-light .create-kb-chip {
      background: rgba(15,23,42,0.04);
      border-color: rgba(15,23,42,0.10);
      color: #334155;
    }
    .chat-reasoning {
      width: 100%;
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 12px;
      background: rgba(0,0,0,0.18);
      overflow: hidden;
    }
    .chat-reasoning > summary.chat-reasoning-sum {
      list-style: none;
      cursor: pointer;
      padding: 6px 10px;
      font-size: 11.5px;
      color: #9AA3B2;
      -webkit-user-select: none;
      user-select: none;
    }
    .chat-reasoning > summary.chat-reasoning-sum::-webkit-details-marker { display: none; }
    .chat-reasoning-pre {
      margin: 0;
      padding: 8px 10px 10px;
      font-size: 12px;
      line-height: 1.45;
      color: rgba(238,241,246,0.94);
      white-space: pre-wrap;
      word-break: break-word;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      border-top: 1px solid rgba(255,255,255,0.06);
      max-height: 42vh;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .create-reply-fold details {
      width: 100%;
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      overflow: hidden;
    }
    .create-reply-fold summary {
      list-style: none;
      cursor: pointer;
      padding: 8px 10px;
      font-size: 12px;
      color: #9aa3b2;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .create-outline {
      padding: 8px 10px 2px;
      font-size: 12px;
      color: #c7cfda;
    }
    .create-outline .lv1 { font-weight: 700; margin: 0 0 4px; }
    .create-outline .lv2 { margin: 0 0 6px 12px; color: #9aa3b2; }
    .create-rich-bubble { margin: 0; border-radius: 0; border: 0; background: transparent; }
    .chat-row.user .chat-bubble-stack { align-items: flex-end; }
    .chat-row.assistant .chat-bubble-stack { align-items: stretch; width: 100%; }
    .chat-row.assistant .chat-bubble { width: 100%; }
    .msg-del-btn {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 2px 8px;
      border-radius: 8px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.06);
      color: #9aa3b2;
      font-size: 11px;
      cursor: pointer;
      align-self: flex-start;
    }
    .chat-row.user .msg-del-btn { align-self: flex-end; }
    .msg-del-btn:active { background: rgba(255, 110, 138, 0.15); border-color: rgba(255, 110, 138, 0.35); color: #ffb8c8; }
    .msg-icon-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      margin-top: 2px;
    }
    .chat-row.user .msg-icon-row { align-self: flex-end; justify-content: flex-end; flex-direction: row-reverse; }
    .chat-row.assistant .msg-icon-row { align-self: flex-start; }
    /* ── TTS 朗读按钮 ──────────────────── */
    .msg-tts-row {
      display: flex; align-items: center; margin-top: 4px;
    }
    .msg-tts-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 28px; height: 28px; border-radius: 50%;
      border: none; background: transparent;
      color: rgba(255,255,255,0.35); cursor: pointer;
      transition: color 0.15s, background 0.12s;
    }
    .msg-tts-btn .ic-sm { width: 15px; height: 15px; }
    .msg-tts-btn:hover, .msg-tts-btn:active { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.08); }
    .msg-tts-btn.tts-playing { color: #60a5fa; }
    .msg-tts-btn.tts-loading { color: rgba(255,255,255,0.4); }
    body.theme-light .msg-tts-btn { color: rgba(0,0,0,0.3); }
    body.theme-light .msg-tts-btn:hover { color: rgba(0,0,0,0.6); background: rgba(0,0,0,0.06); }
    body.theme-light .msg-tts-btn.tts-playing { color: #2563eb; }
    @keyframes tts-spin { to { transform: rotate(360deg); } }
    .tts-spin { animation: tts-spin 1s linear infinite; }

    /* ── retry btn ─────────────────────── */
    .msg-retry-btn {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 3px 10px 3px 8px;
      border-radius: 20px;
      border: 1px solid rgba(255, 255, 255, 0.10);
      background: rgba(255, 255, 255, 0.05);
      color: #8a95a8;
      font-size: 11px;
      cursor: pointer;
      align-self: flex-start;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .msg-retry-btn::after {
      content: '重新生成';
      font-size: 11px;
    }
    .chat-row.user .msg-retry-btn { align-self: flex-end; }
    .msg-icon-row .msg-retry-btn .ic-sm,
    .msg-icon-row .msg-del-btn .ic-sm {
      width: 13px;
      height: 13px;
    }
    .msg-retry-btn:active {
      background: rgba(255, 255, 255, 0.10);
      color: #c8d0dc;
      border-color: rgba(255, 255, 255, 0.18);
    }
    body.theme-light .msg-retry-btn {
      border-color: rgba(0, 0, 0, 0.10);
      background: rgba(0, 0, 0, 0.04);
      color: #8492a6;
    }
    body.theme-light .msg-retry-btn:active {
      background: rgba(0, 0, 0, 0.08);
      color: #475569;
    }
    .agents-dev-placeholder {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 32px 24px;
      text-align: center;
      min-height: 46vh;
    }
    .page[data-page="create"] {
      position: relative;
    }
    .page[data-page="create"].active > .create-page-body {
      position: relative;
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      overflow: hidden;
    }
    /* 仅引导页（选体裁/选类别）让创作区可滚动，避免键盘挡住「开始AI创作」；工作台仍由内层线程区滚动 */
    #createModule.create-flow-scroll {
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
    }
    /* 原生 APK 不加载 Tailwind，#createModule 的 flex-1/min-h-0 失效 → 高度不受约束，
       overflow/子级 flex:1 都失效，导致工作台（小说内容页）与设定页内容被裁、不能滚动。
       这里给 create 页所有形态补真实的高度约束（不依赖 Tailwind）。 */
    .page[data-page="create"].active > .create-page-body > #createModule {
      flex: 1 1 auto;
      min-height: 0;
    }
    /* 工作台/小说内容页：#createModule 需为 flex 列，
       内部 .create-workbench → .create-result-col → .chat-thread 才能拿到约束高度并滚动 */
    body.create-workbench-pane .page[data-page="create"].active > .create-page-body > #createModule {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    /* 创作引导页：仅轻度垫高可滚动区，便于滚到「开始 AI 创作」；勿叠加 app-shell 键盘 padding，否则与 WebView 随键盘收窄重复，输入条与键盘间会出现大块空白 */
    body.native-app.keyboard-open .page[data-page="create"].active #createModule.create-flow-scroll {
      padding-bottom: calc(12px + var(--kb-vv-inset, 0px));
    }
    body.create-flow-subtype-pane:not(.keyboard-open) #createModule.create-flow-scroll {
      padding-bottom: 0;
    }
    /* 创作台：左目录 + 右设定/结果（与首页对话线程独立存储） */
    .create-workbench {
      display: flex;
      flex: 1 1 auto;
      min-height: 0;
      gap: 10px;
      padding: 0 12px 8px;
    }
    .create-sidebar {
      width: 24%;
      min-width: 92px;
      max-width: 200px;
      display: flex;
      flex-direction: column;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.03);
      overflow: hidden;
    }
    .create-sidebar-head {
      padding: 10px 10px 6px;
      font-size: 12px;
      color: #9aa3b2;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .create-sidebar .create-new-btn {
      margin: 8px;
      padding: 8px 10px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 600;
      color: #06121e;
      background: linear-gradient(135deg, #2ee6c9, #5b8cff);
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .create-hist-list {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 4px 6px 10px;
    }
    .create-hist-item {
      width: 100%;
      text-align: left;
      padding: 8px 8px;
      border-radius: 10px;
      border: 1px solid transparent;
      background: transparent;
      color: #e8ecf2;
      font-size: 12px;
      margin-bottom: 4px;
    }
    .create-hist-item.on {
      background: rgba(91,140,255,0.12);
      border-color: rgba(91,140,255,0.28);
    }
    .create-hist-item .sub {
      font-size: 10px;
      color: #6b7585;
      margin-top: 2px;
    }
    .create-main-panel {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      min-height: 0;
      gap: 8px;
    }
    .create-main-panel.create-main-panel--wb {
      gap: 0;
    }
    .create-genre-seg {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      padding: 2px 0;
    }
    .create-genre-title-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .create-genre-card-ic {
      width: 24px;
      height: 24px;
      object-fit: contain;
      flex-shrink: 0;
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.88);
      padding: 2px;
      box-sizing: border-box;
    }
    body.theme-light .create-genre-card-ic {
      background: #fff;
      box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
    }
    .create-genre-title-row .t {
      flex: 1;
      min-width: 0;
    }
    /* 创作体裁 v2：单列八行 + photo/ 配图。回退见 app.create-pickGenre-pre-20260518-bak.html */
    .create-pick-genre { padding-bottom: 8px; }
    .create-home-intro {
      margin-bottom: 14px;
      padding: 14px 14px 16px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(20, 26, 40, 0.96);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    }
    .create-home-intro-kicker {
      margin: 0 0 8px;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0.06em;
      color: #9aa3b2;
    }
    .create-home-intro-title {
      margin: 0 0 10px;
      font-size: 20px;
      font-weight: 800;
      line-height: 1.3;
      letter-spacing: 0.01em;
      color: #e8ecf2;
    }
    .create-home-intro-lead {
      margin: 0;
      font-size: 13px;
      line-height: 1.62;
      font-weight: 400;
      color: #9aa3b2;
    }
    body.theme-light .create-home-intro {
      border-color: rgba(15, 23, 42, 0.08);
      background: #ffffff;
      box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }
    body.theme-light .create-home-intro-kicker { color: #64748b; }
    body.theme-light .create-home-intro-title { color: #0f172a; }
    body.theme-light .create-home-intro-lead { color: #64748b; }
    .create-genre-grid,
    .create-genre-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .create-genre-card {
      position: relative;
      overflow: hidden;
      isolation: isolate;
      min-height: 64px;
      border-radius: 16px;
      border: 1px solid rgba(91, 140, 255, 0.28);
      background: linear-gradient(145deg, rgba(255,255,255,0.10) 0%, rgba(91,140,255,0.12) 42%, rgba(46,230,201,0.08) 100%);
      backdrop-filter: blur(16px) saturate(1.45);
      -webkit-backdrop-filter: blur(16px) saturate(1.45);
      color: #e8ecf2;
      text-align: left;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 3px;
      justify-content: center;
      box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    }
    .create-genre-card::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: linear-gradient(135deg, rgba(255,255,255,0.26) 0%, transparent 38%, transparent 62%, rgba(46,230,201,0.14) 100%);
      pointer-events: none;
      z-index: 0;
    }
    .create-genre-card::after {
      content: '';
      position: absolute;
      top: -40%;
      left: -20%;
      width: 70%;
      height: 55%;
      border-radius: 50%;
      background: radial-gradient(ellipse at center, rgba(91,140,255,0.35), transparent 70%);
      pointer-events: none;
      z-index: 0;
    }
    .create-genre-card > * { position: relative; z-index: 1; }
    .create-genre-card:active { transform: translateY(1px); opacity: 0.92; }
    .create-genre-card.on {
      border-color: rgba(46,230,201,0.55);
      background: linear-gradient(145deg, rgba(46,230,201,0.22), rgba(91,140,255,0.18));
      box-shadow:
        0 12px 32px rgba(46, 230, 201, 0.18),
        inset 0 0 0 1px rgba(46,230,201,0.35),
        inset 0 1px 0 rgba(255,255,255,0.28);
    }
    .create-genre-card .t {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.2;
    }
    .create-genre-card .d {
      font-size: 11px;
      color: #9aa3b2;
      line-height: 1.25;
    }
    .create-genre-card--list {
      flex-direction: row;
      align-items: stretch;
      min-height: 92px;
      padding: 0;
      gap: 0;
    }
    .create-genre-card-photo {
      width: 92px;
      min-width: 92px;
      align-self: stretch;
      object-fit: cover;
      display: block;
      border-radius: 15px 0 0 15px;
      background: rgba(0, 0, 0, 0.2);
    }
    .create-genre-card-body {
      flex: 1;
      min-width: 0;
      padding: 12px 14px 12px 12px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
    }
    .create-genre-card--list .t {
      font-size: 16px;
      font-weight: 700;
      line-height: 1.25;
    }
    .create-genre-card--list .d {
      font-size: 12px;
      line-height: 1.45;
      color: #9aa3b2;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    body.theme-light .create-genre-card--list .d { color: #64748b; }
    body.theme-light .create-genre-text .d { color: #64748b; }
    /* 创作体裁行：图左 + 标题/说明在图右侧，「开始」白字（深色默认 / 浅色 theme-light） */
    .chat-msg-image-preview {
      margin-bottom: 8px;
      max-width: min(100%, 280px);
    }
    .chat-msg-image-preview img {
      display: block;
      width: 100%;
      max-height: 220px;
      object-fit: contain;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(0, 0, 0, 0.2);
    }
    body.theme-light .chat-msg-image-preview img {
      border-color: rgba(15, 23, 42, 0.1);
      background: #f1f5f9;
    }
    .create-inspire-optional-label {
      margin: 0 0 8px 2px;
      font-size: 12px;
      font-weight: 600;
      color: #c5cdd8;
    }
    body.theme-light .create-inspire-optional-label { color: #334155; }
    .create-inspire-image-row {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      margin: 0;
      width: 100%;
    }
    .create-action-stack {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
    }
    .create-action-bar-btn {
      width: 100%;
      box-sizing: border-box;
      min-height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 15px;
      font-weight: 600;
    }
    .create-inspire-image-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 15px;
      font-weight: 600;
      border: 1px dashed rgba(91, 140, 255, 0.45);
      color: #9AA3B2;
      background: rgba(91, 140, 255, 0.08);
      cursor: pointer;
    }
    body.theme-light .create-inspire-image-btn {
      color: #475569;
      border-color: rgba(14, 165, 160, 0.35);
      background: rgba(14, 165, 160, 0.08);
    }
    .create-inspire-image-preview {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(255, 255, 255, 0.04);
    }
    body.theme-light .create-inspire-image-preview {
      border-color: rgba(15, 23, 42, 0.08);
      background: rgba(15, 23, 42, 0.03);
    }
    .create-inspire-image-preview[hidden] { display: none !important; }
    .create-inspire-thumb {
      width: 48px;
      height: 48px;
      object-fit: cover;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .create-inspire-name {
      font-size: 12px;
      color: #9AA3B2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 140px;
    }
    .create-inspire-clear {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      border: none;
      background: rgba(255, 255, 255, 0.08);
      color: #9AA3B2;
      font-size: 18px;
      line-height: 1;
      flex-shrink: 0;
    }
    .create-genre-row {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      min-height: 0;
      box-sizing: border-box;
      padding: 12px;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(20, 26, 40, 0.96);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    }
    body.theme-light .create-genre-row {
      border-color: rgba(15, 23, 42, 0.08);
      background: #ffffff;
      box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }
    .create-genre-main {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .create-genre-thumb-wrap {
      width: 54px;
      height: 54px;
      min-width: 54px;
      flex-shrink: 0;
      border-radius: 50%;
      overflow: hidden;
      background: rgba(255, 255, 255, 0.08);
      display: block;
      margin-top: 0;
      align-self: center;
    }
    body.theme-light .create-genre-thumb-wrap { background: #e2e8f0; }
    .create-genre-thumb-wrap .create-genre-thumb {
      width: 100%;
      height: 100%;
      display: block;
      border-radius: 0;
      object-fit: cover;
      object-position: center;
      transform: scale(1.22);
    }
    .create-genre-thumb-wrap--crop .create-genre-thumb {
      transform: scale(1.5);
    }
    .create-genre-thumb-wrap--wenxin {
      background: rgba(15, 23, 42, 0.55);
    }
    body.theme-light .create-genre-thumb-wrap--wenxin {
      background: #cbd5e1;
    }
    .create-genre-thumb-wrap--wenxin .create-genre-thumb {
      object-fit: cover;
      object-position: center;
      transform: scale(1.42);
    }
    .create-genre-text {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: 4px;
      min-height: 0;
      box-sizing: border-box;
    }
    .create-genre-text .t {
      margin: 0;
      font-size: clamp(15px, 4.2vw, 17px);
      font-weight: 700;
      line-height: 1.35;
      height: auto;
      min-height: 0;
      max-height: none;
      white-space: normal;
      overflow: visible;
      text-overflow: unset;
      color: #e8ecf2;
    }
    body.theme-light .create-genre-text .t { color: #0f172a; }
    .create-genre-text .d {
      margin: 0;
      font-size: clamp(12px, 3.6vw, 13px);
      line-height: 1.45;
      height: auto;
      min-height: 0;
      max-height: none;
      color: #9aa3b2;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .create-genre-start {
      flex-shrink: 0;
      align-self: center;
      margin-top: 0;
      padding: 8px 14px;
      border: none;
      border-radius: 999px;
      font-size: 13px;
      font-weight: 600;
      color: #ffffff !important;
      -webkit-text-fill-color: #ffffff;
      background: linear-gradient(135deg, #8eb4ff 0%, #7aa8f5 100%);
      box-shadow: 0 4px 12px rgba(122, 168, 245, 0.22);
      touch-action: manipulation;
    }
    body.theme-light button.create-genre-start,
    body.theme-dark button.create-genre-start {
      color: #ffffff !important;
      -webkit-text-fill-color: #ffffff;
    }
    .create-genre-start:active { transform: scale(0.97); opacity: 0.9; }
    .create-quote-block {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .create-quote-block--top {
      margin-top: 0;
      margin-bottom: 14px;
      padding: 14px 14px 16px;
      border-top: none;
      border-radius: 14px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(20, 26, 40, 0.96);
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    }
    .create-quote-block--top .create-quote-line {
      margin: 0;
      font-size: 13px;
      line-height: 1.62;
      font-style: italic;
      color: #9aa3b2;
    }
    .create-quote-block--top .create-quote-author {
      margin: 8px 0 0;
      font-size: 12px;
      font-style: italic;
      color: #6b7585;
    }
    body.theme-light .create-quote-block--top {
      border-color: rgba(15, 23, 42, 0.08);
      background: #ffffff;
      box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    }
    body.theme-light .create-quote-block--top .create-quote-line { color: #475569; }
    body.theme-light .create-quote-block--top .create-quote-author { color: #94a3b8; }
    body.theme-light .create-quote-block {
      border-top-color: rgba(15, 23, 42, 0.1);
    }
    body.theme-light #createModule .create-quote-block .font-bold {
      color: #0f172a;
    }
    body.theme-light .create-quote-block .italic {
      color: #64748b;
    }
    body.theme-light .create-genre-card {
      border-color: rgba(14, 165, 160, 0.22);
      background: linear-gradient(145deg, rgba(255,255,255,0.88) 0%, rgba(186,230,253,0.42) 48%, rgba(167,243,208,0.34) 100%);
      color: #0f172a;
      box-shadow:
        0 8px 22px rgba(14, 165, 160, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(14, 165, 160, 0.08);
    }
    body.theme-light .create-genre-card::before {
      background: linear-gradient(135deg, rgba(255,255,255,0.75) 0%, transparent 42%, transparent 58%, rgba(167,243,208,0.22) 100%);
    }
    body.theme-light .create-genre-card::after {
      background: radial-gradient(ellipse at center, rgba(186,230,253,0.55), transparent 72%);
    }
    body.theme-light .create-genre-card.on {
      border-color: rgba(14, 165, 160, 0.38);
      background: linear-gradient(145deg, rgba(240,253,250,0.95), rgba(186,230,253,0.55));
      box-shadow:
        0 10px 26px rgba(14, 165, 160, 0.16),
        inset 0 0 0 1px rgba(14, 165, 160, 0.22);
    }
    body.theme-light .create-genre-card .d { color: #64748b; }
    .create-genre-seg button {
      padding: 6px 9px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.04);
      color: #9aa3b2;
      font-size: 10.5px;
    }
    .create-genre-seg button.on {
      color: #06121e;
      background: linear-gradient(135deg, #2ee6c9, #5b8cff);
      border-color: transparent;
    }
    .create-back-btn {
      height: 30px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid transparent;
      color: #06121e;
      font-size: 11px;
      font-weight: 700;
      background: linear-gradient(135deg, #2ee6c9, #5b8cff);
      box-shadow: 0 6px 16px rgba(91, 140, 255, 0.28);
    }
    .create-back-btn:active {
      transform: translateY(1px);
      opacity: 0.92;
    }
    .create-top-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
      min-height: 34px;
    }
    .create-top-actions--solo {
      justify-content: flex-start;
    }
    /* 创作页顶栏：安全区只算一次（box-sizing:border-box），勿与下方 native-app .topbar 通用规则叠加 */
    .page[data-page="create"].active > .topbar.create-topbar {
      position: relative;
      top: auto;
      z-index: 16;
      flex-shrink: 0;
      align-items: center;
      box-sizing: border-box;
      min-height: 0;
      padding:
        max(env(safe-area-inset-top, 0px), 28px)
        var(--t-page-x-right, 16px)
        8px
        var(--t-page-x, 16px);
      background: linear-gradient(180deg, #0b101a 0%, rgba(10, 14, 24, 0.98) 100%);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    }
    body.native-app .page[data-page="create"].active > .topbar.create-topbar {
      padding-top: max(env(safe-area-inset-top, 0px), 30px);
    }
    body.theme-light .page[data-page="create"].active > .topbar.create-topbar {
      background: linear-gradient(180deg, #f4f6fa 0%, rgba(244, 246, 250, 0.98) 100%);
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    }
    body.create-workbench-pane .page[data-page="create"].active > .topbar.create-topbar {
      padding-bottom: 4px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }
    body.theme-light.create-workbench-pane .page[data-page="create"].active > .topbar.create-topbar {
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    }
    .page[data-page="create"].active > .topbar.create-topbar {
      display: grid;
      grid-template-columns: auto 1fr auto;
      align-items: center;
      column-gap: 8px;
    }
    .create-topbar-leading {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }
    .create-topbar-title {
      font-family: 'Noto Serif SC', serif;
      font-size: 17px;
      font-weight: 500;
      color: #E8ECF2;
      letter-spacing: 0.02em;
      text-align: center;
      min-width: 0;
    }
    body.theme-light .create-topbar-title { color: #0f172a; }
    .create-topbar-spacer {
      width: 34px;
      height: 34px;
      flex-shrink: 0;
    }
    .create-flow-head-title {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: 0.02em;
      color: #e8ecf2;
      line-height: 1.2;
      white-space: nowrap;
      flex-shrink: 0;
    }
    body.theme-light .create-flow-head-title {
      color: #0f172a;
    }
    .create-ghost-strong-btn {
      height: 34px;
      padding: 0 14px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.22);
      color: #e8ecf2;
      font-size: 12px;
      font-weight: 700;
      background: rgba(255,255,255,0.08);
    }
    .create-start-btn {
      width: 100%;
      min-height: 48px;
      height: auto;
      padding: 12px 16px;
      border-radius: 12px;
      border: 1px solid rgba(91,140,255,0.42);
      color: #06121e;
      font-size: 15px;
      font-weight: 800;
      background: linear-gradient(135deg, #2ee6c9, #5b8cff);
      box-shadow: 0 6px 16px rgba(91, 140, 255, 0.28);
    }
    .create-start-btn.create-start-btn-deep {
      height: auto;
      min-height: 48px;
      padding: 10px 12px;
      font-size: 11px;
      line-height: 1.35;
      white-space: normal;
    }
    .create-start-btn:active, .create-ghost-strong-btn:active { transform: translateY(1px); }
    body.theme-light .create-ghost-strong-btn {
      color: #0f172a;
      border-color: rgba(15,23,42,0.22);
      background: rgba(15,23,42,0.06);
    }
    .create-dual-row {
      flex: 1;
      min-height: 0;
      display: flex;
      gap: 8px;
    }
    .create-form-col,
    .create-result-col {
      flex: 1;
      min-width: 0;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.02);
      display: flex;
      flex-direction: column;
      min-height: 120px;
    }
    .create-col-title {
      padding: 8px 12px;
      font-size: 12px;
      color: #9aa3b2;
      border-bottom: 1px solid rgba(255,255,255,0.06);
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
    }
    .create-col-title--actions-only {
      justify-content: flex-end;
      padding: 6px 10px;
    }
    .create-col-title-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
      flex-shrink: 0;
    }
    /* 工作台顶栏：创作历史 / 导出 / 情节推演 / 返回创作台 同一行，各为容器按钮，无分隔横线 */
    .create-wb-toolbar {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: stretch;
      gap: 6px;
      padding: 6px 0 8px;
      flex-shrink: 0;
      width: 100%;
      box-sizing: border-box;
    }
    #createWorkbenchBack.create-wb-tool--back {
      margin-left: 0;
    }
    .create-wb-tool {
      flex: 1 1 0;
      min-width: 0;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.06);
      color: #e8ecf2;
      font: inherit;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }
    .create-wb-tool:active {
      background: rgba(255, 255, 255, 0.1);
    }
    .create-wb-tool-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      width: 100%;
      min-height: 44px;
      padding: 4px 2px;
      box-sizing: border-box;
    }
    .create-wb-tool-label {
      font-size: 9.5px;
      font-weight: 700;
      line-height: 1.1;
      text-align: center;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .create-wb-tool--deduce {
      border-color: rgba(46, 230, 201, 0.35);
      background: linear-gradient(180deg, rgba(46, 230, 201, 0.14), rgba(91, 140, 255, 0.1));
    }
    body.theme-light .create-wb-tool--deduce {
      border-color: rgba(14, 165, 160, 0.32);
      background: linear-gradient(180deg, rgba(167, 243, 208, 0.35), rgba(186, 230, 253, 0.22));
    }
    .create-wb-tool--back .create-wb-tool-inner {
      min-height: 44px;
    }
    .create-wb-tool--back svg,
    .create-wb-tool--back .ic {
      display: block;
      margin: 0;
    }
    body.theme-light .create-wb-tool {
      border-color: rgba(15, 23, 42, 0.12);
      background: rgba(15, 23, 42, 0.05);
      color: #0f172a;
    }
    body.theme-light .create-wb-tool:active {
      background: rgba(15, 23, 42, 0.08);
    }
    .create-wb-tool--accent .create-wb-tool-label {
      color: #2ee6c9;
    }
    body.theme-light .create-wb-tool--accent .create-wb-tool-label {
      color: #0d9488;
    }
    /* 情节推演结果区等待（与创作台 create-waiting 同款动效） */
    .deduce-result-scroll .deduce-waiting {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 2.5rem;
      color: var(--text2, rgba(255, 255, 255, 0.72));
      font-size: 13px;
    }
    /* 返回创作台：浅色浅蓝底 + 深蓝字；深色深蓝底 + 浅蓝字 */
    .create-wb-tool--back {
      border-color: rgba(59, 130, 246, 0.5);
      background: rgba(30, 58, 138, 0.42);
    }
    .create-wb-tool--back:active {
      background: rgba(30, 64, 175, 0.55);
    }
    .create-wb-tool--back .create-wb-tool-label,
    .create-wb-tool--back .ic,
    .create-wb-tool--back .ic-sm {
      color: #bfdbfe;
    }
    body.theme-light .create-wb-tool--back {
      border-color: rgba(147, 197, 253, 0.95);
      background: rgba(219, 234, 254, 0.96);
    }
    body.theme-light .create-wb-tool--back:active {
      background: rgba(191, 219, 254, 1);
    }
    body.theme-light .create-wb-tool--back .create-wb-tool-label,
    body.theme-light .create-wb-tool--back .ic,
    body.theme-light .create-wb-tool--back .ic-sm {
      color: #1e40af;
    }
    .create-wb-actions-row {
      margin-top: 0;
    }
    .create-form-col .create-fields {
      padding: 10px 12px;
      overflow-y: auto;
      flex: 1;
    }
    .create-workbench .name-input,
    .create-drawer .name-input,
    #createModule .name-input {
      text-align: left;
      font-size: 14px;
      font-weight: 400;
      color: #E8ECF2;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.10);
      border-radius: 10px;
      padding: 10px 12px;
    }
    body.theme-light .create-workbench .name-input,
    body.theme-light .create-drawer .name-input,
    body.theme-light #createModule .name-input {
      color: #0F172A;
      background: rgba(15,23,42,0.03);
      border-color: rgba(15,23,42,0.14);
    }
    .create-subtype-picker { position: relative; margin-bottom: 12px; }
    .create-subtype-toggle {
      width: 100%; text-align: left; height: 40px; border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.10); padding: 0 12px;
      background: rgba(255,255,255,0.03); color: #E8ECF2; font-size: 13px;
      display:flex; align-items:center; justify-content:space-between;
    }
    .create-subtype-panel {
      position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 8;
      border: 1px solid rgba(255,255,255,0.10); border-radius: 12px;
      background: #101827; max-height: 220px; overflow: auto; padding: 6px;
      box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    }
    .create-subtype-panel button {
      width: 100%; text-align: left; border-radius: 8px; padding: 9px 10px;
      color: #E8ECF2; font-size: 13px; background: transparent; border: 0;
    }
    .create-subtype-panel button.on { background: rgba(91,140,255,0.20); }
    body.theme-light .create-subtype-toggle {
      color: #0F172A; background: rgba(15,23,42,0.03); border-color: rgba(15,23,42,0.14);
    }
    body.theme-light .create-subtype-panel {
      background: #FFFFFF; border-color: rgba(15,23,42,0.12); box-shadow: 0 10px 24px rgba(15,23,42,0.16);
    }
    body.theme-light .create-subtype-panel button { color: #0F172A; }
    body.theme-light .create-subtype-panel button.on { background: rgba(37,99,235,0.12); }
    textarea.create-intro-autosize {
      display: block;
      width: 100%;
      min-height: 5.75rem;
      max-height: 20rem;
      box-sizing: border-box;
      resize: none;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
      overflow-wrap: anywhere;
      overflow-x: hidden;
    }
    .create-result-col .chat-thread {
      flex: 1;
      min-height: 0;
      padding: 8px 10px;
    }
    /* 情节推演：全屏 fixed 宿主 + 遮罩；关闭时用 display:none 避免 WebView 仍命中透明层导致底栏无法点击 */
    .deduce-host {
      --deduce-surface: rgba(255, 255, 255, 0.04);
      --deduce-surface2: rgba(255, 255, 255, 0.02);
      --deduce-border: rgba(255, 255, 255, 0.1);
      --deduce-text: rgba(232, 236, 242, 0.95);
      --deduce-text2: rgba(200, 210, 225, 0.88);
      --deduce-text3: rgba(232, 236, 242, 0.72);
      --deduce-accent: rgba(46, 230, 201, 0.38);
      --deduce-accent-bg: rgba(46, 230, 201, 0.14);
      --deduce-picker-bg: #121a2a;
      --deduce-picker-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    }
    body.theme-light .deduce-host {
      --deduce-surface: rgba(15, 23, 42, 0.06);
      --deduce-surface2: rgba(15, 23, 42, 0.04);
      --deduce-border: rgba(15, 23, 42, 0.12);
      --deduce-text: #0f172a;
      --deduce-text2: #475569;
      --deduce-text3: #64748b;
      --deduce-accent: rgba(14, 165, 160, 0.45);
      --deduce-accent-bg: rgba(14, 165, 160, 0.12);
      --deduce-picker-bg: #ffffff;
      --deduce-picker-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16);
    }
    .deduce-host #deduceSheet.deduce-sheet {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      max-height: 88vh;
      border-top-left-radius: 28px;
      border-top-right-radius: 28px;
      padding: 8px 0 max(12px, env(safe-area-inset-bottom));
    }
    .deduce-host .deduce-sheet-head {
      flex-shrink: 0;
      padding-left: 18px;
      padding-right: 18px;
      border-bottom: 1px solid var(--deduce-border);
    }
    .deduce-sheet-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--deduce-text);
    }
    .deduce-host #deduceSheet.deduce-sheet > .deduce-ov-scroll {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      padding: 8px 16px 14px;
    }
    .deduce-dual-pane {
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex: 1 1 auto;
      min-height: 0;
    }
    .deduce-pane {
      border-radius: 14px;
      border: 1px solid var(--deduce-border);
      background: var(--deduce-surface2);
      padding: 10px 12px;
      min-width: 0;
    }
    .deduce-pane--form {
      flex: 0 0 auto;
    }
    .deduce-pane--out {
      flex: 1 1 auto;
      min-height: min(42vh, 380px);
      display: flex;
      flex-direction: column;
    }
    .deduce-pane-head {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.04em;
      color: var(--deduce-text3);
      margin: 0 0 8px;
      text-transform: none;
    }
    .deduce-pane-body {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .deduce-lbl {
      display: block;
      font-size: 11px;
      line-height: 1.35;
      letter-spacing: 0.02em;
      color: var(--deduce-text3);
      margin-bottom: 5px;
    }
    .deduce-lbl--gap { margin-top: 10px; }
    .deduce-pane .name-input,
    .deduce-pane .deduce-scenario-input {
      font-size: 13px;
      padding: 10px 12px;
      border-radius: 12px;
      background: var(--deduce-surface);
      border-color: var(--deduce-border);
      color: var(--deduce-text);
    }
    .deduce-scenario-input {
      min-height: 4.5rem;
      resize: none;
      line-height: 1.45;
    }
    .deduce-run-btn { margin-top: 10px; min-height: 44px; border-radius: 12px; }
    .deduce-seg-trigger {
      width: 100%;
      min-height: 44px;
      border-radius: 12px;
      border: 1px solid var(--deduce-border);
      background: var(--deduce-surface);
      color: var(--deduce-text2);
      font-size: 13px;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      text-align: left;
      cursor: pointer;
    }
    .deduce-seg-trigger.has-value {
      color: var(--deduce-text);
      border-color: var(--deduce-accent);
      background: var(--deduce-accent-bg);
    }
    .deduce-seg-trigger-label {
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .deduce-seg-trigger-chevron {
      flex-shrink: 0;
      opacity: 0.72;
    }
    .deduce-empty-hint[hidden] { display: none !important; }
    .deduce-pane-body:has(#deduceResultWrap:not([hidden])) #deduceEmptyHint {
      display: none !important;
    }
    .deduce-empty-hint {
      flex: 1 1 auto;
      min-height: 10rem;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 16px;
      font-size: 12px;
      line-height: 1.5;
      color: var(--deduce-text2);
    }
    .deduce-result-wrap {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .deduce-result-wrap[hidden] { display: none !important; }
    .deduce-host #deduceResult.deduce-result-scroll,
    .deduce-host #deduceRewriteResult.deduce-result-scroll {
      flex: 1 1 auto;
      min-height: 8rem;
      max-height: min(42vh, 380px);
      padding: 12px 14px;
      border-radius: 12px;
      background: var(--deduce-surface);
      border: 1px solid var(--deduce-border);
      color: var(--deduce-text);
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      word-break: break-word;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .deduce-result-footnote {
      font-size: 11px;
      line-height: 1.45;
      color: var(--deduce-text2);
      margin: 0;
    }
    .deduce-result-close { flex-shrink: 0; }
    .deduce-rewrite-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      flex-shrink: 0;
    }
    .deduce-rewrite-actions .cta,
    .deduce-rewrite-actions .ghost-btn {
      flex: 1 1 calc(50% - 4px);
      min-width: 7rem;
      min-height: 40px;
      border-radius: 12px;
    }
        /* 段落选择：嵌套在 deduce-host 内的次级 sheet */
    .deduce-seg-picker {
      position: absolute;
      inset: 0;
      z-index: 4;
      display: none;
      pointer-events: none;
    }
    .deduce-seg-picker.open {
      display: block;
      pointer-events: auto;
    }
    .deduce-seg-picker-bd {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.42);
      opacity: 0;
      transition: opacity 0.22s ease;
    }
    .deduce-seg-picker.open .deduce-seg-picker-bd { opacity: 1; }
    .deduce-seg-picker-panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      max-height: min(72vh, 560px);
      display: flex;
      flex-direction: column;
      background: var(--deduce-picker-bg);
      border-top-left-radius: 20px;
      border-top-right-radius: 20px;
      box-shadow: var(--deduce-picker-shadow);
      transform: translateY(100%);
      transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .deduce-seg-picker.open .deduce-seg-picker-panel {
      transform: translateY(0);
    }
    .deduce-seg-picker-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 16px 6px;
      flex-shrink: 0;
    }
    .deduce-seg-picker-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--deduce-text);
    }
    .deduce-seg-picker-sub {
      font-size: 11px;
      line-height: 1.45;
      color: var(--deduce-text2);
      padding: 0 16px 10px;
      margin: 0;
      flex-shrink: 0;
    }
    .deduce-seg-picker-list {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      padding: 4px 12px max(14px, env(safe-area-inset-bottom));
      -webkit-overflow-scrolling: touch;
    }
    .deduce-seg-opt {
      width: 100%;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      text-align: left;
      padding: 12px;
      margin-bottom: 8px;
      border-radius: 14px;
      border: 1px solid var(--deduce-border);
      background: var(--deduce-surface2);
      color: var(--deduce-text);
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease;
    }
    .deduce-seg-opt:active { opacity: 0.92; }
    .deduce-seg-opt.on {
      border-color: var(--deduce-accent);
      background: var(--deduce-accent-bg);
    }
    .deduce-seg-opt-mark {
      width: 20px;
      height: 20px;
      border-radius: 999px;
      border: 2px solid var(--deduce-border);
      flex-shrink: 0;
      margin-top: 2px;
      position: relative;
    }
    .deduce-seg-opt.on .deduce-seg-opt-mark {
      border-color: rgba(46, 230, 201, 0.9);
    }
    .deduce-seg-opt.on .deduce-seg-opt-mark::after {
      content: '';
      position: absolute;
      inset: 4px;
      border-radius: 999px;
      background: rgba(46, 230, 201, 0.95);
    }
    body.theme-light .deduce-seg-opt.on .deduce-seg-opt-mark {
      border-color: rgba(14, 165, 160, 0.85);
    }
    body.theme-light .deduce-seg-opt.on .deduce-seg-opt-mark::after {
      background: rgba(14, 165, 160, 0.9);
    }
    .deduce-seg-opt-body { flex: 1; min-width: 0; }
    .deduce-seg-opt-title {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--deduce-text);
      margin-bottom: 4px;
    }
    .deduce-seg-opt-snippet {
      display: block;
      font-size: 12px;
      line-height: 1.45;
      color: var(--deduce-text2);
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    .deduce-seg-picker-empty {
      text-align: center;
      padding: 24px 16px;
      font-size: 12px;
      color: var(--deduce-text2);
    }
    .deduce-tabs {
      display: flex;
      gap: 8px;
      flex-shrink: 0;
      margin-bottom: 4px;
      padding: 0 2px;
    }
    .deduce-tab {
      flex: 1;
      min-height: 36px;
      border-radius: 10px;
      border: 1px solid var(--deduce-border);
      background: var(--deduce-surface2);
      color: var(--deduce-text3);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
    }
    .deduce-tab.on {
      border-color: var(--deduce-accent);
      background: var(--deduce-accent-bg);
      color: var(--deduce-text);
    }
    .deduce-page {
      display: none;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      gap: 8px;
    }
    .deduce-page.deduce-page-active {
      display: flex;
    }
    .deduce-page.deduce-page-active > .deduce-dual-pane {
      flex: 1 1 auto;
      min-height: 0;
    }
    #deducePageRewrite.deduce-page-active .deduce-pane--out {
      min-height: min(38vh, 320px);
    }
    .deduce-rewrite-hint {
      font-size: 11px;
      line-height: 1.45;
      color: var(--deduce-text2) !important;
      margin: 0 0 8px;
    }
    /* 键盘弹出：结果区收缩 + 主序反转，让设定区贴近键盘 */
    body.keyboard-open .deduce-host.open .deduce-dual-pane,
    body.native-app.keyboard-open .deduce-host.open .deduce-dual-pane {
      flex-direction: column-reverse;
    }
    body.keyboard-open .deduce-host.open .deduce-pane--out,
    body.native-app.keyboard-open .deduce-host.open .deduce-pane--out {
      min-height: 0;
      flex: 0 1 auto;
      max-height: min(28vh, 220px);
    }
    body.keyboard-open .deduce-host.open .deduce-empty-hint,
    body.native-app.keyboard-open .deduce-host.open .deduce-empty-hint {
      min-height: 2.75rem;
      flex: 0 1 auto;
    }
    body.keyboard-open .deduce-host.open .deduce-pane--form,
    body.native-app.keyboard-open .deduce-host.open .deduce-pane--form {
      padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    /* 推演区始终纵向排布，避免宽屏下双栏横向滑动 */
    .deduce-result-scroll {
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      font-size: 15px;
      line-height: 1.65;
      min-height: 0;
      max-height: none;
    }
    .agents-robot-logo {
      width: 88px;
      height: 88px;
      margin-bottom: 12px;
      opacity: 0.95;
    }
    .mini-new-btn {
      width: 34px; height: 34px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#06121E;
      background: var(--brand-grad);
      box-shadow: 0 6px 16px rgba(46,230,201,0.25);
      flex: 0 0 auto;
    }
    /* 与 .robot-figure 的 --rm-fg 一致：深色白图标、浅色黑图标 */
    .home-new-chat-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      padding: 0;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: transparent;
      color: #E8ECF2;
      flex: 0 0 auto;
      box-shadow: none;
      touch-action: manipulation;
    }
    .home-new-chat-btn:active {
      transform: scale(0.98);
      opacity: 0.88;
      background: rgba(255, 255, 255, 0.06);
    }
    .home-new-chat-btn .ic-sm { width: 18px; height: 18px; stroke-width: 2px; }
    body.theme-light .home-new-chat-btn {
      border-color: rgba(15, 23, 42, 0.1);
      color: #070A12;
    }
    body.theme-light .home-new-chat-btn:active { background: rgba(15, 23, 42, 0.06); }
    .composer .mic.rec {
      color: #FF6E8A;
      box-shadow: 0 0 0 2px rgba(255,110,138,0.35);
      animation: mic-pulse 1.2s ease-in-out infinite;
    }
    @keyframes mic-pulse { 0%,100%{opacity:1} 50%{opacity:.75} }

    /* ── 语音录音浮层 ────────────────────────────────── */
    .voice-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(0,0,0,0.72); backdrop-filter: blur(12px);
      display: none; align-items: flex-end; justify-content: center;
      padding-bottom: max(env(safe-area-inset-bottom, 0px), 24px);
    }
    .voice-overlay.show { display: flex; }
    .voice-overlay-inner {
      width: 100%; max-width: 360px;
      background: rgba(22,28,40,0.95);
      border-radius: 24px 24px 20px 20px;
      padding: 32px 24px 24px;
      display: flex; flex-direction: column; align-items: center; gap: 16px;
      border: 1px solid rgba(255,255,255,0.1);
      box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
    }
    .voice-dots {
      display: flex; align-items: flex-end; gap: 5px; height: 40px;
    }
    .voice-dots i {
      display: inline-block; width: 6px; border-radius: 999px;
      background: linear-gradient(180deg, #60a5fa 0%, #a78bfa 100%);
      box-shadow: 0 0 8px rgba(96,165,250,0.6);
      animation: voice-wave 1.2s ease-in-out infinite;
    }
    .voice-dots i:nth-child(1){ height:14px; animation-delay:0s; }
    .voice-dots i:nth-child(2){ height:24px; animation-delay:.15s; }
    .voice-dots i:nth-child(3){ height:36px; animation-delay:.3s; }
    .voice-dots i:nth-child(4){ height:24px; animation-delay:.45s; }
    .voice-dots i:nth-child(5){ height:14px; animation-delay:.6s; }
    @keyframes voice-wave {
      0%,100%{ transform: scaleY(0.5); opacity:0.5; }
      50%{ transform: scaleY(1.2); opacity:1; }
    }
    .voice-status-text {
      color: #e2e8f0; font-size: 15px; margin: 0; text-align: center;
      min-height: 22px;
    }
    .voice-hint-text {
      color: #94a3b8; font-size: 13px; margin: 0; text-align: center;
    }
    .voice-overlay.cancel-mode .voice-overlay-inner {
      border-color: rgba(248, 113, 113, 0.45);
      box-shadow: 0 -8px 40px rgba(248, 113, 113, 0.15);
    }
    .voice-overlay.cancel-mode .voice-dots i {
      background: linear-gradient(180deg, #f87171 0%, #fb923c 100%);
      box-shadow: 0 0 8px rgba(248, 113, 113, 0.55);
    }
    .voice-overlay.cancel-mode .voice-status-text { color: #fecaca; }
    .voice-cancel-btn {
      padding: 10px 32px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.2);
      background: transparent; color: #94a3b8; font-size: 14px; cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    .voice-cancel-btn:active { background: rgba(255,255,255,0.08); color: #fff; }

    /* 启动脚本在 Capacitor 注入前打上 boot 类，避免 APK 仍显示 390 机壳 */
    html.native-app-boot body .stage,
    body.native-app .stage {
      min-height: 100%;
      height: 100%;
      padding: 0;
      display: block;
    }
    html.native-app-boot body .device,
    body.native-app .device {
      width: 100%;
      max-width: 100%;
      height: 100%;
      border-radius: 0;
      padding: 0;
      background: transparent;
      box-shadow: none;
    }
    html.native-app-boot body .device::before,
    html.native-app-boot body .statusbar,
    body.native-app .device::before,
    body.native-app .statusbar { display: none; }
    html.native-app-boot body .screen,
    body.native-app .screen {
      border-radius: 0;
      min-height: calc(var(--app-vh, 1vh) * 100);
    }
    html.native-app-boot body .app-shell,
    body.native-app .app-shell { inset: 0; }
    html.native-app-boot body .pages,
    body.native-app .pages { min-height: 0; }
    html.native-app-boot body .bottom-rail,
    body.native-app .bottom-rail {
      /* 无手势导航栏机型不加额外间距；有导航栏时由 has-bottom-nav 类接管 */
      padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
      transition: padding-bottom 0.25s ease;
    }
    /* 仅当 WindowInsets 报告真实导航栏高度时才抬升（勿与系统手势条重复留白） */
    body.native-app.has-bottom-nav .bottom-rail,
    html.native-app-boot body.has-bottom-nav .bottom-rail {
      padding-bottom: max(4px, env(safe-area-inset-bottom, 0px), var(--android-nav-h, 0px));
    }
    body.native-app.has-bottom-nav .tabbar,
    html.native-app-boot body.has-bottom-nav .tabbar {
      padding-bottom: 0;
    }
    /* 部分 WebView 未上报 safe-area；创作顶栏已在 .create-topbar 单独处理，此处排除 */
    body.native-app .topbar:not(.home-topbar):not(.create-topbar) {
      padding-top: calc(14px + max(26px, env(safe-area-inset-top, 0px)));
    }
    body.native-app.keyboard-open .topbar:not(.home-topbar):not(.create-topbar) {
      padding-top: calc(14px + max(26px, env(safe-area-inset-top, 0px)));
    }
    body.native-app .home-drawer .hd-panel { padding-top: calc(56px + env(safe-area-inset-top)); }
    body.keyboard-open .bottom-rail #tabbar {
      display: none !important;
    }
    /* 模型输出中仍允许切页：键盘未收起时若 composer 为 sending，底栏 Tab 继续可点 */
    body.keyboard-open .bottom-rail:has(.composer.sending) #tabbar {
      display: grid !important;
    }
    /* 对话首页：键盘打开时隐藏 tabbar（方案 A：composer 贴键盘上方，tabbar 不随键盘上浮）*/
    /* body.keyboard-open:has([data-page="home"].active) 不再强制 display:grid —— 让全局 none 生效 */
    /* 智能体 / 知识库 / 我的：同上，避免从对话切来后 keyboard-open 粘连导致底栏偶发消失 */
    /* 智能体广场/知识库/我的：非对话态可保留底栏 Tab；智能体对话内与首页一致隐藏 Tab */
    body.keyboard-open:has(.page[data-page="agents"].active:not(.agents-in-chat)) .bottom-rail #tabbar,
    body.keyboard-open:has(.page[data-page="kb"].active) .bottom-rail #tabbar,
    body.keyboard-open:has(.page[data-page="me"].active) .bottom-rail #tabbar,
    body.keyboard-open.page-agents:not(.agents-chat-focus) .bottom-rail #tabbar,
    body.keyboard-open.page-kb .bottom-rail #tabbar,
    body.keyboard-open.page-me .bottom-rail #tabbar {
      display: grid !important;
    }
    body.keyboard-open:has(.page[data-page="agents"].active.agents-in-chat) .bottom-rail #tabbar,
    body.keyboard-open.page-agents.agents-chat-focus .bottom-rail #tabbar,
    body.native-app.page-agents.agents-chat-focus.keyboard-open .bottom-rail #tabbar {
      display: none !important;
      height: 0 !important;
      min-height: 0 !important;
      max-height: 0 !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    /* 创作工作台 / 选类别：强制隐藏底栏 Tab（部分机型 keyboard-open + sending 会顶掉 display） */
    body.create-workbench-pane .bottom-rail #tabbar,
    body.create-flow-subtype-pane .bottom-rail #tabbar,
    body.create-immersive-hide-tabbar .bottom-rail #tabbar,
    body.create-workbench-pane.keyboard-open .bottom-rail:has(.composer.sending) #tabbar,
    body.create-flow-subtype-pane.keyboard-open .bottom-rail:has(.composer.sending) #tabbar,
    body.create-immersive-hide-tabbar.keyboard-open .bottom-rail:has(.composer.sending) #tabbar,
    body.create-workbench-pane.keyboard-open:has(.page[data-page="create"].active) .bottom-rail #tabbar,
    body.create-flow-subtype-pane.keyboard-open:has(.page[data-page="create"].active) .bottom-rail #tabbar {
      display: none !important;
      visibility: hidden !important;
      height: 0 !important;
      min-height: 0 !important;
      max-height: 0 !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
    body.create-workbench-pane .bottom-rail {
      padding-top: 0;
      gap: 10px;
      padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    }
    body.create-workbench-pane.native-app .toast {
      bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }
    /* 体裁九宫格：隐藏输入条，强制保留底部四 Tab */
    body.create-flow-genre-pane .bottom-rail #composer,
    body.create-flow-genre-pane .bottom-rail #composerDeepRow,
    body.create-flow-genre-pane .bottom-rail #kbBar,
    body.create-flow-genre-pane .bottom-rail #composerAttachBar {
      display: none !important;
      pointer-events: none !important;
    }
    body.create-flow-genre-pane .bottom-rail #tabbar {
      display: grid !important;
    }
    body.create-flow-genre-pane .bottom-rail {
      padding-top: 0;
      gap: 0;
      padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    }
    /* 选类别/设定与创作工作台：隐藏输入条与底部四 Tab */
    body.create-flow-subtype-pane .bottom-rail #composer,
    body.create-flow-subtype-pane .bottom-rail #composerDeepRow,
    body.create-flow-subtype-pane .bottom-rail #kbBar,
    body.create-flow-subtype-pane .bottom-rail #composerAttachBar,
    body.create-flow-subtype-pane .bottom-rail #tabbar {
      display: none !important;
      pointer-events: none !important;
    }
    body.create-workbench-pane .bottom-rail .composer {
      align-items: center;
    }
    body.create-flow-subtype-pane .bottom-rail {
      padding-top: 0;
      gap: 0;
      padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    }
    body.native-app.keyboard-open .overlay.open {
      padding-bottom: var(--kb-vv-inset, 0px);
    }
    body.native-app.keyboard-open .sheet.open,
    body.native-app.keyboard-open .deduce-host.open #deduceSheet {
      bottom: var(--kb-vv-inset, 0px);
    }
    body.native-app.keyboard-open .kb-picker.open .kp-panel {
      bottom: var(--kb-vv-inset, 0px);
    }
    body.native-app.keyboard-open .expert-sheet.open .es-panel {
      bottom: var(--kb-vv-inset, 0px);
    }
    /* 兜底：若机型未触发原生 resize，则手动给 app-shell 底部补偿 */
    body.native-app.keyboard-manual .app-shell {
      padding-bottom: var(--kb-manual-inset, 0px);
    }
    body.native-app .toast {
      bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    /* ====== 底部 Tab Bar ====== */
    .tabbar {
      position: relative;
      left: auto;
      right: auto;
      bottom: auto;
      width: 100%;
      height: 64px;
      flex: 0 0 auto;
      border-radius: 22px;
      background: linear-gradient(180deg, rgba(20,26,40,0.94), rgba(12,17,28,0.94));
      border: 1px solid rgba(255,255,255,0.07);
      -webkit-backdrop-filter: blur(18px);
      backdrop-filter: blur(18px);
      box-shadow: 0 18px 40px rgba(0,0,0,0.45);
      z-index: 45;
      display: grid; grid-template-columns: repeat(4, 1fr);
    }
    .tabbar button {
      display:flex; flex-direction:column; align-items:center; justify-content:center;
      gap: 3px; color:#7B8696; font-size: 9px;
      transition: color .2s ease;
    }
    .tabbar button span:last-child {
      white-space: nowrap;
      transform: scale(.94);
      transform-origin: center;
      line-height: 1;
    }
    .tabbar button.active { color:#E8ECF2; }
    .tabbar button.active .dot {
      background: linear-gradient(90deg, #2EE6C9, #5B8CFF);
    }
    .tabbar .dot {
      width: 18px; height: 3px; border-radius: 3px; background: transparent;
      margin-bottom: 1px;
    }

    /* ====== 首页侧边历史 ====== */
    .home-drawer {
      position: absolute; inset: 0; z-index: 65;
      pointer-events: none;
    }
    .home-drawer.open { pointer-events: auto; }
    .home-drawer .hd-backdrop {
      position: absolute; inset: 0;
      background: rgba(0,0,0,0.45); opacity: 0;
      transition: opacity .25s ease;
      z-index: 1;
    }
    .home-drawer.open .hd-backdrop { opacity: 1; }
    .home-drawer .hd-panel {
      position: absolute; left: 0; top: 0; bottom: 0; width: 78%;
      max-width: 290px;
      transform: translateX(-102%);
      transition: transform .3s cubic-bezier(.2,.8,.2,1);
      background: linear-gradient(180deg, #0E1421, #0A0F1A);
      border-right: 1px solid rgba(255,255,255,0.08);
      padding: calc(56px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
      display: flex; flex-direction: column;
      z-index: 2;
      pointer-events: auto;
    }
    .home-drawer.open .hd-panel { transform: translateX(0); }
    .hd-head {
      padding: 0 6px 8px; display:flex; align-items:center; justify-content:space-between;
      color: #E8ECF2; font-size: 13px;
    }
    .hd-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 6px 10px 4px; -webkit-overflow-scrolling: touch; }
    .hd-list::-webkit-scrollbar { display:none; }
    .hd-item {
      position: relative;
      width: 100%; text-align: left; padding: 10px 48px 10px 10px; border-radius: 12px;
      background: transparent; border: 1px solid transparent;
      margin-bottom: 6px;
      display: flex; align-items: center; gap: 8px;
      box-sizing: border-box;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      pointer-events: auto;
    }
    .hd-item:hover { background: rgba(255,255,255,0.03); }
    .hd-item:active { background: rgba(91,140,255,0.18); }
    .hd-item.on { background: rgba(91,140,255,0.12); border-color: rgba(91,140,255,0.26); }
    .hd-agent-tag {
      display: inline-block;
      margin-left: 6px;
      padding: 1px 6px;
      font-size: 10px;
      font-weight: 600;
      line-height: 1.35;
      border-radius: 6px;
      color: #2563eb;
      background: rgba(37, 99, 235, 0.12);
      vertical-align: 0.1em;
    }
    body.theme-light .hd-agent-tag {
      color: #1d4ed8;
      background: rgba(37, 99, 235, 0.1);
    }
    .hd-agent-avatar {
      flex: 0 0 32px;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      object-fit: cover;
      background: rgba(255,255,255,0.06);
    }
    .hd-agent-avatar--emoji {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 17px;
    }
    .hd-main { flex: 1; min-width: 0; cursor: pointer; }
    .hd-title { font-size: 12.5px; color:#E8ECF2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hd-meta { font-size: 10.5px; color:#6B7585; margin-top: 3px; }
    .hd-del {
      position: absolute;
      right: 2px;
      top: 50%;
      transform: translateY(-50%);
      z-index: 3;
      width: 44px; height: 44px; min-width: 44px; min-height: 44px;
      border: none;
      padding: 0;
      border-radius: 999px;
      background: transparent;
      display:flex; align-items:center; justify-content:center;
      color:#9aa3b2;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }
    .hd-del .ic-sm { width: 16px; height: 16px; pointer-events: none; }
    .hd-del:hover { color:#FF6E8A; background: rgba(255,110,138,0.10); }
    .hd-del:active { background: rgba(255,110,138,0.18); color:#FF6E8A; }
    .hd-segs { margin-top: 8px; display:flex; flex-direction:column; gap: 6px; }
    .hd-seg-row { display:flex; align-items:stretch; gap:6px; }
    .hd-seg {
      flex: 1;
      border-radius: 12px;
      padding: 12px 14px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.06);
      color: #D7DEE8;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.45;
      text-align: left;
      min-height: 48px;
    }
    .hd-seg:hover { border-color: rgba(91,140,255,0.26); background: rgba(91,140,255,0.10); }
    .hd-seg-del {
      width: 44px;
      min-height: 48px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.05);
      color: #6B7585;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
    }
    .hd-seg-del:hover { color:#FF6E8A; border-color: rgba(255,110,138,0.28); background: rgba(255,110,138,0.12); }

    /* ====== 创作侧边历史：叠在创作页内与创作台同高；历史在左、右侧为半透明创作区 ====== */
    .create-drawer {
      position: absolute;
      inset: 0;
      z-index: 66;
      pointer-events: none;
      display: flex;
      flex-direction: row;
      align-items: stretch;
      min-height: 0;
      height: 100%;
    }
    .create-drawer.open { pointer-events: auto; }
    .create-drawer .cd-backdrop {
      flex: 1 1 auto;
      min-width: 0;
      position: relative;
      background: rgba(0, 0, 0, 0.32);
      opacity: 0;
      transition: opacity 0.26s ease;
    }
    .create-drawer.open .cd-backdrop { opacity: 1; }
    .create-drawer .cd-panel {
      position: relative;
      flex: 0 0 auto;
      width: min(82vw, 300px);
      max-width: 0;
      min-height: 0;
      height: 100%;
      align-self: stretch;
      overflow: hidden;
      transition: max-width 0.34s cubic-bezier(.2,.8,.2,1), opacity 0.22s ease, border-color 0.2s ease;
      opacity: 0;
      transform: none;
      left: auto; top: auto; bottom: auto;
      background: linear-gradient(180deg, #0E1421, #0A0F1A);
      border-right: 1px solid rgba(255,255,255,0.08);
      padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px));
      display: flex; flex-direction: column;
    }
    .create-drawer.open .cd-panel {
      max-width: min(82vw, 300px);
      opacity: 1;
    }
    .cd-head {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 14px 10px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .cd-head-main { flex: 1; min-width: 0; }
    .cd-head-title { font-size: 15px; font-weight: 700; color: #e8ecf2; line-height: 1.2; }
    .cd-head-sub { font-size: 11px; color: #9aa3b2; margin-top: 2px; }
    .cd-head-new {
      flex-shrink: 0;
      height: 32px;
      padding: 0 12px;
      border-radius: 999px;
      border: 1px solid rgba(46,230,201,0.35);
      background: linear-gradient(135deg, rgba(46,230,201,0.22), rgba(91,140,255,0.18));
      color: #e8ecf2;
      font-size: 12px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .cd-head-new:active { opacity: 0.88; transform: translateY(1px); }
    .cd-list-toolbar {
      padding: 8px 12px 4px;
    }
    .cd-search {
      width: 100%;
      height: 36px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.04);
      color: #e8ecf2;
      font-size: 13px;
      padding: 0 12px;
      outline: none;
    }
    .cd-item-card {
      margin: 0 10px 8px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.03);
      overflow: hidden;
    }
    .cd-item-card.on {
      border-color: rgba(46,230,201,0.38);
      background: linear-gradient(180deg, rgba(46,230,201,0.12), rgba(91,140,255,0.06));
      box-shadow: inset 3px 0 0 rgba(46,230,201,0.65);
    }
    .cd-item-top {
      position: relative;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 10px 52px 8px 10px;
    }
    .cd-item-main { flex: 1; min-width: 0; cursor: pointer; }
    .cd-item-top .cd-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
    .cd-item-top .cd-meta { font-size: 11px; color: #9aa3b2; margin-top: 4px; }
    .cd-meta--preview { font-size: 11px; color: #6b7585; margin-top: 6px; line-height: 1.45; }
    .cd-item-card--wenxin .cd-item-body { display: none !important; }
    .cd-item-del {
      position: absolute;
      right: 6px;
      top: 50%;
      transform: translateY(-50%);
      z-index: 3;
      width: 44px;
      height: 44px;
      min-width: 44px;
      min-height: 44px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
      color: #9aa3b2;
      display: flex;
      align-items: center;
      justify-content: center;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      cursor: pointer;
    }
    .cd-item-del .ic-sm { pointer-events: none; }
    .create-en-final-hint {
      font-size: 10px;
      color: #9aa3b2;
      line-height: 1.35;
      margin: -4px 0 8px;
      opacity: 0.92;
    }
    body.theme-light .create-en-final-hint { color: #64748b; }
    body.theme-light .cd-head { border-bottom-color: rgba(15,23,42,0.1); }
    body.theme-light .cd-head-title { color: #0f172a; }
    body.theme-light .cd-head-sub { color: #64748b; }
    body.theme-light .cd-head-new { color: #0f172a; border-color: rgba(14,165,160,0.28); }
    body.theme-light .cd-search { color: #0f172a; background: #fff; border-color: rgba(15,23,42,0.12); }
    body.theme-light .cd-item-card { background: #fff; border-color: rgba(15,23,42,0.1); }
    body.theme-light .cd-item-card.on { border-color: rgba(14,165,160,0.35); background: linear-gradient(180deg, rgba(167,243,208,0.2), rgba(186,230,253,0.12)); box-shadow: inset 3px 0 0 rgba(14,165,160,0.55); }
    body.theme-light .cd-item-del { border-color: rgba(15,23,42,0.1); background: rgba(15,23,42,0.03); color: #64748b; }
    .cd-head-legacy {
      padding: 0 6px 8px; display:flex; align-items:center; justify-content:space-between;
      color: #E8ECF2; font-size: 13px;
    }
    .cd-list {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding: 4px 4px 10px;
    }
    body.native-app .create-drawer.open .cd-list {
      padding-bottom: 10px;
    }
    .cd-list::-webkit-scrollbar { display:none; }
    .cd-item {
      width: 100%; text-align: left; padding: 10px 10px; border-radius: 12px;
      background: transparent; border: 1px solid rgba(255,255,255,0.06);
      margin-bottom: 6px;
      display: flex; align-items: center; gap: 8px;
    }
    .cd-item.on { background: rgba(46,230,201,0.10); border-color: rgba(46,230,201,0.20); }
    .cd-title { font-size: 12.5px; color:#E8ECF2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cd-meta { font-size: 10.5px; color:#6B7585; margin-top: 3px; }
    .cd-meta-sm { font-size: 10px; color: #6b7585; font-weight: 500; }
    .cd-drawer .cd-fold .name-input { font-size: 12px; padding: 8px 10px; }
    .cd-segs { margin-top: 8px; display:flex; flex-direction:column; gap: 6px; }
    .cd-fold + .cd-fold { margin-top: 14px; }
    .cd-fold > summary {
      list-style: none;
      border: none;
      border-radius: 10px;
      padding: 10px 8px;
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-size: 14px;
      font-weight: 700;
    }
    .cd-fold > summary::-webkit-details-marker { display: none; }
    .cd-fold-settings > summary { color: #7DECD8; }
    .cd-fold-segs > summary { color: #8DB1FF; }
    /* 创作历史：设定 / 章节历史 独立按钮（替代 details，真机更易点、展开态更明显） */
    .cd-drawer-toggle-row {
      display: flex;
      flex-direction: row;
      gap: 8px;
      margin-top: 10px;
      flex-wrap: nowrap;
    }
    .cd-drawer-toggle {
      flex: 1 1 0;
      min-width: 0;
      min-height: 44px;
      padding: 8px 6px;
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      background: rgba(255, 255, 255, 0.07);
      color: #e8ecf2;
      font-size: 12px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      -webkit-tap-highlight-color: transparent;
    }
    .cd-drawer-toggle:active {
      background: rgba(255, 255, 255, 0.11);
    }
    .cd-drawer-toggle.on {
      border-color: rgba(46, 230, 201, 0.45);
      background: rgba(46, 230, 201, 0.14);
      color: #c9fff6;
    }
    .cd-drawer-toggle--segs.on {
      border-color: rgba(91, 140, 255, 0.45);
      background: rgba(91, 140, 255, 0.14);
      color: #dbe8ff;
    }
    .cd-drawer-panel {
      margin-top: 8px;
    }
    .cd-drawer-panel[hidden] {
      display: none !important;
    }
    .cd-drawer-panel .cd-segs {
      margin-top: 0;
    }
    .cd-seg-row { display:flex; align-items:stretch; gap:6px; }
    .cd-seg {
      flex: 1;
      border-radius: 12px;
      padding: 12px 14px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.06);
      color: #D7DEE8;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.45;
      text-align: left;
      min-height: 48px;
    }
    .cd-seg:hover { border-color: rgba(46,230,201,0.22); background: rgba(46,230,201,0.08); }
    .cd-seg kbd {
      display: inline-block;
      min-width: 22px;
      margin-right: 6px;
      border-radius: 7px;
      padding: 2px 6px;
      background: rgba(91,140,255,0.2);
      color: #5B8CFF;
      font-size: 11px;
      line-height: 18px;
      vertical-align: 1px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }
    .cd-seg-del {
      position: relative;
      z-index: 3;
      width: 48px;
      min-width: 48px;
      min-height: 48px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.05);
      color: #6B7585;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }
    .cd-seg-del .ic-sm { pointer-events: none; }
    .cd-seg-del:hover { color:#FF6E8A; border-color: rgba(255,110,138,0.28); background: rgba(255,110,138,0.12); }
    .hd-seg kbd {
      display: inline-block;
      min-width: 18px;
      margin-right: 5px;
      border-radius: 6px;
      padding: 0 5px;
      background: rgba(46,230,201,0.16);
      color: #2EE6C9;
      font-size: 10px;
      line-height: 16px;
      vertical-align: 1px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    }

    /* ====== 自定义场景面板（底部 Sheet） ====== */
    .sheet {
      position: absolute; left: 0; right: 0; bottom: 0;
      max-height: 78%;
      background: linear-gradient(180deg, #131929 0%, #0A0E18 100%);
      border-top-left-radius: 28px; border-top-right-radius: 28px;
      border-top: 1px solid rgba(255,255,255,0.08);
      /* 100% 仅贴底边仍会露缝；用额外像素彻底移出视口，避免与底栏叠出「编辑场景导航」条 */
      transform: translateY(calc(100% + 24px)); transition: transform .42s cubic-bezier(.2,.8,.2,1);
      z-index: 80; padding: 8px 18px 26px 18px; overflow-y: auto;
    }
    .sheet.open { transform: translateY(0); }
    #sceneSheet:not(.open) { pointer-events: none; }
    /* 场景编辑 sheet：关闭态用视口高度移出 + 创作工作台页直接不渲染占位，避免底栏叠字 */
    #sceneSheet {
      transform: translateY(120vh);
    }
    #sceneSheet.open {
      transform: translateY(0);
    }
    /* 创作 Tab 任意阶段都不应露出未打开的场景 sheet（避免与底栏叠影） */
    body:has(.page[data-page="create"].active) #sceneSheet:not(.open) {
      display: none !important;
    }
    /* 情节推演：全屏 fixed 宿主 + 遮罩；关闭时用 display:none 避免 WebView 仍命中透明层导致底栏无法点击 */
    .deduce-host {
      position: fixed;
      inset: 0;
      z-index: 300;
      display: none;
    }
    .deduce-host.open {
      display: block;
      pointer-events: auto;
    }
    .deduce-host .deduce-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.48);
      opacity: 0;
      transition: opacity 0.28s ease;
    }
    .deduce-host.open .deduce-backdrop { opacity: 1; }
    .deduce-host #deduceSheet {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      max-height: 88vh;
      z-index: 1;
      transform: translateY(calc(100% + 24px));
      transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .deduce-host.open #deduceSheet {
      transform: translateY(0);
    }
    .sheet-handle {
      width: 38px; height: 4px; border-radius: 999px;
      background: rgba(255,255,255,0.18); margin: 6px auto 14px;
    }
    .sheet h3 { font-size: 12px; color:#6B7585; margin-bottom: 8px; letter-spacing:.02em; }
    .scene-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .scene-tile {
      display:flex; flex-direction:column; align-items:flex-start; gap: 4px;
      padding: 12px; border-radius: 14px; text-align:left;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
      color:#E8ECF2; font-size: 12.5px;
      position: relative;
    }
    .scene-tile.on {
      background: linear-gradient(180deg, rgba(46,230,201,0.14), rgba(91,140,255,0.06));
      border-color: rgba(46,230,201,0.32);
    }
    .scene-tile .ic-wrap {
      width: 26px; height: 26px; border-radius: 8px;
      display:flex; align-items:center; justify-content:center;
      background: rgba(255,255,255,0.04); color:#9AA3B2;
    }
    .scene-tile.on .ic-wrap { background: rgba(46,230,201,0.18); color:#2EE6C9; }
    .scene-tile .corner {
      position:absolute; right: 8px; top: 8px;
      font-size: 10px; color:#06121E;
      width: 18px; height: 18px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      background: var(--brand-grad);
      opacity: 0; transition: opacity .2s;
    }
    .scene-tile.on .corner { opacity: 1; }

    /* sheet 上半部：当前导航的可拖动列表（视觉） */
    .nav-list { display:flex; flex-direction:column; gap: 6px; margin-bottom: 18px; }
    .nav-item {
      display:flex; align-items:center; gap: 10px;
      padding: 10px 12px; border-radius: 12px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .nav-item .grip { color:#6B7585; }
    .nav-item .name { flex:1; color:#E8ECF2; font-size: 13.5px; }
    .nav-item .rm { color:#FF6E8A; font-size: 12px; }
    .nav-item.primary .name::after {
      content: " 榛樿";
      color:#9AA3B2; font-size: 10.5px; margin-left: 4px;
      background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 999px;
    }

    /* ====== 创建智能体覆盖层（保留并轻量化） ====== */
    .overlay {
      position: absolute; inset: 0; z-index: 90;
      border-radius: 44px; overflow: hidden;
      overflow-x: hidden !important;
      background: radial-gradient(120% 80% at 50% -10%, #1A2240 0%, #0A0E18 55%, #06080F 100%);
      transform: translateY(102%);
      transition: transform .5s cubic-bezier(.2,.8,.2,1);
      display:flex; flex-direction:column;
      max-width: 100%;
      touch-action: pan-y;
      overscroll-behavior-x: none;
    }
    .overlay:not(.open) {
      visibility: hidden;
      pointer-events: none;
    }
    .overlay.open {
      transform: translateY(0);
      visibility: visible;
      pointer-events: auto;
    }
    .confirm-mask {
      position: absolute; inset: 0; z-index: 400;
      background: rgba(4,8,15,0.55);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    /* APK WebView：absolute 叠在侧栏/多图层下偶发被挡或裁切，fixed 贴视口保证确认框总在最顶 */
    body.native-app .confirm-mask {
      position: fixed;
      inset: 0;
      z-index: 200000;
      padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px))
        max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
    }
    .confirm-mask.open { display: flex; }
    .confirm-card {
      width: min(92vw, 360px);
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.10);
      background: #101827;
      box-shadow: 0 14px 36px rgba(0,0,0,0.35);
      padding: 14px;
      color: #E8ECF2;
    }
    .confirm-card.confirm-card-accent {
      border-color: rgba(255, 110, 138, 0.22);
      box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 110, 138, 0.08) inset;
    }
    .confirm-card.confirm-card-accent .confirm-title {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .confirm-card.confirm-card-accent .confirm-title::before {
      content: "";
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ff6e8a, #f5b14a);
      flex-shrink: 0;
    }
    .confirm-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
    .confirm-msg { font-size: 13px; color: #C4CBD7; line-height: 1.5; white-space: pre-wrap; }
    .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
    .confirm-actions button {
      height: 34px; min-width: 72px; padding: 0 12px; border-radius: 10px; font-size: 12px;
      border: 1px solid rgba(255,255,255,0.12); color: #E8ECF2; background: rgba(255,255,255,0.06);
    }
    .confirm-actions .ok { background: var(--brand-grad); color: #06121E; border-color: transparent; }
    .ov-head {
      flex: 0 0 auto; padding: 50px 18px 6px 18px;
      display:flex; align-items:center; justify-content:space-between;
    }
    .ov-head .h-btn {
      width: 34px; height: 34px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#9AA3B2; background: rgba(255,255,255,0.04);
    }
    .ov-head .h-test {
      height: 32px; padding: 0 12px; border-radius: 999px;
      font-size: 12px; color:#E8ECF2;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
      display:flex; align-items:center; gap: 6px;
    }
    .ov-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden !important; padding: 4px 18px 110px; max-width: 100%; touch-action: pan-y; overscroll-behavior-x: none; }
    .ov-scroll::-webkit-scrollbar { display: none; }

    .orb-wrap { display:flex; flex-direction:column; align-items:center; padding: 4px 0 10px; }
    .orb {
      position: relative;
      width: 100px; height: 100px; border-radius: 999px;
      background:
        radial-gradient(60% 60% at 35% 30%, var(--orb-c1, #2EE6C9) 0%, transparent 70%),
        radial-gradient(70% 70% at 70% 75%, var(--orb-c2, #5B8CFF) 0%, transparent 75%),
        #0B0F1A;
      box-shadow: 0 12px 40px rgba(46,230,201,0.20), 0 6px 24px rgba(91,140,255,0.16),
                  inset 0 0 0 1px rgba(255,255,255,0.06);
      transition: background .5s ease;
    }
    .orb-letter {
      position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
      font-family: 'Noto Serif SC', serif; font-weight: 500;
      font-size: 34px; color: rgba(255,255,255,0.92);
    }
    .orb-actions { margin-top: 8px; display:flex; gap: 6px; }
    .orb-actions button {
      height: 26px; padding: 0 10px; border-radius: 999px;
      font-size: 11.5px; color:#9AA3B2;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.07);
      display:flex; align-items:center; gap: 4px;
    }
    .name-input {
      margin-top: 10px; width: 100%;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.10);
      border-radius: 10px;
      outline: none;
      text-align: left;
      color:#E8ECF2;
      font-family: inherit;
      font-weight: 500;
      font-size: 14px;
      padding: 10px 12px;
      letter-spacing: .01em;
    }
    /* 登录：验证码输入与「获取验证码」同高对齐（抵消 .name-input 默认 margin-top） */
    #loginSmsPane .login-code-row {
      display: flex;
      align-items: stretch;
      gap: 8px;
      margin-top: 8px;
    }
    #loginSmsPane .login-code-row .name-input {
      margin-top: 0;
      flex: 1 1 auto;
      min-width: 0;
      width: auto;
      height: 40px;
      min-height: 40px;
      box-sizing: border-box;
      padding: 11px 12px;
      line-height: 1.15;
    }
    #loginSmsPane .login-code-row #loginSendSms {
      flex: 0 0 auto;
      height: 40px;
      min-height: 40px;
      box-sizing: border-box;
      margin: 0;
      padding: 0 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
    }
    .bio-input {
      width: 100%;
      background: transparent; border: none; outline: none;
      text-align: center; color:#9AA3B2; font-size: 12px;
    }
    .form-card {
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 16px; padding: 14px;
    }
    .form-card + .form-card { margin-top: 10px; }
    .form-card h3 {
      font-size: 13px; color:#E8ECF2; font-weight: 500;
      display:flex; align-items:center; gap: 6px;
    }
    .form-card .num {
      width: 18px; height: 18px; border-radius: 999px;
      display:inline-flex; align-items:center; justify-content:center;
      font-size: 10px; color:#06121E; font-weight: 600;
      background: var(--brand-grad);
    }
    .form-card .help { font-size: 11.5px; color:#6B7585; margin-top: 3px; }
    .pick-chip {
      display:inline-flex; align-items:center; gap: 5px;
      padding: 7px 10px; border-radius: 999px;
      font-size: 12px; color:#9AA3B2;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .pick-chip.on { color:#E8ECF2; background: rgba(46,230,201,0.14); border-color: rgba(46,230,201,0.30); }
    .pick-chip.primary {
      color:#06121E; background: var(--brand-grad);
      border-color: transparent;
    }
    .seg-row { display:flex; align-items:center; justify-content:space-between; margin-top: 8px; }
    .seg-row .label { font-size: 12px; color:#9AA3B2; }
    .seg-mini { display:flex; padding: 3px; gap: 3px;
      background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
      border-radius: 999px;
    }
    .seg-mini button { padding: 5px 9px; border-radius: 999px; font-size: 11.5px; color:#9AA3B2; }
    .seg-mini button.on { color:#E8ECF2; background: rgba(46,230,201,0.14); }
    .ov-foot {
      flex: 0 0 auto;
      padding: 12px 16px 24px;
      background: linear-gradient(180deg, rgba(10,14,24,0), rgba(10,14,24,0.94) 40%);
      display:flex; align-items:center; gap: 10px;
    }
    .ov-foot .draft { flex:1; font-size: 11.5px; color:#6B7585; display:flex; align-items:center; gap: 6px; }
    .ov-foot .cta {
      height: 44px; padding: 0 20px; border-radius: 999px;
      background: var(--brand-grad);
      color:#06121E; font-weight: 600; font-size: 14px;
      display:flex; align-items:center; gap: 8px;
    }

    /* ====== 团队 / 协作模式 ====== */
    .team-orb {
      position: relative; width: 96px; height: 96px; border-radius: 999px;
      background:
        radial-gradient(60% 60% at 30% 28%, var(--c1, #2EE6C9) 0%, transparent 70%),
        radial-gradient(70% 70% at 75% 78%, var(--c2, #5B8CFF) 0%, transparent 75%),
        #0B0F1A;
      box-shadow: 0 12px 40px rgba(46,230,201,0.18), 0 6px 24px rgba(91,140,255,0.14),
                  inset 0 0 0 1px rgba(255,255,255,0.06);
      display:flex; align-items:center; justify-content:center;
    }
    .team-orb .arch-mark {
      position:absolute; right: -2px; bottom: -2px;
      width: 28px; height: 28px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      background: #0A0E18; border:1px solid rgba(255,255,255,0.10);
      color:#2EE6C9;
    }
    .team-orb .stack {
      display:flex; align-items:center; justify-content:center; gap:2px;
      font-family:'Noto Serif SC', serif; font-size: 22px; color: rgba(255,255,255,0.9);
    }
    .team-orb .stack span+span { opacity:.7; font-size:16px; }
    .team-orb .stack span+span+span { opacity:.45; font-size:12px; }

    .arch-tabs {
      display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
      padding: 3px; border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .arch-tab {
      display:flex; flex-direction:column; align-items:center; gap:3px;
      padding: 8px 4px; border-radius: 10px;
      font-size: 10.5px; color:#9AA3B2;
      transition: background .2s, color .2s;
    }
    .arch-tab .ic-sm { width:14px; height:14px; }
    .arch-tab.on {
      color:#06121E; background: var(--brand-grad);
      box-shadow: 0 4px 12px rgba(46,230,201,0.25);
    }

    /* ====== 团队画布 ====== */
    .team-canvas {
      position: relative;
      height: 260px; width: 100%;
      border-radius: 14px;
      background:
        radial-gradient(80% 60% at 50% 30%, rgba(91,140,255,0.06) 0%, transparent 70%),
        rgba(255,255,255,0.015);
      border: 1px solid rgba(255,255,255,0.06);
      overflow: hidden;
    }
    .team-canvas svg {
      position: absolute; inset: 0; width: 100%; height: 100%;
      pointer-events: none;
    }
    .team-canvas .conn { stroke: rgba(255,255,255,0.14); stroke-width: 1.4; fill:none; }
    .team-canvas .conn.thick { stroke-width: 1.6; }
    .team-canvas .conn.active {
      stroke: url(#connGrad); stroke-width: 2;
      stroke-dasharray: 5 5; animation: connDash 1.1s linear infinite;
      filter: drop-shadow(0 0 4px rgba(46,230,201,0.4));
    }
    .team-canvas .conn-arrow { fill: rgba(255,255,255,0.32); }
    @keyframes connDash { to { stroke-dashoffset: -20; } }

    .tnode {
      position: absolute; transform: translate(-50%,-50%);
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      cursor: pointer; -webkit-user-select: none; user-select: none;
    }
    .tnode .n-orb {
      width: 46px; height: 46px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      font-family:'Noto Serif SC', serif; font-size: 18px; color: rgba(255,255,255,0.95);
      background:
        radial-gradient(60% 60% at 32% 30%, var(--nc1, #5B8CFF) 0%, transparent 70%),
        radial-gradient(70% 70% at 70% 75%, var(--nc2, #2EE6C9) 0%, transparent 75%),
        #0B0F1A;
      border: 1.2px solid rgba(255,255,255,0.10);
      box-shadow: 0 6px 16px rgba(0,0,0,0.45);
      transition: transform .2s, box-shadow .2s;
    }
    .tnode:active .n-orb { transform: scale(.96); }
    .tnode.hub .n-orb {
      width: 56px; height: 56px;
      background: radial-gradient(60% 60% at 50% 40%, #2EE6C9 0%, #1B5E5F 60%, #0B0F1A 100%);
      color:#06121E; font-family:'Inter', sans-serif; font-weight:700; font-size:11px;
      box-shadow: 0 8px 22px rgba(46,230,201,0.30), 0 0 0 1px rgba(46,230,201,0.18);
    }
    .tnode.agg .n-orb {
      width: 52px; height: 52px;
      background: radial-gradient(60% 60% at 50% 40%, #5B8CFF 0%, #2A3F76 60%, #0B0F1A 100%);
      color:#fff; font-family:'Inter', sans-serif; font-weight:600; font-size:11px;
      box-shadow: 0 8px 22px rgba(91,140,255,0.28);
    }
    .tnode.add .n-orb {
      background: transparent;
      border: 1.4px dashed rgba(255,255,255,0.22);
      color: rgba(255,255,255,0.45);
    }
    .tnode .n-label {
      font-size: 10px; color:#9AA3B2; line-height: 1.2;
      max-width: 70px; text-align:center; white-space:nowrap;
      overflow:hidden; text-overflow:ellipsis;
    }
    .tnode .n-sub { font-size: 9px; color:#6B7585; }
    .tnode.active .n-orb {
      box-shadow: 0 0 0 2px #2EE6C9, 0 0 22px rgba(46,230,201,0.45),
                  0 6px 16px rgba(0,0,0,0.45);
    }
    .tnode .n-step {
      position:absolute; top:-2px; right:-2px;
      width:16px; height:16px; border-radius:999px;
      background:#0A0E18; border:1px solid rgba(255,255,255,0.12);
      color:#2EE6C9; font-size:9px; font-weight:600;
      display:flex; align-items:center; justify-content:center;
    }

    .canvas-meta {
      display:flex; align-items:center; justify-content:space-between;
      font-size: 11px; color:#6B7585;
    }
    .canvas-meta .pill {
      padding: 3px 8px; border-radius: 999px;
      background: rgba(46,230,201,0.10); color:#2EE6C9;
      font-size: 10.5px;
    }

    /* ====== 调度规则 / 输出策略 ====== */
    .rule-row {
      display:flex; align-items:center; gap: 10px;
      padding: 10px 12px; margin-top: 6px;
      border-radius: 12px;
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(255,255,255,0.05);
    }
    .rule-row.on { background: rgba(46,230,201,0.07); border-color: rgba(46,230,201,0.22); }
    .rule-row .r-radio {
      width: 16px; height: 16px; border-radius: 999px;
      border: 1.5px solid rgba(255,255,255,0.18);
      flex: 0 0 16px;
      display:flex; align-items:center; justify-content:center;
    }
    .rule-row.on .r-radio { border-color:#2EE6C9; }
    .rule-row.on .r-radio::after {
      content:""; width:8px; height:8px; border-radius:999px; background:#2EE6C9;
    }
    .rule-row .r-text { flex:1; }
    .rule-row .r-title { font-size: 12.5px; color:#E8ECF2; }
    .rule-row .r-help  { font-size: 11px; color:#6B7585; margin-top: 2px; }

    /* ====== 预览 ====== */
    .pv-input {
      display:flex; align-items:center; gap: 8px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.07);
      border-radius: 999px; padding: 4px 4px 4px 14px;
    }
    .pv-input input {
      flex:1; background: transparent; border: none; outline: none;
      color:#E8ECF2; font-size: 12.5px; padding: 8px 0;
    }
    .pv-input input::placeholder { color:#6B7585; }
    .pv-input button {
      width: 32px; height: 32px; border-radius: 999px;
      background: var(--brand-grad); color:#06121E;
      display:flex; align-items:center; justify-content:center;
    }
    .pv-flow { font-size: 11px; color:#9AA3B2; display:flex; align-items:center; gap:6px; flex-wrap: wrap; }
    .pv-flow .step {
      padding: 3px 8px; border-radius: 999px;
      background: rgba(46,230,201,0.10); color:#2EE6C9; font-size: 10.5px;
    }
    .pv-flow .arrow { color:#3a4252; }
    .pv-card {
      margin-top: 8px; padding: 10px 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.025);
      border-left: 2px solid var(--ec, #2EE6C9);
    }
    .pv-card .pv-h {
      display:flex; align-items:center; gap: 6px;
      font-size: 11.5px; color:#E8ECF2; margin-bottom: 4px;
    }
    .pv-card .pv-h .who { color:#9AA3B2; font-size:10.5px; }
    .pv-card .pv-body { font-size: 12px; color:#9AA3B2; line-height: 1.55; }
    .pv-final {
      margin-top: 10px; padding: 12px;
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(46,230,201,0.10), rgba(91,140,255,0.06));
      border: 1px solid rgba(46,230,201,0.22);
    }
    .pv-final .pf-h {
      display:flex; align-items:center; gap: 6px;
      font-size: 11.5px; color:#2EE6C9; margin-bottom: 6px;
    }
    .pv-final .pf-body { font-size: 12.5px; color:#E8ECF2; line-height: 1.55; }

    /* ====== 知识库（页面 / 详情 / 选择器 / 引用） ====== */
    .expert-sheet {
      position: absolute; inset: 0; z-index: 95;
      pointer-events: none;
      visibility: hidden;
    }
    .expert-sheet.open {
      pointer-events: auto;
      visibility: visible;
    }
    .expert-sheet .es-bd {
      position:absolute; inset:0;
      background: rgba(0,0,0,0.45); opacity: 0;
      transition: opacity .25s ease;
    }
    .expert-sheet.open .es-bd { opacity: 1; }
    .expert-sheet .es-panel {
      position:absolute; left:0; right:0; bottom:0;
      max-height: 78%;
      background: #0E121C;
      border-top-left-radius: 22px; border-top-right-radius: 22px;
      transform: translateY(100%);
      transition: transform .35s cubic-bezier(.2,.8,.2,1);
      display:flex; flex-direction:column;
      box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }
    .expert-sheet.open .es-panel { transform: translateY(0); }
    .expert-sheet .es-handle {
      width: 36px; height: 4px; border-radius: 999px;
      background: rgba(255,255,255,0.18);
      margin: 8px auto 4px;
    }
    .expert-sheet .es-head {
      display:flex; align-items:center; gap: 12px;
      padding: 10px 16px 6px;
    }
    .expert-sheet .es-orb {
      width: 48px; height: 48px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      font-family:'Noto Serif SC', serif; font-size: 20px; color:#fff;
      background:
        radial-gradient(60% 60% at 32% 30%, var(--ec1, #5B8CFF) 0%, transparent 70%),
        radial-gradient(70% 70% at 70% 75%, var(--ec2, #2EE6C9) 0%, transparent 75%),
        #0B0F1A;
      border:1px solid rgba(255,255,255,0.08);
    }
    .expert-sheet .es-name {
      width: 100%; background: transparent; border: none; outline: none;
      color:#E8ECF2; font-size: 16px; font-family:'Noto Serif SC', serif; font-weight:500;
    }
    .expert-sheet .es-role {
      width: 100%; background: transparent; border: none; outline: none;
      color:#6B7585; font-size: 11.5px; margin-top: 2px;
    }
    .expert-sheet .es-del {
      width: 32px; height: 32px; border-radius: 999px;
      background: rgba(255,110,138,0.10); color:#FF6E8A;
      display:flex; align-items:center; justify-content:center;
    }
    .expert-sheet .es-body {
      flex:1; overflow-y:auto; padding: 6px 16px 18px;
    }
    .expert-sheet .es-body::-webkit-scrollbar { display:none; }
    .expert-sheet .es-section { margin-top: 14px; }
    .expert-sheet .es-label {
      font-size: 11px; color:#6B7585; margin-bottom: 6px;
      display:flex; align-items:center; justify-content:space-between;
    }
    .expert-sheet .es-label .es-w { color:#2EE6C9; font-weight:500; }
    .expert-sheet .es-chips { display:flex; flex-wrap:wrap; gap: 6px; }
    .expert-sheet .es-chip {
      padding: 6px 10px; border-radius: 999px;
      font-size: 11.5px; color:#9AA3B2;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .expert-sheet .es-chip.on {
      color:#06121E; background: var(--brand-grad); border-color: transparent;
    }
    .expert-sheet .es-chip.scene.on { color:#06121E; background: var(--ec1, #2EE6C9); border-color: transparent; }
    .expert-sheet .es-trig {
      display:inline-flex; align-items:center; gap:4px;
      padding: 6px 10px; border-radius: 999px;
      font-size: 11.5px; color:#E8ECF2;
      background: rgba(46,230,201,0.10);
      border: 1px solid rgba(46,230,201,0.22);
    }
    .expert-sheet .es-trig button { color:#6B7585; padding: 0 0 0 4px; }
    .expert-sheet .es-add-trig {
      padding: 6px 10px; border-radius: 999px;
      font-size: 11.5px; color:#6B7585;
      background: transparent;
      border: 1px dashed rgba(255,255,255,0.18);
    }
    .expert-sheet .es-range {
      width: 100%; appearance: none; height: 4px; border-radius: 999px;
      background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(46,230,201,0.4));
      outline: none;
    }
    .expert-sheet .es-range::-webkit-slider-thumb {
      appearance: none; width: 18px; height:18px; border-radius:999px;
      background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
      border: 2px solid #2EE6C9;
    }
    .expert-sheet .es-foot {
      padding: 10px 16px 22px;
      border-top: 1px solid rgba(255,255,255,0.05);
    }
    .expert-sheet .es-save {
      width: 100%; height: 44px; border-radius: 999px;
      background: var(--brand-grad);
      color:#06121E; font-weight:600; font-size:14px;
    }

    /* ====== 知识库（页面 / 详情 / 选择器 / 引用） ====== */
    /* ====== 知识库（页面 / 详情 / 选择器 / 引用） ====== */
    .kb-seg {
      display:flex; padding: 3px; gap: 3px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 999px;
    }
    .kb-seg button {
      flex:1; height: 28px; border-radius: 999px;
      font-size: 12px; color:#9AA3B2;
    }
    .kb-seg button.on { color:#06121E; background: var(--brand-grad); }

    .kb-search {
      display:flex; align-items:center; gap: 8px;
      height: 36px; padding: 0 12px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      border-radius: 12px;
      color:#6B7585;
    }
    .kb-search input {
      flex:1; background: transparent; border: none; outline: none;
      color:#E8ECF2; font-size: 13px;
    }
    .kb-search input::placeholder { color:#6B7585; }

    /* 文件夹横滑 */
    .kb-folders {
      display:flex; gap: 8px; overflow-x: auto;
      padding-bottom: 4px;
    }
    .kb-folders::-webkit-scrollbar { display:none; }
    .kb-folder {
      flex: 0 0 auto;
      display:inline-flex; align-items:center; gap: 6px;
      padding: 6px 12px; border-radius: 999px;
      font-size: 12px; color:#9AA3B2;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .kb-folder.on {
      color:#E8ECF2; background: rgba(46,230,201,0.12); border-color: rgba(46,230,201,0.28);
    }
    .kb-folder .ic-sm { width: 12px; height: 12px; }
    .kb-page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .kb-link-btn {
      font-size: 12px; color: #9AA3B2; padding: 6px 4px;
      border: none; background: transparent;
    }
    .kb-folder-toolbar {
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 0 2px 4px;
    }
    .kb-folder-toolbar[hidden] { display: none !important; }
    .kb-folder-del-btn {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 11px; color: #FF8A9B; padding: 4px 10px; border-radius: 999px;
      border: 1px solid rgba(255,110,138,0.25); background: rgba(255,110,138,0.08);
    }
    body.theme-light .kb-link-btn { color: #64748B; }
    body.theme-light .kb-folder-del-btn { color: #E11D48; border-color: rgba(225,29,72,0.2); background: rgba(225,29,72,0.06); }

    /* 知识库卡片 */
    .kb-card {
      display: grid; grid-template-columns: 44px 1fr auto; gap: 10px;
      align-items: center;
      padding: 12px;
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 14px;
      margin-top: 8px;
    }
    .kb-card .kb-ic {
      width: 44px; height: 44px; border-radius: 12px;
      display:flex; align-items:center; justify-content:center;
      background: var(--kc-bg, rgba(46,230,201,0.14));
      color: var(--kc-fg, #2EE6C9);
    }
    .kb-card .kb-tt { font-size: 13.5px; color:#E8ECF2; line-height: 1.2; }
    .kb-card .kb-meta {
      margin-top: 4px;
      font-size: 11px; color:#6B7585;
      display:flex; align-items:center; gap: 8px; flex-wrap: wrap;
    }
    .kb-card .kb-meta .dot { width: 3px; height: 3px; border-radius:999px; background:#3A4252; }
    .kb-card .kb-tag-mini {
      padding: 1px 6px; border-radius: 999px;
      font-size: 10px;
      background: rgba(255,255,255,0.04); color:#9AA3B2;
    }
    .kb-card .kb-card-actions {
      display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    }
    .kb-card .kb-act-mini {
      width: 32px; height: 32px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#9AA3B2;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
    }
    .kb-card .kb-act-mini.danger { color: #FB7185; border-color: rgba(225,29,72,0.25); background: rgba(225,29,72,0.08); }
    .kb-card .kb-act {
      width: 32px; height: 32px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color:#9AA3B2;
    }
    body.theme-light .kb-card .kb-act-mini {
      color: #64748B;
      border-color: rgba(15,23,42,0.10);
      background: rgba(15,23,42,0.03);
    }
    body.theme-light .kb-card .kb-act-mini.danger { color: #E11D48; border-color: rgba(225,29,72,0.22); background: rgba(225,29,72,0.06); }
    .kb-card.on { border-color: rgba(46,230,201,0.30); background: rgba(46,230,201,0.05); }
    .kb-card.on .kb-act { color:#2EE6C9; }

    .kb-empty {
      margin-top: 16px; padding: 24px 16px;
      border: 1px dashed rgba(255,255,255,0.10);
      border-radius: 16px; text-align: center;
      color:#6B7585; font-size: 12px;
    }
    .kb-empty .kb-empty-cta {
      margin-top: 10px;
      display:inline-flex; align-items:center; gap: 6px;
      padding: 8px 14px; border-radius: 999px;
      background: var(--brand-grad);
      color:#06121E; font-size: 12.5px; font-weight: 600;
    }

    /* 知识库详情 overlay */
    .kbd-head {
      padding: 14px 18px 6px;
      display:flex; align-items:center; gap: 12px;
    }
    .kbd-head .kbd-ic {
      width: 48px; height: 48px; border-radius: 14px;
      display:flex; align-items:center; justify-content:center;
      background: var(--kc-bg, rgba(46,230,201,0.14));
      color: var(--kc-fg, #2EE6C9);
    }
    .kbd-head .kbd-name { font-size: 16px; color:#E8ECF2; font-weight: 500; }
    .kbd-head .kbd-name-row {
      display: flex; align-items: center; gap: 8px; min-width: 0;
    }
    .kbd-head .kbd-name-row .kbd-name { flex: 1; min-width: 0; }
    .ov-head .kbd-head-actions {
      display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    }
    .ov-head .kbd-del-btn {
      width: 34px; height: 34px; border-radius: 999px;
      border: 1px solid rgba(225,29,72,0.35);
      background: rgba(225,29,72,0.10); color: #FB7185;
      display: inline-flex; align-items: center; justify-content: center;
    }
    body.theme-light .ov-head .kbd-del-btn {
      border-color: rgba(225,29,72,0.28);
      background: rgba(225,29,72,0.08);
      color: #E11D48;
    }
    .ov-head .kbd-upload-btn {
      flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px;
      border: 1px solid rgba(91,140,255,0.35);
      background: rgba(91,140,255,0.12); color: #5B8CFF;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .ov-head .kbd-upload-btn .ic { width: 18px; height: 18px; }
    body.theme-light .ov-head .kbd-upload-btn {
      border-color: rgba(14,165,160,0.35);
      background: rgba(14,165,160,0.10);
      color: #0D9488;
    }
    .kbd-head .kbd-meta { font-size: 11px; color:#6B7585; margin-top: 2px; }
    .kb-new-host {
      position: fixed; inset: 0; z-index: 120; pointer-events: none;
    }
    .kb-new-host.open { pointer-events: auto; }
    .kb-new-bd {
      position: absolute; inset: 0; background: rgba(0,0,0,0.45);
      opacity: 0; transition: opacity .22s ease;
    }
    .kb-new-host.open .kb-new-bd { opacity: 1; }
    .kb-new-panel {
      position: absolute; left: 0; right: 0; bottom: 0;
      max-height: min(78vh, 520px);
      background: #12161E; border-radius: 20px 20px 0 0;
      border-top: 1px solid rgba(255,255,255,0.08);
      padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
      transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.9,.2,1), bottom .22s cubic-bezier(.2,.9,.2,1);
      overflow-y: auto;
    }
    .kb-new-host.open .kb-new-panel { transform: translateY(0); }
    .kb-new-title { font-size: 15px; font-weight: 600; color: #E8ECF2; text-align: center; margin: 4px 0 14px; }
    .kb-new-label { font-size: 11px; color: #6B7585; margin: 10px 0 6px; letter-spacing: .02em; }
    .kb-new-icons { display: flex; gap: 10px; flex-wrap: wrap; }
    .kb-new-ic {
      width: 44px; height: 44px; border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04);
      color: #9AA3B2; display: inline-flex; align-items: center; justify-content: center;
    }
    .kb-new-ic.on { border-color: rgba(46,230,201,0.45); color: #2EE6C9; background: rgba(46,230,201,0.08); }
    .kb-new-folders { display: flex; flex-wrap: wrap; gap: 8px; }
    .kb-new-folder {
      padding: 6px 12px; border-radius: 999px; font-size: 12px;
      border: 1px solid rgba(255,255,255,0.10); color: #9AA3B2; background: rgba(255,255,255,0.04);
    }
    .kb-new-folder.on { color: #06121E; background: linear-gradient(135deg, #2EE6C9, #5B8CFF); border-color: transparent; }
    body.theme-light .kb-new-panel { background: #fff; border-color: rgba(15,23,42,0.08); }
    body.theme-light .kb-new-title { color: #0F172A; }
    body.theme-light .kb-new-label { color: #64748B; }
    body.theme-light .kb-new-ic,
    body.theme-light .kb-new-folder { background: #F8FAFC; border-color: rgba(15,23,42,0.10); color: #475569; }
    body.theme-light .kb-new-ic.on { color: #0D9488; border-color: rgba(13,148,136,0.35); background: rgba(13,148,136,0.08); }
    .kbd-actions {
      padding: 0 16px;
      display:flex; gap: 8px; flex-wrap: wrap;
    }
    .kbd-actions button {
      flex:1; min-width: 0;
      display:flex; flex-direction: column; align-items:center; gap: 3px;
      padding: 10px 8px; border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
      color:#9AA3B2; font-size: 11px;
    }
    .kbd-actions button .ic { width: 16px; height: 16px; }
    .kbd-tags {
      padding: 8px 16px 0;
      display:flex; gap: 6px; overflow-x: auto;
    }
    .kbd-tags::-webkit-scrollbar { display:none; }
    .kbd-tags .kb-tag {
      flex: 0 0 auto;
      padding: 4px 10px; border-radius: 999px;
      font-size: 11px; color:#9AA3B2;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .kbd-tags .kb-tag.on { color:#06121E; background: var(--brand-grad); border-color: transparent; }

    .kb-file-row {
      display: grid; grid-template-columns: 32px 1fr auto; gap: 10px;
      align-items: center; padding: 10px 16px;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .kb-file-row .ft {
      width: 32px; height: 32px; border-radius: 8px;
      display:flex; align-items:center; justify-content:center;
      font-size: 10px; font-weight: 600; color:#fff;
    }
    .kb-file-row .ft.pdf   { background: linear-gradient(135deg, #FF6E8A, #C49BFF); }
    .kb-file-row .ft.doc   { background: linear-gradient(135deg, #5B8CFF, #2EE6C9); }
    .kb-file-row .ft.sheet { background: linear-gradient(135deg, #3DD68C, #2EE6C9); }
    .kb-file-row .ft.img   { background: linear-gradient(135deg, #F5B14A, #FF6E8A); }
    .kb-file-row .ft.md    { background: linear-gradient(135deg, #5BD0C7, #5B8CFF); }
    .kb-file-row .ft.web   { background: linear-gradient(135deg, #C49BFF, #5B8CFF); }
    .kb-file-row .fn { font-size: 13px; color:#E8ECF2; line-height: 1.25; }
    .kb-file-row .fmeta { font-size: 11px; color:#6B7585; margin-top: 2px; }
    .kb-file-row .fmore { color:#6B7585; }
    .kb-file-actions { display: flex; align-items: center; gap: 6px; }
    .kb-file-act {
      width: 34px; height: 34px; border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04); color: #9AA3B2;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .kb-file-act.danger { color: #FF8A9B; border-color: rgba(255,110,138,0.25); background: rgba(255,110,138,0.08); }
    body.theme-light .kb-file-act { background: #F8FAFC; border-color: rgba(15,23,42,0.10); color: #64748B; }
    body.theme-light .kb-file-act.danger { color: #E11D48; border-color: rgba(225,29,72,0.2); background: rgba(225,29,72,0.06); }

    /* 已改为设定页/工作台/知识库页管理引用，底栏 chips 条停用 */
    .kb-bar { display: none !important; }
    .kb-bar.show { display: none !important; }
    .kb-bar .kb-bar-chip {
      display:inline-flex; align-items:center; gap: 5px;
      padding: 5px 8px 5px 5px; border-radius: 999px;
      background: rgba(46,230,201,0.10);
      border: 1px solid rgba(46,230,201,0.22);
      font-size: 11px; color:#E8ECF2;
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }
    .kb-bar .kb-bar-chip .kb-bc-ic {
      width: 18px; height: 18px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      background: var(--kc-bg, rgba(46,230,201,0.18));
      color: var(--kc-fg, #2EE6C9);
    }
    .kb-bar .kb-bar-chip button { color:#6B7585; padding-left: 3px; line-height: 1; }
    .kb-bar .kb-bar-clear {
      padding: 4px 8px; border-radius: 999px;
      font-size: 10.5px; color:#6B7585;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
    }

    /* composer 内 KB 按钮上的角标 */
    .composer .ico { position: relative; }
    .composer .kb-count {
      position: absolute; top: 2px; right: 2px;
      min-width: 14px; height: 14px; padding: 0 3px;
      border-radius: 999px;
      background: #2EE6C9; color: #06121E;
      font-size: 9px; font-weight: 700;
      display:flex; align-items:center; justify-content:center;
    }
    .composer .ico.on { color: #2EE6C9; }

    /* KB Picker（底部 sheet） */
    .kb-picker {
      position: absolute; inset: 0; z-index: 96;
      pointer-events: none;
      visibility: hidden;
    }
    .kb-picker.open {
      pointer-events: auto;
      visibility: visible;
    }
    .kb-picker .kp-bd {
      position:absolute; inset:0;
      background: rgba(0,0,0,0.45); opacity:0;
      transition: opacity .25s ease;
    }
    .kb-picker.open .kp-bd { opacity: 1; }
    .kb-picker .kp-panel {
      position:absolute; left:0; right:0; bottom:0;
      max-height: min(78vh, calc(100dvh - 48px));
      background: linear-gradient(180deg, #151d2e 0%, #0a0e18 100%);
      border-top: 1px solid rgba(46,230,201,0.22);
      border-top-left-radius: 22px; border-top-right-radius: 22px;
      transform: translateY(100%);
      transition: transform .35s cubic-bezier(.2,.8,.2,1);
      display:flex; flex-direction:column;
      box-shadow: 0 -16px 48px rgba(0,0,0,0.55);
    }
    .kb-picker.open .kp-panel { transform: translateY(0); }
    .kb-picker .kp-handle {
      width: 36px; height: 4px; border-radius: 999px;
      background: rgba(255,255,255,0.18);
      margin: 8px auto 4px;
    }
    .kb-picker .kp-head {
      padding: 10px 18px 6px;
      display:flex; align-items:flex-start; justify-content:space-between;
      gap: 12px;
    }
    .kb-picker .kp-head .kp-title { font-size: 15px; color:#E8ECF2; font-weight: 600; }
    .kb-picker .kp-head .kp-sub { font-size: 11.5px; color:#9AA3B2; margin-top: 4px; line-height: 1.45; }
    .kb-picker .kp-head .kp-close-btn {
      width: 32px; height: 32px; border-radius: 999px;
      display:flex; align-items:center; justify-content:center;
      color: #9AA3B2;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      flex-shrink: 0;
    }
    .kb-picker .kp-search {
      margin: 4px 16px 8px;
      flex-shrink: 0;
    }
    .kb-picker .kp-search .kb-search {
      background: rgba(0,0,0,0.22);
      border-color: rgba(46,230,201,0.18);
    }
    .kb-picker .kp-list {
      flex: 0 1 auto;
      min-height: 0;
      max-height: min(42vh, calc(100dvh - 300px));
      overflow-y: auto;
      padding: 0 12px 4px;
    }
    .kb-picker .kp-empty {
      text-align: center;
      padding: 20px 16px 12px;
      color: #9AA3B2;
    }
    .kb-picker .kp-empty .kp-empty-ic {
      width: 44px; height: 44px; margin: 0 auto 10px;
      border-radius: 14px;
      display:flex; align-items:center; justify-content:center;
      background: rgba(46,230,201,0.12);
      color: #2EE6C9;
    }
    .kb-picker .kp-empty p { font-size: 13px; color: #C5CDD9; margin: 0; }
    .kb-picker .kp-empty .kp-empty-sub { font-size: 11.5px; color: #6B7585; margin-top: 6px; line-height: 1.45; }
    .kb-picker .kp-empty .kp-empty-go {
      margin-top: 14px;
      display: inline-flex; align-items: center; gap: 6px;
      padding: 8px 16px; border-radius: 999px;
      font-size: 12.5px; font-weight: 600;
      color: #06121E;
      background: var(--brand-grad);
    }
    .kb-picker .kp-list::-webkit-scrollbar { display:none; }
    .kb-picker .kp-row {
      display: grid; grid-template-columns: 36px 1fr 22px; gap: 10px;
      align-items: center; padding: 10px 8px;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .kb-picker .kp-row .kp-ic {
      width: 36px; height: 36px; border-radius: 10px;
      display:flex; align-items:center; justify-content:center;
      background: var(--kc-bg, rgba(46,230,201,0.14));
      color: var(--kc-fg, #2EE6C9);
    }
    .kb-picker .kp-row .kp-tt { font-size: 13px; color:#E8ECF2; }
    .kb-picker .kp-row .kp-mt { font-size: 11px; color:#6B7585; margin-top: 2px; }
    .kb-picker .kp-row .kp-check {
      width: 22px; height: 22px; border-radius: 999px;
      border: 1.5px solid rgba(255,255,255,0.20);
      display:flex; align-items:center; justify-content:center;
      color: transparent;
    }
    .kb-picker .kp-row.on .kp-check {
      background: var(--brand-grad);
      border-color: transparent; color:#06121E;
    }
    .kb-picker .kp-foot {
      flex-shrink: 0;
      padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid rgba(255,255,255,0.06);
      background: rgba(0,0,0,0.18);
    }
    .kb-picker .kp-web {
      flex:1; display:flex; align-items:center; gap: 8px;
      padding: 9px 12px; border-radius: 12px;
      background: rgba(255,255,255,0.03); color:#9AA3B2;
      border: 1px solid rgba(255,255,255,0.05);
      font-size: 12px;
    }
    .kb-picker .kp-web.on { color:#2EE6C9; border-color: rgba(46,230,201,0.28); background: rgba(46,230,201,0.07); }
    .kb-picker .kp-done {
      width: 100%;
      height: 44px;
      border-radius: 14px;
      background: var(--brand-grad);
      color:#06121E; font-weight: 600; font-size: 14px;
      box-shadow: 0 8px 20px rgba(46,230,201,0.22);
    }

    /* 画布节点 KB 角标 */
    .tnode .n-kb {
      position: absolute; top: -4px; left: -4px;
      min-width: 18px; height: 18px; padding: 0 4px;
      border-radius: 999px;
      background:#0A0E18; border:1px solid rgba(46,230,201,0.40);
      color:#2EE6C9; font-size: 9px; font-weight: 600;
      display:flex; align-items:center; justify-content:center; gap: 2px;
    }
    .tnode .n-kb i { width: 9px; height: 9px; }

    /* 预览引用 */
    .pv-cite {
      margin-top: 6px;
      display:flex; flex-wrap: wrap; gap: 4px;
    }
    .pv-cite .cite {
      display:inline-flex; align-items:center; gap: 4px;
      padding: 3px 7px; border-radius: 999px;
      background: rgba(91,140,255,0.10);
      border: 1px solid rgba(91,140,255,0.22);
      font-size: 10.5px; color:#5B8CFF;
    }
    .pv-cite .cite i { width: 10px; height: 10px; }

    /* ====== 浅色主题（body.theme-light 全覆盖） ====== */
    body.theme-light { background: #E5E9F0; }
    body.theme-light html { background: #E5E9F0; }
    body.theme-light .stage { background: #E5E9F0; }
    body.theme-light .device {
      background: linear-gradient(160deg, #F6F8FC, #D9DFE8);
      box-shadow: 0 40px 90px rgba(20,30,60,0.18),
                  0 10px 28px rgba(20,30,60,0.12),
                  inset 0 0 0 1px rgba(20,30,60,0.05);
    }
    body.theme-light .screen {
      background: radial-gradient(120% 80% at 50% -20%, #FFFFFF 0%, #F4F6FA 50%, #EAEDF3 100%);
      color: #0F172A;
    }

    /* 文字 */
    body.theme-light .text-text1 { color: #0F172A; }
    body.theme-light .text-text2 { color: #475569; }
    body.theme-light .text-text3 { color: #94A3B8; }
    body.theme-light .text-jade  { color: #0EA5A0; }
    body.theme-light .text-mint  { color: #16A34A; }
    body.theme-light .text-sky   { color: #2563EB; }
    body.theme-light .text-amber1{ color: #B45309; }
    body.theme-light .text-rose  { color: #E11D48; }
    body.theme-light .text-lilac { color: #7C3AED; }
    body.theme-light .topbar .greeting,
    body.theme-light .ttl,
    body.theme-light .ov-head span,
    body.theme-light .kp-title,
    body.theme-light .kbd-name,
    body.theme-light .pv-h,
    body.theme-light .pv-final .pf-body,
    body.theme-light .kb-tt,
    body.theme-light .fn,
    body.theme-light .kp-tt,
    body.theme-light .es-name,
    body.theme-light .name-input,
    body.theme-light .composer .composer-input { color: #0F172A; }
    body.theme-light .name-input {
      background: rgba(15,23,42,0.03);
      border-color: rgba(15,23,42,0.14);
    }
    body.theme-light .statusbar { color: #64748B; }
    body.theme-light .meta,
    body.theme-light .help,
    body.theme-light .kb-meta,
    body.theme-light .fmeta,
    body.theme-light .kp-mt,
    body.theme-light .kp-sub,
    body.theme-light .pv-h .who,
    body.theme-light .es-role,
    body.theme-light .bio-input,
    body.theme-light .composer .composer-input::placeholder,
    body.theme-light .pv-input input::placeholder,
    body.theme-light .kb-search input::placeholder,
    body.theme-light .name-input::placeholder { color: #64748B; }

        /* 通用浅色表面 */
    body.theme-light .row,
    body.theme-light .form-card,
    body.theme-light .pv-card,
    body.theme-light .pv-input,
    body.theme-light .kb-card,
    body.theme-light .kb-search,
    body.theme-light .kp-search .kb-search,
    body.theme-light .rule-row,
    body.theme-light .arch-tabs,
    body.theme-light .seg-mini,
    body.theme-light .kb-seg,
    body.theme-light .kb-folder,
    body.theme-light .scene-chip,
    body.theme-light .nav-chip,
    body.theme-light .pick-chip,
    body.theme-light .es-chip,
    body.theme-light .es-add-trig,
    body.theme-light .kp-web,
    body.theme-light .kbd-actions button,
    body.theme-light .toast {
      background: rgba(15,23,42,0.045);
      border-color: rgba(15,23,42,0.08);
    }

    /* 圆图标按钮 */
    body.theme-light .composer .ico,
    body.theme-light .iconbtn,
    body.theme-light .ov-head .h-btn,
    body.theme-light .ov-head .h-test,
    body.theme-light .agent-bubble,
    body.theme-light .chip-edit,
    body.theme-light .kb-card .kb-act,
    body.theme-light .kb-file-row .fmore,
    body.theme-light .lead {
      background: rgba(15,23,42,0.05);
      color: #0F172A;
      border-color: rgba(15,23,42,0.08);
    }
    body.theme-light .ov-head .h-btn { color: #475569; }
    body.theme-light .ov-head .h-test { color: #0F172A; }
    body.theme-light .confirm-mask { background: rgba(15,23,42,0.52); }
    body.theme-light .confirm-card {
      background: #FFFFFF;
      border-color: rgba(15,23,42,0.14);
      color: #0F172A;
      box-shadow: 0 18px 52px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(15, 23, 42, 0.06);
    }
    body.theme-light .confirm-card.confirm-card-accent {
      border-color: rgba(244, 114, 182, 0.35);
      box-shadow: 0 18px 52px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(244, 114, 182, 0.12) inset;
    }
    body.theme-light .confirm-msg { color: #475569; }
    body.theme-light .confirm-actions button { color: #0F172A; background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.12); }
    body.theme-light .confirm-actions .ok {
      background: var(--brand-grad-light);
      color: #ffffff;
      border: 1px solid rgba(15, 23, 42, 0.14);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
      font-weight: 600;
    }
    body.theme-light .agent-bubble { color: #0F172A; }

    /* 输入条 */
    body.theme-light .composer {
      background: rgba(255,255,255,0.96);
      border-color: rgba(15,23,42,0.10);
      box-shadow: 0 6px 18px rgba(20,30,60,0.08);
    }

    /* 底部导航 */
    body.theme-light .tabbar {
      background: rgba(255,255,255,0.92);
      border-color: rgba(15,23,42,0.08);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
      box-shadow: 0 6px 18px rgba(20,30,60,0.08);
    }
    body.theme-light .tabbar button { color: #94A3B8; }
    body.theme-light .tabbar button.active { color: #0F172A; }
    body.theme-light .tabbar button.active .dot { background: var(--brand-grad-light); }

    /* 场景 chips bar */
    body.theme-light .chips-bar .chip { background: rgba(15,23,42,0.04); color: #475569; border-color: rgba(15,23,42,0.06); }
    body.theme-light .chips-bar .chip.on { color: #0F172A; background: rgba(14,165,160,0.10); border-color: rgba(14,165,160,0.30); }

    /* 娈垫帶鎸夐挳 */
    body.theme-light .seg-mini button { color: #475569; }
    body.theme-light .seg-mini button.on { color: #0F172A; background: rgba(14,165,160,0.16); }
    body.theme-light .seg-mini button[data-theme-pick].on { color: #0F172A !important; }
    body.theme-light .kb-seg button { color: #475569; }
    body.theme-light .kb-seg button.on { color: #0F172A; background: rgba(14,165,160,0.16); }
    body.theme-light .pick-chip { color: #475569; }
    body.theme-light .pick-chip.on { color: #0F172A; background: rgba(14,165,160,0.14); border-color: rgba(14,165,160,0.30); }

    /* 鍗忎綔妯″紡 tab */
    body.theme-light .arch-tab { color: #64748B; }
    body.theme-light .arch-tab.on { color: #FFFFFF; }

    /* 团队画布 */
    body.theme-light .team-canvas {
      background:
        radial-gradient(80% 60% at 50% 30%, rgba(37,99,235,0.07) 0%, transparent 70%),
        rgba(15,23,42,0.025);
      border-color: rgba(15,23,42,0.08);
    }
    body.theme-light .team-canvas .conn { stroke: rgba(15,23,42,0.18); }
    body.theme-light .team-canvas .conn-arrow { fill: rgba(15,23,42,0.40); }
    body.theme-light .tnode .n-label { color: #475569; }
    body.theme-light .tnode .n-sub   { color: #94A3B8; }
    body.theme-light .tnode .n-step  { background:#FFFFFF; border-color: rgba(15,23,42,0.12); color:#0EA5A0; }
    body.theme-light .tnode .n-kb    { background:#FFFFFF; border-color: rgba(14,165,160,0.40); }
    body.theme-light .tnode.add .n-orb { background: transparent; border-color: rgba(15,23,42,0.20); color: rgba(15,23,42,0.50); }

    /* 调度规则 / 规则行 */
    body.theme-light .rule-row .r-radio { border-color: rgba(15,23,42,0.20); }
    body.theme-light .rule-row.on { background: rgba(14,165,160,0.08); border-color: rgba(14,165,160,0.30); }
    body.theme-light .rule-row .r-help { color: #64748B; }
    body.theme-light .rule-row .r-title { color: #0F172A; }

    /* overlays / sheets */
    body.theme-light .overlay {
      background: radial-gradient(120% 80% at 50% -10%, #F4F6FA 0%, #FFFFFF 55%, #FFFFFF 100%);
    }
    body.theme-light .sheet {
      background: linear-gradient(180deg, #FFFFFF 0%, #F4F6FA 100%);
      box-shadow: 0 -10px 36px rgba(20,30,60,0.10);
    }
    body.theme-light .deduce-tab {
      border-color: var(--deduce-border);
      background: var(--deduce-surface2);
      color: var(--deduce-text3);
    }
    body.theme-light .deduce-tab.on {
      border-color: var(--deduce-accent);
      background: var(--deduce-accent-bg);
      color: var(--deduce-text);
    }
    body.theme-light .deduce-rewrite-hint {
      color: var(--deduce-text2) !important;
    }
    body.theme-light .sheet-handle,
    body.theme-light .es-handle,
    body.theme-light .kp-handle { background: rgba(15,23,42,0.18); }
    body.theme-light .expert-sheet .es-panel { background: #FFFFFF; box-shadow: 0 -10px 36px rgba(20,30,60,0.18); }
    body.theme-light .expert-sheet .es-bd,
    body.theme-light .kb-picker .kp-bd { background: rgba(15,23,42,0.22); }
    /* 知识库选择器：浅色主题与页面一致 */
    body.theme-light .kb-picker .kp-panel {
      background: #FFFFFF;
      border-top-color: rgba(15,23,42,0.08);
      box-shadow: 0 -10px 36px rgba(20,30,60,0.14);
    }
    body.theme-light .kb-picker .kp-handle { background: rgba(15,23,42,0.14); }
    body.theme-light .kb-picker .kp-head .kp-close-btn {
      color: #64748B;
      background: rgba(15,23,42,0.04);
      border-color: rgba(15,23,42,0.08);
    }
    body.theme-light .kb-picker .kp-head .kp-title { color: #0F172A; }
    body.theme-light .kb-picker .kp-head .kp-sub { color: #64748B; }
    body.theme-light .kb-picker .kp-search .kb-search {
      background: #F8FAFC;
      border-color: rgba(15,23,42,0.10);
    }
    body.theme-light .kb-picker .kp-search input { color: #0F172A; }
    body.theme-light .kb-picker .kp-search input::placeholder { color: #94A3B8; }
    body.theme-light .kb-picker .kp-row .kp-tt { color: #0F172A; }
    body.theme-light .kb-picker .kp-row .kp-mt { color: #64748B; }
    body.theme-light .kb-picker .kp-foot { background: #FFFFFF; border-top-color: rgba(15,23,42,0.06); }
    body.theme-light .kb-picker .kp-empty p { color: #334155; }
    body.theme-light .kb-picker .kp-empty .kp-empty-sub { color: #64748B; }
    body.theme-light .kb-picker .kp-close-btn { color: #64748B; }

    /* 知识库 */
    body.theme-light .kb-card.on { background: rgba(14,165,160,0.07); border-color: rgba(14,165,160,0.30); }
    body.theme-light .kb-card .kb-act.on,
    body.theme-light .kb-card.on .kb-act { color: #0EA5A0; }
    body.theme-light .kb-empty { border-color: rgba(15,23,42,0.12); color: #64748B; }
    body.theme-light .kbd-actions button { color: #475569; }
    body.theme-light .kbd-tags .kb-tag { color: #475569; background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.06); }
    body.theme-light .kbd-tags .kb-tag.on { color: #FFFFFF; }
    body.theme-light .kb-file-row { border-bottom-color: rgba(15,23,42,0.06); }
    body.theme-light .kb-file-row .fmeta { color: #64748B; }
    body.theme-light .kb-bar .kb-bar-chip {
      background: rgba(255,255,255,0.96); color: #0F172A;
      border-color: rgba(14,165,160,0.30);
      box-shadow: 0 4px 12px rgba(20,30,60,0.10);
    }
    body.theme-light .kb-bar .kb-bar-clear { background: rgba(255,255,255,0.96); color: #64748B; border-color: rgba(15,23,42,0.10); }
    body.theme-light .kb-picker .kp-row { border-bottom-color: rgba(15,23,42,0.06); }
    body.theme-light .kb-picker .kp-row .kp-check { border-color: rgba(15,23,42,0.20); }
    body.theme-light .kb-picker .kp-web { color: #475569; border-color: rgba(15,23,42,0.08); background: rgba(15,23,42,0.04); }
    body.theme-light .kb-picker .kp-web.on { color: #0EA5A0; background: rgba(14,165,160,0.08); border-color: rgba(14,165,160,0.30); }
    body.theme-light .kb-folder.on { color: #0F172A; background: rgba(14,165,160,0.12); border-color: rgba(14,165,160,0.30); }

    /* 专家面板内的标签 */
    body.theme-light .es-chip { color: #475569; }
    body.theme-light .es-chip.on { color: #FFFFFF; }
    body.theme-light .es-trig { color: #0F172A; background: rgba(14,165,160,0.10); border-color: rgba(14,165,160,0.30); }
    body.theme-light .es-add-trig { color: #64748B; border-color: rgba(15,23,42,0.18); background: transparent; }
    body.theme-light .es-del { background: rgba(225,29,72,0.10); color: #E11D48; }
    body.theme-light .es-foot { border-top-color: rgba(15,23,42,0.06); }

    /* 预览区 */
    body.theme-light .pv-input button { color: #06121E; }
    body.theme-light .pv-input { border-color: rgba(15,23,42,0.08); }
    body.theme-light .pv-flow .step { background: rgba(14,165,160,0.10); color: #0EA5A0; }
    body.theme-light .pv-flow .arrow { color: #94A3B8; }
    body.theme-light .pv-card { border-left-color: var(--ec, #0EA5A0); }
    body.theme-light .pv-card .pv-body { color: #475569; }
    body.theme-light .pv-final {
      background: linear-gradient(135deg, rgba(14,165,160,0.10), rgba(37,99,235,0.06));
      border-color: rgba(14,165,160,0.28);
    }
    body.theme-light .pv-cite .cite { background: rgba(37,99,235,0.10); border-color: rgba(37,99,235,0.25); color: #2563EB; }

    /* 通知 / Toast */
    body.theme-light .toast { background: rgba(15,23,42,0.92); color: #FFFFFF; }

    /* 状态栏主题按钮 */
    body.theme-light #themeToggle { color: #0F172A; }
    body.theme-light .device::before { background: #0a0a0a; } /* notch keep dark always */

    body.theme-light .statusbar button,
    body.theme-light button,
    body.theme-light .iconbtn i,
    body.theme-light .h-section,
    body.theme-light .greeting,
    body.theme-light .row .ttl,
    body.theme-light .row .meta { color: #0F172A; }
    body.theme-light .row .meta { color: #64748B; }

    /* 桌面 / stage 标题 */
    body.theme-light .stage-title { color: #0F172A; }
    body.theme-light .stage-sub { color: #64748B; }

    /* 首页侧边栏浅色 */
    body.theme-light .home-drawer .hd-panel {
      background: linear-gradient(180deg, #FFFFFF, #F4F6FA);
      border-right-color: rgba(15,23,42,0.08);
    }
    body.theme-light .create-drawer.open .cd-backdrop {
      background: rgba(15, 23, 42, 0.14);
    }
    body.theme-light .create-drawer .cd-panel {
      background: linear-gradient(180deg, #FFFFFF, #F4F6FA);
      border-right-color: rgba(15,23,42,0.10);
    }
    body.theme-light .create-drawer .cd-head { color: #0F172A; }
    body.theme-light .create-drawer .cd-item {
      border-color: rgba(15,23,42,0.10);
      background: rgba(255,255,255,0.72);
    }
    body.theme-light .create-drawer .cd-item.on {
      background: rgba(37,99,235,0.10);
      border-color: rgba(37,99,235,0.22);
    }
    body.theme-light .create-drawer .cd-drawer-toggle {
      border-color: rgba(15, 23, 42, 0.14);
      background: rgba(255, 255, 255, 0.92);
      color: #0f172a;
    }
    body.theme-light .create-drawer .cd-drawer-toggle:active {
      background: rgba(241, 245, 249, 1);
    }
    body.theme-light .create-drawer .cd-drawer-toggle.on {
      border-color: rgba(13, 148, 136, 0.45);
      background: rgba(13, 148, 136, 0.12);
      color: #0f766e;
    }
    body.theme-light .create-drawer .cd-drawer-toggle--segs.on {
      border-color: rgba(37, 99, 235, 0.4);
      background: rgba(37, 99, 235, 0.1);
      color: #1d4ed8;
    }
    body.theme-light .create-drawer #createSettingsDetails > summary {
      color: #0F172A !important;
      border-color: rgba(15,23,42,0.12) !important;
      background: #FFFFFF !important;
    }
    body.theme-light .create-drawer #createSettingsDetails .create-fields {
      background: #FFFFFF !important;
      border-color: rgba(15,23,42,0.12) !important;
    }
    body.theme-light .hd-head,
    body.theme-light .hd-title { color: #0F172A; }
    body.theme-light .hd-meta { color: #64748B; }
    body.theme-light .hd-item.on { background: rgba(37,99,235,0.10); border-color: rgba(37,99,235,0.22); }
    .create-drawer .text-text3 { color: #B8C2D3; }
    .create-drawer .cd-title { color: #E8ECF2; }
    .create-drawer .cd-meta { color: #A8B3C6; }
    .create-drawer .cd-seg { color: #E8ECF2; }
    body.theme-light .create-drawer .text-text3 { color: #475569; }
    body.theme-light .create-drawer .cd-title { color: #0F172A; }
    body.theme-light .create-drawer .cd-meta { color: #64748B; }
    body.theme-light .create-drawer .cd-seg { color: #0F172A; }
    #meProfileOverlay .form-card {
      background: rgba(255,255,255,0.03);
      border-color: rgba(255,255,255,0.10);
    }
    #meProfileOverlay .name-input {
      font-size: 18px;
      font-weight: 600;
      color: #E8ECF2;
      text-align: center;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.12);
    }
    #meProfileOverlay .name-input[disabled] {
      opacity: 1;
      color: #DCE3EE;
    }
    body.theme-light #meProfileOverlay .form-card {
      background: #FFFFFF;
      border-color: rgba(15,23,42,0.10);
    }
    body.theme-light #meProfileOverlay .name-input {
      color: #0F172A;
      background: rgba(15,23,42,0.03);
      border-color: rgba(15,23,42,0.12);
    }
    body.theme-light #meProfileOverlay .name-input[disabled] { color: #0F172A; }
    body.theme-light .chat-row.user .chat-bubble {
      background: rgba(37,99,235,0.12);
      color: #0F172A;
      border-color: rgba(37,99,235,0.22);
    }
    body.theme-light .chat-row.assistant .chat-bubble {
      background: rgba(15,23,42,0.05);
      color: #0F172A;
      border-color: rgba(15,23,42,0.08);
    }
    body.theme-light .chat-reasoning {
      border-color: rgba(15,23,42,0.10);
      background: rgba(15,23,42,0.04);
    }
    body.theme-light .chat-reasoning > summary.chat-reasoning-sum { color: #64748B; }
    body.theme-light .chat-reasoning-pre {
      color: #0F172A;
      border-top-color: rgba(15,23,42,0.08);
    }
    body.theme-light .chat-empty { color: rgba(15,23,42,0.45); }

    /* 浅色：流式光标 / 等待态 / 创作折叠 / 场景大标题等（避免浅字贴浅底） */
    body.theme-light .chat-row.streaming .chat-bubble::after {
      background: rgba(15, 23, 42, 0.78);
    }
    body.theme-light .create-waiting {
      color: #334155;
    }
    body.theme-light .create-waiting-dots i {
      background: rgba(14, 165, 160, 0.88);
    }
    body.theme-light .robot-caret {
      background: rgba(15, 23, 42, 0.55);
    }
    body.theme-light .create-reply-fold details {
      background: #FFFFFF;
      border-color: rgba(15, 23, 42, 0.12);
    }
    body.theme-light .create-reply-fold summary {
      color: #334155;
      border-bottom-color: rgba(15, 23, 42, 0.08);
    }
    body.theme-light .create-outline {
      color: #0F172A;
    }
    body.theme-light .create-outline .lv2 {
      color: #64748B;
    }
    body.theme-light .create-group .label {
      color: #64748B;
    }
    body.theme-light .composer-deep-toggle {
      color: #64748B;
      border-color: rgba(15, 23, 42, 0.12);
      background: rgba(255, 255, 255, 0.92);
    }
    body.theme-light .composer-deep-toggle.on {
      color: #0D9488;
      border-color: rgba(13, 148, 136, 0.38);
      background: rgba(13, 148, 136, 0.12);
    }
    body.theme-light .composer .ico.kb-entry-ico.on {
      color: #0D9488;
      border-color: rgba(13, 148, 136, 0.42);
      background: rgba(13, 148, 136, 0.12);
    }
    body.theme-light .msg-del-btn {
      color: #0f172a;
      background: rgba(255, 255, 255, 0.96);
      border-color: rgba(15, 23, 42, 0.22);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    }
    body.theme-light .msg-del-btn:hover {
      background: rgba(241, 245, 249, 1);
      border-color: rgba(15, 23, 42, 0.28);
      color: #020617;
    }
    body.theme-light .msg-del-btn:active {
      color: #be123c;
      border-color: rgba(225, 29, 72, 0.45);
      background: rgba(254, 226, 226, 0.95);
    }
    /* Lucide 替换为 svg 后须显式 stroke，避免浅色底上描边过浅看不见 */
    body.theme-light .msg-del-btn svg,
    body.theme-light .msg-del-btn svg path,
    body.theme-light .msg-del-btn svg line,
    body.theme-light .msg-del-btn svg polyline,
    body.theme-light .msg-retry-btn svg,
    body.theme-light .msg-retry-btn svg path {
      stroke: currentColor !important;
    }
    body.theme-light .h-display,
    body.theme-light .code-h,
    body.theme-light .mono-row,
    body.theme-light .pill,
    body.theme-light .big-tile,
    body.theme-light .dropzone,
    body.theme-light .ghost-btn,
    body.theme-light .med-tile .t,
    body.theme-light .fun-tile {
      color: #0F172A;
    }
    body.theme-light .h-section {
      color: #64748B;
    }
    body.theme-light .med-tile .s,
    body.theme-light .big-tile i,
    body.theme-light .dropzone .sub,
    body.theme-light .ghost-btn i,
    body.theme-light .mono-meta,
    body.theme-light .fun-tile .s {
      color: #64748B;
    }
    body.theme-light .med-tile .ic-wrap {
      color: #0D9488;
    }
    body.theme-light .code-h .prompt {
      color: #15803D;
    }
    body.theme-light .pill {
      background: rgba(255, 255, 255, 0.92);
      border-color: rgba(15, 23, 42, 0.1);
    }
    body.theme-light .big-tile {
      background: rgba(255, 255, 255, 0.72);
      border-color: rgba(15, 23, 42, 0.08);
    }
    body.theme-light .dropzone {
      background: rgba(255, 255, 255, 0.55);
      border-color: rgba(15, 23, 42, 0.14);
    }
    body.theme-light .ghost-btn {
      background: rgba(255, 255, 255, 0.85);
      border-color: rgba(15, 23, 42, 0.1);
    }
    body.theme-light .med-tile {
      background: linear-gradient(180deg, rgba(14, 165, 160, 0.08), rgba(14, 165, 160, 0.02));
      border-color: rgba(14, 165, 160, 0.22);
    }
    body.theme-light .fun-tile {
      background: linear-gradient(135deg, rgba(196, 155, 255, 0.14), rgba(244, 114, 182, 0.08));
      border-color: rgba(124, 58, 237, 0.18);
    }
    body.theme-light .fun-tile .s {
      color: #475569;
    }

    /* === 数字伙伴 / 智能体广场 / 数字人三套实验代码 DOM 已回退；
           以下 .dc-* / .ag-* / .dh-* selector 在 DOM 中找不到元素，规则不会生效。
           保留主要是为了将来回滚方便（直接改回旧 DOM 即生效）。=== */
    .__dead_companion_pad_selector{}
    /* 聊天气泡区 */
    .dc-thread{
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 14px 16px 14px 16px;
      /* 给左下立绘让出空间：底部 200px 留白避免气泡被挡 */
      padding-bottom: 210px;
    }
    .dc-row{
      display: flex;
      margin-bottom: 10px;
    }
    .dc-row-user{ justify-content: flex-end; }
    .dc-row-assistant{ justify-content: flex-start; }
    .dc-bubble{
      max-width: 76%;
      padding: 9px 13px;
      border-radius: 14px;
      font-size: 14px;
      line-height: 1.55;
      word-wrap: break-word;
      overflow-wrap: break-word;
    }
    .dc-row-assistant .dc-bubble{
      background: rgba(255,255,255,0.05);
      color: #E8ECF2;
      border-bottom-left-radius: 4px;
    /* 给左侧立绘让出避让空间 */
      margin-left: 8px;
    }
    body.theme-light .dc-row-assistant .dc-bubble{
      background: rgba(255,255,255,0.92);
      color: #0f172a;
      box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    }
    .dc-row-user .dc-bubble{
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #07111f;
      font-weight: 500;
      border-bottom-right-radius: 4px;
    }
    /* 左下角立绘（GIF 已加白底为透明）：多层叠加 idle 微动：上下浮动 + 头部摇摆 + 周期性「探头」，让数字人「活」起来。不仅 CSS 改进，JS 侧还会在 .dc-thinking / .dc-speaking 状态下额外触发反馈动画。 */
    .dc-portrait{
      position: absolute;
      left: -12px;
      bottom: 64px;  /* 留出底部输入框高度 */
      width: 220px;
      height: 220px;
      pointer-events: auto;
      z-index: 2;
      filter: drop-shadow(0 12px 28px rgba(46,230,201,0.22));
      transform-origin: 35% 95%;
      /* idle 三层动画：浮动 + 摇摆 + 偶发 peek */
      animation:
        dc-portrait-float 5.6s ease-in-out infinite,
        dc-portrait-sway  7.2s ease-in-out infinite;
    }
    body.theme-light .dc-portrait{
      filter: drop-shadow(0 8px 20px rgba(15,23,42,0.18));
    }
    @keyframes dc-portrait-float {
      0%, 100% { translate: 0 0; }
      50%      { translate: 0 -6px; }
    }
    @keyframes dc-portrait-sway {
      0%, 100% { rotate: 0deg; }
      25%      { rotate: -1.8deg; }
      75%      { rotate:  1.8deg; }
    }
    .dc-portrait-img{
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: left bottom;
      -webkit-user-drag: none;
      user-select: none;
      pointer-events: none;
    /* 软边渐隐：中心 75% 完全显示，到 100% 渐变到透明，进一步消除 GIF 抠图边缘 */
      -webkit-mask-image: radial-gradient(ellipse 75% 85% at 40% 62%, #000 65%, rgba(0,0,0,0.8) 85%, transparent 100%);
      mask-image: radial-gradient(ellipse 75% 85% at 40% 62%, #000 65%, rgba(0,0,0,0.8) 85%, transparent 100%);
    }
    /* 首次点击提示气泡 */
    .dc-portrait-tap-hint{
      position: absolute;
      top: -6px;
      left: 60%;
      transform: translateX(-50%);
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(46,230,201,0.18);
      border: 1px solid rgba(46,230,201,0.35);
      color: #2EE6C9;
      font-size: 11px;
      white-space: nowrap;
      pointer-events: none;
      animation: dc-hint-fade 6s ease-out 2s forwards;
    }
    @keyframes dc-hint-fade {
      0%, 80% { opacity: 1; }
      100% { opacity: 0; visibility: hidden; }
    }
    /* 点击立绘 → 暂时打断 idle，做更夸张的 bounce + 旋转反馈 */
    .dc-portrait.dc-portrait-bounce{
      animation:
        dc-portrait-tap 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        dc-portrait-float 5.6s ease-in-out infinite 0.6s,
        dc-portrait-sway  7.2s ease-in-out infinite 0.6s;
    }
    @keyframes dc-portrait-tap {
      0%   { transform: scale(1.00) translateY(0) rotate(0); }
      30%  { transform: scale(1.08) translateY(-12px) rotate(-4deg); }
      60%  { transform: scale(1.04) translateY(-4px) rotate(3deg); }
      100% { transform: scale(1.00) translateY(0) rotate(0); }
    }
    /* 思考状态：立绘加更快的微微抖动 + 旁边出现「思考中」气泡 */
    .dc-portrait.dc-thinking{
      animation:
        dc-portrait-thinking 1.2s ease-in-out infinite,
        dc-portrait-sway     7.2s ease-in-out infinite;
    }
    @keyframes dc-portrait-thinking {
      0%, 100% { translate: 0 0; }
      50%      { translate: 0 -3px; }
    }
    .dc-portrait.dc-thinking::after{
      content: '鎬濊€冧腑鈥?;
      position: absolute;
      top: 8px;
      right: -4px;
      padding: 5px 10px;
      border-radius: 12px 12px 12px 4px;
      background: rgba(20,26,40,0.95);
      color: #2EE6C9;
      font-size: 12px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.35);
      animation: dc-thought-fade 0.4s ease;
    }
    @keyframes dc-thought-fade {
      0% { opacity: 0; transform: translateY(4px) scale(0.9); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    body.theme-light .dc-portrait.dc-thinking::after{
      background: #ffffff;
      color: #0f5e54;
      border: 1px solid rgba(46,230,201,0.4);
    }
    /* AI 回复中：立绘「说话」状态，加快节奏缩放变化模拟一张一合 */
    .dc-portrait.dc-speaking{
      animation:
        dc-portrait-speak 0.55s ease-in-out infinite,
        dc-portrait-sway  7.2s ease-in-out infinite;
    }
    @keyframes dc-portrait-speak {
      0%, 100% { transform: scale(1.000) translateY(0); }
      50%      { transform: scale(1.018) translateY(-2px); }
    }
    /* 互动反馈小气泡（点击或 AI 回复完成时随机弹出） */
    .dc-portrait-feedback{
      position: absolute;
      top: 18px;
      left: 70%;
      padding: 4px 10px;
      border-radius: 12px 12px 12px 4px;
      background: linear-gradient(135deg, rgba(46,230,201,0.95), rgba(91,140,255,0.95));
      color: #07111f;
      font-size: 12px;
      font-weight: 600;
      white-space: nowrap;
      pointer-events: none;
      box-shadow: 0 4px 12px rgba(46,230,201,0.3);
      animation: dc-feedback-pop 1.8s ease forwards;
      z-index: 3;
    }
    @keyframes dc-feedback-pop {
      0%   { opacity: 0; transform: translateY(8px) scale(0.7); }
      15%  { opacity: 1; transform: translateY(-2px) scale(1.05); }
      30%  { transform: translateY(0) scale(1); }
      85%  { opacity: 1; transform: translateY(-4px) scale(1); }
      100% { opacity: 0; transform: translateY(-12px) scale(0.95); }
    }
    /* 底部输入框 */
    .dc-composer{
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px max(env(safe-area-inset-bottom, 0px), 12px);
      background: rgba(12,19,34,0.86);
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      border-top: 1px solid rgba(255,255,255,0.06);
      flex-shrink: 0;
      z-index: 3;
    }
    body.theme-light .dc-composer{
      background: rgba(255,255,255,0.92);
      border-top-color: rgba(15,23,42,0.06);
    }
    .dc-input{
      flex: 1;
      min-width: 0;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 999px;
      padding: 10px 16px;
      color: #E8ECF2;
      font-size: 14px;
      outline: 0;
    }
    .dc-input::placeholder{ color: #6b7280; }
    body.theme-light .dc-input{
      background: rgba(15,23,42,0.04);
      border-color: rgba(15,23,42,0.08);
      color: #0f172a;
    }
    body.theme-light .dc-input::placeholder{ color: #94a3b8; }
    .dc-send-btn{
      flex-shrink: 0;
      width: 38px;
      height: 38px;
      border-radius: 999px;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #07111f;
      border: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .dc-send-btn:active{ opacity: 0.85; }

    /* 横屏：立绘缩到右下角，主体气泡占大头 */
    @media (orientation: landscape){
      .dc-portrait{
        left: auto;
        right: 12px;
        bottom: 70px;
        width: 160px;
        height: 160px;
      }
      .dc-thread{ padding-bottom: 80px; padding-right: 180px; }
    }

    /* === 旧自定义智能体广场 CSS（已废弃，selector 不再匹配，留作回退） === */
    .__ag_legacy_unused_topbar{
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: max(env(safe-area-inset-top, 0px), 14px) 18px 8px;
      flex-shrink: 0;
    }
    .ag-title{
      font-size: 18px;
      font-weight: 600;
      color: #E8ECF2;
      letter-spacing: 0.5px;
    }
    body.theme-light .ag-title{ color: #0f172a; }
    .ag-new-btn{
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 7px 12px;
      border-radius: 999px;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #07111f;
      font-size: 13px;
      font-weight: 600;
      border: 0;
    }
    .ag-new-btn:active{ opacity: 0.85; }
    .ag-search-wrap{
      padding: 4px 18px 6px;
      flex-shrink: 0;
    }
    .ag-search{
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.08);
    }
    .ag-search input{
      flex: 1;
      background: transparent;
      border: 0;
      outline: 0;
      color: #E8ECF2;
      font-size: 13px;
    }
    .ag-search input::placeholder{ color: #6b7280; }
    body.theme-light .ag-search{ background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.08); }
    body.theme-light .ag-search input{ color: #0f172a; }
    body.theme-light .ag-search input::placeholder{ color: #94a3b8; }
    .ag-search i{ color: #6b7280; }
    body.theme-light .ag-search i{ color: #94a3b8; }
    .ag-scroll{
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 6px 14px 100px;
    }
    .ag-section-title{
      font-size: 12px;
      font-weight: 600;
      color: #9aa3b2;
      padding: 12px 4px 8px;
      letter-spacing: 1px;
    }
    .ag-section-title--gap{ margin-top: 4px; }
    body.theme-light .ag-section-title{ color: #64748b; }
    .ag-grid{
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .ag-card{
      position: relative;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 10px;
      border-radius: 14px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.08);
      text-align: left;
      min-height: 72px;
      transition: transform 0.12s ease, background 0.18s ease;
    }
    .ag-card:active{ transform: scale(0.98); }
    body.theme-light .ag-card{
      background: rgba(255,255,255,0.92);
      border-color: rgba(15,23,42,0.06);
      box-shadow: 0 2px 6px rgba(15,23,42,0.04);
    }
    .ag-card-avatar{
      flex: 0 0 auto;
      width: 40px;
      height: 40px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      color: #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    }
    .ag-card-body{
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .ag-card-name{
      font-size: 13.5px;
      font-weight: 600;
      color: #E8ECF2;
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    body.theme-light .ag-card-name{ color: #0f172a; }
    .ag-card-brief{
      font-size: 11.5px;
      color: #9aa3b2;
      line-height: 1.35;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
    body.theme-light .ag-card-brief{ color: #64748b; }
    .ag-card-tag{
      position: absolute;
      top: 8px;
      right: 8px;
      font-size: 10px;
      color: #2EE6C9;
      background: rgba(46,230,201,0.12);
      padding: 2px 6px;
      border-radius: 6px;
      letter-spacing: 0.5px;
    }
    .ag-empty{
      grid-column: 1 / -1;
      padding: 24px 12px;
      text-align: center;
      color: #6b7280;
      font-size: 13px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px dashed rgba(255,255,255,0.08);
    }
    body.theme-light .ag-empty{
      color: #94a3b8;
      background: rgba(15,23,42,0.03);
      border-color: rgba(15,23,42,0.1);
    }
    /* 新建 / 编辑表单（底部 sheet） */
    .ag-edit-host{
      position: fixed;
      inset: 0;
      z-index: 80;
      pointer-events: none;
    }
    .ag-edit-host.open{ pointer-events: auto; }
    .ag-edit-bd{
      position: absolute;
      inset: 0;
      background: rgba(0,0,0,0.5);
      opacity: 0;
      transition: opacity 0.25s ease;
    }
    .ag-edit-host.open .ag-edit-bd{ opacity: 1; }
    .ag-edit-panel{
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      max-height: 92vh;
      background: #0c1322;
      border-radius: 18px 18px 0 0;
      transform: translateY(100%);
      transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
      display: flex;
      flex-direction: column;
    }
    body.theme-light .ag-edit-panel{ background: #ffffff; }
    .ag-edit-host.open .ag-edit-panel{ transform: translateY(0); }
    .ag-edit-head{
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    body.theme-light .ag-edit-head{ border-bottom-color: rgba(15,23,42,0.06); }
    .ag-edit-title{
      font-size: 15px;
      font-weight: 600;
      color: #E8ECF2;
    }
    body.theme-light .ag-edit-title{ color: #0f172a; }
    .ag-edit-save{
      padding: 6px 14px;
      border-radius: 999px;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #07111f;
      font-size: 13px;
      font-weight: 600;
      border: 0;
    }
    .ag-edit-save:active{ opacity: 0.85; }
    .ag-edit-body{
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 16px 18px 32px;
      padding-bottom: max(32px, env(safe-area-inset-bottom, 0));
    }
    .ag-form-row{ margin-bottom: 12px; }
    .ag-form-row--avatar{
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 18px;
    }
    .ag-avatar-preview{
      width: 56px;
      height: 56px;
      border-radius: 16px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      color: #fff;
      box-shadow: 0 4px 12px rgba(0,0,0,0.2);
      background: linear-gradient(135deg, #5B8CFF, #2EE6C9);
    }
    .ag-avatar-picker{
      flex: 1;
      min-width: 0;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .ag-avatar-opt{
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: rgba(255,255,255,0.05);
      border: 1px solid transparent;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .ag-avatar-opt.on{
      background: rgba(46,230,201,0.18);
      border-color: rgba(46,230,201,0.4);
    }
    body.theme-light .ag-avatar-opt{ background: rgba(15,23,42,0.04); }
    body.theme-light .ag-avatar-opt.on{
      background: rgba(46,230,201,0.16);
      border-color: rgba(46,230,201,0.45);
    }
    .ag-form-label{
      display: block;
      font-size: 11.5px;
      color: #9aa3b2;
      margin: 14px 0 6px;
      letter-spacing: 0.5px;
    }
    .ag-required{ color: #FF7A7A; }
    body.theme-light .ag-form-label{ color: #64748b; }
    .ag-color-picker{
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 8px;
    }
    .ag-color-opt{
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: 2px solid transparent;
      transition: transform 0.12s ease;
    }
    .ag-color-opt.on{
      border-color: #ffffff;
      transform: scale(1.1);
      box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    body.theme-light .ag-color-opt.on{
      border-color: #0f172a;
    }
    .ag-form-actions{ margin-top: 24px; }
    .ag-edit-delete{
      width: 100%;
      padding: 11px;
      border-radius: 12px;
      background: rgba(255,80,80,0.1);
      border: 1px solid rgba(255,80,80,0.25);
      color: #FF7A7A;
      font-size: 13px;
    }
    /* 兼容旧 dh- 选择器，避免历史 CSS 污染（实际不再用） */
    .dh-stage,
    .dh-canvas-wrap,
    .dh-layer,
    .dh-action-bar,
    .dh-topbar { display: none !important; }

    /* ====== 手工创作模块 · 富文本编辑器 ====== */
    .create-genre-thumb-wrap--handwrite{
      background: linear-gradient(135deg, rgba(91,140,255,0.18), rgba(46,230,201,0.18));
    }
    .create-genre-emoji-thumb{
      width: 54px;
      height: 54px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      line-height: 1;
    }
    body.create-handwrite-pane .create-page-body{
      padding: 0;
      overflow: hidden;
    }
    body.create-handwrite-pane #createModule{
      height: 100%;
      overflow: hidden;
    }
    .hw-root{
      display: flex;
      flex-direction: column;
      /* 真实高度由 JS 主动按 visualViewport.height 设置（在 16-handwrite-create.js bindViewportSizing 里）；
         以兼容 MIUI/EMUI/旧 WebView 中 100dvh 与键盘事件不同步的问题。
         这里给一个 100% 兜底，避免 JS 还没设上时元素是 0 高。
         overflow: hidden 关键：JS 算出来的 vv 高度可能略大于父容器高，
         hw-root 自身可能被外层滚动，导致 title-row / toolbar 滚走消失（#3 bug 根因）。 */
      height: 100%;
      overflow: hidden;
      background: #0c1322;
    }
    body.theme-light .hw-root{ background: #ffffff; }
    .hw-title-row{
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-bottom: 1px solid rgba(255,255,255,0.06);
      flex-shrink: 0; /* 永远不被压缩；与 hw-toolbar 一起常驻顶部不滚动 */
    }
    body.theme-light .hw-title-row{ border-bottom-color: rgba(15,23,42,0.06); }
    .hw-iconbtn{
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      border-radius: 999px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.05);
      border: 0;
      color: #9aa3b2;
    }
    .hw-iconbtn:active{ background: rgba(46,230,201,0.15); color: #2EE6C9; }
    body.theme-light .hw-iconbtn{ background: rgba(15,23,42,0.05); color: #475569; }
    body.theme-light .hw-iconbtn:active{ background: rgba(46,230,201,0.12); color: #0f5e54; }
    .hw-title-input{
      flex: 1;
      min-width: 0;
      background: transparent;
      border: 0;
      outline: 0;
      color: #E8ECF2;
      font-size: 17px;
      font-weight: 600;
      padding: 6px 4px;
    }
    .hw-title-input::placeholder{ color: #475569; font-weight: 400; }
    body.theme-light .hw-title-input{ color: #0f172a; }
    body.theme-light .hw-title-input::placeholder{ color: #94a3b8; }
    .hw-char-count{
      font-size: 11px;
      color: #6b7280;
      flex-shrink: 0;
      min-width: 36px;
      text-align: right;
    }
    .hw-save-badge{
      font-size: 11px;
      color: #6b7280;
      flex-shrink: 0;
      min-width: 48px;
      text-align: right;
    }
    .hw-toolbar{
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 8px 12px;
      overflow-x: auto;
      border-bottom: 1px solid rgba(255,255,255,0.06);
      flex-shrink: 0;
      flex-wrap: nowrap;
    }
    body.theme-light .hw-toolbar{ border-bottom-color: rgba(15,23,42,0.06); }
    .hw-tb-btn{
      flex-shrink: 0;
      min-width: 32px;
      height: 32px;
      padding: 0 8px;
      border-radius: 8px;
      background: rgba(255,255,255,0.05);
      border: 0;
      color: #E8ECF2;
      font-size: 13px;
      font-weight: 500;
      transition: background 0.15s ease, transform 0.1s ease;
      white-space: nowrap;
    }
    .hw-tb-btn:active{ transform: scale(0.94); background: rgba(46,230,201,0.18); }
    .hw-tb-btn b, .hw-tb-btn i, .hw-tb-btn u{ font-style: italic; }
    .hw-tb-btn b{ font-weight: 700; font-style: normal; }
    .hw-tb-btn u{ font-style: normal; }
    body.theme-light .hw-tb-btn{ background: rgba(15,23,42,0.05); color: #0f172a; }
    body.theme-light .hw-tb-btn:active{ background: rgba(46,230,201,0.15); }
    .hw-tb-sep{
      width: 1px;
      height: 18px;
      background: rgba(255,255,255,0.1);
      margin: 0 4px;
      flex-shrink: 0;
    }
    body.theme-light .hw-tb-sep{ background: rgba(15,23,42,0.1); }
    .hw-tb-spacer{ flex: 1; min-width: 8px; }
    .hw-tb-polish{
      background: linear-gradient(135deg, rgba(46,230,201,0.22), rgba(91,140,255,0.22)) !important;
      color: #2EE6C9 !important;
      font-weight: 600;
    }
    body.theme-light .hw-tb-polish{
      background: linear-gradient(135deg, rgba(46,230,201,0.16), rgba(91,140,255,0.16)) !important;
      color: #0f5e54 !important;
    }
    .hw-tb-polish.hw-loading,
    .hw-polish-fly.hw-loading{
      opacity: 0.55;
      pointer-events: none;
    }
    .hw-tb-export{
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF) !important;
      color: #07111f !important;
      font-weight: 600;
    }
    .hw-tb-clear{ color: #FF7A7A; }
    .hw-scroll-area{
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 18px 18px max(40px, env(safe-area-inset-bottom, 0));
    }
    .hw-editor{
      min-height: 100%;
      outline: 0;
      color: #E8ECF2;
      font-size: 15px;
      line-height: 1.8;
      font-family: 'Noto Serif SC', 'Source Han Serif SC', serif;
      caret-color: #2EE6C9;
    /* 编辑器自身允许选中（外层创作页禁选规则被 contenteditable 兜底但保留例外） */
      -webkit-user-select: text !important;
      user-select: text !important;
      -webkit-touch-callout: default !important;
    }
    body.theme-light .hw-editor{ color: #0f172a; }
    .hw-editor:empty::before{
      content: '浠庤繖閲屽紑濮嬩功鍐欌€︹€?;
      color: #475569;
      pointer-events: none;
      font-style: italic;
    }
    body.theme-light .hw-editor:empty::before{ color: #94a3b8; }
    .hw-editor h1{ font-size: 22px; font-weight: 700; margin: 16px 0 12px; }
    .hw-editor h2{ font-size: 18px; font-weight: 600; margin: 12px 0 8px; }
    .hw-editor p{ margin: 0 0 10px; }
    .hw-editor blockquote{
      margin: 10px 0;
      padding: 8px 14px;
      border-left: 3px solid rgba(46,230,201,0.5);
      color: #9aa3b2;
      background: rgba(255,255,255,0.02);
      border-radius: 0 8px 8px 0;
    }
    body.theme-light .hw-editor blockquote{
      color: #475569;
      background: rgba(46,230,201,0.04);
    }
    .hw-editor ul, .hw-editor ol{ padding-left: 26px; margin: 8px 0; }
    .hw-editor li{ margin-bottom: 4px; }
    /* 浮动 AI 润色按钮（选中文字时定位到选区上方） */
    .hw-polish-fly{
      position: absolute;
      transform: translate(-50%, 0);
      z-index: 60;
      padding: 7px 14px;
      border-radius: 999px;
      background: #0c1322;
      border: 1px solid rgba(46,230,201,0.45);
      color: #2EE6C9;
      font-size: 12.5px;
      font-weight: 600;
      display: none;
      align-items: center;
      gap: 6px;
      box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    }
    .hw-polish-fly.show{ display: inline-flex; }
    .hw-polish-fly:active{ transform: translate(-50%, 0) scale(0.95); }
    body.theme-light .hw-polish-fly{
      background: #ffffff;
      color: #0f5e54;
      border-color: rgba(46,230,201,0.55);
      box-shadow: 0 6px 16px rgba(15,23,42,0.18);
    }
    .hw-fly-icon{ font-size: 13px; }

    /* ====== 手工创作 · 文稿历史抽屉 ====== */
    .hw-drawer-host{
      position: absolute;
      inset: 0;
      z-index: 60;
      pointer-events: none;
    }
    .hw-drawer-host.open{ pointer-events: auto; }
    .hw-drawer-bd{
      position: absolute;
      inset: 0;
      background: rgba(0,0,0,0.45);
      opacity: 0;
      transition: opacity 0.25s ease;
    }
    .hw-drawer-host.open .hw-drawer-bd{ opacity: 1; }
    .hw-drawer-panel{
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: min(86%, 320px);
      background: #0c1322;
      box-shadow: 2px 0 18px rgba(0,0,0,0.45);
      transform: translateX(-100%);
      transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
      display: flex;
      flex-direction: column;
    }
    body.theme-light .hw-drawer-panel{
      background: #ffffff;
      box-shadow: 2px 0 18px rgba(15,23,42,0.14);
    }
    .hw-drawer-host.open .hw-drawer-panel{ transform: translateX(0); }
    .hw-drawer-head{
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: max(env(safe-area-inset-top, 0px), 14px) 14px 10px;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    body.theme-light .hw-drawer-head{ border-bottom-color: rgba(15,23,42,0.06); }
    .hw-drawer-title{
      flex: 1;
      text-align: center;
      font-size: 15px;
      font-weight: 600;
      color: #E8ECF2;
    }
    body.theme-light .hw-drawer-title{ color: #0f172a; }
    .hw-drawer-list{
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      /* 顶部 padding 加大，避免第一条文档（尤其带「当前」标签的那条）紧贴 head 底边被视觉遮挡 */
      padding: 16px 10px max(20px, env(safe-area-inset-bottom, 0));
    }
    .hw-doc-empty{
      padding: 32px 12px;
      text-align: center;
      color: #6b7280;
      font-size: 13px;
    }
    body.theme-light .hw-doc-empty{ color: #94a3b8; }
    .hw-doc-row{
      display: flex;
      align-items: stretch;
      gap: 6px;
      padding: 10px 8px 10px 12px;
      border-radius: 10px;
      margin-bottom: 6px;
      background: transparent;
      transition: background 0.15s ease;
      cursor: pointer;
    }
    .hw-doc-row:active{ background: rgba(255,255,255,0.05); }
    .hw-doc-row--cur{
      background: rgba(46,230,201,0.10);
      box-shadow: inset 3px 0 0 #2EE6C9;
    }
    body.theme-light .hw-doc-row--cur{
      background: rgba(46,230,201,0.10);
      box-shadow: inset 3px 0 0 #0f5e54;
    }
    .hw-doc-main{
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .hw-doc-title{
      font-size: 14px;
      font-weight: 600;
      color: #E8ECF2;
      line-height: 1.3;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    body.theme-light .hw-doc-title{ color: #0f172a; }
    .hw-doc-cur-tag{
      font-size: 10px;
      color: #2EE6C9;
      background: rgba(46,230,201,0.16);
      padding: 1px 6px;
      border-radius: 4px;
      flex-shrink: 0;
      font-weight: 500;
    }
    body.theme-light .hw-doc-cur-tag{ color: #0f5e54; background: rgba(46,230,201,0.14); }
    .hw-doc-snip{
      font-size: 11.5px;
      color: #9aa3b2;
      line-height: 1.4;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    body.theme-light .hw-doc-snip{ color: #64748b; }
    .hw-doc-meta{
      font-size: 10.5px;
      color: #6b7280;
    }
    body.theme-light .hw-doc-meta{ color: #94a3b8; }
    .hw-doc-del{
      flex-shrink: 0;
      width: 32px;
      align-self: center;
      height: 32px;
      border-radius: 999px;
      border: 0;
      background: transparent;
      color: #6b7280;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .hw-doc-del:active{ background: rgba(255,80,80,0.12); color: #FF7A7A; }

    /* === 旧数字人 CSS 保留位（兼容历史） === */
    .__dh_legacy_unused{
      position: relative;
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      perspective: 800px;
      perspective-origin: 50% 40%;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
    }
    .dh-topbar{
      position: absolute;
      top: max(env(safe-area-inset-top, 0px), 14px);
      left: 0;
      right: 0;
      display: flex;
      justify-content: center;
      pointer-events: none;
      z-index: 5;
    }
    .dh-title{
      pointer-events: auto;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(20,26,40,0.55);
      border: 1px solid rgba(255,255,255,0.08);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      font-size: 12.5px;
      color: #E8ECF2;
    }
    body.theme-light .dh-title{
      background: rgba(255,255,255,0.75);
      border-color: rgba(15,23,42,0.08);
      color: #1f2937;
    }
    .dh-name{
      font-weight: 600;
      letter-spacing: 0.5px;
    }
    .dh-state{
      font-size: 11.5px;
      color: #94a3b8;
    }
    body.theme-light .dh-state{ color: #64748b; }
    /* 数字人主容器：占舞台中央，按宽度居中并预留底部药丸条空间 */
    .dh-canvas-wrap{
      position: relative;
      width: min(82vw, 360px);
      aspect-ratio: 3 / 4;
      max-height: calc(100% - 200px);
      will-change: transform;
      transition: filter 0.4s ease;
      transform-style: preserve-3d;
      transform: perspective(800px) rotateX(0deg) rotateY(0deg);
      filter: drop-shadow(0 18px 32px rgba(0,0,0,0.45));
    }
    body.theme-light .dh-canvas-wrap{
      filter: drop-shadow(0 12px 24px rgba(15,23,42,0.16));
    }
    /* 待机静态层 */
    .dh-layer{
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      object-position: center bottom;
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
    }
    .dh-idle-img{
      z-index: 1;
    /* idle 呼吸 + 微浮动（CSS 单层 sin 模拟胸腔起伏） */
      animation: dh-breath 4.4s ease-in-out infinite, dh-float 7.2s ease-in-out infinite;
      transform-origin: 50% 100%;
    }
    @keyframes dh-breath {
      0%, 100% { transform: scale(1.000); }
      50%      { transform: scale(1.012); }
    }
    @keyframes dh-float {
      0%, 100% { translate: 0 0; }
      50%      { translate: 0 -4px; }
    }
    /* 动作视频层：触发时 .show 类淡入，覆盖在 idle 之上 */
    .dh-action-video{
      z-index: 2;
      opacity: 0;
      transition: opacity 0.35s ease;
      background: transparent;
    }
    .dh-action-video.show{ opacity: 1; }
    .action-playing .dh-idle-img{
      /* 动作播放时给底图轻微淡出，但保留 5% 不透明度避免完全黑（视频带 alpha 时更自然） */
      opacity: 0.08;
      transition: opacity 0.35s ease;
    }
        /* 触控捕获层：透明，但接收全部 pointer 事件 */
    .dh-touch-capture{
      position: absolute;
      inset: 0;
      z-index: 3;
      cursor: grab;
      touch-action: none;
    }
    .dh-touch-capture:active{ cursor: grabbing; }
    /* 底部动作药丸条 */
    .dh-action-bar{
      position: absolute;
      left: 0;
      right: 0;
      bottom: max(env(safe-area-inset-bottom, 0px), 24px);
      display: flex;
      justify-content: center;
      gap: 10px;
      padding: 0 16px;
      z-index: 6;
      pointer-events: none;
    }
    .dh-action-pill{
      pointer-events: auto;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 9px 16px;
      border-radius: 999px;
      background: rgba(20,26,40,0.72);
      border: 1px solid rgba(255,255,255,0.1);
      color: #E8ECF2;
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.4px;
      -webkit-backdrop-filter: blur(12px);
      backdrop-filter: blur(12px);
      transition: transform 0.15s ease, background 0.2s ease;
    }
    .dh-action-pill:active{
      transform: scale(0.96);
      background: rgba(46,230,201,0.18);
      border-color: rgba(46,230,201,0.45);
    }
    body.theme-light .dh-action-pill{
      background: rgba(255,255,255,0.78);
      border-color: rgba(15,23,42,0.08);
      color: #1f2937;
    }
    body.theme-light .dh-action-pill:active{
      background: rgba(46,230,201,0.12);
      border-color: rgba(46,230,201,0.42);
      color: #0f5e54;
    }
    .dh-action-dot{
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      box-shadow: 0 0 6px rgba(46,230,201,0.6);
    }
    /* 横屏模式：左右更宽，向上抬一点 */
    @media (orientation: landscape){
      .dh-canvas-wrap{
        width: auto;
        height: min(78vh, 480px);
        aspect-ratio: 3 / 4;
        max-height: none;
      }
      .dh-action-bar{ bottom: 18px; }
    }

    /* ====== Toast ====== */
    .toast {
      position: absolute;
      left: 50%;
      bottom: calc(140px + env(safe-area-inset-bottom, 0px));
      transform: translateX(-50%) translateY(8px);
      background: rgba(20,26,40,0.96);
      border: 1px solid rgba(255,255,255,0.1);
      color:#E8ECF2; font-size: 12.5px; padding: 8px 12px; border-radius: 999px;
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px); opacity: 0; pointer-events: none;
      transition: opacity .25s ease, transform .25s ease;
      z-index: 95;
    }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* 通用 icon 尺寸 */
    .ic { width: 18px; height: 18px; }
    .ic-sm { width: 14px; height: 14px; }
    .ic-lg { width: 22px; height: 22px; }

    /* ====== 创作页全面禁选中 / 长按菜单 / 右键 ======
       目的：模型生成的小说/演讲稿/论文等正文、以及创作页所有展示态文本
       （标题、体裁卡、quote-block、详细介绍、设定表单的展示文字）一律不允许复制。
       范围：整个 .page[data-page="create"]，白名单仅放真正的输入控件。
       注意：底部 composer 在 bottomRail 内，不属于任一页，本规则不会影响其复制粘贴。 */
    .page[data-page="create"],
    .page[data-page="create"] * {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      -webkit-touch-callout: none;
      -webkit-tap-highlight-color: transparent;
    }
    /* 真正需要用户输入的控件保留原生交互（包括历史抽屉搜索框、设定表单各 input/textarea） */
    .page[data-page="create"] input,
    .page[data-page="create"] textarea,
    .page[data-page="create"] select,
    .page[data-page="create"] [contenteditable="true"],
    .page[data-page="create"] input *,
    .page[data-page="create"] textarea * {
      -webkit-user-select: text;
      -moz-user-select: text;
      -ms-user-select: text;
      user-select: text;
      -webkit-touch-callout: default;
    }


    /* ===== 首页：机器人历史按钮（替代 panel-left） ===== */
    .home-hist-robot-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1px;
      width: 36px;
      height: 36px;
      flex-shrink: 0;
      border: none;
      background: transparent;
      cursor: pointer;
      padding: 0;
      border-radius: 8px;
      transition: opacity 0.15s;
      -webkit-tap-highlight-color: transparent;
    }
    .home-hist-robot-btn:active { opacity: 0.6; }
    .home-hist-robot-svg {
      width: 24px;
      height: 21px;
    }
    .home-hist-label {
      font-size: 9px;
      line-height: 1;
      color: var(--text2, #8A93A4);
      letter-spacing: 0.02em;
    }
    /* 眨眼动画应用到历史按钮里的眼睛 */
    @keyframes hist-robot-blink {
      0%, 90%, 100% { transform: scaleY(1); }
      94%, 97% { transform: scaleY(0.08); }
    }
    .home-hist-robot-btn #histRobotEyeL,
    .home-hist-robot-btn #histRobotEyeR {
      transform-origin: center;
      transform-box: fill-box;
    }
    .home-hist-blink #histRobotEyeL { animation: hist-robot-blink 0.22s ease; }
    .home-hist-blink #histRobotEyeR { animation: hist-robot-blink 0.22s ease 0.03s; }

    /* ===== 首页分栏布局：左图 + 右侧对话 ===== */
    /* .page[data-page="home"] — display 由 .page / .page.active 统一控制，此处不覆盖 */
    .home-body-split {
      display: flex;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }
    .home-split-left {
      width: 38%;
      flex-shrink: 0;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 12px 4px 0 6px;
      overflow: hidden;
      pointer-events: none;
    }
    .home-split-img {
      width: 100%;
      height: auto;
      max-height: 72%;
      object-fit: contain;
      object-position: top center;
      border-radius: 10px;
      opacity: 0.92;
      user-select: none;
    }
    .home-split-right {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    /* home-scroll 在分栏右侧时需要填满 */
    .home-split-right #homeScroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
    }

    /* ===== 智能体页：Live2D ===== */
    .agents-live2d-wrap {
      position: relative;
      width: 100%;
      height: 100%;
      background: radial-gradient(ellipse at 50% 60%, #1a1a2e 0%, #0a0e18 100%);
      overflow: hidden;
      display: flex;
      align-items: stretch;
    }
    .agents-live2d-canvas {
      position: absolute;
      inset: 0;
      width: 100% !important;
      height: 100% !important;
    }
    .agents-live2d-loading {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      color: rgba(255,255,255,0.6);
      font-size: 14px;
      pointer-events: none;
      z-index: 2;
    }
    .agents-live2d-hint {
      position: absolute;
      bottom: 24px;
      left: 0;
      right: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      z-index: 3;
      pointer-events: none;
    }
    .agents-live2d-name {
      font-size: 15px;
      font-weight: 600;
      color: rgba(255,255,255,0.9);
      letter-spacing: 0.05em;
    }
    .agents-live2d-sub {
      font-size: 11px;
      color: rgba(255,255,255,0.4);
    }

    /* ===== AI润色 Diff 预览面板 ===== */
    .hw-polish-overlay {
      position: absolute;
      inset: 0;
      z-index: 200;
      display: flex;
      flex-direction: column;
      background: var(--bg, #0A0E18);
      border-top: 1px solid rgba(255,255,255,0.08);
    }
    .hw-polish-overlay-head {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px 8px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .hw-polish-overlay-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text1, #E8ECF2);
      flex: 1;
    }
    .hw-polish-overlay-body {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .hw-diff-label {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .hw-diff-label--old { color: #F56565; }
    .hw-diff-label--new { color: #48BB78; }
    .hw-diff-box {
      border-radius: 8px;
      padding: 10px 12px;
      font-size: 13px;
      line-height: 1.7;
      white-space: pre-wrap;
      word-break: break-all;
    }
    .hw-diff-box--old {
      background: rgba(245,101,101,0.08);
      border: 1px solid rgba(245,101,101,0.2);
      color: #F56565;
      text-decoration: line-through;
      text-decoration-color: rgba(245,101,101,0.5);
    }
    .hw-diff-box--new {
      background: rgba(72,187,120,0.08);
      border: 1px solid rgba(72,187,120,0.2);
      color: #48BB78;
    }
    .hw-polish-overlay-foot {
      display: flex;
      gap: 8px;
      padding: 10px 12px 14px;
      border-top: 1px solid rgba(255,255,255,0.07);
    }
    .hw-polish-apply-btn {
      flex: 1;
      height: 40px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #0A0E18;
      border: none;
      cursor: pointer;
    }
    .hw-polish-cancel-btn {
      flex: 1;
      height: 40px;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      background: rgba(255,255,255,0.06);
      color: var(--text2, #8A93A4);
      border: 1px solid rgba(255,255,255,0.1);
      cursor: pointer;
    }

    /* ===== 手工创作：章节标记样式 ===== */
    #hwEditor .hw-chapter-mark {
      display: block;
      width: 100%;
      padding: 6px 0 4px;
      margin: 8px 0 2px;
      font-size: 15px;
      font-weight: 700;
      color: var(--jade, #2EE6C9);
      border-bottom: 1px solid rgba(46,230,201,0.25);
      line-height: 1.4;
      letter-spacing: 0.03em;
    }

    /* ===== 顶栏 ego 机器人按钮（提升版） ===== */
    .home-topbar-ego-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 44px;
      height: 44px;
      border: none;
      background: transparent;
      cursor: pointer;
      padding: 2px;
      border-radius: 10px;
      -webkit-tap-highlight-color: transparent;
      transition: opacity 0.15s;
    }
    .home-topbar-ego-btn:active { opacity: 0.6; }
    .home-topbar-robot-figure {
      transform: scale(0.72);
      transform-origin: center bottom;
    }
    /* 眨眼动画复用 robot-figure 的 SVG 眼睛元素 */
    .home-topbar-ego-btn #histRobotEyeL,
    .home-topbar-ego-btn #histRobotEyeR {
      transform-origin: center;
      transform-box: fill-box;
    }
    .home-hist-blink #histRobotEyeL { animation: hist-robot-blink 0.22s ease; }
    .home-hist-blink #histRobotEyeR { animation: hist-robot-blink 0.22s ease 0.03s; }

    /* ===== 首页：robot-hero 没有图标版本 ===== */
    .robot-hero--no-figure .robot-row {
      gap: 0;
      padding: 6px 12px 4px;
    }
    .robot-hero--no-figure .robot-type-line {
      padding-bottom: 0;
    }

    /* ===== 首页分栏：修复 flex 布局未生效 ===== */
    .home-body-split {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      display: flex !important;
      flex-direction: row !important;
      overflow: hidden !important;
    }
    /* 覆盖原有直接子选择器规则，不再直接作用于 home-scroll */
    .page[data-page="home"].active > .home-scroll {
      flex: 0 0 auto;
    }
    .home-split-right {
      flex: 1 !important;
      min-width: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
    }
    .home-split-right #homeScroll {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
    }

    /* ===== 智能体页：Live2D + 对话完整布局 ===== */
    .agents-live2d-root {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      background: transparent;
      overflow: hidden;
    }
    .agents-live2d-stage {
      position: relative;
      flex: 0 0 55%;
      min-height: 0;
      background: transparent;
      overflow: hidden;
    }
    .agents-live2d-canvas {
      position: absolute;
      inset: 0;
      width: 100% !important;
      height: 100% !important;
    }
    /* 重置旧的 wrap 样式 */
    .agents-live2d-wrap {
      background: transparent !important;
    }
    /* 模型说话气泡 */
    .agents-speech-bubble {
      position: absolute;
      top: 12px;
      left: 50%;
      transform: translateX(-50%);
      max-width: 80%;
      background: rgba(255,255,255,0.12);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 14px;
      padding: 8px 14px;
      font-size: 13px;
      color: rgba(255,255,255,0.9);
      line-height: 1.5;
      text-align: center;
      z-index: 10;
      animation: bubble-fade-in 0.3s ease;
    }
    @keyframes bubble-fade-in {
      from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
      to   { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    /* 对话面板 */
    .agents-chat-panel {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      background: var(--bg, #0A0E18);
      border-top: 1px solid rgba(255,255,255,0.07);
    }
    .agents-chat-thread {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 10px 14px 4px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .agents-chat-composer {
      flex-shrink: 0;
      display: flex;
      align-items: flex-end;
      gap: 8px;
      padding: 8px 12px 10px;
      border-top: 1px solid rgba(255,255,255,0.06);
    }
    .agents-chat-input {
      flex: 1;
      min-height: 36px;
      max-height: 100px;
      resize: none;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 13px;
      color: var(--text1, #E8ECF2);
      outline: none;
      overflow-y: auto;
      font-family: inherit;
    }
    .agents-chat-input::placeholder { color: var(--text3, #555E6E); }
    .agents-chat-send {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #0A0E18;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    /* 对话消息气泡 */
    .agents-msg { display: flex; flex-direction: column; max-width: 82%; }
    .agents-msg--user { align-self: flex-end; align-items: flex-end; }
    .agents-msg--ai   { align-self: flex-start; align-items: flex-start; }
    .agents-msg-bubble {
      padding: 8px 12px;
      border-radius: 12px;
      font-size: 13px;
      line-height: 1.6;
      word-break: break-all;
    }
    .agents-msg--user .agents-msg-bubble {
      background: linear-gradient(135deg, #2EE6C9, #5B8CFF);
      color: #0A0E18;
      border-bottom-right-radius: 4px;
    }
    .agents-msg--ai .agents-msg-bubble {
      background: rgba(255,255,255,0.07);
      color: var(--text1, #E8ECF2);
      border-bottom-left-radius: 4px;
      border: 1px solid rgba(255,255,255,0.08);
    }

    /* ===== 首页 hero：左侧装饰图 + 右侧问候语 ===== */
    .robot-row--with-img {
      align-items: center;
      gap: 4px;
      padding: 4px 12px 6px 0;
    }
    .robot-hero-img-wrap {
      flex-shrink: 0;
      width: 38%;
      min-width: 0;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      overflow: hidden;
      padding-left: 4px;
    }
    .robot-hero-img {
      width: 100%;
      max-height: 120px;
      object-fit: contain;
      object-position: bottom center;
      user-select: none;
      pointer-events: none;
      -webkit-user-drag: none;
    }
    /* 问候语在右侧时样式微调 */
    .robot-row--with-img .robot-type-line {
      flex: 1;
      min-width: 0;
      padding-bottom: 4px;
    }

    /* ===== 智能体页面：跟随主题配色（不固定深色） ===== */
    .agents-chat-panel {
      background: transparent !important;
    }
    .agents-chat-composer {
      background: transparent;
    }
    .agents-chat-input {
      background: rgba(255,255,255,0.07);
      border: 1px solid rgba(255,255,255,0.12);
      color: #E8ECF2;
    }
    .agents-chat-input::placeholder { color: rgba(255,255,255,0.3); }

    /* 浅色主题覆盖 */
    body.theme-light .agents-chat-panel {
      border-top-color: rgba(15,23,42,0.08);
    }
    body.theme-light .agents-chat-input {
      background: rgba(15,23,42,0.05);
      border-color: rgba(15,23,42,0.12);
      color: #0F172A;
    }
    body.theme-light .agents-chat-input::placeholder { color: #94A3B8; }
    body.theme-light .agents-chat-composer { border-top-color: rgba(15,23,42,0.06); }
    body.theme-light .agents-msg--ai .agents-msg-bubble {
      background: rgba(15,23,42,0.05);
      color: #0F172A;
      border-color: rgba(15,23,42,0.1);
    }
    body.theme-light .agents-speech-bubble {
      background: rgba(15,23,42,0.08);
      border-color: rgba(15,23,42,0.12);
      color: #0F172A;
    }
    body.theme-light .agents-live2d-name { color: rgba(15,23,42,0.8); }
    body.theme-light .agents-live2d-sub  { color: rgba(15,23,42,0.4); }

    /* ===== 首页分栏：Live2D左 + 对话右（最终版） ===== */
    /* 覆盖旧的直接子选择器：home-scroll 已不是 page 的直接子 */
    .page[data-page="home"].active > .home-scroll { flex: 0 0 auto; min-height: 0; }

    .home-body-split {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      display: flex !important;
      flex-direction: row !important;
      overflow: hidden !important;
    }

    /* 右栏：对话流 */
    .home-chat-col {
      flex: 1 !important;
      min-width: 0 !important;
      min-height: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
    }
    .home-chat-col .robot-hero,
    .home-chat-col .home-robot-panel {
      position: relative;
      z-index: 1;
    }
    .home-chat-col #homeScroll {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      overflow-y: auto !important;
      overflow-x: hidden !important;
    }
    /* 右栏对话气泡最大宽度适配窄列 */
    .home-chat-col .chat-thread .msg-bubble,
    .home-chat-col .chat-thread .user-bubble { max-width: 96%; }


    /* ===== 首页问候语：居中全宽条 ===== */
    .home-greeting-bar {
      flex-shrink: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      text-align: center !important;
      padding: 10px 16px 8px !important;
      margin: 0 !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      min-height: auto !important;
    }
    .home-greeting-text {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      gap: 2px !important;
    }
    .home-greeting-text .ri-main { text-align: center; }
    .home-greeting-text .ri-sub  { text-align: center; }

    /* home-chat-col 里 home-scroll 直接填满 */
    .home-chat-col {
      flex: 1 !important;
      min-width: 0 !important;
      min-height: 0 !important;
      display: flex !important;
      flex-direction: column !important;
      overflow: hidden !important;
    }
    .home-chat-col #homeScroll {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      overflow-y: auto !important;
    }

    /* ===== 顶栏眨眼机器人：用 robot-figure 正确继承颜色变量 ===== */
    .home-hist-robot-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 38px;
      height: 38px;
      border: none;
      background: transparent;
      cursor: pointer;
      padding: 2px;
      border-radius: 8px;
      -webkit-tap-highlight-color: transparent;
      transition: opacity 0.15s;
    }
    .home-hist-robot-btn:active { opacity: 0.55; }
    .home-hist-robot-figure {
      width: 28px !important;
      height: 26px !important;
      min-width: 0 !important;
      min-height: 0 !important;
      padding: 0 !important;
      background: transparent !important;
      border-radius: 0 !important;
    }
    .home-hist-robot-figure .robot-mark {
      width: 28px !important;
      height: 26px !important;
    }
    /* 眨眼动画 */
    @keyframes hist-robot-blink {
      0%, 88%, 100% { transform: scaleY(1); }
      92%, 96% { transform: scaleY(0.07); }
    }
    .home-hist-robot-figure #histRobotEyeL,
    .home-hist-robot-figure #histRobotEyeR {
      transform-origin: center;
      transform-box: fill-box;
    }
    .home-hist-blink .home-hist-robot-figure #histRobotEyeL {
      animation: hist-robot-blink 0.25s ease;
    }
    .home-hist-blink .home-hist-robot-figure #histRobotEyeR {
      animation: hist-robot-blink 0.25s ease 0.03s;
    }

    /* 真机 APK：开机动画由 14-robot-live2d.js 控制，勿在此强制隐藏 */

    /* ===== 启动加载屏（Web + 真机） ===== */
    .app-splash {
      position: fixed;
      inset: 0;
      z-index: 9999;
      overflow: hidden;
      background: #E5F2FB;
    }
    .app-splash .splash-bg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
    }
    .app-splash .splash-foot {
      position: absolute;
      left: 0;
      right: 0;
      bottom: calc(11vh + env(safe-area-inset-bottom, 0px));
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      padding: 0 24px;
      transition: opacity 0.45s ease, transform 0.45s ease;
    }
    .app-splash.splash-hide {
      pointer-events: none;
    }
    .app-splash.splash-hide .splash-foot {
      opacity: 0;
      transform: translateY(8px);
    }
    .app-splash.is-gone {
      display: none !important;
    }
    .splash-sub {
      margin: 0;
      font-size: 13px;
      letter-spacing: 0.08em;
      color: rgba(71, 85, 105, 0.88);
      text-shadow: 0 1px 8px rgba(255, 255, 255, 0.65);
    }
    .splash-progress {
      width: min(56vw, 200px);
      height: 3px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.1);
      overflow: hidden;
    }
    .splash-progress-bar {
      display: block;
      width: 36%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, rgba(91, 140, 255, 0.2), rgba(91, 140, 255, 0.95));
      animation: splash-progress 1.2s ease-in-out infinite;
    }
    .splash-mascot-svg {
      width: min(52vw, 200px);
      height: min(52vw, 172px);
    }
    /* 整屏开机插画（people/boot-splash.png 自带 EGO 文案，铺满全屏） */
    .app-splash .splash-inner {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-end;
      padding: 0 24px calc(5vh + env(safe-area-inset-bottom, 0px));
    }
    .app-splash .splash-mascot-img {
      position: absolute;
      inset: 0;
      margin: 0;
    }
    .app-splash .splash-mascot-img .splash-frame {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      pointer-events: none;
      user-select: none;
      -webkit-user-drag: none;
    }
    /* 插画已含「正在唤醒」语义文案，隐去重复副标题，仅保留底部进度条 */
    .app-splash .splash-sub { display: none; }
    .app-splash .splash-progress { position: relative; z-index: 1; }
    .splash-robot-mark {
      width: 100%;
      height: 100%;
      display: block;
      filter: drop-shadow(0 12px 28px rgba(91, 140, 255, 0.28));
    }
    .splash-robot-mark .robot-svg-head { fill: rgba(255, 255, 255, 0.14); }
    .splash-robot-mark .robot-svg-torso { fill: rgba(255, 255, 255, 0.08); }
    .splash-robot-mark .robot-svg-eye { fill: #5b8cff; }
    .splash-eye-l, .splash-eye-r {
      transform-origin: center;
      transform-box: fill-box;
      animation: hist-robot-blink 2.4s ease-in-out infinite;
    }
    @keyframes splash-progress {
      0% { transform: translateX(-120%); }
      100% { transform: translateX(320%); }
    }
    body.theme-light .app-splash,
    html.theme-light .app-splash {
      background: #E5F2FB;
    }
    html.theme-light .splash-title,
    body.theme-light .splash-title { color: #0f172a; }
    html.theme-light .splash-sub,
    body.theme-light .splash-sub { color: #64748b; }
    html.theme-light .splash-progress,
    body.theme-light .splash-progress { background: rgba(15, 23, 42, 0.08); }
    html.theme-light .splash-robot-mark .robot-svg-head,
    body.theme-light .splash-robot-mark .robot-svg-head { fill: rgba(30, 41, 59, 0.1); }
    html.theme-light .splash-robot-mark .robot-svg-eye,
    body.theme-light .splash-robot-mark .robot-svg-eye { fill: #111827; }
    /* ===== 聊天气泡：半透明玻璃效果 ===== */
    .chat-row.user .chat-bubble {
      background: rgba(91,140,255,0.18) !important;
      backdrop-filter: blur(12px) !important;
      -webkit-backdrop-filter: blur(12px) !important;
      border: 1px solid rgba(91,140,255,0.30) !important;
      color: #E8ECF2 !important;
    }
    .chat-row.assistant .chat-bubble {
      background: rgba(255,255,255,0.06) !important;
      backdrop-filter: blur(12px) !important;
      -webkit-backdrop-filter: blur(12px) !important;
      border: 1px solid rgba(255,255,255,0.10) !important;
      color: #D4DAE6 !important;
    }
    /* 浅色主题玻璃气泡 */
    body.theme-light .chat-row.user .chat-bubble {
      background: rgba(37,99,235,0.10) !important;
      backdrop-filter: blur(10px) !important;
      -webkit-backdrop-filter: blur(10px) !important;
      border: 1px solid rgba(37,99,235,0.20) !important;
      color: #1E3A5F !important;
    }
    body.theme-light .chat-row.assistant .chat-bubble {
      background: rgba(255,255,255,0.55) !important;
      backdrop-filter: blur(10px) !important;
      -webkit-backdrop-filter: blur(10px) !important;
      border: 1px solid rgba(15,23,42,0.10) !important;
      color: #1E293B !important;
    }

    /* ===== 对话气泡统一玻璃效果（非首页；首页见 home-layout-v2 / ui-taste-v3） ===== */
    body:not(.page-home) .chat-row.user .chat-bubble {
      background: rgba(80,130,255,0.22) !important;
      backdrop-filter: blur(14px) saturate(160%) !important;
      -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
      border: 1px solid rgba(120,160,255,0.35) !important;
      color: rgba(230,240,255,0.96) !important;
      box-shadow: 0 2px 12px rgba(60,100,255,0.15) !important;
    }
    body:not(.page-home) .chat-row.assistant .chat-bubble {
      background: rgba(10,18,40,0.42) !important;
      backdrop-filter: blur(14px) saturate(160%) !important;
      -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
      border: 1px solid rgba(255,255,255,0.14) !important;
      color: rgba(220,232,255,0.94) !important;
      box-shadow: 0 2px 12px rgba(0,0,0,0.18) !important;
    }
    /* 浅色主题的玻璃（非首页） */
    body.theme-light:not(.page-home) .chat-row.user .chat-bubble {
      background: rgba(37,99,235,0.12) !important;
      backdrop-filter: blur(12px) !important;
      -webkit-backdrop-filter: blur(12px) !important;
      border: 1px solid rgba(37,99,235,0.22) !important;
      color: #1e3a6e !important;
    }
    body.theme-light:not(.page-home) .chat-row.assistant .chat-bubble {
      background: rgba(255,255,255,0.58) !important;
      backdrop-filter: blur(12px) !important;
      -webkit-backdrop-filter: blur(12px) !important;
      border: 1px solid rgba(15,23,42,0.10) !important;
      color: #1e293b !important;
    }


    /* Android adjustNothingRail：只抬底栏贴键盘；机器人/背景/开场白不随动 */
    html.keyboard-rail-animating {
      transition: --kb-vv-inset 0.25s cubic-bezier(0.2, 0.9, 0.2, 1);
    }
    body.native-app.keyboard-rail-only.keyboard-open .bottom-rail,
    body.native-app.keyboard-rail-only.keyboard-rail-active .bottom-rail {
      bottom: var(--kb-vv-inset, 0px) !important;
      transform: none !important;
      padding-bottom: 0 !important;
    }
    html.keyboard-rail-animating body.native-app.keyboard-rail-only .bottom-rail {
      transition: bottom 0.25s cubic-bezier(0.2, 0.9, 0.2, 1) !important;
    }
    html.keyboard-rail-animating body.native-app.keyboard-rail-only .home-chat-col #homeScroll,
    html.keyboard-rail-animating body.native-app.keyboard-rail-only #agentChatThread,
    html.keyboard-rail-animating body.native-app.keyboard-rail-only.create-workbench-pane #createResultThread,
    html.keyboard-rail-animating body.native-app.keyboard-rail-only.page-create #createModule.create-flow-scroll {
      transition: padding-bottom 0.25s cubic-bezier(0.2, 0.9, 0.2, 1) !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-home .page[data-page="home"].active > .home-head-band {
      position: sticky !important;
      top: 0 !important;
      left: auto !important;
      width: 100% !important;
      transform: none !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-home .home-body-split {
      padding-top: 0 !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-home .home-robot-panel,
    body.native-app.keyboard-rail-only.keyboard-open.page-home #homeChatBg,
    body.native-app.keyboard-rail-only.keyboard-open.page-home .home-openers-dock {
      transform: none !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open .home-chat-col #homeScroll,
    body.native-app.keyboard-rail-only.keyboard-open .home-chat-col #chatThread {
      scroll-padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 16px);
    }
    body.native-app.keyboard-rail-only.keyboard-open .home-chat-col #homeScroll {
      padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 8px) !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open #agentChatThread,
    body.native-app.keyboard-rail-only.keyboard-rail-active #agentChatThread {
      padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 8px) !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.create-workbench-pane #createResultThread,
    body.native-app.keyboard-rail-only.keyboard-rail-active.create-workbench-pane #createResultThread {
      padding-bottom: calc(16px + var(--kb-vv-inset, 0px)) !important;
    }
    /* 智能体对话：头带/背景固定，只顶聊天气泡 */
    body.native-app.keyboard-rail-only.keyboard-open.page-agents.agents-chat-focus .page[data-page="agents"].active.agents-in-chat > #agentsHeadBand {
      position: sticky !important;
      top: 0 !important;
      left: auto !important;
      width: 100% !important;
      max-width: 100% !important;
      transform: none !important;
      box-shadow: none !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-agents.agents-chat-focus .page[data-page="agents"].active.agents-in-chat .agents-chat-root .chat-thread {
      padding-top: 0 !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-agents.agents-chat-focus #agentsChatBg,
    body.native-app.keyboard-rail-only.keyboard-open.page-agents.agents-chat-focus .agents-chat-bg {
      transform: none !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-agents.agents-chat-focus #agentChatThread {
      scroll-padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 16px);
    }
    /* 创作体裁/工作台：顶栏固定，内容区随键盘留白 */
    body.native-app.keyboard-rail-only.keyboard-open.page-create .page[data-page="create"].active > .topbar.create-topbar {
      position: sticky !important;
      top: 0 !important;
      transform: none !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-create #createModule.create-flow-scroll {
      padding-bottom: calc(12px + var(--kb-vv-inset, 0px)) !important;
    }
    body.native-app.keyboard-rail-only.keyboard-open.page-create.create-workbench-pane #createResultThread {
      scroll-padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 16px);
    }

    /* ===== 键盘弹起：只顶输入框，导航栏和模型不动 ===== */
    /* bottom-rail 的 fixed 抬升由 home-layout-v2 的 .keyboard-rail-active 控制 */

    /* 键盘打开时聊天区增加底部 padding，避免被 bottom-rail 遮挡 */
    body.native-app.keyboard-open .home-chat-col #homeScroll,
    body.native-app.keyboard-open .home-chat-col #chatThread {
      scroll-padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 16px);
      scroll-behavior: auto;
    }
    body.native-app.keyboard-open .home-chat-col #homeScroll {
      padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 0px)) !important;
    }

    body.native-app.keyboard-android.keyboard-open .home-chat-col #homeScroll {
      padding-bottom: calc(var(--kb-vv-inset, 0px) + var(--bottom-rail-height, 96px) + 8px) !important;
    }

    /* 键盘打开时非首页保持 tabbar 可见（首页键盘打开时应隐藏 tabbar） */
    body.page-kb.keyboard-open .bottom-rail #tabbar,
    body.page-agents.keyboard-open .bottom-rail #tabbar,
    body.page-me.keyboard-open .bottom-rail #tabbar {
      display: grid !important;
    }

    /* 浅色主题 head-band 固定背景 */
    body.theme-light.native-app.keyboard-open .page[data-page="home"].active .home-head-band {
      background: linear-gradient(180deg, #f4f6fa 0%, #eef2f7 100%) !important;
    }

    /* 首页气泡透明度：详见 home-layout-v2.css / ui-taste-v3.css，此处仅保留 native 键盘态布局 */

    /* 确保 pages 区域不被 bottom-rail 压住 */
    body.native-app.keyboard-open .pages {
      padding-bottom: 0 !important;
    }

    /* home-body-split 键盘态补上 head-band 高度，消除空白 */
    body.native-app.keyboard-open .home-body-split {
      padding-top: var(--home-head-offset, 110px) !important;
    }

    .page[data-page="home"].active .home-body-split {
      position: relative;
    }
    .page[data-page="home"].active .home-chat-col { flex: 1 1 auto !important; width: 100% !important; max-width: 100% !important; margin-left: 0 !important; z-index: 1; position: relative; }
    .page[data-page="home"].active .home-chat-col .chat-thread { padding-left: 12px; }
    body.native-app.keyboard-open .home-chat-col { flex: 1 1 auto !important; width: 100% !important; margin-left: 0 !important; }
    .create-handwrite-pane #hwEditor,
    .create-handwrite-pane .hw-editor {
      -webkit-touch-callout: none;
    }

    /* ===== 首页消息操作 20260525b ===== */
    .page[data-page="home"] .chat-row.user .msg-del-btn,
    .page[data-page="home"] .chat-row.user .msg-icon-row .msg-del-btn {
      display: none !important;
      pointer-events: none !important;
    }
    .page[data-page="home"] .chat-row.user .msg-icon-row {
      min-height: 0;
    }
    .page[data-page="home"] .chat-row.user:not(:has(.msg-retry-btn)) .msg-icon-row {
      display: none !important;
    }
    .page[data-page="home"].active .home-chat-col { margin-left: 0 !important; padding-left: 0 !important; }
    body.native-app.keyboard-open .page[data-page="home"].active .home-chat-col { margin-left: 0 !important; }

    /* ═══════════════════════════════════════════════════════════
       登录页隐私同意行
    ═══════════════════════════════════════════════════════════ */
    .login-privacy-row {
      display: flex; align-items: flex-start; gap: 8px;
      margin: 14px 0 10px; cursor: pointer;
    }
    .login-privacy-check {
      flex: 0 0 18px; width: 18px; height: 18px;
      border-radius: 5px;
      border: 1.5px solid rgba(255,255,255,0.25);
      display: flex; align-items: center; justify-content: center;
      transition: border-color .18s, background .18s;
      margin-top: 1px;
      background: transparent;
    }
    .login-privacy-check.checked {
      border-color: #3b82f6;
      background: #3b82f6;
    }
    .login-privacy-check-icon {
      width: 11px; height: 11px;
      color: #fff;
      opacity: 0;
      transition: opacity .15s;
    }
    .login-privacy-check.checked .login-privacy-check-icon {
      opacity: 1;
    }
    @keyframes privacyShake {
      0%,100%{ transform:translateX(0) }
      20%{ transform:translateX(-4px) }
      60%{ transform:translateX(4px) }
    }
    .login-privacy-check.shake {
      animation: privacyShake .35s ease;
      border-color: #ef4444;
    }
    .login-privacy-text {
      font-size: 12px; line-height: 1.5;
      color: rgba(255,255,255,0.5);
      user-select: none;
    }
    body.theme-light .login-privacy-text { color: #64748b; }
    body.theme-light .login-privacy-check { border-color: #d1d5db; }
    .login-privacy-link {
      background: none; border: none; padding: 0;
      cursor: pointer; font-size: 12px;
      color: #3b82f6; text-decoration: underline;
    }

    /* ═══════════════════════════════════════════════════════════
       隐私同意弹窗 / 账号注销弹窗
    ═══════════════════════════════════════════════════════════ */
    .privacy-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(0,0,0,0.72);
      display: flex; align-items: center; justify-content: center;
      padding: 24px;
    }
    .privacy-modal {
      background: #1a2035;
      border-radius: 16px;
      padding: 28px 24px 24px;
      max-width: 360px; width: 100%;
      box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    }
    body.theme-light .privacy-modal {
      background: #fff;
    }
    .privacy-title {
      font-size: 17px; font-weight: 700;
      color: #f0f4ff; margin: 0 0 12px;
      text-align: center;
    }
    body.theme-light .privacy-title { color: #0f172a; }
    .privacy-body {
      font-size: 14px; line-height: 1.6;
      color: #b0bfd8; margin: 0 0 12px;
    }
    body.theme-light .privacy-body { color: #334155; }
    .privacy-links {
      display: flex; gap: 12px; justify-content: center;
      margin: 0 0 12px;
    }
    .privacy-link-btn {
      background: none; border: none; cursor: pointer;
      color: #5b8cff; font-size: 14px; text-decoration: underline;
      padding: 0;
    }
    .privacy-note {
      font-size: 12px; color: #64748b;
      margin: 0 0 20px; line-height: 1.5;
    }
    .privacy-actions {
      display: flex; gap: 10px;
    }
    .privacy-btn-decline, .privacy-btn-agree {
      flex: 1; height: 44px; border-radius: 10px;
      border: none; cursor: pointer; font-size: 15px; font-weight: 600;
    }
    .privacy-btn-decline {
      background: rgba(255,255,255,0.08);
      color: #94a3b8;
    }
    .privacy-btn-agree {
      background: linear-gradient(135deg,#2ee6c9,#5b8cff);
      color: #fff;
    }

    /* 20260615b: 智谱式底部输入条初版（composer 壳） */
    body.page-home .bottom-rail,
    body.page-agents.agents-chat-focus .bottom-rail,
    body.page-chat .bottom-rail,
    body.create-workbench-pane .bottom-rail {
      padding-left: 12px !important;
      padding-right: 12px !important;
      gap: 8px !important;
    }
    body.page-home .bottom-rail #composer.composer,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer,
    body.page-chat .bottom-rail #composer.composer,
    body.create-workbench-pane .bottom-rail #composer.composer {
      min-height: 0 !important;
      border-radius: 28px !important;
      padding: 8px 10px 6px !important;
      gap: 0 !important;
      background: rgba(255, 255, 255, 0.94) !important;
      border: 1px solid rgba(15, 23, 42, 0.08) !important;
      box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12) !important;
      color: #0f172a !important;
      backdrop-filter: blur(12px) saturate(135%) !important;
      -webkit-backdrop-filter: blur(12px) saturate(135%) !important;
      /* 换行时文字在上、按钮在下（对齐 DeepSeek / 智谱） */
      display: grid !important;
      grid-template-columns: auto 1fr auto;
      grid-template-rows: auto auto;
      align-items: stretch !important;
      align-content: start !important;
      row-gap: 4px !important;
      column-gap: 6px !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer .composer-input,
    body.page-home .bottom-rail #composer.composer .composer-input,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-input,
    body.page-chat .bottom-rail #composer.composer .composer-input,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-input {
      grid-column: 1 / -1 !important;
      grid-row: 1 !important;
      width: 100% !important;
      min-width: 0 !important;
      max-width: 100% !important;
      flex: none !important;
      align-self: start !important;
      box-sizing: border-box !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer .composer-attach-wrap,
    body.page-home .bottom-rail #composer.composer .composer-attach-wrap,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-attach-wrap,
    body.page-chat .bottom-rail #composer.composer .composer-attach-wrap,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-attach-wrap {
      grid-column: 1 !important;
      grid-row: 2 !important;
      align-self: end !important;
      justify-self: start !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer #composerKbBtn,
    body.page-home .bottom-rail #composer.composer #composerKbBtn,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerKbBtn,
    body.page-chat .bottom-rail #composer.composer #composerKbBtn,
    body.create-workbench-pane .bottom-rail #composer.composer #composerKbBtn {
      grid-column: 2 !important;
      grid-row: 2 !important;
      align-self: end !important;
      justify-self: start !important;
      margin-left: 2px !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer #composerSend,
    body.home-composer-zhipu .bottom-rail #composer.composer #composerMic,
    body.home-composer-zhipu .bottom-rail #composer.composer #composerStop,
    body.page-home .bottom-rail #composer.composer #composerSend,
    body.page-home .bottom-rail #composer.composer #composerMic,
    body.page-home .bottom-rail #composer.composer #composerStop,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerSend,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerMic,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerStop,
    body.page-chat .bottom-rail #composer.composer #composerSend,
    body.page-chat .bottom-rail #composer.composer #composerMic,
    body.page-chat .bottom-rail #composer.composer #composerStop,
    body.create-workbench-pane .bottom-rail #composer.composer #composerSend,
    body.create-workbench-pane .bottom-rail #composer.composer #composerMic,
    body.create-workbench-pane .bottom-rail #composer.composer #composerStop {
      grid-column: 3 !important;
      grid-row: 2 !important;
      align-self: end !important;
      justify-self: end !important;
    }
    body:not(.theme-light).page-home .bottom-rail #composer.composer,
    body:not(.theme-light).page-agents.agents-chat-focus .bottom-rail #composer.composer,
    body:not(.theme-light).page-chat .bottom-rail #composer.composer,
    body:not(.theme-light).create-workbench-pane .bottom-rail #composer.composer {
      background: rgba(248, 250, 252, 0.88) !important;
      border-color: rgba(255, 255, 255, 0.18) !important;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2) !important;
    }
    body.page-home .bottom-rail #composer.composer .composer-attach-wrap,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-attach-wrap,
    body.page-chat .bottom-rail #composer.composer .composer-attach-wrap,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-attach-wrap {
      flex: 0 0 auto !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    body.page-home .bottom-rail #composer.composer .ico:not(#composerExportBtn),
    body.page-home .bottom-rail #composer.composer .mic,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .ico:not(#composerExportBtn),
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .mic,
    body.page-chat .bottom-rail #composer.composer .ico:not(#composerExportBtn),
    body.page-chat .bottom-rail #composer.composer .mic {
      width: 40px !important;
      height: 40px !important;
      min-width: 40px !important;
      border-radius: 50% !important;
      color: #64748b !important;
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
    }
    body.page-home .bottom-rail #composer.composer #composerInsertBtn,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerInsertBtn,
    body.page-chat .bottom-rail #composer.composer #composerInsertBtn,
    body.create-workbench-pane .bottom-rail #composer.composer #composerInsertBtn {
      color: #334155 !important;
      background: rgba(15, 23, 42, 0.06) !important;
    }
    body.page-home .bottom-rail #composer.composer #composerSend,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerSend,
    body.page-chat .bottom-rail #composer.composer #composerSend,
    body.create-workbench-pane .bottom-rail #composer.composer #composerSend {
      color: #fff !important;
      background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
      box-shadow: 0 5px 14px rgba(37, 99, 235, 0.22) !important;
    }
    body.page-home .bottom-rail #composer.composer #composerMic,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer #composerMic,
    body.page-chat .bottom-rail #composer.composer #composerMic,
    body.create-workbench-pane .bottom-rail #composer.composer #composerMic {
      color: #334155 !important;
    }
    body.page-home .bottom-rail #composer.composer .composer-input,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-input,
    body.page-chat .bottom-rail #composer.composer .composer-input,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-input {
      min-height: 24px !important;
      max-height: 120px !important;
      padding: 2px 4px 0 !important;
      margin: 0 !important;
      color: #0f172a !important;
      font-size: 15px !important;
      line-height: 1.45 !important;
      text-indent: 0 !important;
      caret-color: #2563eb !important;
    }
    body.page-home .bottom-rail #composer.composer .composer-input:placeholder-shown,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-input:placeholder-shown,
    body.page-chat .bottom-rail #composer.composer .composer-input:placeholder-shown,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-input:placeholder-shown {
      text-align: center !important;
    }
    body.page-home .bottom-rail #composer.composer .composer-input:focus,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-input:focus,
    body.page-chat .bottom-rail #composer.composer .composer-input:focus,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-input:focus {
      text-align: left !important;
    }
    body.page-home .bottom-rail #composer.composer .composer-input::placeholder,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer .composer-input::placeholder,
    body.page-chat .bottom-rail #composer.composer .composer-input::placeholder,
    body.create-workbench-pane .bottom-rail #composer.composer .composer-input::placeholder {
      color: rgba(51, 65, 85, 0.48) !important;
    }
    body.page-home .bottom-rail #composer.composer.sending #composerStop,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer.sending #composerStop,
    body.page-chat .bottom-rail #composer.composer.sending #composerStop,
    body.create-workbench-pane .bottom-rail #composer.composer.sending #composerStop {
      color: #dc2626 !important;
      background: rgba(220, 38, 38, 0.08) !important;
      border: 1px solid rgba(220, 38, 38, 0.18) !important;
    }

    /* 20260615o: 生成中收成紧凑单行（仅暂停钮） */
    body.home-composer-zhipu .bottom-rail #composer.composer.sending,
    body.page-home .bottom-rail #composer.composer.sending,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer.sending,
    body.page-chat .bottom-rail #composer.composer.sending,
    body.create-workbench-pane .bottom-rail #composer.composer.sending {
      padding: 4px 8px !important;
      row-gap: 0 !important;
      grid-template-rows: auto !important;
      align-items: center !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer.sending .composer-input,
    body.page-home .bottom-rail #composer.composer.sending .composer-input,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer.sending .composer-input,
    body.page-chat .bottom-rail #composer.composer.sending .composer-input,
    body.create-workbench-pane .bottom-rail #composer.composer.sending .composer-input {
      display: none !important;
      height: 0 !important;
      min-height: 0 !important;
      max-height: 0 !important;
      padding: 0 !important;
      margin: 0 !important;
      overflow: hidden !important;
      border: none !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer.sending .composer-attach-wrap,
    body.page-home .bottom-rail #composer.composer.sending .composer-attach-wrap,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer.sending .composer-attach-wrap,
    body.page-chat .bottom-rail #composer.composer.sending .composer-attach-wrap,
    body.create-workbench-pane .bottom-rail #composer.composer.sending .composer-attach-wrap {
      display: none !important;
    }
    body.home-composer-zhipu .bottom-rail #composer.composer.sending #composerStop,
    body.page-home .bottom-rail #composer.composer.sending #composerStop,
    body.page-agents.agents-chat-focus .bottom-rail #composer.composer.sending #composerStop,
    body.page-chat .bottom-rail #composer.composer.sending #composerStop,
    body.create-workbench-pane .bottom-rail #composer.composer.sending #composerStop {
      grid-column: 3 !important;
      grid-row: 1 !important;
      width: 36px !important;
      height: 36px !important;
      min-width: 36px !important;
      margin: 0 !important;
    }

    /* 20260615c: 智谱式 composer — 仅 +附件 与 语音；聚焦切发送，生成切暂停 */
    body.page-home #kbBar,
    body.page-agents.agents-chat-focus #kbBar,
    body.create-workbench-pane #kbBar,
    body.page-home #composerExportBtn,
    body.page-agents.agents-chat-focus #composerExportBtn,
    body.page-chat #composerExportBtn,
    body.create-workbench-pane #composerExportBtn {
      display: none !important;
    }
    body.page-home:not(.home-composer-send-mode) #composerSend,
    body.page-agents.agents-chat-focus:not(.home-composer-send-mode) #composerSend,
    body.create-workbench-pane:not(.home-composer-send-mode) #composerSend {
      display: none !important;
    }
    body.page-home.home-composer-send-mode #composerMic,
    body.page-agents.agents-chat-focus.home-composer-send-mode #composerMic,
    body.create-workbench-pane.home-composer-send-mode #composerMic {
      display: none !important;
    }
    body.page-home.home-composer-send-mode #composerSend,
    body.page-agents.agents-chat-focus.home-composer-send-mode #composerSend,
    body.create-workbench-pane.home-composer-send-mode #composerSend {
      display: flex !important;
    }
    body.page-home:not(.composer.sending) #composerStop,
    body.page-agents.agents-chat-focus:not(.composer.sending) #composerStop,
    body.create-workbench-pane:not(.composer.sending) #composerStop {
      display: none !important;
    }
    body.page-home .composer.sending #composerStop,
    body.page-agents.agents-chat-focus .composer.sending #composerStop,
    body.create-workbench-pane .composer.sending #composerStop {
      display: inline-flex !important;
    }

    /* ===== Lab 测试包：对话配置 ===== */
    .lab-build-chip {
      flex: 0 0 auto;
      margin-left: 6px;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid rgba(46, 230, 201, 0.45);
      background: rgba(46, 230, 201, 0.14);
      color: #0f766e;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    body:not(.theme-light) .lab-build-chip { color: #5eead4; }
    .lab-manifest-backdrop {
      position: fixed;
      inset: 0;
      z-index: 900;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(4px);
    }
    .lab-manifest-sheet {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 910;
      max-height: min(88vh, 720px);
      border-radius: 20px 20px 0 0;
      background: #f8fafc;
      box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
      display: flex;
      flex-direction: column;
    }
    body:not(.theme-light) .lab-manifest-sheet {
      background: #0f172a;
      box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
    }
    body.lab-manifest-open { overflow: hidden; }
    .lab-manifest-sheet-hd {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 16px 10px;
      border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    }
    body:not(.theme-light) .lab-manifest-sheet-hd {
      border-bottom-color: rgba(255, 255, 255, 0.08);
    }
    .lab-manifest-sheet-title {
      margin: 0;
      font-size: 17px;
      font-weight: 700;
    }
    .lab-manifest-sheet-sub {
      margin: 4px 0 0;
      font-size: 12px;
      color: #64748b;
      line-height: 1.4;
    }
    .lab-manifest-close {
      width: 36px;
      height: 36px;
      border-radius: 12px;
      border: none;
      background: rgba(15, 23, 42, 0.06);
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .lab-manifest-list {
      overflow: auto;
      padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .lab-manifest-card {
      padding: 14px;
      border-radius: 14px;
      border: 1px solid rgba(15, 23, 42, 0.08);
      background: #fff;
    }
    body:not(.theme-light) .lab-manifest-card {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.08);
    }
    .lab-manifest-card-hd {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
    }
    .lab-manifest-name {
      margin: 0;
      font-size: 15px;
      font-weight: 700;
    }
    .lab-manifest-tag {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(91, 140, 255, 0.12);
      color: #3b5bdb;
      white-space: nowrap;
    }
    .lab-manifest-desc {
      margin: 0 0 10px;
      font-size: 12px;
      color: #64748b;
      line-height: 1.45;
    }
    .lab-manifest-meta {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 12px;
      margin: 0 0 10px;
      font-size: 11px;
    }
    .lab-manifest-meta dt {
      color: #94a3b8;
      font-weight: 600;
    }
    .lab-manifest-meta dd {
      margin: 2px 0 0;
      color: #334155;
      word-break: break-all;
    }
    body:not(.theme-light) .lab-manifest-meta dd { color: #e2e8f0; }
    .lab-manifest-meta-wide { grid-column: 1 / -1; }
    .lab-manifest-meta code {
      font-size: 10px;
      background: rgba(15, 23, 42, 0.06);
      padding: 1px 4px;
      border-radius: 4px;
    }
    .lab-manifest-details {
      margin-top: 8px;
      font-size: 12px;
    }
    .lab-manifest-details summary {
      cursor: pointer;
      color: #2563eb;
      font-weight: 600;
    }
    .lab-manifest-pre {
      margin: 8px 0 0;
      padding: 10px;
      border-radius: 10px;
      background: rgba(15, 23, 42, 0.05);
      font-size: 11px;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
      max-height: 220px;
      overflow: auto;
    }
    body:not(.theme-light) .lab-manifest-pre {
      background: rgba(0, 0, 0, 0.25);
    }
