/* ============================================================
 * styles-mobile.css —— 手机端 App 化布局层
 *
 * 只做一件事：把 PC 的「侧栏抽屉 + 主区」重排成
 *   [顶部栏] [四个分类胶囊] [列表/详情] [底部 5 个 tab]
 *
 * 双保险不影响电脑端：
 *   1) 所有规则都挂在 html[data-mobile="1"] 上（由 mobile-shell.js 在
 *      screen.width < 900 时才设置）；
 *   2) 整份文件包在 @media (max-width: 900px) 内。
 * 桌面端两者都不满足，样式一条都不会命中。
 *
 * 不改任何原有 class 的桌面规则，只做覆盖，因此回滚 = 删掉引入即可。
 * ============================================================ */

@media (max-width: 900px) {
  html[data-mobile='1'] {
    --m-tab-h: 56px;
    --m-comp-h: 100px;
    --m-safe-b: env(safe-area-inset-bottom, 0px);
    --m-safe-t: env(safe-area-inset-top, 0px);

    /* 手机端自己的中性色板：卡片 / 胶囊 / 描边 / 三级文字。
       全部走变量，浅色主题下面一屏整套换掉，不会出现「白底白字」。 */
    --m-surface: rgba(26, 26, 30, 0.94);
    --m-surface-2: rgba(255, 255, 255, 0.055);
    --m-surface-3: rgba(255, 255, 255, 0.09);
    --m-hair: rgba(255, 255, 255, 0.09);
    --m-ink: #fafafa;
    --m-ink-2: rgba(255, 255, 255, 0.58);
    --m-ink-3: rgba(255, 255, 255, 0.36);
  }
  html[data-theme='light'][data-mobile='1'] {
    --m-surface: rgba(255, 255, 255, 0.96);
    --m-surface-2: rgba(16, 18, 28, 0.045);
    --m-surface-3: rgba(16, 18, 28, 0.075);
    --m-hair: rgba(16, 18, 28, 0.09);
    --m-ink: #14161c;
    --m-ink-2: rgba(20, 22, 28, 0.62);
    --m-ink-3: rgba(20, 22, 28, 0.42);
  }

  /* ---------- 1. 把抽屉侧栏变成「列表页」 ---------- */
  html[data-mobile='1'] .sidebar {
    position: static;
    /* 关键：桌面版是 flex: 0 0 300px，只改 width 不够，flex-basis 仍会把宽度撑到 300 */
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto;
    min-height: calc(100dvh - var(--m-tab-h) - var(--m-safe-b));
    transform: none !important;
    border-right: 0;
    box-shadow: none;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding-bottom: calc(var(--m-tab-h) + var(--m-safe-b) + 12px);
  }
  html[data-mobile='1'] .sidebar.open { transform: none !important; }
  html[data-mobile='1'] .side-mask { display: none !important; }

  /* 顶部品牌行：只留 Logo + 站名，APP / 收起按钮在手机上无意义 */
  html[data-mobile='1'] .side-head {
    padding: calc(var(--m-safe-t) + 10px) 14px 6px;
    gap: 9px;
  }
  html[data-mobile='1'] .side-app,
  html[data-mobile='1'] .side-toggle { display: none !important; }
  html[data-mobile='1'] .side-logo { width: 32px; height: 32px; border-radius: 10px; }
  html[data-mobile='1'] .side-logo svg { width: 18px; height: 18px; }
  html[data-mobile='1'] .side-title { font-size: 15px; }
  html[data-mobile='1'] .side-sub { font-size: 10.5px; }

  /* 侧栏内边距清掉，让列表铺满屏宽 */
  html[data-mobile='1'] .side-nav { padding: 0 12px; overflow: visible; }

  /* 推广卡：手机上会让首屏多占一大块，挪到「我的」页里（同一入口） */
  html[data-mobile='1'] .sn-promo { display: none !important; }

  /* 四个页签宫格 → 由底部 tab 接管 */
  html[data-mobile='1'] .sn-tabs { display: none !important; }

  /* ---------- 2. 分类胶囊：只留 聊天/图片/视频/音频，横向铺满 ---------- */
  html[data-mobile='1'] .sn-chips {
    display: flex;
    gap: 8px;
    padding: 8px 0 10px;
    margin: 0;
    overflow-x: auto;
    border: 0;
    background: transparent;
    -webkit-overflow-scrolling: touch;
  }
  html[data-mobile='1'] .sn-chips::-webkit-scrollbar { display: none; }
  html[data-mobile='1'] .sn-chip {
    flex: 1 0 auto;
    min-width: 64px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    justify-content: center;
    background: var(--card-2, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  }
  /* 「全部」在手机端不出现：默认按聊天分类进入，与模板一致。
     「工具」(canvas) 改为只在「智能体」页签显示 —— 底部「开放 API」要落到
     智能体 → 工具，用户也需要能在工具分类里直接浏览，所以不能再全局隐藏。 */
  html[data-mobile='1'] .sn-chip[data-chip='all'] { display: none !important; }
  html[data-mobile='1'] .sn-chip[data-chip='canvas'] { display: none !important; }
  html[data-mobile='1'][data-m-navtab='agent'] .sn-chip[data-chip='canvas'] { display: inline-flex !important; }

  /* 搜索框：保留功能，压扁一点 */
  html[data-mobile='1'] .sn-search { margin: 0 0 10px; height: 36px; }

  /* 列表卡片：手机上单列、留白更紧、去掉悬停态残留 */
  html[data-mobile='1'] .sn-list {
    max-height: none;
    overflow: visible;
    padding-bottom: 8px;
  }
  html[data-mobile='1'] .sn-card { border-radius: 14px; }
  html[data-mobile='1'] .sn-card:hover { transform: none; }

  /* ---------- 3. 主区 = 详情屏，做成第二层页面 ---------- */
  html[data-mobile='1'] .main-col {
    max-width: none;
    padding: 0;
    display: none;
  }
  html[data-mobile='1'][data-m-view='detail'] .main-col {
    display: block;
    padding-bottom: calc(var(--m-tab-h) + var(--m-safe-b) + 12px);
  }
  html[data-mobile='1'][data-m-view='detail'] .sidebar { display: none; }

  /* 详情屏顶部栏：返回 + 标题 */
  html[data-mobile='1'] .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: calc(var(--m-safe-t) + 8px) 12px 8px;
    gap: 8px;
    background: var(--bg, #0b0b0f);
    border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  }
  html[data-mobile='1'] .topbar-left { gap: 8px; }
  html[data-mobile='1'] #menuBtn {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--card-2, rgba(255, 255, 255, 0.06));
  }
  html[data-mobile='1'] .page-title { font-size: 16px; }
  /* 这颗按钮在手机上不再是「打开菜单」，而是「返回列表」：换成左箭头 */
  html[data-mobile='1'] #menuBtn svg { display: none !important; }
  html[data-mobile='1'] #menuBtn::after {
    content: '';
    width: 9px;
    height: 9px;
    margin-left: 3px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  /* 详情屏里不需要这些桌面专属元素 */
  html[data-mobile='1'] .lk-dock,
  html[data-mobile='1'] .topbar-right { display: none !important; }

  /* 内容区铺满，去掉桌面 1200 宽容器 */
  html[data-mobile='1'] .content { padding: 0 12px 12px; }

  /* ---------- 4. 列表屏：隐藏主区，并强制侧栏可见（兜底，避免空白页） ---------- */
  html[data-mobile='1'][data-m-view='list'] .main-col { display: none; }
  html[data-mobile='1'][data-m-view='list'] .sidebar {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  /* ---------- 5. 「我的」页：浮层改全屏页 ---------- */
  html[data-mobile='1'] .side-foot {
    display: block;
    padding: 0 12px;
  }
  html[data-mobile='1'] .side-foot > a,
  html[data-mobile='1'] .side-foot > span { display: none; }

  html[data-mobile='1'] .sn-center {
    position: fixed;
    inset: 0;
    z-index: 80;
    border-radius: 0;
    max-height: none;
    padding: calc(var(--m-safe-t) + 12px) 12px
             calc(var(--m-tab-h) + var(--m-safe-b) + 12px);
    overflow-y: auto;
    background: var(--bg, #0b0b0f);
    border: 0;
  }

  /* ---------- 6. 底部 tab bar ---------- */
  html[data-mobile='1'] .m-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    height: calc(var(--m-tab-h) + var(--m-safe-b));
    padding-bottom: var(--m-safe-b);
    background: rgba(11, 11, 15, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  html[data-theme='light'][data-mobile='1'] .m-tabbar {
    background: rgba(255, 255, 255, 0.94);
    border-top-color: rgba(16, 18, 28, 0.08);
  }
  html[data-mobile='1'] .m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted, #8b93a3);
    font-size: 10.5px;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-tab.is-on { color: var(--accent, #f4523a); font-weight: 600; }
  html[data-mobile='1'] .m-tab svg { width: 22px; height: 22px; }
  html[data-mobile='1'] .m-tab-dot {
    position: absolute;
    transform: translate(14px, -12px);
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
    font-style: normal;
  }

  /* ---------- 7. 「我的」页内容（JS 生成） ---------- */
  html[data-mobile='1'] .m-me {
    position: fixed;
    inset: 0;
    z-index: 85;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg, #0b0b0f);
    padding: calc(var(--m-safe-t) + 12px) 12px calc(var(--m-tab-h) + var(--m-safe-b) + 12px);
  }
  html[data-mobile='1'] .m-me-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: var(--card-2, rgba(255, 255, 255, 0.05));
    margin-bottom: 12px;
  }
  html[data-mobile='1'] .m-me-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ffc24b, #ff5f6d);
  }
  html[data-mobile='1'] .m-me-name { font-size: 15px; font-weight: 700; }
  html[data-mobile='1'] .m-me-sub { font-size: 11.5px; opacity: 0.62; margin-top: 2px; }
  html[data-mobile='1'] .m-me-group {
    font-size: 11.5px;
    opacity: 0.55;
    margin: 14px 4px 8px;
  }
  html[data-mobile='1'] .m-me-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 12px;
    background: var(--card-2, rgba(255, 255, 255, 0.05));
    border-radius: 14px;
    margin-bottom: 8px;
    text-align: left;
    font-size: 14px;
  }
  html[data-mobile='1'] .m-me-item .m-me-ic {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--accent, #f4523a);
    background: rgba(244, 82, 58, 0.12);
  }
  html[data-mobile='1'] .m-me-item svg { width: 17px; height: 17px; }
  html[data-mobile='1'] .m-me-arrow { margin-left: auto; opacity: 0.4; }

  /* ---------- 「我的」页对齐蓝猫：服务支持宫格 + 帮助与设置列表 ---------- */
  /* 服务支持：一张圆角卡里 5 个带浅紫底色的图标格，前三后二自动换行 */
  html[data-mobile='1'] .m-me-sup {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 8px;
    padding: 16px 8px 14px;
    border-radius: 18px;
    background: var(--card-2, rgba(255, 255, 255, 0.05));
    margin-bottom: 6px;
  }
  html[data-mobile='1'] .m-me-sup-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--ink, #f2f2f6);
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-me-sup-ic {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.14);
  }
  html[data-mobile='1'] .m-me-sup-ic svg { width: 23px; height: 23px; }
  html[data-mobile='1'] .m-me-sup-cell:active .m-me-sup-ic { background: rgba(139, 92, 246, 0.26); }
  html[data-mobile='1'] .m-me-sup-t { opacity: 0.88; }
  html[data-theme='light'][data-mobile='1'] .m-me-sup-ic { color: #6d4bd8; background: rgba(139, 92, 246, 0.12); }

  /* 帮助与设置：整卡分身分行，行间细分割线，右侧可带值 */
  html[data-mobile='1'] .m-me-list {
    border-radius: 18px;
    background: var(--card-2, rgba(255, 255, 255, 0.05));
    overflow: hidden;
    margin-bottom: 6px;
  }
  html[data-mobile='1'] .m-me-row {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 14px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--hair, rgba(255, 255, 255, 0.06));
    text-align: left;
    font-size: 14px;
    color: var(--ink, #f2f2f6);
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-me-row:last-child { border-bottom: 0; }
  html[data-mobile='1'] .m-me-row:active { background: rgba(255, 255, 255, 0.05); }
  html[data-mobile='1'] .m-me-row .m-me-ic {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ink, #f2f2f6);
    opacity: 0.9;
  }
  html[data-mobile='1'] .m-me-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
  }
  html[data-mobile='1'] .m-me-row-t { font-size: 14px; }
  html[data-mobile='1'] .m-me-row-d { font-size: 11.5px; opacity: 0.5; }
  html[data-mobile='1'] .m-me-row-v { font-size: 12.5px; opacity: 0.55; flex: 0 0 auto; }
  html[data-mobile='1'] .m-me-row .m-me-arrow { margin-left: 4px; }
  /* 脚注 */
  html[data-mobile='1'] .m-me-ver {
    text-align: center;
    font-size: 11px;
    opacity: 0.34;
    padding: 16px 0 6px;
  }

  /* 详情屏滚动条与安全区 */
  html[data-mobile='1'] body {
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }

  /* ---------- 8. 悬浮按钮上移，别被底部 tab 压住 ---------- */
  html[data-mobile='1'] #pcFab {
    bottom: calc(var(--m-tab-h) + var(--m-safe-b) + 12px) !important;
    right: 12px !important;
    transform: scale(.92);
    transform-origin: right bottom;
  }
  html[data-mobile='1'] .m-me ~ #pcFab { display: none; }

  /* ============================================================
   * 9. 首页（创作）= 单模型大卡 + 快捷创作 + composer
   * ============================================================ */

  /* 9.1 首页独立层：只在「创作 + 列表屏」出现，其它时候收起 */
  html[data-mobile='1'] .m-home { display: none; }
  html[data-mobile='1'] .m-composer { display: none; }
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-home {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: var(--bg, #0b0b0f);
    padding: calc(var(--m-safe-t) + 10px) 14px
             calc(var(--m-tab-h) + var(--m-safe-b) + var(--m-comp-h) + 24px);
  }
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-composer { display: block; }

  /* 9.2 首页时侧栏整体收起（列表/搜索/访客卡都不在首页出现） */
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .sidebar { display: none !important; }
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .main-col { display: none !important; }

  /* 9.2b 首页顶部品牌行 */
  html[data-mobile='1'] .m-home-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 2px 2px 12px;
  }
  html[data-mobile='1'] .m-home-logo {
    width: 34px; height: 34px;
    border-radius: 11px;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #ffc24b, #ff5f6d);
    flex: 0 0 auto;
  }
  html[data-mobile='1'] .m-home-brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  html[data-mobile='1'] .m-home-brand b { font-size: 14.5px; font-weight: 700; }
  html[data-mobile='1'] .m-home-brand i { font-style: normal; font-size: 10.5px; opacity: 0.5; }

  /* 9.2c 分类：改成参考站那种「一个分段槽 + 选中项浮起」
     原来是四枚各自描边的胶囊，四道边框在手机上很碎；现在只剩一条槽和一枚亮片。 */
  html[data-mobile='1'] .m-chips {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 2px 0 6px;
    border-radius: 14px;
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
  }
  html[data-mobile='1'] .m-chip {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 4px;
    border-radius: 11px;
    font-size: 13px;
    color: var(--m-ink-2);
    background: transparent;
    border: 0;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
  }
  html[data-mobile='1'] .m-chip-ic { display: flex; opacity: 0.8; }
  html[data-mobile='1'] .m-chip.is-on {
    color: var(--m-ink);
    font-weight: 600;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.09));
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  }
  html[data-theme='light'][data-mobile='1'] .m-chip.is-on {
    background: #fff;
    box-shadow: 0 2px 8px rgba(16, 18, 28, 0.12), inset 0 0 0 1px rgba(16, 18, 28, 0.05);
  }
  html[data-mobile='1'] .m-chip.is-on .m-chip-ic { opacity: 1; }

  /* 9.4 模型大卡：去掉描边与底色，改成参考站的「留白 + 居中」展示区，
     信息层级靠字号与间距拉开，不再用一个方盒子把内容框住 */
  html[data-mobile='1'] .m-hero {
    margin: 0;
    padding: 22px 4px 2px;
    border-radius: 0;
    background: none;
    border: 0;
    text-align: center;
  }
  html[data-mobile='1'] .m-hero-ic { display: flex; justify-content: center; margin-bottom: 14px; }
  html[data-mobile='1'] .m-hero-ic .sn-card-ic {
    width: 62px !important;
    height: 62px !important;
    flex: 0 0 62px !important;
    border-radius: 19px;
  }
  html[data-mobile='1'] .m-hero-ic .sn-card-ic svg { width: 32px !important; height: 32px !important; }
  html[data-mobile='1'] .m-hero-ic .sn-card-ic img { width: 36px !important; height: 36px !important; }
  html[data-mobile='1'] .m-hero-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.25;
  }
  html[data-mobile='1'] .m-hero-badge {
    font-style: normal;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 999px;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.16);
    white-space: nowrap;
  }
  html[data-theme='light'][data-mobile='1'] .m-hero-badge {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.12);
  }
  html[data-mobile='1'] .m-hero-desc {
    margin: 12px auto 0;
    max-width: 330px;
    font-size: 12.5px;
    line-height: 1.78;
    color: var(--m-ink-2);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 主按钮做成浅色胶囊，和输入卡的模型胶囊同一套语言 */
  html[data-mobile='1'] .m-hero-foot {
    margin-top: 16px;
    height: 34px;
    padding: 0 15px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--m-ink);
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
  }
  html[data-mobile='1'] .m-hero-load {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 42px 0;
    font-size: 12.5px;
    color: var(--m-ink-2);
  }
  html[data-mobile='1'] .m-spin {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent;
    animation: m-spin 0.8s linear infinite;
  }
  @keyframes m-spin { to { transform: rotate(360deg); } }

  /* 9.4b 提示词样例：一条横滑的小胶囊，点一下填进输入框 */
  html[data-mobile='1'] .m-sugs {
    display: flex;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0 0 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  html[data-mobile='1'] .m-sugs[hidden] { display: none !important; }
  html[data-mobile='1'] .m-sugs::-webkit-scrollbar { display: none; }
  html[data-mobile='1'] .m-sug {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--m-ink-2);
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
    white-space: nowrap;
  }
  html[data-mobile='1'] .m-sug:active { color: var(--m-ink); background: rgba(139, 92, 246, 0.18); border-color: rgba(139, 92, 246, 0.42); }

  /* 9.5 还可以直接创作 */
  html[data-mobile='1'] .m-sec-t {
    margin: 22px 2px 10px;
    font-size: 12px;
    color: var(--m-ink-3);
    letter-spacing: 0.2px;
  }
  html[data-mobile='1'] .m-quick {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 4px;
  }
  html[data-mobile='1'] .m-q {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 11px;
    border-radius: 16px;
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
    font-size: 12.5px;
    text-align: left;
    color: var(--m-ink);
    transition: transform 0.12s ease, background 0.15s ease;
  }
  html[data-mobile='1'] .m-q:active { transform: scale(0.975); background: var(--m-surface-3); }
  html[data-mobile='1'] .m-q-ic {
    width: 34px; height: 34px; border-radius: 11px;
    display: grid; place-items: center;
  }
  html[data-mobile='1'] .m-q[data-qcat='image'] .m-q-ic { color: #34d399; background: rgba(52, 211, 153, 0.14); }
  html[data-mobile='1'] .m-q[data-qcat='video'] .m-q-ic { color: #fb923c; background: rgba(251, 146, 60, 0.14); }
  html[data-mobile='1'] .m-q[data-qcat='audio'] .m-q-ic { color: #f472b6; background: rgba(244, 114, 182, 0.14); }

  /* 9.6 composer（浮在 tabbar 之上）
     参考 lingkeai.vip：一整块大圆角输入卡 —— 上面是占位/输入，下面一行是
     「模型胶囊 … 计费说明 · 发送圆钮」，没有分隔线，也不再有第二枚重复胶囊。 */
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-composer {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--m-tab-h) + var(--m-safe-b) + 10px);
    z-index: 70;
    padding: 12px 12px 10px;
    border-radius: 26px;
    background: var(--m-surface);
    border: 1px solid var(--m-hair);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
  }
  html[data-theme='light'][data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-composer {
    box-shadow: 0 16px 40px rgba(16, 18, 28, 0.14), inset 0 1px 0 #fff;
  }
  html[data-mobile='1'] .m-cmp-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* 模型胶囊：自动模式是「✦ 综合最优」，手动模式是「Logo + 模型名」 */
  html[data-mobile='1'] .m-cmp-model {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 48%;
    min-width: 0;
    height: 34px;
    padding: 0 9px 0 5px;
    border-radius: 999px;
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
    font-size: 13px;
    font-weight: 500;
    color: var(--m-ink);
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  html[data-mobile='1'] .m-cmp-model:active {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.4);
  }
  html[data-mobile='1'] .m-cmp-logo { display: flex; flex: 0 0 auto; }
  /* 首页输入卡最左侧的「+」：上传素材入口（进工作台并高亮素材槽） */
  html[data-mobile='1'] .m-cmp-add {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px dashed var(--m-hair);
    border-radius: 11px;
    background: var(--m-surface-2);
    color: var(--m-ink-2);
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-cmp-add:active {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.45);
    color: var(--m-ink);
  }
  html[data-mobile='1'] .m-cmp-logo .sn-card-ic {
    width: 24px !important; height: 24px !important; flex: 0 0 24px !important; border-radius: 8px;
  }
  html[data-mobile='1'] .m-cmp-logo .sn-card-ic svg { width: 14px !important; height: 14px !important; }
  html[data-mobile='1'] .m-cmp-logo .sn-card-ic img { width: 16px !important; height: 16px !important; }
  html[data-mobile='1'] .m-cmp-autoic {
    width: 24px; height: 24px;
    border-radius: 8px;
    display: grid; place-items: center;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.18);
  }
  html[data-mobile='1'] .m-cmp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-mobile='1'] .m-cmp-chev { display: flex; flex: 0 0 auto; opacity: 0.45; }
  html[data-mobile='1'] .m-cmp-bill {
    /* 计费说明贴着发送键，把右侧整组顶到边 */
    margin-left: auto;
    font-size: 10.5px;
    color: var(--m-ink-3);
    white-space: nowrap;
  }
  @media (max-width: 372px) {
    html[data-mobile='1'] .m-cmp-bill { display: none; }
    /* 窄屏没有计费文字了，改由发送键自己顶右 */
    html[data-mobile='1'] .m-cmp-send { margin-left: auto; }
  }
  html[data-mobile='1'] .m-cmp-send {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    border-radius: 50%;
    /* 浏览器默认给 <button> 2px outset 边框，深色背景上会变成一圈白环 */
    border: 0 !important;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    display: grid; place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.35);
    transition: transform 0.14s ease, opacity 0.14s ease;
  }
  html[data-mobile='1'] .m-cmp-send:active { transform: scale(0.93); }

  /* 9.6b 输入卡收起 / 展开
     参考站手机端：默认是一整卡，点右上角「﹀」收成一条小胶囊，
     再点一下展开并把光标放回输入框。收起态不遮挡首页内容，
     底部留白（--m-comp-h）也跟着一起缩短。 */
  html[data-mobile='1'][data-m-cmp-min='1'] { --m-comp-h: 56px; }
  html[data-mobile='1'] .m-cmp-fold {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 32px;
    height: 26px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    border: 1px solid var(--m-hair);
    background: var(--m-surface-3);
    color: var(--m-ink-2);
    opacity: 1;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-cmp-fold:active { color: var(--m-ink); background: rgba(139, 92, 246, 0.2); }
  html[data-mobile='1'] .m-cmp-mini { display: none; }
  html[data-mobile='1'] .m-composer.is-min {
    padding: 11px 12px;
    border-radius: 999px;
    cursor: pointer;
  }
  html[data-mobile='1'] .m-composer.is-min .m-cmp-ph,
  html[data-mobile='1'] .m-composer.is-min .m-cmp-row2,
  html[data-mobile='1'] .m-composer.is-min .m-cmp-fold { display: none !important; }
  html[data-mobile='1'] .m-composer.is-min .m-cmp-mini {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 26px;
  }
  html[data-mobile='1'] .m-cmp-mini-ic {
    display: flex;
    color: #c4b5fd;
  }
  html[data-mobile='1'] .m-cmp-mini-t {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: var(--m-ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-mobile='1'] .m-cmp-mini-up {
    display: flex;
    color: var(--m-ink-3);
    transform: rotate(180deg);
  }

  /* ============================================================
   * 10. 选择模型面板
   * ============================================================ */
  html[data-mobile='1'] .m-sheet { position: fixed; inset: 0; z-index: 240; }
  html[data-mobile='1'] .m-sheet[hidden] { display: none !important; }
  html[data-mobile='1'] .m-sheet-bd {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0; transition: opacity 0.2s;
  }
  html[data-mobile='1'] .m-sheet.is-in .m-sheet-bd { opacity: 1; }
  html[data-mobile='1'] .m-sheet-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: 76vh;
    padding: 4px 0 calc(var(--m-safe-b) + 8px);
    background: var(--bg, #0b0b0f);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  }
  html[data-mobile='1'] .m-sheet.is-in .m-sheet-panel { transform: none; }
  html[data-mobile='1'] .m-sheet-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
  }
  html[data-mobile='1'] .m-sheet-hd b { font-size: 15px; }
  html[data-mobile='1'] .m-sheet-x {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    color: var(--muted, #8b93a3);
    background: var(--card-2, rgba(255, 255, 255, 0.06));
  }
  html[data-mobile='1'] .m-auto {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 12px 8px;
    padding: 11px 12px;
    border-radius: 14px;
    background: var(--card-2, rgba(255, 255, 255, 0.05));
    border: 1px solid transparent;
    text-align: left;
    color: inherit;
  }
  html[data-mobile='1'] .m-auto.is-on { border-color: rgba(124, 92, 252, 0.5); background: rgba(124, 92, 252, 0.12); }
  html[data-mobile='1'] .m-auto-ic {
    width: 32px; height: 32px; border-radius: 10px;
    display: grid; place-items: center;
    color: #a48ffd; background: rgba(124, 92, 252, 0.16);
    flex: 0 0 auto;
  }
  html[data-mobile='1'] .m-auto-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html[data-mobile='1'] .m-auto-txt b { font-size: 13.5px; }
  html[data-mobile='1'] .m-auto-txt i { font-style: normal; font-size: 11px; opacity: 0.55; }
  html[data-mobile='1'] .m-tick {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    color: transparent;
  }
  html[data-mobile='1'] .m-auto.is-on .m-tick,
  html[data-mobile='1'] .m-mrow.is-on .m-tick { color: var(--accent, #f4523a); }

  html[data-mobile='1'] .m-sheet-tabs {
    display: flex;
    gap: 6px;
    padding: 2px 12px 8px;
    overflow-x: auto;
  }
  html[data-mobile='1'] .m-sheet-tabs::-webkit-scrollbar { display: none; }
  html[data-mobile='1'] .m-stab {
    flex: 1 0 auto;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--muted, #8b93a3);
    background: var(--card-2, rgba(255, 255, 255, 0.05));
  }
  html[data-mobile='1'] .m-stab.is-on {
    color: #fff;
    background: var(--accent, #f4523a);
    font-weight: 600;
  }
  html[data-mobile='1'] .m-sheet-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px 6px;
  }
  html[data-mobile='1'] .m-sheet-empty {
    padding: 30px 0;
    text-align: center;
    font-size: 12.5px;
    opacity: 0.5;
  }
  html[data-mobile='1'] .m-mrow {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 12px;
    text-align: left;
    color: inherit;
    background: transparent;
    border: 0;
  }
  html[data-mobile='1'] .m-mrow:active { background: var(--card-2, rgba(255, 255, 255, 0.06)); }
  html[data-mobile='1'] .m-mrow + .m-mrow { margin-top: 2px; }
  html[data-mobile='1'] .m-mrow.is-on { background: var(--card-2, rgba(255, 255, 255, 0.06)); }
  html[data-mobile='1'] .m-mrow-ic { display: flex; flex: 0 0 auto; }
  html[data-mobile='1'] .m-mrow-ic .sn-card-ic {
    width: 34px !important; height: 34px !important; flex: 0 0 34px !important; border-radius: 10px;
  }
  html[data-mobile='1'] .m-mrow-ic .sn-card-ic svg { width: 18px !important; height: 18px !important; }
  html[data-mobile='1'] .m-mrow-ic .sn-card-ic img { width: 20px !important; height: 20px !important; }
  html[data-mobile='1'] .m-mrow-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html[data-mobile='1'] .m-mrow-txt b {
    font-size: 13.5px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  html[data-mobile='1'] .m-mrow-txt i { font-style: normal; font-size: 11px; opacity: 0.5; }

  /* ============================================================
   * 11. 未登录拦截提示
   * ============================================================ */
  html[data-mobile='1'] .m-gate { position: fixed; inset: 0; z-index: 250; }
  html[data-mobile='1'] .m-gate[hidden] { display: none !important; }
  html[data-mobile='1'] .m-gate-bd {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.52);
    opacity: 0; transition: opacity 0.2s;
  }
  html[data-mobile='1'] .m-gate.is-in .m-gate-bd { opacity: 1; }
  html[data-mobile='1'] .m-gate-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 22px 20px calc(var(--m-safe-b) + 22px);
    background: var(--bg, #0b0b0f);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  }
  html[data-mobile='1'] .m-gate.is-in .m-gate-panel { transform: none; }
  html[data-mobile='1'] .m-gate-ic {
    width: 48px; height: 48px; margin: 0 auto 12px;
    border-radius: 15px;
    display: grid; place-items: center;
    color: #a48ffd;
    background: rgba(124, 92, 252, 0.16);
  }
  html[data-mobile='1'] .m-gate-t { font-size: 16.5px; font-weight: 700; }
  html[data-mobile='1'] .m-gate-d {
    margin: 8px auto 18px;
    max-width: 300px;
    font-size: 12.5px;
    line-height: 1.65;
    opacity: 0.6;
  }
  html[data-mobile='1'] .m-gate-btns { display: flex; gap: 10px; }
  html[data-mobile='1'] .m-gate-btns button {
    flex: 1;
    height: 44px;
    border-radius: 13px;
    font-size: 14.5px;
    font-weight: 600;
  }
  html[data-mobile='1'] .m-gate-b1 {
    color: inherit;
    background: var(--card-2, rgba(255, 255, 255, 0.07));
    border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  }
  html[data-mobile='1'] .m-gate-b2 {
    color: #fff;
    background: var(--accent, #f4523a);
  }

  /* ============================================================
   * 12. 登录 / 注册浮层：抬到 tabbar 之上，且可滚到底
   *     （原来 z-index 40，被 tabbar 90 / 我的页 85 压住，
   *       表现为「点注册没反应」）
   * ============================================================ */
  html[data-mobile='1'] #loginRoot {
    z-index: 260 !important;
    padding: 0 !important;
    align-items: start !important;
  }
  html[data-mobile='1'] #loginRoot .login-wrap {
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px calc(var(--m-tab-h) + var(--m-safe-b) + 24px);
  }

  /* 13. 「我的」页头部按钮（登录 / 注册 / 账户） */
  html[data-mobile='1'] .m-me-who { flex: 1; min-width: 0; }
  html[data-mobile='1'] .m-me-auths { display: flex; gap: 8px; flex: 0 0 auto; }
  html[data-mobile='1'] .m-me-auth {
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 12.5px;
    color: inherit;
    background: var(--card-2, rgba(255, 255, 255, 0.07));
    border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
    white-space: nowrap;
  }
  html[data-mobile='1'] .m-me-auth.is-main {
    color: #fff;
    background: var(--accent, #f4523a);
    border-color: transparent;
    font-weight: 600;
  }

  /* 13.5 首页输入框：从占位文字改成真 textarea（可输入、回车发送） */
  html[data-mobile='1'] .m-cmp-ph {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 26px;
    margin: 2px 0 9px;
    max-height: 112px;
    /* styles-lux / styles-premium 给所有 textarea 加了 !important 的圆角、底色与
       聚焦光环（青绿色），不覆盖的话输入卡里会多出一个内嵌小框，聚焦时还会亮一圈。
       右侧留 26px 给「收起」按钮，避免第一行文字被它压住。 */
    padding: 0 26px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    resize: none;
    color: var(--m-ink);
    font: inherit;
    font-size: 16px; /* iOS 聚焦小于 16px 的输入框会自动放大页面 */
    line-height: 1.5;
    opacity: 1;
    overflow-y: auto;
    -webkit-appearance: none;
    appearance: none;
    white-space: pre-wrap;
    word-break: break-word;
  }
  /* 站点有一条 html[data-theme="dark"] textarea:focus { background/border-color/
     box-shadow !important } 的规则，选择器权重比上面这条高；聚焦时输入框里会冒出
     一块浅色方块 + 3px 紫色光环。这里用更高权重整组压掉，只在整张卡上留光环。 */
  html[data-theme='dark'][data-mobile='1'] .m-cmp-ph:focus,
  html[data-theme='dark'][data-mobile='1'] .m-cmp-ph:focus-visible,
  html[data-theme='light'][data-mobile='1'] .m-cmp-ph:focus,
  html[data-theme='light'][data-mobile='1'] .m-cmp-ph:focus-visible {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }
  html[data-mobile='1'] .m-cmp-ph::placeholder { color: var(--m-ink-3); opacity: 1; }
  /* 聚焦时提示「正在这一块输入」：光环加在整张输入卡上，而不是输入框自己 */
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-composer:focus-within {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(139, 92, 246, 0.12);
  }
  html[data-theme='light'][data-mobile='1'][data-m-home='1'][data-m-view='list'] .m-composer:focus-within {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 16px 40px rgba(16, 18, 28, 0.14), 0 0 0 3px rgba(124, 58, 237, 0.1);
  }

  /* 13.8 聊天页在小视口（键盘弹出/横屏/小屏）下必须能滚到底：
     站点把 .mb / .mb-inner 都设成 overflow:hidden，高度一压缩，底部
     输入区直接被裁掉，发送键点不到 —— 这也是「点提交却跳回上一页」的成因之一。 */
  html[data-mobile='1'][data-m-view='detail'] .mb,
  html[data-mobile='1'][data-m-view='detail'] .mb-inner {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: calc(var(--m-tab-h) + var(--m-safe-b) + 12px);
  }

  /* 14. 软键盘弹出：收起底部导航与首页输入框，别压住聊天页的发送键 */
  html[data-mobile='1'][data-m-kb='1'] .m-tabbar { display: none !important; }
  /* 首页正在输入：输入框跟着键盘上移，不能收起 */
  html[data-mobile='1'][data-m-kb='1'] .m-composer {
    bottom: calc(var(--m-kb, 0px) + 8px) !important;
  }
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .main-col { padding-bottom: 8px; }

  /* 14.5 键盘弹出时，把聊天输入卡整体贴到键盘上沿：
     否则小视口里输入区会被裁掉，用户点「发送」实际点在键盘/导航上。 */
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-dock-wrap {
    position: fixed !important;
    left: 8px;
    right: 8px;
    bottom: calc(var(--m-kb, 0px) + 8px);
    z-index: 72;
    max-height: 66vh;
    overflow-y: auto;
    padding: 4px;
    border-radius: 18px;
    background: var(--bg, #0b0b0f);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
  /* 打字时只收起素材槽；参数条（计费/策略）按参考站保持常驻 */
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-refs,
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-ref-add { display: none !important; }
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-dock-wrap { max-height: 46vh; }
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-compose textarea {
    min-height: 46px !important;
    max-height: 108px !important;
  }

  /* ============================================================
   * 16. 模型 / 聊天页底部导航：常态保留（对齐参考站发送后仍有底部导航）；
   *     键盘弹出时统一由第 14 节 data-m-kb='1' 收起，避免误触 tab 跳回列表。
   * ============================================================ */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .main-col {
    padding-bottom: calc(var(--m-safe-b) + 10px);
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-inner {
    scroll-padding-bottom: calc(var(--m-safe-b) + 14px);
  }
  /* 键盘弹出后输入卡被抬成 fixed，给它腾出高度，最后一条消息不会被压住 */
  html[data-mobile='1'][data-m-kb='1'][data-m-view='detail'] .mb-inner {
    padding-bottom: 148px;
  }

  /* ============================================================
   * 17. 聊天页（模型工作台）输入卡：和首页输入卡用同一套语言
   *     原来这块是绿/紫撞色渐变描边，跟整站紫色主题打架；参数胶囊在窄屏
   *     会折成三行，把输入卡撑到半屏高。这里只动外观与排布，参数/发送/上传
   *     的逻辑一处没改。
   * ============================================================ */
  html[data-mobile='1'] .mb-dock { padding: 0 10px 8px; }
  /* 参数胶囊改成一行横滑后，内容的 min-content 变宽，会把输入坞整块撑到屏幕外。
     这里把外层的 grid 轨道钉成 1fr（最小 0），各层再补 min-width:0，
     内容想宽也只能在自己的容器里横滑，不会顶破页面。 */
  html[data-mobile='1'] .mb-dock-wrap { grid-template-columns: minmax(0, 1fr); }
  html[data-mobile='1'] .mb-dock,
  html[data-mobile='1'] .mb-card,
  html[data-mobile='1'] .mb-compose,
  html[data-mobile='1'] .mb-compose-main,
  html[data-mobile='1'] .mb-params,
  html[data-mobile='1'] .mb-params-row { min-width: 0; box-sizing: border-box; max-width: 100%; }
  html[data-mobile='1'] .mb-dock-card {
    padding: 11px 12px 10px;
    border-radius: 22px;
    border: 1px solid var(--m-hair);
    background: var(--m-surface);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  html[data-theme='light'][data-mobile='1'] .mb-dock-card {
    box-shadow: 0 12px 30px rgba(16, 18, 28, 0.12), inset 0 1px 0 #fff;
  }
  /* 输入区是卡片里的第二层「绿紫撞色盒子」，和外面的卡叠成双层边框；
     手机上把它摊平，只留外面一张卡 */
  html[data-mobile='1'] .mb-compose {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    gap: 9px;
  }
  /* 上传槽容器本身不需要那张虚线大框，虚线圈只留给里面的素材格 */
  html[data-mobile='1'] .mb-rail {
    background: none;
    border: 0;
    padding: 0;
    min-height: 0;
  }
  /* 语音 / 发送改成一行贴右下（原来是一整宽的行、按钮居中飘在中间） */
  html[data-mobile='1'] .mb-compose-side {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    min-height: 0;
    width: 100%;
    gap: 8px;
  }
  html[data-mobile='1'] .mb-tools { flex-direction: row; align-items: center; gap: 8px; }
  /* 参数胶囊：保持换行，只把高度与间距收紧一点 */
  html[data-mobile='1'] .mb-params { gap: 6px; margin-bottom: 7px; }
  html[data-mobile='1'] .mb-params-row { min-height: 0; }
  html[data-mobile='1'] .mb-chip { height: 27px; border-radius: 999px; }
  html[data-mobile='1'] .mb-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 6px 16px rgba(109, 40, 217, 0.35);
  }
  html[data-mobile='1'] .mb-send svg { width: 18px; height: 18px; }
  html[data-mobile='1'] .mb-send:hover { transform: none; }
  /* 输入框：站点给所有 textarea 上了 !important 的底色 + 描边（聚焦还会变紫），
     叠在卡片里就是「卡里套小框」。这里权重抬到最高，只留一张卡。 */
  html[data-theme='dark'][data-mobile='1'] .mb-input,
  html[data-theme='light'][data-mobile='1'] .mb-input {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    min-height: 92px !important;
    max-height: 150px !important;
    font-size: 15px;
    line-height: 1.7;
  }
  html[data-theme='dark'][data-mobile='1'] .mb-input:focus,
  html[data-theme='light'][data-mobile='1'] .mb-input:focus {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  /* 17.2 模型页输入卡：右上角「收起」+ 收起后底部的「展开输入框」胶囊
     原来只能上滑历史被动收起，用户不知道能收；收起后只有一颗小键盘图标，
     窄屏上既不好点也不好认。这里补一条带文字的显式入口（桌面端不出现）。 */
  html[data-mobile='1'] .mb-dock-card { position: relative; }
  html[data-mobile='1'] .mb-dock-fold {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 32px;
    height: 26px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--m-hair, rgba(255, 255, 255, 0.1));
    border-radius: 9px;
    background: var(--m-surface-2, rgba(255, 255, 255, 0.05));
    color: var(--m-ink-2, #c3c7d1);
    opacity: 0.8;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .mb-dock-fold:active { opacity: 1; }
  /* 收起按钮压在右上角，正文右侧留出来，别让第一行字被盖住 */
  html[data-mobile='1'] .mb-input { padding-right: 26px !important; }
  html[data-mobile='1'] .mb-dock-bar { display: none; }
  /* 胶囊挂在 body 上（不再位于 .mb-inner 内），所以用自身状态类控制，
     并且层级要压过 tabbar(90)/我的页(85)，低于弹层(240) —— 否则被导航条盖住点不到 */
  html[data-mobile='1'] .mb-dock-bar.is-on {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--m-safe-b, 0px) + 16px);
    z-index: 230;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 18px;
    max-width: calc(100vw - 28px);
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid var(--m-hair, rgba(255, 255, 255, 0.1));
    background: var(--m-surface, #16161c);
    color: var(--m-ink, #e9e9ef);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  }
  /* 键盘弹起时输入卡本来就是展开的，胶囊留着只会被键盘推上来挡住内容 */
  html[data-mobile='1'][data-m-kb='1'] .mb-dock-bar { display: none !important; }
  /* 返回列表屏只是把 .main-col 藏起来，模型页 DOM 还在（胶囊也还在 body 上），
     不按视图状态再藏一次就会顶着列表页浮一条「展开输入框」 */
  html[data-mobile='1'][data-m-view='list'] .mb-dock-bar { display: none !important; }
  /* 收起态：底部已有「展开输入框」，一键到底的箭头会和它叠在同一位置，
     挡住胶囊右半边并截走点击（用户以为按不到）。收起时直接让位。 */
  html[data-mobile='1'] .mb.is-dock-min .mb-dock-jump { display: none !important; }
  html[data-mobile='1'] .mb-dock-jump.is-off { display: none !important; }
  html[data-mobile='1'] .mb-dock-bar-ic { display: flex; color: #c4b5fd; }
  html[data-mobile='1'] .mb-dock-bar-ic svg { width: 16px; height: 16px; }
  html[data-mobile='1'] .mb.is-dock-min .mb-dock-mini { display: none !important; }
  /* 收起后内容区多留一点底部空间，最后一条消息不被胶囊压住 */
  html[data-mobile='1'] .mb.is-dock-min .mb-inner { padding-bottom: 62px; }
  /* 首页点了「+」进来：把素材槽闪两下，告诉用户上传在这里 */
  html[data-mobile='1'] .mb-ref-add.is-hint {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    animation: mbRefHint 0.9s ease-in-out 3;
  }
  @keyframes mbRefHint {
    0%, 100% { border-color: rgba(139, 92, 246, 0.5); }
    50% { border-color: #a78bfa; box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.28); }
  }

  /* ============================================================
   * 18. 智能体创作页（dai 组件：人物图片 / 商品图片 / 场景图片 / 影棚 …）
   *     问题：.dai-compose 是 overflow:hidden 的卡片，里面 .dai-form 的
   *     flex:1 + min-height:0 在手机窄屏被压到 177px，而输入框自身
   *     min-height:140，直接溢出卡片下沿被裁掉 —— 用户看到的是「输入框
   *     只剩一条缝」，下方的比例 / 数量 / 上传参数也跟着一起被裁。
   *     这里让创作卡按内容撑高，不再裁切任何内容（只影响手机端）。
   * ============================================================ */
  html[data-mobile='1'] .dai-compose {
    overflow: visible;
    height: auto;
    align-self: start;
  }
  html[data-mobile='1'] .dai-form {
    flex: 0 0 auto;
    min-height: 0;
  }
  html[data-mobile='1'] .dai-prompt {
    flex: 0 0 auto;
    min-height: 118px;
    max-height: 260px;
    /* iOS 聚焦 <16px 输入框会自动放大整页 */
    font-size: 16px;
  }
  html[data-mobile='1'] .dai-workspace { height: auto; }
  /* 预览/参考示例卡在手机上一屏放不下，压到 320 高即可，别把创作卡挤没 */
  html[data-mobile='1'] .dai-preview { min-height: 320px; }

  /* 18.2 AI 商品影棚顶栏：桌面是一行「返回+品牌+标签 …… 全局设置/新建商品」，
     手机上宽度不够，flex 把品牌文字挤成竖排并和按钮叠在一起。
     这里改成两行：第一行品牌，第二行操作按钮靠右。 */
  html[data-mobile='1'] .pss-topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 2px 10px;
  }
  html[data-mobile='1'] .pss-topbar-left {
    flex: 1 1 100%;
    min-width: 0;
  }
  html[data-mobile='1'] .pss-brand { min-width: 0; flex: 1; }
  html[data-mobile='1'] .pss-brand-icon { width: 32px; height: 32px; border-radius: 10px; }
  html[data-mobile='1'] .pss-brand b { font-size: 14.5px; white-space: nowrap; }
  html[data-mobile='1'] .pss-brand small { font-size: 10.5px; white-space: nowrap; }
  /* 「创作工作台」标签手机上纯属占位，藏掉把宽度让给标题 */
  html[data-mobile='1'] .pss-tag { display: none; }
  html[data-mobile='1'] .pss-topbar-right {
    flex: 1 1 100%;
    justify-content: flex-end;
  }
  html[data-mobile='1'] .pss-ghost,
  html[data-mobile='1'] .pss-gold { padding: 0 12px; height: 34px; font-size: 12.5px; }
  /* 影棚主体是 5fr/7fr 双栏，手机上一栏只剩一百多像素，直接单列堆叠 */
  html[data-mobile='1'] .pss-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 0;
  }
  html[data-mobile='1'] .pss-hero-copy h2 { font-size: 23px; }

  /* 这几颗是 <button>，浏览器会补一圈 2px outset 默认边框，深色底上就是白描边 */  html[data-mobile='1'] .m-me-item,
  html[data-mobile='1'] .m-tab,
  html[data-mobile='1'] .m-gate-btns button,
  html[data-mobile='1'] .m-sheet-x,
  html[data-mobile='1'] .m-stab { border: 0; }

  /* 底部导航：图标与文字贴近参考站比例 */
  html[data-mobile='1'] .m-tabbar { background: rgba(9, 9, 11, 0.92); }
  html[data-mobile='1'] .m-tab { font-size: 10px; gap: 4px; }
  html[data-mobile='1'] .m-tab svg { width: 21px; height: 21px; }

  /* 15. 会员服务浮钮：层级压到面板/浮层之下，位置抬到 composer 之上 */
  html[data-mobile='1'] #pcFab {
    z-index: 55 !important;
  }
  html[data-mobile='1'][data-m-home='1'][data-m-view='list'] #pcFab {
    bottom: calc(var(--m-tab-h) + var(--m-safe-b) + var(--m-comp-h) + 16px) !important;
  }
  /* ============================================================
   * 18. 对齐蓝猫移动端对话壳：顶部四模式切换栏 + 底部输入坞，
   *     两段永远 fixed，发送/生成只换中间内容，不跳页、不闪烁。
   * ============================================================
   * 结构（detail / data-m-dkind=model）：
   *   ┌ 顶部 .m-home（品牌行 + 聊天/图片/视频/音频） fixed top
   *   │ 中间 .main-col → .mb → .mb-stream（唯一滚动区）
   *   └ 底部 .mb-dock-wrap fixed（贴 tabbar 上沿）+ .m-tabbar fixed bottom
   * 四种模式共用同一外壳，切顶部 chip 只换 .mb 内容，外壳 DOM 不重建。
   */
  html[data-mobile='1'] {
    --m-head-h: 100px;          /* 顶部收缩条总高（品牌行 + 模式胶囊） */
    --m-dock-h: 172px;          /* 底部输入坞默认高（对齐蓝猫输入卡） */
  }

  /* 18.1 顶部：收缩成一条，钉在视口顶端，层级高于内容、低于弹层 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-home {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: auto;
    z-index: 70;
    overflow: visible;
    height: calc(var(--m-safe-t) + var(--m-head-h));
    padding: calc(var(--m-safe-t) + 8px) 14px 0;
    background: var(--bg, #0b0b0f);
    border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-home-head { padding-bottom: 6px; }
  /* 模式胶囊整条可点，禁止被父级 transform 影响 fixed 定位 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-chips {
    margin: 0;
    transform: none !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-chip { pointer-events: auto; }

  /* 18.2 收缩态只留头部与模式条 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-hero,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-sugs,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-sec-t,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .m-quick { display: none !important; }
  /* 详情屏自带 topbar 不再重复出现（顶部条已充当顶栏） */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .topbar { display: none !important; }

  /* 18.3 主区：取消桌面 flex 撑高与 overflow:hidden，高度交给视口减去顶部+底部，
     padding 用同一变量，避免写死 108px 与顶部条实际高度不一致造成跳动 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .main-col,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .main-col.mb-wide {
    display: block !important;
    height: calc(100dvh - var(--m-safe-t) - var(--m-head-h)) !important;
    min-height: 0;
    overflow: hidden;
    background: var(--bg, #0b0b0f);
    padding: calc(var(--m-safe-t) + var(--m-head-h)) 0 0 !important;
    box-sizing: border-box;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .main-col > .content {
    height: 100%;
    padding: 0 !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb {
    height: 100% !important;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border: 0;
    background: none;
    overflow: hidden;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-inner {
    height: 100%;
    overflow: hidden;
  }

  /* 18.4 底部输入坞：钉在 tabbar 正上方，固定高度，内部只让输入卡参与布局 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    position: fixed !important;
    left: 0; right: 0;
    bottom: calc(var(--m-tab-h) + var(--m-safe-b)) !important;
    z-index: 72;
    display: block !important;
    height: auto !important;
    max-height: none !important;
    grid-template-rows: none !important;
    overflow: visible;
    padding: 0;
    background: var(--bg, #0b0b0f);
    border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb.is-dock-min .mb-dock-wrap {
    grid-template-rows: none !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock {
    padding: 8px 10px 8px !important;
    transition: none !important;
  }
  /* 卡片高度必须完全由内容决定。
     ⚠️ 历史上这里写过 max-height: calc(var(--m-dock-h) - 16px)，
     而 --m-dock-h 又由 JS 测量这张卡所在坞的高度得出 —— 形成循环依赖。
     iOS Safari 在这种「尺寸依赖自身祖先尺寸」的场景下会先按偏小的初始值
     布局并自锁，表现为：提交后参数胶囊被裁掉，下方露出一整块黑色底（真机截图）。
     Android Chrome 的测量时序不同，所以没暴露。此处直接去掉高度上限，
     由 .mb-dock-wrap 的 fixed 定位 + 内容撑高来保证不越界。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-card {
    max-height: none !important;
    overflow: visible !important;
    padding: 9px 11px 8px !important;
    border-radius: 18px !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-compose textarea.mb-input {
    min-height: 46px !important;
    max-height: 92px !important;
    height: 46px !important;
    padding: 6px 0 !important;
    font-size: 15px;
    line-height: 1.6;
  }
  /* 参数区默认折叠：蓝猫把「尺寸/时长/画质」收进高级设置，默认只留输入+工具行。
     点 .mb-params-toggle 展开；展开后 dock 内部滚动，不挤压对话流。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params {
    display: none !important;
    max-height: 170px;
    overflow-y: auto;
    margin: 6px 0 0 !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params.is-open { display: flex !important; }
  /* 高级设置开关：默认不显示（桌面端由 styles-model-bench.css 隐藏）。
     手机 detail 里钉在输入卡顶部右侧，浅描边小胶囊。 */
  html[data-mobile='1'] .mb-params-toggle { display: none; }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    margin: 0 0 4px auto;
    border-radius: 999px;
    background: var(--m-surface-2);
    border: 1px solid var(--m-hair);
    color: var(--m-ink-2);
    font-size: 11px;
    line-height: 1;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params-toggle[aria-expanded='true'] {
    color: var(--m-ink);
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.14);
  }
  /* 素材槽默认收起（蓝猫底部没有常驻素材格，需要时点 + 展开） */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-rail { display: none !important; }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-compose-side { min-height: 0; }

  /* 18.5 对话流：唯一滚动区，底部留出固定输入坞的空间 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-stream {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 6px 12px calc(var(--m-dock-h) + var(--m-tab-h) + var(--m-safe-b) + 16px) !important;
    scroll-padding-bottom: calc(var(--m-dock-h) + var(--m-tab-h) + var(--m-safe-b) + 16px);
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-inner { padding-bottom: 0 !important; }
  /* 空态时消息仍在中部，不贴着输入卡 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-stream.is-empty { justify-content: center; }

  /* 18.6 键盘弹出：输入坞贴键盘上沿，顶部模式条保持不动；tabbar 收起 */
  html[data-mobile='1'][data-m-kb='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    bottom: calc(var(--m-kb, 0px) + 6px) !important;
  }
  html[data-mobile='1'][data-m-kb='1'][data-m-dkind='model'][data-m-view='detail'] .mb-stream {
    padding-bottom: calc(var(--m-dock-h) + 12px) !important;
  }

  /* ============================================================
   * 19. 蓝猫顶部品牌行图标 + 修复提交后输入卡被裁切
   * ============================================================ */
  /* 19.1 品牌行右侧「历史记录 / 新对话」两枚图标（对齐蓝猫那条）：
         brand 吃掉中间宽度，图标组永远贴右，detail 收缩条与首页都生效。 */
  html[data-mobile='1'] .m-home-head { position: relative; }
  html[data-mobile='1'] .m-home-brand { flex: 1 1 auto; min-width: 0; }
  html[data-mobile='1'] .m-home-acts {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex: 0 0 auto;
  }
  html[data-mobile='1'] .m-home-act {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--m-ink-2, #8b8b96);
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .m-home-act svg { width: 19px; height: 19px; }
  html[data-mobile='1'] .m-home-act:active {
    background: rgba(139, 92, 246, 0.16);
    color: var(--m-ink, #f2f2f6);
  }

  /* 19.2 修复「模型和规格尺寸被挡住看不到」：
         撤销 18.4 的 .mb-params{display:none} 折叠，参数默认展开；
         取消卡片的 max-height 截断，dock 高度交给内容自适应，
         由 JS 把实测高度写回 --m-dock-h，stream 的留白随之同步，永不遮挡。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px 6px;
    max-height: none !important;
    overflow: visible !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params-toggle {
    display: none !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-card {
    max-height: none !important;
    overflow: visible !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    overflow: visible !important;
  }

  /* ============================================================
   * 20. 输入卡永久在上层 + 蓝猫式居中下拉箭头
   * ============================================================ */
  /* 20.1 输入坞永远压在对话内容之上（含任务卡/媒体浮层），背景滚上来也盖不住。
         tabbar 是 90，这里给 88：高于所有内容层、低于导航栏与弹层。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    z-index: 88 !important;
  }
  /* 收起态需要一个明显的「上拉展开」横框（见第 20.3 节），
     所以这里不再隐藏 .mb-dock-bar；下拉箭头只在展开态出现，两者互斥不重叠。 */

  /* 20.2 蓝猫式居中下拉箭头：钉在输入卡正上方，点击收起输入框露出更多对话。
         展开时朝下（收起），收起后箭头朝上并落到底部（展开），两种状态都在上层常驻。 */
  html[data-mobile='1'] .mb-dock-drop { display: none; }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-drop {
    display: grid;
    place-items: center;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--m-dock-h, 172px) + var(--m-tab-h) + var(--m-safe-b) + 5px);
    z-index: 89;
    width: 54px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--m-surface-2, rgba(255,255,255,.06));
    color: var(--m-ink-2, #8b8b96);
    -webkit-tap-highlight-color: transparent;
    transition: bottom .2s ease;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-drop svg {
    width: 18px; height: 18px;
    transition: transform .2s ease;
  }
  /* 收起态：下拉箭头让位给底部「上拉框」，避免出现两个小箭头叠在一起 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb.is-dock-min .mb-dock-drop {
    display: none !important;
  }
  /* 收起态：整个输入坞高度归零、彻底隐藏到下方（不占位、不残留背景条） */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb.is-dock-min .mb-dock-wrap {
    height: 0 !important;
    overflow: hidden !important;
    border-top: 0 !important;
  }

  /* 20.3 收起后的「上拉展开」横框：蓝猫式，一条明显的圆角框浮在底部，
         写清「上拉 展开输入框」，点它或向上滑都能把输入卡拉回来。
         JS 里 placeDockBar() 已把它定位在 tabbar 之上、z-index 230（高于导航），
         这里只强化外观与图标朝向。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] body > .mb-dock-bar.is-on {
    height: 46px !important;
    min-width: 190px;
    padding: 0 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-color: rgba(139, 92, 246, 0.42) !important;
    background: var(--m-surface, #16161c) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.12) !important;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-bar-ic svg {
    transform: rotate(180deg);   /* keyboard/chevron 图标翻成朝上，提示「往上拉」 */
  }
  /* 收起态给上拉框留出位置，最后一条消息不被压住 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb.is-dock-min .mb-inner {
    padding-bottom: 76px !important;
  }

  /* ============================================================
   * 21. 移动端「模型选择」胶囊（对齐蓝猫输入卡里的 DS-V4.1-Flash ⌄）
   * ============================================================ */
  html[data-mobile='1'] .mb-model-pick { display: none; }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-model-pick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 12px;
    margin-right: auto;
    max-width: 52%;
    border: 1px solid var(--m-hair, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: var(--m-surface-2, rgba(255, 255, 255, 0.07));
    color: var(--m-ink, #f2f2f6);
    font-size: 13px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-model-pick-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-model-pick svg {
    width: 14px; height: 14px; flex: 0 0 auto; opacity: 0.65;
  }

  /* 21.1 模型选择浮层（底部弹出），移动端用 */
  html[data-mobile='1'] .mb-mpick-mask {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(4, 6, 12, 0.55);
  }
  html[data-mobile='1'] .mb-mpick-sheet {
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--m-surface, #15151b);
    color: var(--m-ink, #f2f2f6);
    border-radius: 20px 20px 0 0;
    padding: 6px 0 calc(var(--m-safe-b, 0px) + 10px);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.5);
    animation: mb-mpick-up 0.22s ease;
  }
  @keyframes mb-mpick-up {
    from { transform: translateY(18px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  html[data-mobile='1'] .mb-mpick-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 8px;
  }
  html[data-mobile='1'] .mb-mpick-head b { font-size: 15px; }
  html[data-mobile='1'] .mb-mpick-x {
    border: 0; background: transparent; color: var(--m-ink-2, #8b8b96);
    font-size: 24px; line-height: 1; padding: 2px 8px; border-radius: 8px;
  }
  html[data-mobile='1'] .mb-mpick-list { overflow-y: auto; padding: 4px 10px 10px; }
  html[data-mobile='1'] .mb-mpick-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: 0; background: transparent; color: inherit; padding: 11px 10px; border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }
  html[data-mobile='1'] .mb-mpick-item:active { background: rgba(255, 255, 255, 0.06); }
  html[data-mobile='1'] .mb-mpick-item.is-cur { background: rgba(139, 92, 246, 0.14); }
  html[data-mobile='1'] .mb-mpick-logo {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
    display: grid; place-items: center; overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
  }
  html[data-mobile='1'] .mb-mpick-logo img { width: 100%; height: 100%; object-fit: contain; }
  html[data-mobile='1'] .mb-mpick-logo svg { width: 18px; height: 18px; }
  html[data-mobile='1'] .mb-mpick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  html[data-mobile='1'] .mb-mpick-main b {
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html[data-mobile='1'] .mb-mpick-main i {
    font-style: normal; font-size: 11.5px; color: var(--m-ink-2, #8b8b96);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html[data-mobile='1'] .mb-mpick-cur {
    flex: 0 0 auto; font-size: 11px; color: var(--m-accent, #8b5cf6);
    border: 1px solid rgba(139, 92, 246, 0.4); border-radius: 999px; padding: 2px 8px;
  }
  html[data-mobile='1'] .mb-mpick-empty {
    padding: 24px; text-align: center; color: var(--m-ink-2, #8b8b96); font-size: 13px;
  }

  /* ============================================================
   * 23. 提交后输入卡下方不留多余空白（红框区域修复）
   *     某些模型（如 deepseek-v4-flash 文本型）提交后参数胶囊不渲染，
   *     若参数区容器/行仍保留 margin、min-height 或隐藏判定失效，
   *     输入卡里「模型胶囊行」下方就会露出一块空白卡片背景。
   *     这里让所有空区彻底不占位，卡片高度严格由可见内容决定。
   * ============================================================ */
  /* 23.1 参数区：没有任何可见行时整块隐藏，连 margin 一起去掉 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params:not(:has(.mb-params-row:not([hidden]))),
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params:not(:has(.mb-chip:not([hidden]))) {
    display: none !important;
    margin: 0 !important;
    gap: 0 !important;
  }
  /* 23.2 单行没有可见胶囊时收起（含被 JS 设 hidden 的行） */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params-row[hidden] { display: none !important; }
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params-row:empty { display: none !important; }
  /* 23.3 输入卡高度完全自适应：不给卡片/坞任何固定或最小高度，
        避免内容变少时仍撑出空白。dock 由卡片内容撑高。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-card,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-compose,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-compose-main,
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock {
    height: auto !important;
    min-height: 0 !important;
  }
  /* 23.4 消除卡片底边与导航栏之间的深色横带间隙：
         dock 原本 8px 底部 padding 会露出一条背景带（用户截图的红箭头处），
         收窄到 2px 并让输入坞背景与导航栏一致，卡片视觉上贴住导航栏。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock {
    padding: 8px 10px 2px !important;
  }
  /* 23.4 底部背景去黑块：输入坞本身不铺不透明底色，让页面背景透上来，
         卡片与导航栏之间的任何高度差都不会显成一条/一块黑色。
         卡片自己有不透明背景，正常状态下视觉完全一致。 */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    background: transparent !important;
    border-top: 0 !important;
  }
  html[data-theme='light'][data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-dock-wrap {
    background: transparent !important;
  }
  /* 23.5 卡片底部不留内边距空白（若有 foot 行则保留其内容高度） */
  html[data-mobile='1'][data-m-dkind='model'][data-m-view='detail'] .mb-params:not(:has(.mb-chip:not([hidden]))) ~ * { margin-bottom: 0 !important; }
  /* 23.6 收起态不受影响：仍由第 20.2 节把 dock-wrap 归零 */

}

/* ============================================================
 * 22. 桌面端隐藏移动端专用控件
 *     第 20/21 节的规则写在 @media (max-width:900px) 内，
 *     桌面宽视口下整块不生效，若不在全局兜底，
 *     模型选择胶囊与下拉箭头会按默认 display 挤进桌面输入卡。
 *     用 :not([data-mobile='1']) 定向，只影响非移动壳，移动端不受干扰。
 * ============================================================ */
html:not([data-mobile='1']) .mb-model-pick,
html:not([data-mobile='1']) .mb-dock-drop { display: none !important; }


/* ============================================================
 * rc2-mobile-unify：充值弹层在手机端统一为电脑端那套模板
 * 原来 styles-recharge.css 的媒体查询把档次改成 3 列、支付方式改成竖排，
 * 且底部按钮落在屏外。这里只在手机端覆盖回 5 列 + 横排，并压缩间距让
 * 「取消 / 确认充值」在 390px 屏内完整可见。电脑端不受影响。
 * ============================================================ */
html[data-mobile='1'] .rc2-mask { padding: 8px !important; }
html[data-mobile='1'] .rc2-modal {
  width: 100% !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 16px) !important;
  padding: 14px 12px 12px !important;
  border-radius: 14px !important;
}
html[data-mobile='1'] .rc2-modal.rc2-paymode {
  width: 100% !important;
  max-width: 100% !important;
  padding: 16px 12px 12px !important;
}
html[data-mobile='1'] .rc2-head-t b { font-size: 19px !important; }
html[data-mobile='1'] .rc2-head-t span { font-size: 11.5px !important; }
html[data-mobile='1'] .rc2-tabs { gap: 22px !important; margin-top: 12px !important; }
html[data-mobile='1'] .rc2-tab { font-size: 12.5px !important; padding-bottom: 9px !important; }
html[data-mobile='1'] .rc2-pane { padding-top: 12px !important; }
html[data-mobile='1'] .rc2-label { font-size: 11.5px !important; margin-bottom: 8px !important; }

/* 档次：与电脑端一样 5 列（手机端缩小字号与间距，避免 ¥2000 溢出） */
html[data-mobile='1'] .rc2-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 5px !important;
}
html[data-mobile='1'] .rc2-tier { min-height: 68px !important; border-radius: 8px !important; }
html[data-mobile='1'] .rc2-price { margin: 18px 0 10px !important; padding: 0 2px !important; }
html[data-mobile='1'] .rc2-price i { font-size: 10px !important; }
html[data-mobile='1'] .rc2-price b { font-size: 15px !important; letter-spacing: -.5px !important; }
html[data-mobile='1'] .rc2-get {
  padding: 4px 3px !important;
  font-size: 8.5px !important;
  gap: 2px !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}
html[data-mobile='1'] .rc2-bolt { top: 5px; left: 4px; width: 11px; height: 11px; }
html[data-mobile='1'] .rc2-bolt svg { width: 11px; height: 11px; }
html[data-mobile='1'] .rc2-badge { top: 4px; right: 4px; width: 16px; height: 16px; }
html[data-mobile='1'] .rc2-badge svg { width: 10px; height: 10px; }

html[data-mobile='1'] .rc2-gift { font-size: 10.5px !important; margin-top: 8px !important; }
html[data-mobile='1'] .rc2-custom { margin-top: 8px !important; }
html[data-mobile='1'] .rc2-input { height: 38px !important; font-size: 12px !important; }

/* 支付方式：与电脑端一样两列横排 */
html[data-mobile='1'] .rc2-chans {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
html[data-mobile='1'] .rc2-chan { height: 46px !important; padding: 0 8px !important; gap: 6px !important; font-size: 12.5px !important; }
html[data-mobile='1'] .rc2-chan-t { font-size: 12px !important; }

/* 底部按钮完整留在屏内 */
html[data-mobile='1'] .rc2-agree { margin-top: 10px !important; font-size: 10.5px !important; }
html[data-mobile='1'] .rc2-foot { margin-top: 12px !important; padding-top: 12px !important; gap: 8px !important; }
html[data-mobile='1'] .rc2-cancel,
html[data-mobile='1'] .rc2-confirm { height: 42px !important; font-size: 13px !important; border-radius: 9px !important; }
