/* ============================================================================
   智能AI风水师 - 前端样式（二期：最大程度参照文心一言 wenxin.baidu.com）
   PC + 移动端自适应：白色底、蓝色强调 #4e6ef2、圆角卡片、细边框 #e5e6eb
   二期新增：欢迎页居中大圆角输入卡片（chips+图标工具栏）、侧栏左下四项、
            顶栏下拉菜单、收藏/反馈/下载/分享弹窗、AI气泡操作条、图片气泡、
            语音识别动效
   ============================================================================ */

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

:root {
    --blue: #4e6ef2;
    --blue-hover: #3f5de0;
    --blue-light: #eef2fe;
    --border: #e5e6eb;
    --text: #1f2329;
    --text-sub: #646a73;
    --text-light: #8f959e;
    --bg: #ffffff;
    --bg-side: #f7f8fa;
    --bg-bubble-user: #e8edfb;
    --red: #f5483b;
    --radius: 12px;
}

/* SPEC4 §2：禁止 iOS 自动放大字体，避免顶栏内容被挤压导致汉堡按钮不可见 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    height: 100%;
    overflow: hidden;
}

/* v9：iOS 9+ 真实可见高度（不含悬浮底栏）兜底 */
html { height: -webkit-fill-available; }

/* v0.8.3：禁止页面级左右拖动（clip 不破坏 sticky；hidden 作老内核兜底） */
html, body { overflow-x: hidden; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    /* v9：高度链——100% → -webkit-fill-available（iOS 真实可见高度）
       → var(--app-height)（JS visualViewport 精确值，随键盘/微信底栏显隐实时变化）
       v0.9.5：撤掉末尾 100dvh 覆盖——dvh 不随 iOS 键盘收缩，且微信底栏显隐时更新迟滞
       （苹果首页输入框下大缝隙/键盘挡住输入框的根因），统一由 --app-height 驱动 */
    height: 100%;
    height: -webkit-fill-available;
    height: var(--app-height, 100vh);
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

button { font-family: inherit; }

/* ============================ 顶部细栏 ============================ */
.topbar {
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: relative;
    z-index: 20;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    user-select: none;
    /* SPEC4 §2：允许压缩但不为 0，给 hamburger/右侧按钮让出空间 */
    flex: 0 1 auto;
    min-width: 0;
}

/* SPEC4 §2：站点名过长时省略号兜底，不挤压汉堡按钮 */
.logo-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4e6ef2, #7b9bff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.topbar-right {
    /* SPEC4 §2：右侧按钮组不收缩，保证永远有空间 */
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-right > * {
    flex-shrink: 0;
}

.top-btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}

.top-btn:hover {
    color: var(--blue);
    border-color: #c7d2f7;
    background: var(--blue-light);
}

.user-badge {
    font-size: 13px;
    color: var(--text-sub);
    background: var(--bg-side);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 5px 12px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.user-badge:hover {
    color: var(--blue);
    border-color: #c7d2f7;
}

.user-badge .vip-flag {
    color: #b8860b;
    font-weight: 600;
}

.top-user { position: relative; }
.more-wrap { position: relative; }

/* 顶栏移动端头像按钮（PC 隐藏） */
.top-avatar {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-side);
    color: var(--text-sub);
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
}

.top-avatar.logged {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

/* 下拉菜单（通用） */
.drop-menu {
    position: absolute;
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(31, 35, 41, .12);
    padding: 6px;
    display: none;
    z-index: 80;
}

.drop-menu.show { display: block; }

.menu-item {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.menu-item:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.user-menu {
    top: calc(100% + 8px);
    right: 0;
}

.more-menu {
    top: calc(100% + 8px);
    right: 0;
    max-width: 280px;
    max-height: 340px;
    overflow-y: auto;
}

.link-item {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-item:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.btn-vip-top {
    border: none;
    background: linear-gradient(135deg, #ffd591, #ffb84d);
    color: #7a4a00;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s;
}

.btn-vip-top:hover { filter: brightness(1.05); }

/* 汉堡按钮（仅移动端显示） */
.hamburger {
    display: none;
    /* SPEC4 §2：不被 flex 挤压（iPhone 13 字体放大场景） */
    flex: 0 0 auto;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    margin-right: 10px;
    padding: 6px;
}

.hamburger span {
    display: block;
    /* SPEC4 §2：固定条宽，不依赖按钮容器宽度 */
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

/* ============================ 整体布局 ============================ */
.layout {
    display: flex;
    /* v9：高度由 body 的 flex 纵列接管（topbar 固定 52px，layout 占剩余），
       删除脆弱的 calc(100vh - 52px) 三层声明；min-height:0 保证子项可收缩滚动 */
    flex: 1 1 auto;
    min-height: 0;
}

/* ============================ 左侧边栏 ============================ */
.sidebar {
    width: 264px;
    flex: 0 0 264px;
    background: var(--bg-side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 30;
}

.side-top {
    padding: 14px 14px 8px;
}

.btn-new-chat {
    width: 100%;
    border: none;
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    padding: 10px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}

.btn-new-chat:hover { background: var(--blue-hover); }

.btn-new-chat .plus {
    font-size: 16px;
    font-weight: 600;
    margin-right: 2px;
}

.side-section {
    padding: 6px 8px;
}

.side-title {
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 10px 6px;
    user-select: none;
}

/* 分类折叠导航 */
.side-cats {
    flex: 0 1 auto;
    overflow-y: auto;
    max-height: 42%;
}

.cat-parent {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    color: var(--text);
}

.cat-parent:hover { background: #eceff5; }

.cat-arrow {
    font-size: 11px;
    color: var(--text-light);
    transition: transform .15s;
    display: inline-block;
}

.cat-group.open .cat-arrow { transform: rotate(90deg); }

.cat-children {
    display: none;
    padding-left: 22px;
}

.cat-group.open .cat-children { display: block; }

.cat-child {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
}

.cat-child:hover {
    background: var(--blue-light);
    color: var(--blue);
}

/* 历史记录 */
.side-history {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.history-empty {
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 12px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin: 1px 4px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
}

.history-item:hover { background: #eceff5; }

.history-item.active {
    background: var(--blue-light);
    color: var(--blue);
}

.history-item .h-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item .h-del {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    color: var(--text-light);
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    visibility: hidden;
}

.history-item:hover .h-del { visibility: visible; }

.history-item .h-del:hover {
    background: #dfe3ea;
    color: #d4380d;
}

/* ---------- 左下角固定四项 ---------- */
.side-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    padding: 8px;
}

.sf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 4px;
}

.sf-item {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
}

.sf-item:hover {
    background: #eceff5;
    color: var(--blue);
}

.sf-item .sf-ico {
    font-size: 14px;
    line-height: 1;
}

.sf-item .sf-txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sf-user-wrap { position: relative; }

.side-user-menu {
    /* v12.8：必须显式 top:auto——否则继承 .user-menu 的 top 与这里的 bottom 同时生效，
       菜单被锚定在按钮下方向下展开，「退出登录」被屏幕底边裁掉（移动端侧边栏尤其明显） */
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
}

/* 移动端抽屉内友情链接列表 */
.sf-links-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
    padding-top: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.sf-links-list.show { display: flex; }

/* 移动端专属入口（PC 隐藏；注意须写在 .sf-item 之后） */
.mobile-only { display: none; }

/* ============================ 主区 ============================ */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #fff;
}

.chat-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-inner {
    flex: 1 0 auto;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 24px 16px;
    display: flex;
    flex-direction: column;
}

/* ---------- 欢迎区（未开始对话，整体垂直居中偏下） ---------- */
.welcome-wrap {
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 6vh 0 24px;
    width: 100%;
}

.welcome {
    text-align: center;
}

.welcome-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4e6ef2, #7b9bff);
    color: #fff;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(78, 110, 242, .28);
}

.welcome-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-sub {
    font-size: 14px;
    color: var(--text-sub);
}

/* 推荐问题卡片（输入卡片下方） */
.rec-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
}

.rec-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}

.rec-card:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 14px rgba(78, 110, 242, .12);
}

.rec-card-tag {
    display: inline-block;
    font-size: 12px;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 4px;
    padding: 2px 8px;
    margin-bottom: 8px;
}

.rec-card-q {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

/* ---------- 消息气泡流 ---------- */
.msg-row {
    display: flex;
    margin-bottom: 18px;
    align-items: flex-start;
    gap: 10px;
}

.msg-user { justify-content: flex-end; }

.avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4e6ef2, #7b9bff);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.bubble {
    max-width: 78%;
    border-radius: 14px;
    padding: 11px 15px;
    font-size: 15px;
    line-height: 1.7;
    word-break: break-word;
}

.msg-user .bubble {
    background: var(--bg-bubble-user);
    color: var(--text);
    border-top-right-radius: 4px;
}

.msg-ai .bubble {
    background: #fff;
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.bubble-text {
    white-space: pre-wrap;
}

.bubble-img {
    display: block;
    max-width: 240px;
    width: 100%;
    border-radius: 10px;
}

.src-tag {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

/* AI 气泡操作条：复制 / 收藏 / 分享 */
.msg-actions {
    display: flex;
    gap: 2px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
}

.act-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.act-btn:hover {
    background: var(--bg-side);
    color: var(--blue);
}

.act-btn.done { color: #237804; }

.act-btn .act-ico { font-size: 13px; line-height: 1; }

/* 相关问题 chips */
.rel-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rel-chip {
    font-size: 12px;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 12px;
    padding: 4px 12px;
    cursor: pointer;
    user-select: none;
}

.rel-chip:hover { background: #dfe7fd; }

/* 正在输入动画 */
.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 4px 2px;
}

.typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b6c4f7;
    animation: typingBlink 1.2s infinite;
}

.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }

@keyframes typingBlink {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ============================ 输入区（欢迎页居中卡片 + 底部固定两种形态） ============================ */
.input-area { width: 100%; }

.input-holder-center { width: 100%; }

.input-holder-bottom {
    flex: 0 0 auto;
    padding: 10px 24px 12px;
    background: #fff;
}

.input-holder-bottom .input-area {
    max-width: 860px;
    margin: 0 auto;
}

/* 大圆角输入卡片（文心一言风格） */
.input-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 14px 16px 10px;
    box-shadow: 0 6px 24px rgba(31, 35, 41, .08);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.input-card:focus-within {
    border-color: var(--blue);
    box-shadow: 0 6px 24px rgba(78, 110, 242, .14);
}

/* v12.5 文心式图片待发送预览（输入卡片内、输入框上方） */
.img-preview {
    position: relative;
    display: inline-block;
    margin: 0 0 8px;
    border-radius: 10px;
    overflow: visible;
}
.img-preview img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.img-preview-x {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}
.img-preview-x:hover { background: rgba(0, 0, 0, .85); }

#inputBox {
    display: block;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    max-height: 160px;
    overflow-y: auto;
    background: transparent;
    padding: 2px 0;
}

/* 工具栏：左侧 chips，右侧图标 + 发送 */
.input-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.tool-chips {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tool-chips::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 13px;
    border-radius: 16px;
    padding: 5px 13px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background .15s, color .15s, border-color .15s;
}

.chip:hover {
    border-color: #c7d2f7;
    color: var(--blue);
}

.chip.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.chip .chip-ico { font-size: 13px; line-height: 1; }

.tool-icons {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.icon-btn:hover {
    background: var(--bg-side);
    color: var(--blue);
}

/* 语音录音中（红色跳动） */
.icon-btn.recording {
    color: var(--red);
    background: #fff1f0;
    animation: recPulse 1.2s ease-out infinite;
}

@keyframes recPulse {
    0%   { box-shadow: 0 0 0 0 rgba(245, 72, 59, .4); }
    70%  { box-shadow: 0 0 0 8px rgba(245, 72, 59, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 72, 59, 0); }
}

/* SPEC4 §4：录音上传识别中的菊花态（蓝色呼吸） */
.icon-btn.busy {
    color: var(--blue);
    background: var(--blue-light);
    animation: voiceBusy 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes voiceBusy {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

.btn-send {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    aspect-ratio: 1 / 1; /* v0.9.5：正圆双保险，任何环境不被拉伸 */
    border: none;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.btn-send:hover { background: var(--blue-hover); }

.btn-send:disabled {
    background: #c9d4f8;
    cursor: not-allowed;
}

.input-tip {
    margin: 6px auto 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

/* ============================ 弹窗 ============================ */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(31, 35, 41, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-mask.show { display: flex; }

.modal {
    width: 100%;
    max-width: 400px;
    max-height: 88vh;
    max-height: calc(var(--app-height, 100vh) * 0.88);
    max-height: 88dvh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    animation: modalIn .18s ease-out;
}

.modal-vip { max-width: 460px; }
.modal-list { max-width: 520px; }

@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    font-size: 22px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 0 20px 8px; }

.modal-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 14px;
}

.modal-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    /* v0.9.2：15px→16px——iOS 对 <16px 输入框 focus 时强制放大整页 */
    font-size: 16px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color .15s;
    font-family: inherit;
}

.modal-input:focus { border-color: var(--blue); }

.modal-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.code-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.code-row .modal-input {
    flex: 1;
    margin-bottom: 0;
}

.btn-code {
    flex: 0 0 118px;
    border: 1px solid var(--blue);
    color: var(--blue);
    background: #fff;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}

.btn-code:hover { background: var(--blue-light); }

.btn-code:disabled {
    border-color: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
    background: #fff;
}

.modal-hint {
    min-height: 20px;
    font-size: 13px;
    color: #d4380d;
    padding: 10px 0 4px;
    line-height: 1.5;
}

.modal-hint.ok { color: #237804; }

/* ---------- 登录弹窗双 tab（SPEC4 §1.3，文心系简洁下划线选中态） ---------- */
.login-tabs {
    display: flex;
    gap: 24px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.login-tab {
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text-sub);
    padding: 10px 2px;
    cursor: pointer;
    position: relative;
    transition: color .15s;
}

.login-tab.active {
    color: var(--blue);
    font-weight: 600;
}

.login-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--blue);
}

.login-pane .modal-body { padding-top: 14px; }

/* ===== v11：意见反馈弹窗「我的反馈」选项卡（选项卡栏复用 login-tabs/login-tab） ===== */
.fb-pane .modal-body { padding-top: 14px; }

.fb-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.fb-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fb-badge {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 10px;
}

/* 与后台 badge 配色一致：未处理=橙 / 已处理=绿 */
.fb-badge-orange { color: #d46b08; background: #fff7e6; }
.fb-badge-green { color: #237804; background: #f6ffed; }

.fb-time {
    font-size: 12px;
    color: var(--text-light);
}

.fb-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.fb-reply {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f7f8fa;
    border-radius: 8px;
    padding: 8px 10px;
}

.fb-handled-time {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.fb-pending {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.login-switch-line {
    font-size: 12px;
    color: var(--text-light);
    padding-bottom: 6px;
}

.login-switch-line a {
    color: var(--blue);
    text-decoration: none;
}

.modal-hint .test-code {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--blue);
    background: var(--blue-light);
    border-radius: 6px;
    padding: 2px 10px;
    margin-left: 4px;
}

.modal-foot {
    display: flex;
    gap: 12px;
    padding: 12px 20px 18px;
}

.btn-cancel, .btn-primary {
    flex: 1;
    border-radius: 10px;
    padding: 11px 0;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, filter .15s;
}

.btn-cancel {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
}

.btn-cancel:hover { background: var(--bg-side); }

.btn-primary {
    border: none;
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover { background: var(--blue-hover); }

.btn-primary:disabled {
    background: #c9d4f8;
    cursor: not-allowed;
}

/* 数据列表弹窗（收藏 / 我的分享共用） */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 56vh;
    overflow-y: auto;
    padding-bottom: 10px;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}

.list-main {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.list-title {
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-main:hover .list-title { color: var(--blue); }

.list-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

.list-btn {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 12px;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s, border-color .15s, background .15s;
}

.list-btn:hover {
    color: var(--blue);
    border-color: var(--blue);
}

.list-btn.danger:hover {
    color: #d4380d;
    border-color: #ffa39e;
    background: #fff1f0;
}

.list-empty {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    padding: 24px 0;
}

/* 收藏详情 */
.detail-block { margin-bottom: 14px; }

.detail-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
}

.detail-text {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--bg-side);
    border-radius: 10px;
    padding: 12px 14px;
    max-height: 40vh;
    overflow-y: auto;
}

/* 下载弹窗 */
.dl-body {
    text-align: center;
    padding-bottom: 22px;
}

.dl-qr img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

.dl-text {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.7;
    margin: 14px 0;
}

.dl-link {
    display: inline-block;
    text-decoration: none;
    padding: 11px 34px;
    border-radius: 10px;
    font-size: 15px;
}

.dl-empty {
    font-size: 13px;
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 20px 10px;
}

/* VIP 套餐卡片 */
.pkg-list {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.pkg-card {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
}

.pkg-card:hover { border-color: var(--blue); }

.pkg-card.selected {
    border-color: var(--blue);
    background: var(--blue-light);
}

.pkg-name {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 6px;
}

.pkg-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--red);
}

.pkg-price .cur {
    font-size: 12px;
    font-weight: 400;
}

.pkg-days {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.pay-qr {
    text-align: center;
    margin-bottom: 10px;
}

.pay-qr img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}

.pay-qr .no-qr {
    font-size: 13px;
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 20px 10px;
}

.pay-notice {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.6;
}

.media-diag-log {
    width: 100%;
    max-height: 42vh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    padding: 12px;
    border-radius: 8px;
    background: #f5f6f7;
    color: #30343b;
    font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: left;
    user-select: text;
    -webkit-user-select: text;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    top: 72px;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(31, 35, 41, .88);
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    padding: 10px 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 200;
    max-width: 86%;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 抽屉遮罩（移动端） */
.sidebar-mask {
    display: none;
}

/* ============================ 移动端（≤768px） ============================ */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .topbar { padding: 0 12px; }

    .logo-text { font-size: 16px; }

    .btn-vip-top { padding: 6px 12px; }

    /* 顶栏精简：我的分享/更多/登录按钮收进抽屉，仅保留头像入口 */
    .top-btn, .top-user, .more-wrap { display: none !important; }

    /* v11：手机端移除语音输入按钮（PC >768px 保留），同行其余元素自然补齐 */
    #btnVoice { display: none !important; }

    .top-avatar { display: inline-flex; }

    /* 抽屉底部追加的移动端入口 */
    .mobile-only { display: flex; }

    .sidebar {
        position: fixed;
        top: 52px;
        left: 0;
        /* v9：iOS fixed 元素 bottom:0 相对布局视口，会被悬浮底栏遮挡；
           改为显式高度链 vh → var(--app-height) → dvh */
        bottom: auto;
        height: calc(100vh - 52px);
        height: calc(var(--app-height, 100vh) - 52px); /* v0.9.5：撤 dvh 覆盖，与 body 同源 */
        width: 280px;
        flex: none;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 6px 0 24px rgba(31, 35, 41, .12);
    }

    .sidebar-mask.show {
        display: block;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        /* v9：同 .sidebar，显式高度链避免被 iOS 悬浮底栏遮挡 */
        bottom: auto;
        height: calc(100vh - 52px);
        height: calc(var(--app-height, 100vh) - 52px); /* v0.9.5：撤 dvh 覆盖，与 body 同源 */
        background: rgba(31, 35, 41, .4);
        z-index: 25;
    }

    .chat-inner { padding: 16px 14px 10px; }

    /* 欢迎页输入卡片全宽，整体略向上收 */
    .welcome-wrap {
        gap: 14px;
        padding: 2vh 0 16px;
    }

    .welcome-logo {
        width: 56px;
        height: 56px;
        font-size: 30px;
        margin-bottom: 14px;
    }

    .welcome-title { font-size: 20px; }

    .welcome-sub { font-size: 13px; }

    .rec-cards { grid-template-columns: 1fr; }

    .bubble {
        max-width: 100%;
        font-size: 14.5px;
    }

    .msg-row { gap: 8px; }

    .msg-ai .bubble { flex: 1; min-width: 0; }

    .msg-user .bubble { max-width: 86%; }

    .avatar { flex-basis: 30px; width: 30px; height: 30px; font-size: 16px; }

    .bubble-img { max-width: 68vw; }

    /* 气泡操作条在移动端保持可点（增大点击区域） */
    .act-btn { padding: 5px 10px; }

    .input-holder-bottom {
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
    }

    .input-card { border-radius: 18px; }

    .input-tip { font-size: 11px; }

    .modal { max-width: 100%; }

    .pkg-list { flex-direction: column; }
}

/* ============================ 超窄屏（≤400px，SPEC4 §2：保汉堡按钮空间） ============================ */
@media (max-width: 400px) {
    .logo-text {
        font-size: 14px;
        max-width: 9em;
    }

    .topbar { padding: 0 8px; }

    .hamburger { margin-right: 6px; }
}

/* ============================ VIP 弹窗：支付方式选择 + 立即支付 ============================ */
/* v12：1003 气泡内「开通VIP」链接（红色加粗可点击） */
.vip-go-link {
    color: #e6162d;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* 支付方式选择行：两个按钮并排（PC/移动端一致，一行两列均分） */
.pay-method-row {
    display: flex;
    gap: 10px;
    margin: 4px 0 2px;
}

.pay-method-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 10px;
    border: 1.5px solid;
    background: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

/* 微信支付（绿色 #09bb07 系）：未选=白底绿边绿字，选中=实心绿白字 */
.pay-method-btn.wx {
    border-color: #09bb07;
    color: #09bb07;
}

.pay-method-btn.wx.selected {
    background: #09bb07;
    color: #fff;
}

.pay-method-btn.wx:not(.selected):hover { background: #e9f9e9; }

/* 支付宝（蓝色 #1677ff 系）：未选=白底蓝边蓝字，选中=实心蓝白字 */
.pay-method-btn.ali {
    border-color: #1677ff;
    color: #1677ff;
}

.pay-method-btn.ali.selected {
    background: #1677ff;
    color: #fff;
}

.pay-method-btn.ali:not(.selected):hover { background: #e8f1ff; }

/* 立即支付：橙色（#ff7d00 系）全宽大按钮 */
.btn-pay-now {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #ff7d00;
    cursor: pointer;
    transition: background .15s;
}

.btn-pay-now:hover { background: #f07400; }

.btn-pay-now:disabled {
    background: #ffc080;
    cursor: not-allowed;
}

/* v12：移动端单按钮直付——微信绿 / 支付宝蓝（置于 :hover/:disabled 之后保证优先级生效） */
.btn-pay-now.btn-pay-wx { background: #07c160; }
.btn-pay-now.btn-pay-wx:hover { background: #06ad56; }
.btn-pay-now.btn-pay-wx:disabled { background: #8fdcb2; }

.btn-pay-now.btn-pay-ali { background: #1677ff; }
.btn-pay-now.btn-pay-ali:hover { background: #0f66e0; }
.btn-pay-now.btn-pay-ali:disabled { background: #9cc4ff; }


/* ============================================================================
 * v0.3/v0.4 豆包式 UI 补充样式（顶栏logo小字/朗读按钮/欢迎区/推荐胶囊/底部tab）
 * ==========================================================================*/
.logo-text-wrap { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.logo-sub { font-size: 10px; color: #a2abbd; font-weight: 400; margin-top: 2px; letter-spacing: .5px; }
.pc-only { display: inline-flex; }
.echo { display: inline; }

/* 朗读开关按钮（开启时品牌蓝高亮） */
.tts-btn { position: relative; }
.tts-btn.tts-on { color: var(--brand, #4e6ef2); }
.tts-btn svg { display: block; }

/* 分类导航容器 */
.cat-nav { display: flex; flex-direction: column; }

/* 豆包式欢迎区：头像 + 圆角气泡 */
.db-welcome-msg { display: flex; align-items: flex-start; gap: 12px; }
.db-welcome-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(78, 110, 242, .12); object-fit: cover;
}
.db-welcome-bubble {
    background: #f2f3f5; color: #1d2129; font-size: 15px; line-height: 1.7;
    border-radius: 4px 18px 18px 18px; padding: 12px 18px;
}
.db-welcome-links { margin-top: 14px; }
.db-welcome-links a { color: var(--brand, #4e6ef2); text-decoration: none; }
.db-welcome-links a:hover { text-decoration: underline; }

/* 豆包式推荐问题胶囊卡（单列竖排，覆盖文心式双列grid） */
.db-rec-list { display: flex; flex-direction: column; gap: 10px; }
.db-rec-item { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.db-rec-icon { flex: 0 0 auto; font-size: 18px; line-height: 1; }
.db-rec-q { flex: 1 1 auto; min-width: 0; }
.db-rec-arrow { flex: 0 0 auto; color: #c2c7d1; font-size: 18px; line-height: 1; transition: transform .15s; }
.db-rec-item:hover .db-rec-arrow { transform: translateX(3px); color: var(--brand, #4e6ef2); }
.db-rec-refresh {
    display: block; margin: 14px auto 0; padding: 6px 18px;
    border: none; background: none; color: #86909c; font-size: 13px;
    cursor: pointer; border-radius: 999px;
}
.db-rec-refresh:hover { color: var(--brand, #4e6ef2); background: #f2f3f5; }

/* 豆包式底部 tab 栏：默认（PC）隐藏，仅移动端显示 */
.db-tabbar { display: none; }

@media (max-width: 768px) {
    .pc-only { display: none !important; }

    .db-tabbar {
        /* v0.9.5：改文档流（body flex 纵列最后一行），随可视高度整体缩放——
           iOS 键盘弹起时与输入栏一起被推上去（原 fixed 挂在布局视口，会被键盘盖住） */
        display: flex; flex: 0 0 auto;
        background: #fff; border-top: 1px solid #eff0f1;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, .04);
    }
    .db-tab {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 8px 0 6px; color: #86909c; font-size: 11px; text-decoration: none;
        position: relative;
    }
    .db-tab svg { display: block; }
    .db-tab.active { color: var(--brand, #4e6ef2); }
    .db-tab:active { background: #f7f8fa; }
    /* v0.9.3：「我的」通知小红点（有任何消息/订单/派单即显示，不显示条数） */
    .db-tab-dot {
        position: absolute; top: 6px; left: calc(50% + 2px);
        width: 8px; height: 8px; border-radius: 50%;
        background: #f53f3f; box-shadow: 0 0 0 1.5px #fff;
    }

    /* v0.9.5：tab 栏改文档流后不再遮挡内容，原输入区/主体为 fixed 栏预留的底部让位全部移除 */
}

/* ============================================================================
 * v0.4 豆包式长按消息菜单
 * ==========================================================================*/
.msgmenu-mask {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, .35);
    display: flex; align-items: center; justify-content: center;
    animation: msgmenuFade .15s ease;
}
@keyframes msgmenuFade { from { opacity: 0; } to { opacity: 1; } }
.msgmenu {
    width: min(320px, 86vw); background: #fff; border-radius: 18px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .18); overflow: hidden;
    animation: msgmenuPop .18s ease;
}
@keyframes msgmenuPop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.msgmenu-top { display: flex; border-bottom: 1px solid #f2f3f5; }
.msgmenu-ico-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 16px 0 14px; border: none; background: none; cursor: pointer;
    color: #1d2129; font-size: 13px;
}
.msgmenu-ico-btn + .msgmenu-ico-btn { border-left: 1px solid #f2f3f5; }
.msgmenu-ico-btn:active { background: #f7f8fa; }
.msgmenu-list { display: flex; flex-direction: column; }
.msgmenu-row {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 14px 20px; border: none; background: none; cursor: pointer;
    font-size: 16px; color: #1d2129; text-align: left;
}
.msgmenu-row:active { background: #f7f8fa; }
.msgmenu-row-ico { flex-shrink: 0; width: 22px; display: flex; align-items: center; justify-content: center; color: #4e5969; }
.msgmenu-row.danger { color: #f53f3f; }
.msgmenu-row.danger .msgmenu-row-ico { color: #f53f3f; }
.msgmenu-chev { margin-left: auto; color: #b6bccf; display: flex; transition: transform .2s; }
.msgmenu-row.open .msgmenu-chev { transform: rotate(180deg); }
.msgmenu-more { border-top: 1px solid #f2f3f5; }
.msgmenu-mask .msgmenu-row + .msgmenu-row { border-top: 1px solid #f7f8fa; }

/* ============================================================================
 * v0.4 修复：AI 头像图片必须约束在圆形小头像内
 * （logo.png 为512px原图，无约束时会溢出撑满聊天区，造成"大插画"错乱）
 * ==========================================================================*/
.avatar.avatar-logo { background: none; overflow: hidden; }
.avatar.avatar-logo img {
    width: 100%; height: 100%; display: block;
    object-fit: cover; border-radius: 50%;
}
/* 消息气泡图片同样限制最大宽度，防止任何图片撑破布局 */
.bubble img { max-width: 100%; height: auto; }


/* ============================================================================
 * v0.5 豆包三页布局：顶栏 / 欢迎页 / 常规聊天页
 * ==========================================================================*/
.topbar-left { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.top-icon-btn {
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--text); display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
}
.top-icon-btn:hover { background: #f2f3f5; color: var(--blue); }
.top-icon-btn:active { transform: scale(.94); }
.top-icon-btn:focus-visible, .db-quick-item:focus-visible, .db-tab:focus-visible,
.side-fee-btn:focus-visible, .db-rec-refresh:focus-visible {
    outline: 2px solid var(--blue); outline-offset: 2px;
}
.top-edit { display: none; }
.top-title-chevron { display: none; color: #b6bccf; font-size: 22px; font-weight: 400; }
.top-title-chevron.show { display: inline; }
.side-fee-btn {
    width: 100%; min-height: 40px; margin-top: 10px; padding: 9px 12px;
    border: 1px solid #f0d7a8; border-radius: 10px; background: #fff8ea;
    color: #7a4a00; font-size: 14px; font-weight: 600; cursor: pointer;
}
.side-fee-btn:hover { background: #fff1d6; }
.input-holder-center { display: none; }
.db-chat-quick {
    display: none; flex: 0 0 auto; width: 100%; max-width: 860px; margin: 0 auto;
    align-items: center; gap: 8px; padding: 8px 24px 0; background: #fff;
}
/* v0.9.4：首页/聊天页合并为同一页面——聊天页不再显示快捷胶囊（功能与底部 tab 栏重复） */
.db-quick-item {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 9px 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid #e5e6eb; border-radius: 12px; background: #fff;
    color: #4e5969; font-size: 14px; text-decoration: none; white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.db-quick-item:hover, .db-quick-item.active { border-color: #c9cdd4; background: #f7f8fa; color: #1d2129; }
.db-quick-chevron { color: #b6bccf; margin-left: -2px; }
.md-bold { font-weight: 700; }
.md-em { font-weight: 600; }

@media (max-width: 768px) {
    .topbar { height: 56px; flex-basis: 56px; padding: 0 8px; justify-content: space-between; }
    .topbar-left { gap: 2px; }
    .topbar-right { gap: 2px; }
    .top-edit { display: inline-flex; }
    .hamburger { width: 40px; height: 40px; margin: 0; padding: 9px; gap: 6px; }
    .hamburger span { width: 20px; height: 2px; }
    .logo {
        position: absolute; left: 50%; transform: translateX(-50%);
        max-width: calc(100% - 190px); text-align: center; gap: 4px;
    }
    .logo-text { font-size: 18px; font-weight: 600; }
    .logo-sub { display: none; }
    .topbar-right .top-icon-btn { display: inline-flex !important; }
    .topbar-right .top-user, .topbar-right .more-wrap, .topbar-right .top-avatar { display: none !important; }
    .tts-btn.tts-on { color: #1687f8; }
    .sidebar { top: 56px; height: calc(100vh - 56px); height: calc(var(--app-height, 100vh) - 56px); }
    .sidebar-mask.show { top: 56px; height: calc(100vh - 56px); height: calc(var(--app-height, 100vh) - 56px); }

    /* v0.9.5：tab 栏改文档流，layout 不再为其预留底部空间（原 62px 预留移除） */
    .chat-inner { padding: 18px 14px 12px; }
    .welcome-wrap { margin: 0; gap: 14px; padding: 12px 0 18px; }
    .db-welcome { text-align: left; }
    .db-welcome-msg { gap: 12px; align-items: flex-start; }
    .db-welcome-avatar { width: 50px; height: 50px; box-shadow: none; }
    .db-welcome-bubble {
        padding: 10px 14px; border-radius: 4px 18px 18px 18px;
        background: #f7f8fa; font-size: 16px; line-height: 1.65;
    }
    .db-welcome-links { display: none; }
    .db-rec-list { gap: 12px; margin-top: 4px; }
    .db-rec-item {
        min-height: 56px; padding: 14px 16px; border: 0; border-radius: 28px;
        background: #fff; box-shadow: 0 4px 18px rgba(31, 35, 41, .065);
    }
    .db-rec-item:hover { border: 0; box-shadow: 0 4px 18px rgba(31, 35, 41, .1); }
    .db-rec-icon { font-size: 20px; }
    .db-rec-q { font-size: 15px; font-weight: 600; line-height: 1.45; }
    .db-rec-arrow { font-size: 24px; }
    .db-rec-refresh { align-self: flex-start; min-height: 40px; margin: 0 0 0 2px; padding: 7px 10px; font-size: 14px; }

    .db-tabbar { min-height: 62px; }
    .db-tab { min-height: 60px; padding: 7px 0 6px; font-size: 11px; }
    .db-tab.active { color: #111214; }
    /* v0.9.4：聊天页底部 tab 栏常驻（原 chat-started 时隐藏已移除，「我的」小红点两态可见） */
    .db-chat-quick {
        gap: 7px; padding: 7px 10px 0; overflow-x: auto; scrollbar-width: none;
    }
    .db-chat-quick::-webkit-scrollbar { display: none; }
    .db-quick-item { padding: 8px 10px; font-size: 13px; border-radius: 11px; }
    .db-quick-item svg { width: 18px; height: 18px; flex: 0 0 auto; }

    .input-holder-bottom {
        /* v0.9.4：欢迎页/聊天页输入栏同位置同缝隙，收紧与 tab 栏间距；
           v0.9.5：底部安全区由文档流 tab 栏自身 padding 承担，输入区不再重复预留 */
        padding: 8px 12px 8px; border-top: 0; background: #fff;
    }
    .input-card { padding: 13px 14px 9px; border: 0; border-radius: 24px; box-shadow: 0 5px 22px rgba(31, 35, 41, .09); }
    .input-card:focus-within { border: 0; box-shadow: 0 5px 22px rgba(31, 35, 41, .13); }
    #inputBox { font-size: 16px; line-height: 1.55; }
    .input-tip { display: none; }
    #btnVoice { display: inline-flex !important; }
    .tool-icons { gap: 3px; }
    .tool-icons .icon-btn { width: 40px; height: 40px; }
    .tool-icons .icon-btn svg { width: 22px; height: 22px; }
    .chip { min-height: 34px; }

    .msg-row { margin-bottom: 18px; }
    .msg-user .bubble {
        max-width: 84%; padding: 12px 17px; border: 0; border-radius: 22px 22px 6px 22px;
        background: #55b9f3; color: #fff; font-size: 16px; line-height: 1.6;
    }
    .msg-ai .avatar { display: none; }
    .msg-ai .bubble {
        padding: 16px; border: 0; border-radius: 16px; background: #f7f8fa;
        font-size: 16px; line-height: 1.8;
    }
    .msg-ai .msg-actions { border-top: 0; padding-top: 2px; }
    .msg-ai .src-tag { margin-top: 10px; }

    /* v0.9.4：聊天页输入卡片不再单独压缩变形（原 chat-started 一组覆盖已移除），
       欢迎页/聊天页输入栏样式完全一致 */
}

@media (max-width: 380px) {
    .logo { max-width: calc(100% - 174px); }
    .logo-text { font-size: 16px; }
    .top-icon-btn, .hamburger { width: 38px; height: 38px; }
    .db-quick-item { padding-left: 8px; padding-right: 8px; font-size: 12px; gap: 4px; }
    .db-quick-item svg { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .top-icon-btn, .db-rec-arrow, .type-cursor { transition: none !important; animation: none !important; }
}


/* ============================================================================
 * v0.6 豆包式文字输入 ↔ 按住说话
 * 单条输入结构，修复聊天态工具栏挤压输入框及真机触控聚焦区域过小的问题
 * ==========================================================================*/
.input-card,
.chat-started .input-card { display: block; }
.db-input-row button { -webkit-tap-highlight-color: transparent; }
.db-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.db-input-switch {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    position: relative;
}
#inputBox,
.chat-started #inputBox {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    max-height: 120px;
    margin: 0;
    padding: 10px 5px 8px;
    border: 0;
    outline: 0;
    color: var(--text);
    caret-color: var(--blue);
    background: transparent;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-user-select: text;
    user-select: text;
    -webkit-appearance: none;
    appearance: none;
}
.db-input-row .tool-icons { flex: 0 0 auto; margin: 0; gap: 4px; }
.db-input-row .db-input-side {
    flex: 0 0 42px;
    width: 42px;
    height: 44px;
    padding: 0;
    color: #1d2129;
    touch-action: manipulation;
}
.db-input-row .btn-send {
    /* v0.9.5：发送键改豆包式精致小圆钮——36px 正圆（aspect-ratio 双保险不变形） */
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin-bottom: 3px;
    touch-action: manipulation;
}
.btn-send.is-plus:not(.stopping) {
    color: #1d2129;
    background: transparent;
    opacity: 1;
}
.btn-send.is-plus:not(.stopping):disabled { color: #1d2129; background: transparent; }
.input-card > .input-toolbar { margin-top: 6px; }
.input-card > .input-toolbar:empty,
.input-card > .input-toolbar:has(.tool-chips:empty) { display: none; }
.chat-started .input-card > .input-toolbar { display: none; }

.db-hold-talk {
    display: none;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #1d2129;
    font-size: 16px;
    font-weight: 600;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.voice-input-mode #inputBox { display: none !important; }
.db-input-switch #inputBox,
.voice-input-mode .db-hold-talk { animation: dbInputModeIn .14s ease-out; }
.voice-input-mode .db-hold-talk { display: block; }
@keyframes dbInputModeIn {
    from { opacity: .25; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
.voice-input-mode .voice-switch-icon { display: none; }
.keyboard-switch-icon { display: none; }
.voice-input-mode .keyboard-switch-icon { display: block; }
.db-hold-talk.recording { color: #1677ff; background: #eef6ff; }
.db-hold-talk.cancelling { color: #f53f3f; background: #fff1f0; }
.db-hold-talk.busy { color: #86909c; pointer-events: none; }

/* 录音提示层不接管触摸，手指移动/松开始终由“按住说话”按钮处理 */
.voice-record-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: none;
    pointer-events: none;
    background: linear-gradient(180deg,
        rgba(42, 139, 255, 0) 18%,
        rgba(50, 146, 255, .18) 43%,
        rgba(46, 137, 252, .83) 70%,
        #3589f4 100%);
}
.voice-record-overlay.show { display: block; animation: voiceOverlayIn .14s ease-out; }
.voice-record-content {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(58px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}
.voice-record-hint { font-size: 17px; font-weight: 600; line-height: 1.6; text-shadow: 0 1px 3px rgba(0,0,0,.08); }
.voice-record-transcript {
    max-width: min(560px, 90vw);
    max-height: 112px;
    margin-bottom: 22px;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.65;
    color: rgba(255,255,255,.96);
}
.voice-record-transcript:empty { display: none; }
.voice-record-sub { margin-top: 18px; font-size: 13px; color: rgba(255,255,255,.78); }
.voice-wave {
    height: 48px;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: 100%;
    overflow: hidden;
}
.voice-wave i {
    display: block;
    flex: 0 0 3px;
    width: 3px;
    height: 10px;
    border-radius: 3px;
    background: rgba(255,255,255,.9);
    animation: voiceWave 1s ease-in-out infinite;
}
.voice-wave i:nth-child(4n+1) { animation-delay: -.2s; }
.voice-wave i:nth-child(4n+2) { animation-delay: -.65s; }
.voice-wave i:nth-child(4n+3) { animation-delay: -.4s; }
.voice-wave i:nth-child(5n) { animation-delay: -.8s; }
.voice-record-overlay.cancelling {
    background: linear-gradient(180deg,
        rgba(245, 63, 63, 0) 18%,
        rgba(245, 63, 63, .14) 43%,
        rgba(245, 63, 63, .78) 70%,
        #e76565 100%);
}
.voice-record-overlay.cancelling .voice-wave { opacity: .35; }
.voice-record-overlay.busy .voice-wave i { animation-duration: 1.6s; }
@keyframes voiceWave {
    0%, 100% { height: 8px; opacity: .55; }
    50% { height: 34px; opacity: 1; }
}
@keyframes voiceOverlayIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
    .input-card { padding: 9px 10px; }
    /* v0.9.4：聊天页输入卡片内边距/圆角与欢迎页一致（原 chat-started 覆盖已移除） */
    .input-card > .input-toolbar { margin: 2px 4px 0; }
    .db-input-row { align-items: center; gap: 3px; }
    #inputBox, .chat-started #inputBox { padding: 10px 4px 8px; font-size: 16px; line-height: 1.6; }
    .db-input-row .tool-icons { gap: 1px; }
    .voice-record-content { bottom: calc(46px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
    .input-card { padding-left: 7px; padding-right: 7px; }
    .db-input-row .db-input-side { flex-basis: 37px; width: 37px; }
    .db-input-row .btn-send { flex-basis: 34px; width: 34px; height: 34px; } /* v0.9.5：超窄屏同步正圆小钮 */
    .db-hold-talk { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
    .voice-record-overlay, .voice-wave i, .db-input-switch #inputBox, .db-hold-talk { animation: none !important; }
}


/* ============================================================================
 * v0.7 真机输入与麦克风权限兼容
 * ==========================================================================*/
.input-holder-center,
.input-holder-bottom,
.input-area,
.input-card,
.db-input-switch { position: relative; }
.input-card { z-index: 2; }
.db-input-switch { z-index: 3; pointer-events: auto; }
#inputBox,
.chat-started #inputBox,
.db-input-switch #inputBox {
    position: relative;
    z-index: 4;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    -webkit-text-fill-color: var(--text);
    -webkit-touch-callout: default;
}
.db-input-row .db-input-side,
.db-input-row .btn-send { position: relative; z-index: 5; }

/* v0.7.1：WKWebView 对带 CSS 动画/变换的原生 textarea 会偶发丢失光标和键盘。
   输入框始终保留原生编辑能力，不参与双态切换动画；语音态仍单独隐藏。 */
.db-input-switch { cursor: text; }
.db-input-switch #inputBox,
.chat-started .db-input-switch #inputBox {
    animation: none !important;
    transform: none !important;
    -webkit-transform: none !important;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    touch-action: manipulation;
    caret-color: var(--blue);
}
.voice-input-mode .db-input-switch { cursor: default; }

.voice-permission-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2300;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, .48);
    -webkit-overflow-scrolling: touch;
}
.voice-permission-modal.show { display: flex; }
.voice-permission-card {
    position: relative;
    width: min(420px, 100%);
    max-height: calc(var(--app-height, 100vh) - 48px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 24px 22px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(15, 23, 42, .22);
    color: #1d2129;
}
.voice-permission-card h3 { margin: 0 28px 12px; font-size: 19px; line-height: 1.45; text-align: center; }
.voice-permission-card p { margin: 0 0 14px; color: #4e5969; font-size: 14px; line-height: 1.7; }
.voice-permission-card ol { margin: 0; padding-left: 22px; color: #1d2129; font-size: 14px; line-height: 1.75; }
.voice-permission-card li { margin: 7px 0; padding-left: 2px; }
.voice-permission-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #86909c;
    font-size: 26px;
    line-height: 36px;
    cursor: pointer;
}
.voice-permission-actions { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px; }
.voice-permission-actions button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    border-radius: 21px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
}
.voice-permission-copy { border: 1px solid #c9cdd4; background: #fff; color: #4e5969; }
.voice-permission-retry { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
@media (max-width: 360px) {
    .voice-permission-modal { padding: 16px; }
    .voice-permission-card { padding: 22px 17px 17px; }
    .voice-permission-actions { gap: 8px; }
    .voice-permission-actions button { padding-left: 8px; padding-right: 8px; }
}

/* ============================================================
   v0.7.7 豆包式侧边栏（搜索+新建 / 主入口 / 功能入口 / 最近 / 底部固定栏）
   ============================================================ */
.db-side-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px; }
.db-side-search {
    flex: 1; display: flex; align-items: center; gap: 6px;
    background: #eceff5; border-radius: 9px; padding: 7px 10px;
    color: var(--text-light);
}
.db-side-search input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    /* v0.9.2：13px→16px——iOS 对 <16px 输入框 focus 时强制放大整页 */
    font-size: 16px; color: var(--text); font-family: inherit;
}
.db-side-newbtn {
    width: 32px; height: 32px; flex: none;
    border: none; background: transparent; border-radius: 8px;
    color: var(--text-sub); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.db-side-newbtn:hover { background: #eceff5; color: var(--text); }

.db-side-entry {
    display: flex; align-items: center; gap: 9px;
    margin: 4px 12px 2px; padding: 9px 10px;
    background: #eceff5; border-radius: 10px; cursor: pointer;
}
.db-side-entry-logo { width: 24px; height: 24px; border-radius: 50%; flex: none; object-fit: cover; }
.db-side-entry-name { font-size: 15px; font-weight: 600; color: var(--text); }

.db-side-funcs { padding: 4px 8px 2px; }
.db-func-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    font-size: 14px; color: var(--text); cursor: pointer; user-select: none;
}
.db-func-item:hover { background: #eceff5; }
.db-func-item svg { color: var(--text-sub); flex: none; }

.db-recent-title { padding: 10px 14px 4px; }
.history-item .h-ico {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    background: #eef2ff; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

.db-side-bottom {
    flex: none; display: flex; align-items: center; gap: 4px;
    border-top: 1px solid var(--border); padding: 10px 12px;
}
.db-side-user {
    flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
    border: none; background: transparent; cursor: pointer;
    padding: 5px 6px; border-radius: 8px; font-family: inherit;
}
.db-side-user:hover { background: #eceff5; }
.db-side-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: #dfe8fb; color: #7a9cf5;
    display: flex; align-items: center; justify-content: center;
}
.db-side-name {
    font-size: 14px; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-side-chevron { color: var(--text-light); font-size: 15px; flex: none; }
.db-side-iconbtn {
    width: 34px; height: 34px; flex: none;
    border: none; background: transparent; border-radius: 8px;
    color: var(--text-sub); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.db-side-iconbtn:hover { background: #eceff5; color: var(--text); }

/* ============================================================
   v0.7.7 豆包式设置页（全屏覆盖层）
   ============================================================ */
.db-settings {
    position: fixed; inset: 0; z-index: 300;
    background: #f5f6f8; display: none; flex-direction: column;
}
.db-settings.show { display: flex; }
.db-settings-head {
    flex: none; height: 50px; display: flex; align-items: center;
    padding: 0 6px;
}
.db-settings-back {
    width: 40px; height: 40px; border: none; background: transparent;
    color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.db-settings-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; color: var(--text); }
.db-settings-head-r { width: 40px; }
.db-settings-body {
    flex: 1; overflow-y: auto; padding: 4px 14px 44px;
    width: 100%; max-width: 640px; margin: 0 auto;
}
.db-profile { text-align: center; padding: 20px 0 16px; }
.db-profile-avatar {
    width: 74px; height: 74px; border-radius: 50%;
    background: #e6efff; color: #8fb0f5;
    margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
}
.db-profile-name {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 19px; font-weight: 600; color: var(--text); cursor: pointer;
}
.db-profile-chevron { color: var(--text-light); font-size: 17px; }
.db-profile-sub { font-size: 12px; color: var(--text-light); margin-top: 5px; }
.db-profile-btn {
    margin-top: 14px; border: 1px solid var(--border); background: #fff;
    border-radius: 19px; padding: 8px 24px; font-size: 13px;
    color: var(--text); cursor: pointer; font-family: inherit;
}
.db-profile-btn:hover { background: #f0f3ff; border-color: #c9d6ff; color: var(--blue); }

.db-set-card { background: #fff; border-radius: 14px; margin-top: 14px; overflow: hidden; }
.db-set-item {
    display: flex; align-items: center; gap: 11px;
    padding: 14px; font-size: 15px; color: #1d2129; cursor: pointer; user-select: none;
}
.db-set-item + .db-set-item { border-top: 1px solid #f2f3f5; }
.db-set-item:active { background: #f7f8fa; }
.db-set-ico {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.db-set-txt { flex: 1; }
.db-set-arrow { color: #c4c9d4; font-size: 16px; flex: none; }
.db-set-links-list { padding: 0 14px 10px; }
.db-set-links-list .link-item { padding: 6px 0; font-size: 14px; }
.db-set-version { text-align: center; color: var(--text-light); font-size: 12px; margin-top: 24px; }
.db-set-agreements { text-align: center; font-size: 12px; margin-top: 8px; }
.db-set-agreements a { color: var(--blue); margin: 0 10px; }

/* v0.7.7：移动端抽屉打开时盖住底部 tabbar（z-index 900），保证抽屉底栏可点 */
.sidebar-mask.show { z-index: 940; }
.sidebar.open { z-index: 950; }

/* v0.7.7 修正：设置页须盖过抽屉（950）与底部栏（900） */
.db-settings { z-index: 1200; }


/* ============================ v0.9.6 日月分工：iOS 首页条件锁高 ============================
   月亮（键盘收起，默认）：文档可滚动——微信 iOS 底栏随滑动自动收展（同集市/详情页的收展行为）；
   太阳（键盘弹起，.ios-kb）：锁高——输入栏+tab栏整体推到键盘上方（v0.9.5 已验证行为）。
   仅 iOS（JS 给 html 加 .ios-doc）且 ≤768px 生效，PC/安卓零影响。
   --tabbar-h/--dock-h 由 JS 实测（输入框长高时坞高实时跟随）。 */
@media (max-width: 768px) {
    /* —— 月亮：文档滚动模式（默认） —— */
    html.ios-doc, html.ios-doc body { overflow-y: visible; height: auto; }
    html.ios-doc body {
        /* +100px 保底整页可滚动——欢迎页等短内容页也能下滑触发微信栏收展。
           v0.9.6.3 的 +1px 真机实测触发不了（手势没有真实滚动位移，微信收不到下滑信号），
           v0.9.6.4 加大到 100px（超过栏自身高度，一次下滑必产生真实位移） */
        min-height: calc(var(--app-height, 100vh) + 100px);
        padding-top: 52px;
    }
    html.ios-doc .topbar { position: fixed; top: 0; left: 0; right: 0; }
    html.ios-doc .layout { flex: none; }
    html.ios-doc .chat-scroll { flex: none; overflow: visible; }
    /* 消息区最小一屏高：欢迎页保持垂直居中观感，超过则自然撑开文档 */
    html.ios-doc .chat-inner { min-height: calc(var(--app-height, 100vh) - 52px - var(--dock-h, 160px)); }
    html.ios-doc .main { padding-bottom: var(--dock-h, 160px); }
    /* 底部坞：输入栏 + tab栏固定悬停（键盘收起时微信栏在它们之下显隐，随滑动收展） */
    html.ios-doc .input-holder-bottom {
        position: fixed; left: 0; right: 0; bottom: var(--tabbar-h, 62px); z-index: 22;
        border-top: 1px solid var(--border);
    }
    html.ios-doc .db-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; }

    /* —— 太阳：键盘弹起锁高模式（.ios-kb，回到 v0.9.5 布局） —— */
    html.ios-doc.ios-kb, html.ios-doc.ios-kb body { overflow-y: hidden; }
    html.ios-doc.ios-kb body {
        height: var(--app-height, 100vh); min-height: 0; padding-top: 0;
    }
    html.ios-doc.ios-kb .topbar { position: static; }
    html.ios-doc.ios-kb .layout { flex: 1 1 auto; }
    html.ios-doc.ios-kb .chat-scroll { flex: 1; overflow-y: auto; }
    html.ios-doc.ios-kb .chat-inner { min-height: 0; }
    html.ios-doc.ios-kb .main { padding-bottom: 0; }
    html.ios-doc.ios-kb .input-holder-bottom { position: static; border-top: 0; }
    html.ios-doc.ios-kb .db-tabbar { position: static; }
}
