/* ═══════════ Singularity · 奇点 · 黑白科技风（双主题，跟随系统） ═══════════ */
/* v1.4.110 ②：统一请求层的顶部细进度条——只在「真有请求在飞且超过 700ms」时出现，
   让「点了没反应」变成「看得见它在等」。 */
html.net-busy::after {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9999;
  background: linear-gradient(90deg, transparent, var(--primary, #000) 45%, transparent);
  background-size: 45% 100%; background-repeat: no-repeat;
  animation: netSlide 1.1s linear infinite; pointer-events: none;
}
@keyframes netSlide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
:root {
  /* 样式自愈探针：app.js 读这个变量判断 style.css 是否是当前版本。
     旧缓存里没有它 → 自动换 URL 重拉一次，避免新界面配旧样式。 */
  --sg-css-ok: 1;
  --bg: #ffffff;
  --panel: #fbfbfa;          /* v1.4.184：面板靠 1.6% 色差从页面底浮起，不再靠黑框 */
  --raise: #f5f5f3;          /* 二级浮起（选中项、悬浮层内侧） */
  --border: rgba(0, 0, 0, .07);   /* 发丝线：只做边界暗示，不做分隔框 */
  --hair: rgba(0, 0, 0, .075);
  --focus-ring: 0 0 0 1px rgba(0, 0, 0, .04), 0 3px 8px rgba(0, 0, 0, .05), 0 10px 28px rgba(0, 0, 0, .06);
  --fw-body: 400; --fw-strong: 600; --fw-head: 700;
  --text: #0d0d0d;
  --dim: #767676;
  --primary: #000000;
  --primary-dark: #333333;
  --primary-soft: #f0f0f0;
  --grad: #000000;
  --on-primary: #ffffff;
  --user-bubble: #0d0d0d;
  --user-fg: #ffffff;
  --danger: #333333;
  /* v1.4.106：提醒色（回收站到期预警用；两套主题各一档，别用 --danger 冒充） */
  --warn: #b8760f;
  --code-bg: #f2f2f2;
  --code-text: #111111;
  --pre-bg: #0b0b0b;
  --pre-text: #ededed;
  --think-bg: #fafafa;
  --think-border: #d9d9d9;
  --hover-bg: #f4f4f4;
  --grid-line: rgba(0, 0, 0, .045);
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .05);
  --radius: 6px;
  --sidebar-w: 264px;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
}
/* 内联 SVG 尺寸兜底：无显式 width 的统一 18px，防止浏览器默认 300×150 撑爆布局 */
svg:not([width]) { width: 18px; height: 18px; flex-shrink: 0; }
html[data-theme="dark"] body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html[data-theme="dark"] {
  --bg: #080808;
  --panel: #0e0e0e;          /* v1.4.184：暗色同样用 2% 色差分层 */
  --raise: #151515;
  --border: rgba(255, 255, 255, .075);
  --hair: rgba(255, 255, 255, .09);
  --focus-ring: 0 0 0 1px rgba(255, 255, 255, .05), 0 3px 10px rgba(0, 0, 0, .5), 0 12px 30px rgba(0, 0, 0, .55);
  --fw-body: 350; --fw-strong: 550; --fw-head: 600;   /* 暗色降一档，抵消光渗 */
  --text: #e9e9e9;
  --dim: #8c8c8c;
  --primary: #ffffff;
  --primary-dark: #cccccc;
  --primary-soft: rgba(255, 255, 255, .10);
  --grad: #ffffff;
  --on-primary: #000000;
  --user-bubble: #f2f2f2;
  --user-fg: #080808;
  --danger: #d0d0d0;
  --warn: #e0a33a;
  --code-bg: #1b1b1b;
  --code-text: #e8e8e8;
  --pre-bg: #000000;
  --pre-text: #ededed;
  --think-bg: #0d0d0d;
  --think-border: #2b2b2b;
  --hover-bg: #1a1a1a;
  --grid-line: rgba(255, 255, 255, .055);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ───────── 黑洞引擎（blackhole.js 驱动）─────────
 * 画布平时躺在 body 背景之上、全部内容之下（z-index:-1），仅深色主题显示；
 * 门厅期间 body.bh-on 把它提到 app 之上，配合 #bh-gate 文案层构成开场 */
#bh-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; display: none; }
body.bh-on { background: #04060a; }
body.bh-on #bh-canvas { z-index: 55; display: block !important; }
body.bh-on #app { visibility: hidden; }

#bh-gate {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
/* 底部压暗：吸积盘最亮的地方正好在标题区，不压一层字会糊在亮面上 */
#bh-gate::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 52%;
  background: linear-gradient(to bottom,
    rgba(4, 6, 10, 0) 0%, rgba(4, 6, 10, .30) 32%,
    rgba(4, 6, 10, .62) 58%, rgba(4, 6, 10, .88) 88%);
  pointer-events: none;
}
.bh-title-wrap {
  position: relative; z-index: 1;
  text-align: center; margin-bottom: max(6vh, 34px);
  opacity: 0; transform: translateY(14px);
  transition: opacity 2.2s ease, transform 2.2s ease;
}
.bh-title-wrap.show { opacity: 1; transform: translateY(0); }
.bh-title {
  font-size: clamp(38px, 5.4vw, 62px); font-weight: 200;
  letter-spacing: .18em; margin-right: -.18em;
  color: #f5f9fc;
  text-shadow: 0 0 60px rgba(196, 224, 248, .34), 0 0 18px rgba(234, 244, 253, .18);
}
.bh-sub {
  margin-top: 14px; font-size: 10px; font-weight: 300; line-height: 1.6;
  letter-spacing: .46em; margin-right: -.46em;
  color: rgba(196, 224, 248, .46);
  opacity: 0; transition: opacity 1.6s ease .8s;
}
.bh-title-wrap.show .bh-sub { opacity: 1; }
.bh-tagline {
  margin-top: 20px; font-size: 13px; font-weight: 300;
  letter-spacing: .24em; margin-right: -.24em;
  color: rgba(233, 239, 245, .58);
  opacity: 0; transition: opacity 1.6s ease 1.2s;
}
.bh-title-wrap.show .bh-tagline { opacity: 1; }
.bh-enter {
  margin-top: 30px; pointer-events: auto; cursor: pointer;
  font: inherit; font-size: 12px; letter-spacing: .34em;
  color: rgba(234, 244, 253, .94);
  background: rgba(196, 224, 248, .05);
  padding: 12px 28px 12px 32px;
  border: .5px solid rgba(196, 224, 248, .30);
  border-radius: 999px;
  opacity: 0; transition: opacity 1.4s ease 1.6s, border-color .4s ease,
    box-shadow .4s ease, color .4s ease, background .4s ease, letter-spacing .4s ease;
  animation: bh-pulse 3.4s ease-in-out infinite 2.2s;
}
.bh-title-wrap.show .bh-enter { opacity: 1; }
.bh-enter:hover {
  border-color: rgba(234, 244, 253, .75);
  box-shadow: 0 0 54px -8px rgba(196, 224, 248, .58), inset 0 0 24px rgba(196, 224, 248, .10);
  color: #fff; letter-spacing: .42em;
  background: rgba(196, 224, 248, .10);
  animation-play-state: paused;
}
@keyframes bh-pulse { 0%, 100% { opacity: .58; } 50% { opacity: 1; } }
.bh-skip {
  display: block; margin: 16px auto 0; pointer-events: auto; cursor: pointer;
  font: inherit; font-size: 10.5px; letter-spacing: .22em;
  color: rgba(233, 239, 245, .30);
  background: none; border: none; padding: 8px 14px;
  opacity: 0; transition: opacity 1.4s ease 2s, color .3s ease;
}
.bh-title-wrap.show .bh-skip { opacity: 1; }
.bh-skip:hover { color: rgba(233, 239, 245, .72); }

/* 坠入时的白光爆闪：跟着 dive 进度起，切到对话视角后从满白里显影 */
#bh-flash {
  position: fixed; inset: 0; z-index: 80; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 46%,
    rgba(244, 250, 255, 1) 0%, rgba(198, 224, 248, .86) 26%,
    rgba(120, 164, 205, .42) 52%, transparent 78%);
}
#bh-flash.go { animation: bh-flashout 1.5s cubic-bezier(.16, .72, .3, 1) forwards; }
@keyframes bh-flashout { 0% { opacity: 0; } 22% { opacity: .74; } 44% { opacity: 1; } 100% { opacity: 1; } }
#bh-flash.reveal { animation: bh-flashreveal 1.5s cubic-bezier(.3, 0, .2, 1) forwards; }
@keyframes bh-flashreveal { 0% { opacity: 1; } 22% { opacity: .92; } 100% { opacity: 0; } }

@media (max-width: 560px) {
  .bh-title { font-size: 34px; letter-spacing: .12em; margin-right: -.12em; }
  .bh-sub { font-size: 8.5px; letter-spacing: .28em; margin-right: -.28em; }
  .bh-tagline { font-size: 12px; letter-spacing: .14em; margin-right: -.14em; }
  .bh-title-wrap { margin-bottom: max(9vh, 44px); }
}
@media (prefers-reduced-motion: reduce) {
  .bh-title-wrap, .bh-sub, .bh-tagline, .bh-enter, .bh-skip { transition-duration: .2s !important; animation: none !important; }
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text); overflow: hidden;
  transition: background .2s, color .2s;
}
#app { display: flex; height: 100vh; height: 100dvh; }

/* ───────── 左侧栏 ───────── */
.sidebar {
  width: var(--sidebar-w); background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: margin-left .28s cubic-bezier(.4, 0, .2, 1);   /* v1.4.96 ④：跟手缓动 */
}
html[data-theme="light"] .sidebar { border-right-color: var(--border); }
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 10px; }
.brand-logo {
  width: 36px; height: 36px; flex-shrink: 0;
  object-fit: contain;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--dim); }
.icon-btn {
  border: none; background: transparent; color: var(--dim); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.lg { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
/* 触控热区：小按钮外观不变，点按范围扩大到约 40px（手机上不再点空） */
.icon-btn, .session-item .s-del, .vs-x { position: relative; }
.icon-btn::after, .session-item .s-del::after, .vs-x::after {
  content: ''; position: absolute; inset: -6px; border-radius: inherit;
}
.vs-x::after { inset: -7px; }

/* 输入框功能按钮：大图标 + 文字标注 */
.cap-btn {
  border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 4px 8px; border-radius: 10px; min-width: 46px;
  color: var(--dim); transition: background .12s, color .12s;
}
.cap-btn .cap-ico { font-size: 19px; line-height: 1.15; }
.cap-btn .cap-txt { font-size: 10.5px; line-height: 1.2; letter-spacing: .5px; }
.cap-btn:hover { background: var(--primary-soft); color: var(--primary); }
.cap-btn.on { background: var(--primary-soft); color: var(--primary); }
.cap-btn.on .cap-txt { font-weight: 600; }
.cap-btn.listening .cap-ico { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }

.new-chat-btn {
  margin: 6px 14px 10px; padding: 10px 14px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--grad); color: var(--on-primary); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow); transition: transform .12s;
}
.new-chat-btn:hover { transform: translateY(-1px); }

.sidebar-nav { padding: 4px 10px; border-bottom: 1px solid var(--border); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  font-size: 14px; color: var(--text); cursor: pointer; margin-bottom: 2px;
  /* v1.4.150：跟随光标的径向渐变已下线，这里只留 hover 底色与左侧引导线 ——
     两者都是静态反馈，不随指针位置重绘。 */
  position: relative;
  transition: background-color .15s ease;
}
.nav-item:hover { background-color: var(--primary-soft); }
/* 引导线：矩形行用左侧竖条比 2px 环更贴形状；hover 时从中间长出来，active 常驻 */
.nav-item::before {
  content: ''; position: absolute; left: 2px; top: 22%; width: 2px; height: 56%;
  border-radius: 2px; background: var(--primary);
  opacity: 0; transform: scaleY(.35);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.nav-item:hover::before { opacity: .5; transform: scaleY(1); }
.nav-item.active::before { opacity: .9; transform: scaleY(1); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* v1.4.200 假期倒计时：导航下常驻一行，无边框、悬停才出底色 —— 它是「信息」不是「入口」，
   所以不给按钮的重量感；点开才是签到与日历。节假日左侧点转暖色，补班日右侧挂角标。 */
.hol-line {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 20px);
  margin: 6px 10px 0; padding: 5px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--dim); font-family: inherit;
  font-size: 11.5px; line-height: 1.4; text-align: left; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.hol-line:hover { background: var(--hover-bg); color: var(--text); }
.hol-line[data-kind="in"] { color: var(--text); }
.hol-dot { width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--border); }
.hol-line[data-kind="in"] .hol-dot { background: var(--warn); }
.hol-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hol-tag {
  margin-left: auto; flex: none; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 10.5px; color: var(--dim); line-height: 16px;
}

.session-header { padding: 14px 16px 6px; font-size: 11px; color: var(--dim); letter-spacing: 1px; }
.session-list { flex: 1; overflow-y: auto; padding: 0 10px; }
.session-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px; margin-bottom: 2px;
  color: var(--text); white-space: nowrap; overflow: hidden;
}
.session-item:hover { background: var(--hover-bg); }
.session-item.active { background: var(--raise); color: var(--text); font-weight: var(--fw-strong); }
/* v1.4.86：任务与视图解耦后，后台还在跑的会话要看得见（文档流式进行中点） */
.session-item.running .s-title::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
  border-radius: 50%; background: var(--primary); vertical-align: 1px;
  animation: runDot 1.4s ease-in-out infinite;
}
@keyframes runDot { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.session-item .s-title { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.session-item .s-del {
  border: none; background: transparent; color: var(--dim); cursor: pointer;
  opacity: 0; border-radius: 6px; width: 22px; height: 22px; flex-shrink: 0;
}
.session-item:hover .s-del { opacity: 1; }
.session-item .s-del:hover { color: var(--text); background: var(--hover-bg); }

.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--border); }
.theme-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 6px;
  border: none; background: transparent; color: var(--text); border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.theme-toggle:hover { background: var(--hover-bg); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad);
  color: var(--on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.user-name { font-size: 13.5px; font-weight: 600; }
.user-plan { font-size: 11px; color: var(--dim); }

/* ───────── 主区 ───────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view { display: none; flex-direction: column; height: 100%; min-width: 0; }
.view.active { display: flex; }
.view-header { padding: 28px 36px 8px; }
.view-header h2 { font-size: 22px; }
.view-header p { color: var(--dim); font-size: 13.5px; margin-top: 6px; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--panel);
  /* v1.4.180：顶栏是首屏里唯一会撑出横向滚动的行 —— 五个图标按钮 + 游客提示
     都是 nowrap。给 flex 容器留出收缩余地，标题先让位（它本来就有省略号）。 */
  min-width: 0; gap: 8px;
}
.chat-title-wrap { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.chat-title { font-weight: 700; font-size: 15.5px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { display: flex; gap: 4px; align-items: center; flex: 0 1 auto; min-width: 0; }
.header-model {
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 9px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; margin-right: 6px;
}

/* 欢迎页 */
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
/* 首屏只有标题时，整块在对话区里垂直居中，画面才不空；高度用视口兜底，避免百分比在某些布局下失效 */
.welcome {
  max-width: 940px; margin: 0 auto; padding: 0 24px 14vh; text-align: center;
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.welcome-inner { width: 100%; }
/* 黑洞已不进问答页，深色欢迎头不再需要暗底护字，深浅共用同一套版式 */
.welcome-rule { width: 46px; height: 1px; background: currentColor; opacity: .16; margin: 24px auto 22px; }
.welcome-sub2 { margin-top: 0; }
.welcome-hint {
  margin-top: 30px; font-size: 11.5px; letter-spacing: .1em; color: var(--dim); opacity: .8;
}
.welcome-logo {
  width: 68px; height: 68px; margin: 0 auto 18px;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .18));
}
.welcome-title { font-size: 25px; margin-bottom: 9px; }
.welcome-sub { color: var(--dim); font-size: 14.5px; margin-bottom: 26px; }

.skill-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-bottom: 28px; }
.skill-nav-item {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  background: var(--primary-soft); border: none; border-radius: 9px;
  font-size: 13px; cursor: pointer; transition: all .15s; color: var(--text);
}
.skill-nav-item:hover { background: var(--hover-bg); color: var(--text); transform: translateY(-1px); }
.skill-nav-item.active { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* 消息 */
.messages { max-width: 820px; margin: 0 auto; padding: 24px 24px 12px; }
.msg { display: flex; gap: 12px; margin-bottom: 26px; animation: fadein .25s ease; }
/* 入场动画只做「淡进来」，起始不取 0：低端机 / 软渲染下 CSS 动画时间轴可能被主线程饿停，
   若从 opacity:0 起步会整块隐形（见账号弹层历史 bug）——起点给 .35 保证永远可见 */
@keyframes fadein { from { opacity: .35; transform: translateY(6px);} to { opacity: 1; transform: none;} }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  background: var(--bg); border: 1px solid var(--border); color: var(--dim);
}
.msg-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
/* v1.4.158：手机尾号这类 3~4 位首字，缩字号才塞得进圆内、不贴边被裁 */
.msg-avatar.sg-av-long { font-size: 11px; letter-spacing: -.2px; }
.avatar.sg-av-long, .user-chip .avatar.sg-av-long { font-size: 10.5px; letter-spacing: -.2px; }
.acct-head .avatar.sg-av-long { font-size: 11.5px; }
.msg.user { flex-direction: row-reverse; }
.msg.user .msg-body { display: flex; flex-direction: column; align-items: flex-end; }
.msg.ai .msg-avatar { padding: 3px; }
.msg-body { flex: 1; min-width: 0; }
.msg.user .msg-content {
  background: var(--user-bubble); color: var(--text); padding: 12px 16px; border-radius: 16px 4px 16px 16px;
  white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.65;
}
.msg.ai .msg-content { padding: 2px 0; font-size: 14.5px; line-height: 1.7; word-break: break-word; }
/* 三点跳动加载 */
.typing-dots { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); opacity: .55; animation: tdot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.msg-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; margin: 0 6px 6px 0; border: 1px solid var(--border); cursor: zoom-in; transition: transform .12s ease, border-color .12s ease; }
.msg-thumb:hover, .md-img:hover, .chip-thumb:hover { transform: translateY(-1px); border-color: var(--text); }

/* 附件缩略图：22px 太小，看不清是哪一页；放大到 34px 并且能点开灯箱 */
.chip-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; flex: 0 0 auto; }

/* 图片灯箱（v1.4.60）*/
.img-lightbox {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .86); backdrop-filter: blur(4px); padding: 48px 56px 64px;
}
.img-lightbox[hidden] { display: none; }
.img-lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;
  background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.il-btn {
  position: absolute; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.il-btn:hover { background: rgba(255, 255, 255, .26); }
.il-close { top: 16px; right: 16px; width: 36px; height: 36px; font-size: 16px; }
.il-prev, .il-next { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 26px; line-height: 1; }
.il-prev { left: 12px; }
.il-next { right: 12px; }
.il-cap {
  position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: rgba(255, 255, 255, .82);
  font-size: 13px; padding: 0 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.lb-open { overflow: hidden; }

/* v1.4.135：ctx-usage / cost-est 已随元素移除（token 用量不再显示，实际消耗看回答后的 stream-meta） */
@media (max-width: 720px) {
  .il-prev, .il-next { width: 38px; height: 38px; font-size: 22px; }
}
.msg-file-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; border-radius: 8px; padding: 4px 10px; margin: 0 6px 6px 0; text-decoration: none;
}
.msg-file-chip.src-more { cursor: pointer; background: transparent; border: 1px dashed var(--border); color: var(--dim); font-family: inherit; }

/* markdown */
.md h1,.md h2,.md h3,.md h4 { margin: 14px 0 8px; line-height: 1.4; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15.5px; }
.md p { margin: 8px 0; }
.md ul,.md ol { margin: 8px 0; padding-left: 24px; }
.md li { margin: 4px 0; }
.md code {
  background: var(--code-bg); color: var(--code-text); padding: 2px 6px; border-radius: 6px; font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
}
.md pre {
  background: var(--pre-bg); color: var(--pre-text); border-radius: 12px; padding: 14px 16px; overflow-x: auto;
  margin: 10px 0; position: relative; font-size: 13px; line-height: 1.6;
}
.md pre code { background: transparent; color: inherit; padding: 0; }
.md blockquote { border-left: 3px solid var(--primary); background: var(--primary-soft); padding: 8px 14px; border-radius: 0 10px 10px 0; margin: 10px 0; }
.md table { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: 13.5px; }
.md th,.md td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.md th { background: var(--hover-bg); font-weight: 600; }
.md a { color: var(--primary); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.copy-code-btn {
  position: absolute; top: 8px; right: 8px; border: none; background: rgba(255,255,255,.14); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.md pre:hover .copy-code-btn { opacity: 1; }

/* 思维链：极弱化——无边框无底色，只有一行灰色小字，默认折叠 */
.thinking-block {
  margin: 0 0 8px; padding: 0; border: none; background: none;
  font-size: 12px; color: var(--dim);
}
.thinking-block summary {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; list-style: none; user-select: none;
  color: var(--dim); font-weight: 400; font-size: 12px;
  opacity: .68; transition: opacity .15s; padding: 1px 0;
}
.thinking-block summary:hover { opacity: 1; }
.thinking-block summary::-webkit-details-marker,
.thinking-block summary::marker { display: none; content: ''; }
.thinking-block summary::before {
  content: ''; width: 0; height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent;
  transition: transform .15s;
}
.thinking-block[open] summary::before { transform: rotate(90deg); }
.thinking-content {
  white-space: pre-wrap; margin: 5px 0 2px 2px; padding-left: 10px;
  border-left: 1px solid var(--think-border);
  line-height: 1.65; max-height: 260px; overflow-y: auto;
  color: var(--dim); font-size: 12px; opacity: .85;
}

/* Agent 工具状态 */
.tool-status {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--primary);
  background: var(--primary-soft); border-radius: 10px; padding: 8px 13px; margin-bottom: 10px;
}

/* 任务清单（update_plan） */
.plan-block {
  margin: 0 0 10px; padding: 10px 14px 8px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); font-size: 12.5px; max-width: 420px;
}
.plan-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 12px; letter-spacing: .4px; }
.plan-prog { color: var(--dim); font-weight: 400; font-size: 11.5px; }
.plan-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-item { display: flex; align-items: center; gap: 8px; color: var(--dim); line-height: 1.4; }
.plan-item.doing { color: var(--text); font-weight: 500; }
.plan-item.done { opacity: .75; }
.plan-item .pi {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); font-size: 10px; font-style: normal; color: var(--dim);
}
.plan-item.done .pi { background: var(--primary); border-color: var(--primary); color: var(--panel); font-weight: 700; }
.plan-item.doing .pi { border: 2px solid var(--primary); border-top-color: transparent; animation: spin .8s linear infinite; }
.tool-status .spin {
  width: 13px; height: 13px; border: 2px solid var(--primary); border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0;
}
.tool-status.done { color: var(--dim); background: var(--hover-bg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* 消息操作按钮 */
/* 对齐主流交互：第一行 复制/重新生成/继续生成/朗读，第二行 👍👎 */
.msg-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; opacity: 0; transition: opacity .15s; }
.actions-row { display: flex; align-items: center; gap: 16px; }
.fb-row { gap: 10px; margin-top: 2px; }
.msg:hover .msg-actions { opacity: 1; }
/* 触屏设备没有 hover：操作条常显，否则复制/重生成/朗读在手机上完全不可达 */
@media (hover: none) {
  .msg-actions { opacity: 1; }
  /* 手机窄屏：收紧间距/内边距，让 复制/重新生成/继续生成/朗读 稳定一行放下 */
  .actions-row { flex-wrap: wrap; gap: 6px; row-gap: 4px; }
  .msg-actions button { padding: 6px 6px; white-space: nowrap; gap: 4px; }
  .msg-actions button svg { width: 14px; height: 14px; }
  .fb-row { gap: 4px; }
  /* 桌宠在手机端默认隐藏（见 app.js 自动档），不再压住消息区；保留兜底间距 */
  .messages { padding-bottom: 92px; }
}
/* 点过（聚焦）的消息也保持可见，方便键盘/触屏混合设备 */
.msg:focus-within .msg-actions { opacity: 1; }
.msg-actions button {
  border: none; background: transparent; color: var(--dim); font-size: 13px; cursor: pointer;
  padding: 3px 6px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 5px;
}
.msg-actions button svg { width: 15px; height: 15px; flex: none; display: block; }
.fb-row button { font-size: 13px; padding: 3px 5px; gap: 0; }
.fb-row button svg { width: 16px; height: 16px; }
.msg-actions button:hover { background: var(--primary-soft); color: var(--primary); }
.msg-actions button.on { background: var(--primary-soft); color: var(--primary); }

.cursor-blink { display: inline-block; width: 7px; height: 16px; background: var(--primary); border-radius: 2px; vertical-align: -3px; animation: blink .9s infinite; }
/* v1.4.100 流式增量渲染容器：稳定前缀 .md-stable / 活跃尾部 .md-live，纯透传层不引入间距 */
.md-stable, .md-live { display: block; }
@keyframes blink { 50% { opacity: 0; } }

/* 输入区 */
.composer-zone { padding: 8px 24px 14px; max-width: 868px; margin: 0 auto; width: 100%; }
.attached-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.attached-files:empty { margin: 0; }
.file-chip {
  display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 11px; font-size: 12.5px; box-shadow: var(--shadow);
}
.file-chip button { border: none; background: transparent; cursor: pointer; color: var(--dim); font-size: 13px; }
.file-chip button:hover { color: var(--danger); }
/* 带缩略图的附件：左侧贴边，别让 34px 的图显得悬空 */
.file-chip:has(.chip-thumb) { padding: 4px 10px 4px 4px; }
.active-skill-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px;
  background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 600;
  border-radius: 999px; padding: 5px 12px;
}
.active-skill-chip button { border: none; background: transparent; color: var(--primary); cursor: pointer; font-size: 14px; }
.composer {
  display: flex; align-items: flex-end; gap: 8px; background: var(--panel);
  border: 1px solid transparent; border-radius: 18px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: box-shadow .18s ease;
}
.composer:focus-within { border-color: transparent; box-shadow: var(--focus-ring); }
.composer-actions { display: flex; gap: 4px; padding-bottom: 4px; align-items: flex-end; }
/* AI 生成图片 */
.md-img {
  display: block; max-width: min(420px, 100%); max-height: 420px;
  border-radius: 12px; margin-top: 8px; border: 1px solid var(--border);
  box-shadow: var(--shadow); cursor: zoom-in;
}
/* AI 生成视频 / 语音 */
.md-video-box {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--panel); max-width: min(520px, 100%);
}
.md-video { display: block; width: 100%; max-height: 340px; background: #000; }
.md-media-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; font-size: 12px; color: var(--dim);
}
.md-media-foot a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.md-media-foot a:hover { border-color: var(--text); }
.md-audio-box {
  display: flex; flex-direction: column; gap: 6px; margin-top: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); max-width: min(420px, 100%);
}
.md-audio-label { font-size: 12px; color: var(--dim); }
.md-audio-box audio { width: 100%; height: 34px; }
/* 历史压缩分隔条 */
.ctx-divider { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.ctx-divider-btn {
  align-self: center; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px dashed var(--border); color: var(--dim);
  font-size: 11.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: color .15s ease, border-color .15s ease;
}
.ctx-divider-btn:hover, .ctx-divider-btn.open { color: var(--text); border-color: var(--text); }
.ctx-ico { font-size: 12px; }
.ctx-summary {
  max-height: 240px; overflow: auto; white-space: pre-wrap;
  font-size: 12.5px; line-height: 1.6; color: var(--dim);
  background: var(--think-bg); border: 1px solid var(--think-border);
  border-radius: 10px; padding: 10px 14px; margin: 0 32px;
}
.setting-select {
  flex: 1; max-width: 220px; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text);
  font-family: inherit;
}
/* v1.4.67：富文本输入框。文字与附件 chip 同处一行，chip 可以夹在两句话中间 */
#chat-input {
  flex: 1; border: none; outline: none; font-size: 14.5px; line-height: 1.55;
  font-family: inherit; max-height: 180px; min-height: 32px; background: transparent;
  color: var(--text); padding: 6px 2px; overflow-y: auto; overflow-x: hidden;
  white-space: pre-wrap; word-break: break-word; cursor: text; box-sizing: border-box;
}
#chat-input:empty::before {
  content: attr(placeholder); color: var(--dim); pointer-events: none; opacity: .75;
}
#chat-input:focus::before { opacity: .55; }

/* 内联附件块：contenteditable=false，整体作为一个不可分割的字符单位 */
.inline-att {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  max-width: 260px; padding: 2px 5px 2px 7px; margin: 0 2px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--primary-soft); color: var(--text);
  font-size: 12.5px; line-height: 1.7; white-space: nowrap;
  user-select: none; -webkit-user-select: none; cursor: default;
}
.inline-att.dir { border-color: var(--primary); background: var(--panel); }
.inline-att .ia-ico { font-size: 13px; line-height: 1; flex-shrink: 0; }
.inline-att .ia-thumb {
  width: 20px; height: 20px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}
.inline-att .ia-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.inline-att .ia-count {
  flex-shrink: 0; color: var(--dim); font-size: 11px; padding-left: 3px;
}
.inline-att .ia-x {
  border: none; background: transparent; color: var(--dim); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 2px 3px; border-radius: 4px; flex-shrink: 0;
}
.inline-att .ia-x:hover { color: var(--danger); background: var(--hover-bg); }

/* ---------- 计划模式操作条（v1.4.69） ---------- */
.plan-actions { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.plan-actions .plan-go { padding: 7px 16px; font-size: 13px; border-radius: 9px; }
.plan-actions .ghost-btn { padding: 7px 14px; font-size: 13px; border-radius: 9px; }

/* ---------- 角色卡（v1.4.69） ---------- */
.panel-skill-item.card-add { color: var(--accent, #7c8cff); font-weight: 600; }
.panel-skill-item .card-edit { margin-left: auto; opacity: 0; cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.panel-skill-item:hover .card-edit { opacity: .7; }
.panel-skill-item .card-edit:hover { opacity: 1; background: var(--hover-bg); }
.card-row { display: flex; gap: 10px; }
.card-tools-head { font-size: 12.5px; color: var(--dim); margin: 12px 0 6px; }
.card-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; max-height: 180px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.card-tool-item { font-size: 12px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- MCP OAuth 授权行（v1.4.69） ---------- */
.mcp-auth { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--gold, #f5c069); }
.mcp-auth .small-btn { padding: 3px 10px; font-size: 12px; border-radius: 6px; }

/* ── AI 生成内容标识（v1.4.68 · 合规） ── */
.ai-gen-wrap { position: relative; display: inline-block; }
.ai-gen-badge {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; line-height: 1.6; color: #fff; background: rgba(20, 22, 28, 0.72);
  pointer-events: none; letter-spacing: 0.5px;
}

/* ── HTML 产物对话内预览（v1.4.68） ── */
.html-preview-mask {
  position: fixed; inset: 0; z-index: 900; background: rgba(8, 10, 14, 0.72);
  display: none; align-items: center; justify-content: center; padding: 28px;
}
.html-preview-mask.show { display: flex; }
.html-preview-box {
  width: min(1100px, 96vw); height: min(760px, 92vh); display: flex; flex-direction: column;
  background: var(--bg, #12141a); border: 1px solid var(--line, #2a2e3a); border-radius: 14px; overflow: hidden;
}
.html-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line, #2a2e3a); font-size: 13px; color: var(--dim);
}
.html-preview-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.html-preview-frame { flex: 1; border: none; background: #fff; }

/* ── v1.4.110 ①：产物行内预览 ───────────────────────────────────
   一套弹层通吃：图片 / PDF / 音视频 / 文本 / Office 内容速览。
   层次比 HTML 预览再高一层（z 940），避免被旧弹层压住。 */
body.fp-lock { overflow: hidden; }
.fp-mask {
  /* 比命令面板(1500)/运行面板(1450)/离线条(950)都高，低于顶部进度条(9999) */
  position: fixed; inset: 0; z-index: 1600; background: rgba(8, 10, 14, .74);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.fp-mask.show { display: flex; animation: fadeIn .12s ease; }
.fp-box {
  width: min(1120px, 96vw); height: min(800px, 92vh); display: flex; flex-direction: column;
  background: var(--panel, #fff); color: var(--text, #111);
  border: 1px solid var(--border, #d9d9d9); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}
.fp-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--border, #d9d9d9); font-size: 13px; min-height: 48px;
}
.fp-kind {
  flex-shrink: 0; font-size: 10.5px; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px;
  background: var(--primary-soft, #f0f0f0); color: var(--dim, #767676); border: 1px solid var(--border, #d9d9d9);
}
.fp-name { font-weight: 600; max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-meta { font-size: 11.5px; color: var(--dim, #767676); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.fp-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.fp-tabs {
  display: flex; gap: 6px; padding: 7px 12px; overflow-x: auto; border-bottom: 1px solid var(--border, #d9d9d9);
  background: var(--think-bg, #fafafa);
}
.fp-tab {
  flex-shrink: 0; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border, #d9d9d9); background: transparent; color: var(--dim, #767676);
  font-family: inherit;
}
.fp-tab.on { background: var(--primary, #000); color: var(--on-primary, #fff); border-color: var(--primary, #000); }
.fp-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg, #fff); }
.fp-body-frame { overflow: hidden; background: #fff; }
.fp-frame { width: 100%; height: 100%; border: none; display: block; }
.fp-body-media { display: flex; align-items: center; justify-content: center; padding: 14px; background: var(--code-bg, #f2f2f2); }
.fp-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.fp-video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.fp-audio { width: min(560px, 92%); }
.fp-body-doc { padding: 18px 22px 26px; background: var(--panel, #fff); }
.fp-body-pdf { padding: 14px; background: var(--code-bg, #f2f2f2); }
.fp-pdf { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fp-pdf-page {
  max-width: 100%; height: auto; background: #fff; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16), 0 6px 18px rgba(0, 0, 0, .10);
}
.fp-doc { font-size: 14px; line-height: 1.75; max-width: 900px; }
.fp-doc p { margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; }
.fp-md-h { font-size: 15.5px; margin: 16px 0 8px; }
.fp-cap {
  margin: 14px 0 8px; font-size: 11.5px; letter-spacing: .04em; color: var(--dim, #767676);
  border-left: 3px solid var(--primary, #000); padding-left: 8px;
}
.fp-md-li { padding-left: 6px; margin: 3px 0; }
.fp-md-q { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--border, #d9d9d9); color: var(--dim, #767676); }
.fp-doc code, .fp-md-table code { background: var(--code-bg, #f2f2f2); padding: 1px 4px; border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }
.fp-code {
  background: var(--pre-bg, #0b0b0b); color: var(--pre-text, #ededed); padding: 12px 14px;
  border-radius: 8px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; margin: 10px 0;
}
.fp-pre {
  margin: 0; padding: 16px 18px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word; color: var(--text, #111); background: var(--bg, #fff);
}
.fp-md-table, .fp-sheet { border-collapse: collapse; font-size: 13px; width: 100%; }
.fp-md-table { margin: 10px 0; }
.fp-md-table th, .fp-md-table td, .fp-sheet th, .fp-sheet td {
  border: 1px solid var(--border, #d9d9d9); padding: 6px 9px; text-align: left; vertical-align: top;
}
.fp-md-table th, .fp-sheet th { background: var(--think-bg, #fafafa); font-weight: 600; }
.fp-sheet-wrap { overflow: auto; max-width: 100%; }
.fp-sheet { font-size: 12.5px; }
.fp-sheet th, .fp-sheet td { white-space: nowrap; }
.fp-sheet .fp-rn { color: var(--dim, #767676); text-align: right; background: var(--think-bg, #fafafa); font-variant-numeric: tabular-nums; }
.fp-doc-img { max-width: 100%; border-radius: 8px; margin: 10px 0; border: 1px solid var(--border, #d9d9d9); }
.fp-note { color: var(--dim, #767676); font-size: 12.5px; }
.fp-foot {
  padding: 7px 14px; border-top: 1px solid var(--border, #d9d9d9); font-size: 11.5px;
  color: var(--dim, #767676); background: var(--think-bg, #fafafa); line-height: 1.5;
}
.fp-loading { display: flex; align-items: center; gap: 9px; padding: 26px 20px; color: var(--dim, #767676); font-size: 13px; }
.fp-loading i {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border, #d9d9d9);
  border-top-color: var(--primary, #000); animation: spin .8s linear infinite;
}
.fp-nope { margin: 40px auto; max-width: 480px; text-align: center; padding: 0 20px; }
.fp-nope b { display: block; font-size: 14px; margin-bottom: 6px; }
.fp-nope p { color: var(--dim, #767676); font-size: 12.5px; line-height: 1.7; margin: 0 0 14px; }
/* 产物行里名字可点：让人知道「这儿能点开看」 */
.file-name.file-open { cursor: pointer; }
.file-name.file-open:hover { text-decoration: underline; text-underline-offset: 2px; }
/* 预览不了的格式按钮置灰——比藏起来更好，用户能看到「这里本来可以点」 */
.ghost-btn:disabled { opacity: .42; cursor: not-allowed; }
@media (max-width: 560px) {
  .fp-mask { padding: 0; }
  .fp-box { width: 100%; height: 100%; border-radius: 0; border: none; }
  .fp-head { flex-wrap: wrap; min-height: 0; padding: 8px 10px; }
  .fp-name { max-width: 100%; order: 2; flex: 1 1 100%; font-size: 13px; }
  .fp-kind { order: 1; }
  .fp-meta { order: 3; flex: 1 1 100%; }
  .fp-acts { order: 4; flex: 1 1 100%; justify-content: flex-end; }
  .fp-acts .ghost-btn { padding: 4px 8px; font-size: 12px; }
  .fp-body-doc { padding: 12px 12px 20px; }
  .fp-doc { font-size: 13.5px; }
}

/* ── 积分明细（v1.4.68） ── */
.usage-list { max-height: 260px; overflow-y: auto; margin: 8px 0; }
.usage-row { display: flex; gap: 10px; align-items: baseline; padding: 5px 2px; border-bottom: 1px dashed var(--line, #2a2e3a); font-size: 12.5px; }
.usage-ts { color: var(--dim); flex: 0 0 64px; }
.usage-amt { flex: 0 0 52px; text-align: right; font-variant-numeric: tabular-nums; }
.usage-plus { color: #6fce8b; }
.usage-minus { color: #e88a8a; }
.usage-note { color: var(--text); opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 点文件夹 chip 展开的夹内清单：只展示登记到的文件名与类型，不做任何读取 */
.dir-peek {
  position: fixed; z-index: 9200; max-height: min(420px, 60vh); overflow-y: auto;
  box-sizing: border-box; padding: 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18); font-size: 12.5px;
}
.dir-peek .dp-head {
  font-weight: 600; padding: 4px 6px 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px; line-height: 1.5;
}
.dir-peek .dp-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.dir-peek .dp-row:hover { background: var(--hover-bg); border-radius: 6px; }
.dir-peek .dp-ico { flex-shrink: 0; font-size: 13px; }
.dir-peek .dp-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dir-peek .dp-kind { flex-shrink: 0; color: var(--dim); font-size: 11px; }
.dir-peek .dp-more, .dir-peek .dp-foot {
  color: var(--dim); font-size: 11px; padding: 6px; line-height: 1.5;
}
.dir-peek .dp-foot { border-top: 1px solid var(--border); margin-top: 4px; }
.send-btn {
  width: 34px; height: 34px; border: 1px solid rgba(127,127,127,.35); border-radius: 50%; cursor: pointer; flex-shrink: 0;
  background: #1b1b1b; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center; transition: transform .12s, opacity .15s;
}
.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.send-btn.stop { background: var(--danger); }
.composer-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap; row-gap: 3px;               /* 中等宽度下整段换行，不要半句断开 */
  font-size: 11px; color: var(--dim); margin-top: 8px; position: relative;
}
.composer-hint > span { white-space: nowrap; }
#btn-think-toggle.on, #btn-agent-toggle.on { background: var(--primary-soft); color: var(--primary); }
/* 消耗提示：流式中与完成后的「已消耗 X 积分」（stream-meta 保留；预估 cost-est 已随元素移除） */
.stream-meta {
  margin-top: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .4px;
  color: var(--dim); opacity: .75; animation: fadeIn .3s ease;
}
.msg-meta {
  margin-top: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .4px;
  color: var(--dim); opacity: .85;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════ v1.4.106 ②：自动档成本可见性（回答下方一行） ═══════════ */
.route-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 12px; line-height: 1.5; color: var(--dim); max-width: 100%;
}
.route-note.cheap { border-style: dashed; }
.rn-tag {
  flex: 0 0 auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px;
  padding: 1px 5px; border-radius: 4px; color: var(--on-primary); background: var(--primary);
}
.rn-text { flex: 1 1 auto; min-width: 0; color: var(--dim); }
.rn-text b { color: var(--text); font-weight: 600; }
.rn-why { margin-left: 6px; opacity: .8; }
.rn-btn {
  flex: 0 0 auto; border: 1px solid var(--border); background: transparent; color: var(--primary);
  font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.rn-btn:hover:not(:disabled) { background: var(--hover-bg); }
.rn-btn:disabled { color: var(--dim); border-style: dashed; cursor: default; }

/* v1.4.107 ④：从托盘「新回复」跳过来的那条消息，闪两下让人看见 */
@keyframes msgFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  45% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 36%, transparent); }
}
#messages .msg.msg-flash { border-radius: 10px; animation: msgFlash 1.05s ease-out 2; }

/* v1.4.108 ④：删除会话前的「连带产物」核对弹层 */
.del-lead { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.del-lead b { color: var(--text); }
.del-note { margin: 0 0 12px; font-size: 12px; line-height: 1.6; color: var(--dim); }
.del-keep {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 10px; margin-bottom: 4px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none;
}
.del-keep input { accent-color: var(--primary); margin: 0; }
/* 弹层内的按钮排（acctModal 的 modal-body 里没有 modal-foot，别硬套那个带分隔线的） */
.del-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.del-acts .ghost-btn, .del-acts .primary-btn { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
/* 危险主按钮：primary-btn 在文件更后面定义，单类会被覆盖，这里抬一级特异性 */
.primary-btn.warn-btn {
  border: 1px solid color-mix(in srgb, var(--danger) 46%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}
.primary-btn.warn-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 24%, transparent); }
.primary-btn.warn-btn:disabled { opacity: .6; cursor: default; }

/* v1.4.107 ②：成本行展开明细（打分明细 + 封顶原因） */
.rn-more {
  flex: 0 0 auto; border: 1px solid var(--border); background: transparent; color: var(--dim);
  font-size: 11px; padding: 2px 7px; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.rn-more:hover { color: var(--text); background: var(--hover-bg); }
.rn-detail {
  flex: 1 0 100%; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.rn-detail[hidden] { display: none !important; }
.rn-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.rn-d {
  font-size: 11px; padding: 1px 7px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--dim); background: transparent;
}
.rn-d.hit {
  color: var(--primary); font-weight: 600;
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.rn-sum { margin-top: 5px; font-size: 11.5px; color: var(--dim); line-height: 1.55; }
.rn-sum b { color: var(--text); }
.rn-cap { color: var(--warn, #b8760f); }

/* ───────── 技能中心 ───────── */
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; padding: 18px 28px 40px; overflow-y: auto; flex: 1;
  align-content: start; align-items: stretch;
}
.skill-section-title {
  grid-column: 1 / -1; font-weight: 700; font-size: 15px; color: var(--text);
  padding: 10px 2px 0;
}
.skill-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; cursor: pointer; transition: all .15s; position: relative;
  display: flex; flex-direction: column;
}
.skill-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.skill-card.active { border-color: var(--primary); background: var(--primary-soft); }
.skill-card .sk-icon { font-size: 26px; margin-bottom: 8px; line-height: 1; }
.skill-card .sk-name { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.skill-card .sk-desc {
  font-size: 12px; color: var(--dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.skill-card .sk-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 10px; }
.skill-card .sk-tags span {
  font-size: 10.5px; color: var(--dim); background: var(--bg);
  border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.skill-card.active .sk-tags span { background: var(--panel); }
.skill-card .sk-badge {
  position: absolute; top: 12px; right: 12px; font-size: 10.5px; background: var(--primary);
  color: var(--on-primary); padding: 2px 8px; border-radius: 999px; display: none;
}
.skill-card.active .sk-badge { display: block; }
.skill-card .sk-dl { font-size: 11px; color: var(--dim); margin-top: 8px; }
.skill-card.connector { opacity: .8; cursor: default; }
.skill-card.connector:hover { border-color: var(--border); transform: none; box-shadow: none; }
.skill-empty { grid-column: 1 / -1; text-align: center; color: var(--dim); font-size: 13.5px; padding: 40px 0; }

/* ── 技能中心顶栏（主流版式） ── */
.sk-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px 4px; gap: 16px;
}
.sk-tabs { display: flex; gap: 4px; }
.sk-tab {
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--dim); transition: all .15s;
}
.sk-tab:hover { color: var(--primary); background: var(--primary-soft); }
.sk-tab.active { color: var(--primary); background: var(--primary-soft); }
.sk-search {
  flex: 0 1 260px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; outline: none;
}
.sk-search:focus { border-color: var(--primary); }

/* 分类横幅 */
.cat-banners {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  padding: 12px 28px 4px;
}
@media (max-width: 1100px) { .cat-banners { grid-template-columns: repeat(3, 1fr); } }
.cat-banner {
  border-radius: 12px; padding: 12px 14px; cursor: pointer; min-height: 108px;
  border: 1px solid var(--border); transition: all .15s;
}
.cat-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cb-label { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.cb-item { font-size: 11.5px; color: var(--dim); padding: 2.5px 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-item:hover { color: var(--primary); }
/* 技能中心横幅：中性统一（灰系底 + 橙色分类标记） */
.bn-green, .bn-orange, .bn-blue, .bn-purple, .bn-teal, .bn-cyan {
  background: linear-gradient(135deg, #f3f3f1, #ebebe8);
}
[data-theme="dark"] .bn-green,
[data-theme="dark"] .bn-orange,
[data-theme="dark"] .bn-blue,
[data-theme="dark"] .bn-purple,
[data-theme="dark"] .bn-teal,
[data-theme="dark"] .bn-cyan { background: linear-gradient(135deg, #1e1e1c, #171715); }
.cb-label { display: flex; align-items: center; gap: 7px; }
.cb-label::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}

/* 分类筛选 chips */
.cat-chips {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  padding: 12px 28px 0;
}
.cat-chip {
  font-size: 12px; padding: 5px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); color: var(--dim); background: var(--panel); transition: all .12s;
}
.cat-chip:hover { color: var(--primary); border-color: var(--primary); }
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }

/* ───────── 知识库 ───────── */
.kb-toolbar { display: flex; align-items: center; gap: 14px; padding: 16px 36px; }
.kb-count { color: var(--dim); font-size: 13px; }
/* v1.4.164：知识库归属标签 —— 让人一眼确认「这份库是谁的」，而不是猜为什么换账号还在 */
.kb-owner {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  color: var(--dim); background: var(--hover-bg); border: 1px solid var(--border);
  white-space: nowrap;
}
.kb-owner[hidden] { display: none !important; }
.kb-owner::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); opacity: .75; }
.primary-btn {
  border: none; background: var(--primary); color: var(--on-primary); padding: 9px 18px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.primary-btn:hover { background: var(--primary-dark); }
.ghost-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 8px 16px;
  border-radius: 10px; cursor: pointer; font-size: 13px;
}
.ghost-btn:hover { border-color: var(--primary); color: var(--primary); }
.ghost-btn.danger { color: var(--danger); }
.ghost-btn.danger:hover { border-color: var(--danger); background: rgba(229,72,77,.08); }
.ghost-btn.current { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.kb-list { padding: 0 36px 40px; overflow-y: auto; flex: 1; }
.kb-item {
  display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 16px; margin-bottom: 10px;
}
.kb-item .kb-icon { font-size: 20px; }
.kb-item .kb-name { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-item .kb-meta { color: var(--dim); font-size: 12px; }
.kb-empty { text-align: center; color: var(--dim); padding: 60px 0; font-size: 14px; }

/* ══════════ v1.4.165：知识库多选 / 清空 / 云同步状态 ══════════
 * 全部走主题变量：深色与四套皮肤下都不需要额外覆盖，
 * 状态色只用 primary（正常）与 danger（失败），不做第三种「警告黄」。 */
.kb-toolbar .ghost-btn.small-btn { padding: 6px 12px; font-size: 12.5px; }
.kb-toolbar .ghost-btn:disabled { opacity: .45; cursor: not-allowed; }
.kb-toolbar .ghost-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.kb-sync {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--dim); white-space: nowrap; cursor: default;
}
.kb-sync[hidden] { display: none !important; }
.kb-sync::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); opacity: .7; }
.kb-sync.is-ok::before { background: var(--primary); opacity: 1; }
.kb-sync.is-busy::before { background: var(--primary); opacity: .45; }
.kb-sync.is-err { color: var(--danger); cursor: pointer; }
.kb-sync.is-err::before { background: var(--danger); opacity: 1; }
.kb-sync.is-local { cursor: pointer; }
.kb-owner { margin-left: 10px; }
.kb-batchbar {
  display: flex; align-items: center; gap: 12px; margin: 0 36px 10px; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--hover-bg);
  font-size: 12.5px; color: var(--dim);
}
.kb-batchbar[hidden] { display: none !important; }
.kb-batchbar .kb-sel-all { display: inline-flex; align-items: center; gap: 6px; color: var(--text); cursor: pointer; }
.kb-batchbar input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.kb-batch-spacer { flex: 1; }
.kb-check { display: inline-flex; align-items: center; }
.kb-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.kb-list.picking .kb-item { cursor: pointer; }
.kb-item.is-sel { border-color: var(--primary); background: var(--primary-soft); }
.kb-item .kb-ops { margin-left: auto; display: flex; gap: 6px; }

/* ══════════ v1.4.165：资料库最近删除 ══════════ */
.lib-trash-btn.has-items { border-color: var(--primary); color: var(--primary); }
.lib-trash-btn.open { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.lib-trash-panel {
  margin: 0 36px 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); overflow: hidden;
}
.lib-trash-panel[hidden] { display: none !important; }
.lt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lt-head b { font-size: 13.5px; }
.lt-head span { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.lt-head-ops { display: flex; align-items: center; gap: 8px; }
.lt-list { max-height: 260px; overflow-y: auto; }
.lt-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--border); }
.lt-item:first-child { border-top: none; }
.lt-item .kb-name { flex: 1; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-item .kb-meta { color: var(--dim); font-size: 12px; white-space: nowrap; }
.lt-ops { display: flex; gap: 6px; }
.lt-ops .ghost-btn { padding: 5px 10px; font-size: 12px; }
.lt-empty { padding: 26px 16px; text-align: center; color: var(--dim); font-size: 13px; }

/* ══════════ v1.4.166：知识库分组条 / 文件预览 ══════════ */
.kb-groupbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 36px 10px; min-height: 30px;
}
.kb-groupbar[hidden], .kb-groupbar .kg-chips[hidden] { display: none !important; }
.kg-label { color: var(--dim); font-size: 12px; white-space: nowrap; }
.kg-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kg-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
  color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.kg-chip:hover { border-color: var(--primary); }
.kg-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.kg-chip .kg-n { color: var(--dim); font-size: 11px; font-weight: 400; }
.kg-chip.on .kg-n { color: var(--primary); opacity: .75; }
/* 关掉的分组不进上下文： chip 右侧那个小眼睛是开关，点 chip 主体只切筛选 */
.kg-eye {
  border: none; background: transparent; color: var(--dim); cursor: pointer;
  font-size: 12px; line-height: 1; padding: 2px 1px; margin-left: 1px;
}
.kg-eye:hover { color: var(--primary); }
.kg-chip.is-off { opacity: .55; }
.kg-chip.is-off .kg-name { text-decoration: line-through; }
.ghost-btn.tiny-btn { padding: 4px 9px; font-size: 12px; border-radius: 999px; }
.kg-spacer { flex: 1; }
.kg-hint { color: var(--dim); font-size: 11.5px; white-space: nowrap; }
.kb-move-sel, .setting-input.kb-move-sel {
  font-family: inherit; font-size: 12px; color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 9px; padding: 6px 9px; outline: none; cursor: pointer;
}
.kb-move-sel:disabled { opacity: .45; cursor: not-allowed; }
.kb-item { cursor: pointer; }
.kb-item .kb-name:hover { color: var(--primary); }
.kb-item .kb-group-tag {
  flex: none; font-size: 11px; color: var(--dim); border: 1px solid var(--border);
  background: var(--hover-bg); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.kb-item.is-muted { opacity: .55; }
.kb-item.is-muted .kb-name { text-decoration: line-through; }
.kb-preview { max-width: 620px; }
.kb-preview .modal-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.kb-pv-meta { color: var(--dim); font-size: 12.5px; line-height: 1.7; }
.kb-pv-group { display: flex; align-items: center; gap: 10px; }
.kb-pv-group label { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.kb-pv-group select { max-width: 260px; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; }
.kb-pv-text {
  margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg); color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  max-height: 46vh; overflow-y: auto; user-select: text;
}
.kb-pv-note {
  font-size: 12px; color: var(--dim); background: var(--hover-bg);
  border-radius: 9px; padding: 8px 11px; line-height: 1.6;
}
.kb-pv-note[hidden] { display: none !important; }

/* ══════════ v1.4.166：统一回收站 ══════════ */
.view-trash { overflow-y: auto; }
.ut-tabs {
  display: flex; align-items: center; gap: 8px; padding: 12px 36px 4px;
  border-bottom: 1px solid var(--border);
}
.ut-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px;
  border: 1px solid transparent; border-bottom: none; border-radius: 10px 10px 0 0;
  background: transparent; color: var(--dim); font-size: 13.5px; cursor: pointer;
}
.ut-tab:hover { color: var(--primary); }
.ut-tab.on { border-color: var(--border); background: var(--panel); color: var(--primary); font-weight: 600; }
.ut-tab b {
  font-size: 11px; font-weight: 600; min-width: 18px; text-align: center;
  border-radius: 999px; padding: 1px 6px; background: var(--hover-bg); color: var(--dim);
}
.ut-tab.on b { background: var(--primary-soft); color: var(--primary); }
.ut-tabs-spacer { flex: 1; }
.ut-retention { color: var(--dim); font-size: 12px; padding-right: 4px; }
.ut-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 36px 10px;
}
.ut-toolbar .ghost-btn, .ut-toolbar .primary-btn { padding: 6px 12px; font-size: 12.5px; }
.ut-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.ut-sel-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.ut-sel-all input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.ut-sel-n { color: var(--dim); font-size: 12px; }
.ut-alert {
  margin: 4px 36px 10px; padding: 10px 14px; border-radius: 10px;
  background: var(--hover-bg); border: 1px solid var(--border);
  color: var(--text); font-size: 12.5px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ut-alert[hidden] { display: none !important; }
.ut-alert b { color: var(--danger); }
.ut-alert .ghost-btn { padding: 5px 11px; font-size: 12px; }
.ut-list { padding: 4px 36px 40px; flex: 1; min-height: 0; }
.ut-item {
  display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 9px;
}
.ut-item.is-picked { border-color: var(--primary); background: var(--primary-soft); }
.ut-item > input.ut-pick { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex: none; }
.ut-item .ut-ico { font-size: 18px; flex: none; }
.ut-item .ut-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ut-item .ut-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-item .ut-meta { color: var(--dim); font-size: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ut-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--hover-bg); color: var(--dim); }
.ut-badge.warn { background: var(--primary-soft); color: var(--danger); font-weight: 600; }
.ut-item .ut-left { white-space: nowrap; }
.ut-item .ut-left.warn { color: var(--danger); font-weight: 600; }
.ut-item .ut-ops { display: flex; gap: 6px; flex: none; }
.ut-item .ut-ops .ghost-btn { padding: 5px 10px; font-size: 12px; }
.ut-empty { text-align: center; color: var(--dim); padding: 60px 0; font-size: 14px; line-height: 1.9; }
.ut-empty small { display: block; font-size: 12px; opacity: .8; }
@media (max-width: 760px) {
  .ut-tabs, .ut-toolbar { padding-left: 16px; padding-right: 16px; }
  .ut-alert { margin-left: 16px; margin-right: 16px; }
  .ut-list { padding-left: 16px; padding-right: 16px; }
  .kb-groupbar { padding-left: 16px; padding-right: 16px; }
  .ut-item { flex-wrap: wrap; }
  .ut-item .ut-ops { width: 100%; justify-content: flex-end; }
}

/* ───────── 设置 ───────── */
.settings-body { padding: 0; overflow: hidden; flex: 1; min-height: 0; width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 0; }
.setting-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; }
.setting-card h3 { font-size: 15px; margin-bottom: 14px; }
.theme-picker { display: flex; gap: 10px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.setting-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.setting-row input[type="number"] { width: 110px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); }
.setting-row.checkbox-row { cursor: pointer; }
.setting-row.checkbox-row input { accent-color: var(--primary); width: 16px; height: 16px; }
.setting-desc { font-size: 12.5px; color: var(--dim); margin-bottom: 12px; line-height: 1.65; }
.theme-picker + .setting-desc { margin-top: 12px; }
.balance-box { font-size: 14px; margin-bottom: 12px; line-height: 1.8; }
.balance-num { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ───────── 浮层 / Toast ───────── */
.popover {
  position: fixed; z-index: 100; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(20,60,55,.2); padding: 10px; width: 280px;
}
.popover-title { font-size: 11.5px; color: var(--dim); padding: 6px 10px; letter-spacing: 1px; }
.panel-skill-group { font-size: 11.5px; color: var(--dim); font-weight: 700; padding: 8px 10px 3px; }
.panel-skill-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px;
}
.panel-skill-item:hover { background: var(--primary-soft); }
.panel-skill-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  /* v1.4.200：带操作按钮的提示（签到提醒）必须让 .toast 的 gap 生效 ——
     原来是 block，按钮紧贴文字，看着像两段文字叠在一起 */
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  background: var(--pre-bg); color: var(--pre-text); padding: 10px 20px; border-radius: 12px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  border: 1px solid var(--border);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 顶部变体：门厅落地后的积分提示不能压在输入框上（那里正对着 slogan 和发送按钮） */
.toast.at-top { top: max(64px, calc(env(safe-area-inset-top, 0px) + 54px)); bottom: auto; transform: translateX(-50%) translateY(-14px); }
.toast.at-top.show { transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }
::-webkit-scrollbar-track { background: transparent; }

/* 窄屏侧栏浮层只在真正的手机档（≤760）生效：820 档没有汉堡按钮，
   浮层会永久压住正文且收不起来 —— 断点必须和 .btn-menu / .sidebar.open 保持一致 */
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 50; height: 100%; }
}

/* ═══════════ 模型服务商 ═══════════ */
.prov-current {
  font-size: 13px; color: var(--text); background: var(--primary-soft);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; margin: 10px 0 12px;
}
.prov-current code {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: 12px;
}
/* 模型类型快捷选择 */
.model-type-row {
  display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; flex-wrap: wrap;
}
.model-type-row .mt-label { font-size: 12.5px; color: var(--dim); flex-shrink: 0; }
.model-type-row select, .model-type-row input {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 7px 10px; font-size: 13px; outline: none;
}
.model-type-row select { max-width: 240px; cursor: pointer; }
.model-type-row select:focus, .model-type-row input:focus { border-color: var(--primary); }
.model-type-row input { flex: 1; min-width: 170px; }
.prov-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 10px; }
.prov-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); padding: 10px 12px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.prov-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.prov-card.active { border-color: var(--primary); background: var(--primary-soft); }
.prov-card.unset { opacity: .78; }
.prov-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.prov-main { flex: 1; min-width: 0; }
.prov-title {
  font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prov-tag {
  font-size: 10px; font-weight: 500; padding: 1px 6px; border-radius: 999px;
  background: var(--hover-bg); color: var(--dim); flex: 0 0 auto;
}
.prov-tag.on { background: var(--primary); color: var(--on-primary); }
.prov-sub {
  font-size: 11.5px; color: var(--dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prov-right { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }
.mini-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--dim);
  font-size: 11.5px; padding: 3px 9px; border-radius: 7px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.mini-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 999; background: rgba(10, 30, 28, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 520px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(10, 30, 28, .28); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100vh - 80px);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.prov-modal-note {
  font-size: 12.5px; color: var(--dim); line-height: 1.6;
  background: var(--hover-bg); border-radius: 9px; padding: 8px 11px; margin-bottom: 14px;
}
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 5px; }
.field > span em { font-style: normal; color: var(--primary); }
.field input {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  padding: 9px 11px; border-radius: 9px; color: var(--text);
  border: 1px solid var(--border); background: var(--bg); outline: none;
}
.field input:focus { border-color: var(--primary); background: var(--panel); }
.prov-test-result { font-size: 12.5px; line-height: 1.6; color: var(--dim); min-height: 18px; word-break: break-all; }
.prov-test-result.ok { color: var(--primary); }
.prov-test-result.bad { color: var(--danger); }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 18px 16px; border-top: 1px solid var(--border); background: var(--bg);
}
.modal-foot .ghost-btn, .modal-foot .primary-btn { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.prov-model-select {
  margin-top: 5px; max-width: 100%; font-family: inherit; font-size: 11.5px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; padding: 3px 6px; cursor: pointer; outline: none;
}
.prov-model-select:hover, .prov-model-select:focus { border-color: var(--primary); }
.prov-sub code { background: var(--panel); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; font-size: 11px; }

/* ═══════════ 顶栏模型选择器 ═══════════ */
.model-picker { position: relative; }
.model-picker-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.model-picker-btn:hover { border-color: var(--primary); color: var(--primary); }
.model-picker-btn .caret { font-size: 10px; color: var(--dim); }
.model-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 292px;
  max-height: 440px; overflow-y: auto; z-index: 80;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 52px rgba(10, 30, 28, .2); padding: 6px;
}
.mm-group { font-size: 11px; color: var(--dim); padding: 9px 10px 4px; letter-spacing: .3px; }
.mm-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
}
.mm-item:hover { background: var(--hover-bg); }
.mm-item.active { color: var(--primary); font-weight: 600; }
.mm-ico { width: 19px; text-align: center; flex: 0 0 auto; }
.mm-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-mult { font-size: 11.5px; color: var(--dim); flex: 0 0 auto; }
.mm-check { color: var(--primary); font-weight: 700; flex: 0 0 auto; }
.mm-empty { padding: 16px; font-size: 13px; color: var(--dim); text-align: center; }
.mm-foot {
  border-top: 1px solid var(--border); margin-top: 6px; padding: 11px 10px 8px;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.mm-foot:hover { color: var(--primary); }

/* 模型选择器位于输入框右下角：菜单向上弹出 */
.composer .model-picker { flex: 0 0 auto; align-self: flex-end; }
.composer .model-picker-btn {
  padding: 6px 12px; font-size: 12.5px; font-weight: 600;
  background: var(--bg); border-radius: 999px;
}
.composer .model-menu {
  top: auto; bottom: calc(100% + 10px); right: 0;
}

/* 引导页下拉 */
.field-select {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  padding: 9px 11px; border-radius: 9px; color: var(--text);
  border: 1px solid var(--border); background: var(--bg); outline: none; cursor: pointer;
}
.field-select:focus { border-color: var(--primary); background: var(--panel); }
#onboard-getkey a { color: var(--primary); text-decoration: none; }
#onboard-getkey a:hover { text-decoration: underline; }

@keyframes hudPulse { 0%, 100% { opacity: 1; } 50% { opacity: .22; } }

/* ═══════════ 免费额度提示（v1.4.184：顶栏移除后，只在低额/用完时用到这一行） ═══════════ */
.quota-hint {
  border: 0; background: transparent; padding: 0; margin: 0;
  font: inherit; letter-spacing: inherit; color: var(--dim); cursor: pointer;
  display: inline-flex; align-items: center;
}
.quota-hint.empty { color: var(--text); font-weight: 600; }
.quota-hint:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.quota-hint[hidden] { display: none !important; }

/* 引导页内的免费额度横幅 */
.onboard-note {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.65; color: var(--primary);
  background: var(--primary-soft); border: 1px dashed var(--primary);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}

/* 免费额度下不可用的按钮 */
.cap-btn.free-off { opacity: .42; }

/* ═══════════ 第一阶段：输入区重构（按钮移到输入框下方）+ 小宠物 ═══════════ */
.composer { flex-direction: column; align-items: stretch; }
.composer-top { display: flex; align-items: flex-end; gap: 8px; }
/* 文档流式单行工具条：左「+」，右「模型胶囊 · 语音 · 圆形发送」 */
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding-top: 6px; flex-wrap: nowrap; }
.ca-left, .ca-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.model-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 1;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 500; font-family: inherit;
  transition: border-color .15s;
}
.model-pill:hover { border-color: var(--text); }
.model-pill .pill-check { width: 13px; height: 13px; color: var(--primary); flex-shrink: 0; }
.model-pill .pill-chev { width: 12px; height: 12px; opacity: .5; flex-shrink: 0; }
#model-btn-txt { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-btn svg.cap-ico { width: 17px; height: 17px; display: block; }
.cap-btn .cap-ico { font-size: 17px; line-height: 1.15; }
.composer-wrap { position: relative; }

/* ═══════════ 侧边栏：GPT 式 + 线性图标 + 会话分组 ═══════════ */
.new-chat-btn { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.new-chat-btn:hover { background: var(--hover-bg); transform: none; border-color: var(--dim); }
.new-chat-btn svg { width: 17px; height: 17px; display: block; }
.new-chat-btn .plus { color: var(--primary); }
.nav-item span.ni-ico { display: inline-flex; width: 20px; height: 20px; }
.nav-item svg { width: 17px; height: 17px; }
.session-group-label { font-size: 11px; color: var(--dim); padding: 12px 12px 5px; font-weight: 500; letter-spacing: .3px; }
.user-chip { cursor: pointer; width: 100%; border: none; background: transparent; font-family: inherit; text-align: left; }
.user-chip:hover { background: var(--hover-bg); }
.user-chip .avatar { background: var(--bg); border: 1px solid var(--border); color: var(--dim); font-weight: 600; font-size: 12px; }
.badge-member {
  display: inline-block; border: 1px solid var(--primary); color: var(--primary);
  font-size: 10px; border-radius: 4px; padding: 0 4px; line-height: 1.5; margin-left: 4px; vertical-align: 1px;
}

/* ═══════════ 账号面板（点击 ID 弹出） ═══════════ */
.sidebar-footer { position: relative; }
.acct-pop {
  position: absolute; bottom: calc(100% + 10px); left: 8px; width: 248px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(20, 20, 16, .16); padding: 13px; z-index: 80;
  animation: acctIn .16s cubic-bezier(.2, .8, .2, 1);
}
@keyframes acctIn { from { opacity: .55; transform: translateY(6px) scale(.995); } to { opacity: 1; transform: none; } }
.acct-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.acct-head .avatar { width: 36px; height: 36px; background: var(--bg); border: 1px solid var(--border); color: var(--dim); }
.acct-phone { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; }
.acct-stats {
  display: flex; background: var(--bg); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
}
.acct-stats > div { flex: 1; }
.acct-stats > div + div { border-left: 1px solid var(--border); padding-left: 12px; }
.acct-stat-label { font-size: 10.5px; color: var(--dim); }
.acct-stat-val { font-size: 13.5px; margin-top: 2px; font-weight: 600; }
.acct-upgrade-btn {
  display: block; width: 100%; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 7px; font-size: 12.5px; cursor: pointer; margin-bottom: 10px; text-align: center; font-family: inherit;
}
.acct-upgrade-btn:hover { border-color: var(--primary); color: var(--primary); }
.acct-menu { line-height: 2.15; font-size: 13px; color: var(--text); }
.acct-menu-item { display: flex; justify-content: space-between; align-items: center; padding: 0 4px; border-radius: 7px; cursor: pointer; }
.acct-menu-item:hover { background: var(--hover-bg); }
.acct-menu-item .chev { color: var(--dim); font-size: 12px; }
.acct-menu-item.danger { color: var(--danger); border-top: 1px solid var(--border); margin-top: 5px; padding-top: 5px; }
.acct-menu-item.danger:hover { background: var(--hover-bg); }
.acct-login-tip { font-size: 12px; color: var(--dim); line-height: 1.7; padding: 4px 2px; }
.acct-login-btn {
  display: block; width: 100%; margin-top: 8px; border: none; border-radius: 9px; padding: 8px;
  background: var(--primary); color: var(--on-primary); font-size: 13px; cursor: pointer; font-family: inherit;
}
.acct-login-btn:hover { background: var(--primary-dark); }

/* ═══════════ 登录 / 注册弹窗 ═══════════ */
.auth-switch { text-align: center; font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.auth-switch a { color: var(--primary); cursor: pointer; text-decoration: none; }
.auth-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 6px; }

/* ═══════════ 升级会员页 ═══════════ */
.view-upgrade-body { max-width: 980px; margin: 0 auto; padding: 10px 28px 60px; overflow-y: auto; }
.upg-hero { text-align: center; margin: 14px 0 26px; }
.upg-hero h3 { font-size: 21px; }
.upg-hero p { color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.upg-section-label { font-size: 13px; color: var(--dim); margin: 22px 0 12px; font-weight: 500; }
.upg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 16px;
  position: relative; cursor: pointer; transition: all .15s;
}
.plan-card:hover { border-color: var(--dim); transform: translateY(-2px); }
.plan-card.featured { border: 1.5px solid var(--primary); }
.plan-tag {
  position: absolute; top: -10px; right: 14px; background: var(--primary); color: var(--on-primary);
  font-size: 10.5px; padding: 2px 9px; border-radius: 999px;
}
.plan-name { font-weight: 700; font-size: 15px; }
.plan-price { font-size: 26px; font-weight: 700; margin: 8px 0 2px; }
.plan-price small { font-size: 12px; font-weight: 400; color: var(--dim); }
.plan-price-sub { font-size: 11.5px; color: var(--dim); margin-bottom: 10px; }
.plan-feats { font-size: 12.5px; line-height: 1.95; color: var(--text); }
.plan-feats b { color: var(--primary); }
.pack-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* v1.4.195：购买积分是独立页，四档并排；卡片以价格为主视觉，单价用来标「最划算」 */
.pack-row.pack-row-4 { grid-template-columns: repeat(4, 1fr); }
.pack-card .pack-price-lg { font-size: 25px; font-weight: 700; color: var(--text); margin: 6px 0 2px; }
.pack-card .pack-price-lg small { font-size: 11.5px; font-weight: 400; color: var(--dim); }
.pack-card .pack-unit { font-size: 11.5px; color: var(--dim); line-height: 1.6; margin-top: 6px; }
.pack-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: all .15s;
}
.pack-card:hover { border-color: var(--dim); }
.pack-name { font-size: 13px; font-weight: 600; }
.pack-grain { font-size: 13px; margin-top: 5px; color: var(--primary); font-weight: 700; }
.pack-price { font-size: 12px; color: var(--dim); margin-top: 3px; }
.upg-team {
  margin-top: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.upg-team .t-title { font-weight: 700; font-size: 14.5px; }
.upg-team .t-desc { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.upg-pay {
  margin-top: 26px; border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap;
}
.upg-pay-note { font-size: 12.5px; color: var(--dim); line-height: 2; flex: 1; min-width: 260px; }
.upg-pay-note b { color: var(--text); }

/* ═══════════ 管理面板 ═══════════ */
.view-admin-body { max-width: 1080px; margin: 0 auto; padding: 10px 28px 60px; overflow-y: auto; width: 100%; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 22px; }
.adm-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; }
.adm-stat .l { font-size: 11.5px; color: var(--dim); }
.adm-stat .v { font-size: 21px; font-weight: 700; margin-top: 3px; }
.adm-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.adm-card h3 { font-size: 14.5px; margin-bottom: 12px; }
.adm-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-input {
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px; font-size: 13px;
  background: var(--bg); color: var(--text); outline: none; font-family: inherit; min-width: 120px;
}
.adm-input:focus { border-color: var(--primary); }
.adm-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 9px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.adm-btn:hover { border-color: var(--primary); color: var(--primary); }
.adm-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.adm-btn.primary:hover { background: var(--primary-dark); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th { text-align: left; color: var(--dim); font-weight: 500; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.adm-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.adm-table tr:hover td { background: var(--hover-bg); }
.adm-tag { font-size: 11px; border-radius: 5px; padding: 1px 7px; }
.adm-tag.free { background: var(--bg); color: var(--dim); border: 1px solid var(--border); }
.adm-tag.paid { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary); }

/* ═══════════ 手机端：抽屉式侧边栏 ═══════════ */
.btn-menu { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 120;
    transform: translateX(-102%); transition: transform .22s ease;
    width: min(82vw, 300px);
    padding-top: env(safe-area-inset-top);
  }
  .sidebar.open { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, .3); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 15, 12, .42); z-index: 110; }
  .btn-menu { display: inline-flex; }
  .btn-collapse { display: none; }
  .view-header { padding: 20px 18px 6px; }
  .view-upgrade-body, .view-admin-body { padding: 6px 14px 50px; }
  .upg-grid, .pack-row { grid-template-columns: 1fr; }
  /* v1.4.195：四档加量包在窄屏改两列（.pack-row.pack-row-4 特异性更高，必须同等选择器才盖得住） */
  .pack-row.pack-row-4 { grid-template-columns: repeat(2, 1fr); }
  .messages { padding: 16px 12px 8px; }
  .composer-zone { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  /* iOS 规则：输入框字号 <16px 时聚焦会强制放大整页，这里统一到 16px */
  .chat-input, #chat-input, #session-search, #sk-search,
  .setting-textarea, #auth-phone, #auth-code, #auth-pass,
  input[type="text"], input[type="tel"], input[type="password"], input[type="search"], textarea { font-size: 16px; }
  .acct-pop { left: 0; width: 236px; }
  .chat-header { padding: 10px 12px; }
  .cap-btn .cap-txt { display: none; }
  /* 「+」菜单里的文字在手机上要保留（只藏输入框旁边那排的） */
  .plus-menu .cap-btn .cap-txt { display: inline; }
  .cap-btn { padding: 8px 10px; }
  .cap-btn svg.cap-ico { width: 19px; height: 19px; }
  .model-pill { padding: 6px 10px; }
  #model-btn-txt { max-width: 96px; }
}

/* ═══════════ Singularity 科技风覆写（HUD / 网格 / 卡片 / 等宽字体 / 方角细线） ═══════════ */

/* 布局：HUD 栏占位，视图改为弹性填充 */
.view { flex: 1; height: auto; min-height: 0; }

/* ── 等宽字体区（科技 HUD 感） ── */
.brand-name, .brand-sub, .chat-title, .session-header,
.welcome-grid-label, .view-header h2, .view-header p, .composer-hint,
.cap-btn .cap-txt, .theme-toggle, .theme-opt, .session-group-label,
.plan-price, .balance-num, .adm-stat-num, .welcome-title, .sk-search {
  font-family: var(--mono);
}

/* ── 品牌排版 ── */
.brand-name { font-size: 15px; letter-spacing: .4px; white-space: nowrap; }
.brand-name .brand-cn { font-size: 10px; font-weight: 500; color: var(--dim); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: 2px; letter-spacing: 1px; }
.brand-sub { font-size: 9.5px; letter-spacing: 1.2px; }
/* v1.4.58：品牌图标改为自带深色底的黑洞，不能再 invert —— 反相会把深底洗成白块。
   浅色 / 深色主题都用同一张图，深色主题里反而更贴合。 */

/* ── 纯白背景（已去网格） ── */

/* ── 圆角 + 细线 ── */
.new-chat-btn, .nav-item, .session-item, .theme-toggle, .user-chip,
.skill-nav-item, .skill-card, .plan-card, .pack-card,
.setting-card, .modal, .acct-pop, .popover, .primary-btn, .ghost-btn,
.cat-chip, .sk-search, .adm-input, .adm-btn, .thinking-block, .tool-status,
.msg-avatar, .attached-files .file-chip, .active-skill-chip, .upg-pay { border-radius: 6px; }
/* v1.4.158：消息头像改正圆（与侧边栏 / 账号面板一致），不再是小圆角方块 */
.msg-avatar { border-radius: 50%; }
.md pre { border-radius: 6px; }

/* ── 新建对话按钮 ── */
.new-chat-btn { background: var(--panel); color: var(--text); border: 1px solid var(--border); font-size: 12px; font-weight: 600; letter-spacing: .6px; box-shadow: none; }
.new-chat-btn:hover { background: var(--hover-bg); border-color: var(--primary); transform: none; }
.new-chat-btn .plus { color: var(--primary); }

/* ── 卡片式消息区 ── */
.msg.user .msg-content { background: var(--user-bubble); color: var(--user-fg); border: 1px solid var(--user-bubble); border-radius: 6px 2px 6px 6px; }
/* v1.4.86：对齐主流交互 —— AI 回答是纯文本流，不套白卡片。
   旧版这里给 .msg.ai .msg-content 加了 panel 底色 + 1px 边框 + 圆角，
   首字未到时三点动画就落在一个空方框里，看着像卡住的占位卡。 */
.msg.ai .msg-content { background: none; border: none; border-radius: 0; padding: 2px 0; }

/* ── 欢迎页 ── */
.welcome { padding-top: 2vh; padding-bottom: 13vh; }
.welcome-logo { width: 84px; height: 84px; margin-bottom: 26px; filter: none; }
.welcome-title { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.welcome-title span { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 17px; font-weight: 400; color: var(--dim); letter-spacing: 5px; margin-left: 10px; }
.welcome-sub { font-size: 12px; line-height: 2.1; letter-spacing: .8px; color: var(--dim); margin: 0; }
.welcome-grid-label { font-size: 10px; letter-spacing: 2.5px; color: var(--dim); margin: 24px 0 16px; }
.skill-nav-item { border-radius: 9px; font-size: 11.5px; letter-spacing: .3px; }

/* ── 输入框：圆角细边 + 机器人栖息在框沿 ── */
.composer { position: relative; z-index: 5; border: 1px solid transparent; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.03); background: var(--panel); overflow: visible; }
.composer:focus-within { border-color: transparent; box-shadow: var(--focus-ring); }

/* ── 加号功能菜单 ── */
.plus-btn { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 9px; background: var(--panel); border: 1px solid var(--border); }
.plus-btn .cap-ico { width: 17px; height: 17px; }
.plus-btn:hover { background: var(--hover-bg); }
.plus-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
#btn-mic { width: 34px; height: 34px; min-width: 34px; padding: 0; justify-content: center; border-radius: 9px; background: var(--panel); border: 1px solid var(--border); }
#btn-mic .cap-ico { width: 17px; height: 17px; }
#btn-mic:hover { background: var(--hover-bg); color: var(--text); }
#btn-mic.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.plus-menu {
  display: none; position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 30;
  width: 248px; padding: 6px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.13);
}
.plus-menu.open { display: block; animation: pmIn .14s ease; }
@keyframes pmIn { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.plus-menu .cap-btn {
  display: flex; flex-direction: row; width: 100%; align-items: center; justify-content: flex-start;
  text-align: left; gap: 10px;
  padding: 9px 10px; border-radius: 8px; background: transparent; border: none;
}
.plus-menu .cap-btn:hover { background: var(--hover-bg); }
.plus-menu .cap-btn .cap-ico { width: 16px; height: 16px; font-size: 16px; }
.plus-menu .cap-btn .cap-txt { font-size: 12.5px; letter-spacing: .2px; }
.plus-menu .cap-btn.on { background: var(--primary-soft); color: var(--text); }
.plus-menu .cap-btn.on .cap-txt { font-weight: 600; }
.pm-sep { height: 1px; background: var(--border); margin: 6px 8px; opacity: .7; }
.pm-access .pm-switch {
  margin-left: auto; width: 30px; height: 17px; border-radius: 9px; flex-shrink: 0;
  background: var(--border); position: relative; transition: background .15s;
}
.pm-access .pm-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.pm-access.on .pm-switch { background: var(--primary); }
.pm-access.on .pm-switch::after { left: 15px; }
.pm-note { font-size: 10.5px; line-height: 1.7; color: var(--dim); padding: 8px 10px 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.pm-note b { color: var(--text); font-weight: 600; }

/* ── 通用排版细节 ── */
.session-header { font-size: 10px; letter-spacing: 1.5px; }
.view-header h2 { letter-spacing: -.5px; font-size: 21px; }
.view-header p { font-size: 11px; letter-spacing: .5px; }
.composer-hint { font-size: 10px; letter-spacing: .8px; }
.cap-btn .cap-txt { font-size: 9.5px; letter-spacing: .5px; }
.cap-btn { border-radius: 4px; }
.theme-toggle { font-size: 11.5px; letter-spacing: .5px; }
#theme-icon { font-size: 15px; width: 17px; text-align: center; }
.plan-card.featured { border-color: var(--primary); }
.md code { font-family: var(--mono); }

/* ── 技能/横幅图标去彩色，统一黑白灰 ── */
.sk-icon, .skill-nav-item > span:first-child, .panel-skill-item > span:first-child, #active-skill-name { filter: grayscale(1); }

/* ── 手机端 ── */
@media (max-width: 760px) {
  /* 底部小字收敛：免责声明缩成短语，避免多段文字挤成一团换行（v1.4.135 后只剩免责声明与积分牌） */
  .composer-hint > span:first-child { white-space: nowrap; }
  .welcome { padding-top: 7vh; }
  .welcome-title { font-size: 25px; }
  .welcome-title span { font-size: 14px; letter-spacing: 3px; }
}

/* ── 成品文件下载卡片 ── */
/* v1.4.201：交付门禁失败的显式回执 —— 不用绿色、不折叠成「已生成」 */
.artifact-gate-fail { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--warn); border-radius: 8px; background: var(--hover-bg); color: var(--text); font-size: 13px; line-height: 1.6; }
.artifact-box { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.artifact-label { font: 10px var(--mono); letter-spacing: 1.2px; color: var(--dim); }
.artifact-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.artifact-card:hover { border-color: var(--primary); background: var(--hover-bg); box-shadow: var(--shadow); }
.artifact-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.artifact-ops { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
/* v1.4.202：类型色块图标——主色底 + 右上折角 + 白字缩写，替代旧描边小标签 */
.artifact-card { --art-fold: var(--panel); }
.artifact-card:hover { --art-fold: var(--hover-bg); }
.artifact-icon {
  flex: 0 0 auto; width: 38px; height: 44px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); border-radius: 8px;
}
.artifact-icon::before {
  content: ''; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 11px 11px 0;
  border-color: transparent var(--art-fold) transparent transparent;
  border-top-right-radius: 8px;
}
.artifact-icon-ab { font: 700 11px var(--mono); letter-spacing: .3px; color: #fff; padding-right: 5px; }
.artifact-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.artifact-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-size { font: 10px var(--mono); color: var(--dim); }
/* 预览：圆形图标按钮（描边圆 + 眼睛） */
.artifact-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg); color: var(--dim);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.artifact-ico:hover { border-color: var(--primary); color: var(--primary); }
.artifact-ico svg { width: 15px; height: 15px; display: block; }
/* 下载：实心胶囊主按钮（亮色黑底白字 / 暗色白底黑字，双主题自适应） */
.artifact-primary {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 15px; border-radius: 16px;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: opacity .15s;
}
.artifact-primary:hover { opacity: .85; }
.artifact-primary svg { width: 14px; height: 14px; display: block; }
@media (max-width: 760px) {
  .artifact-box { max-width: 100%; }
  .artifact-card { padding: 9px 10px; gap: 10px; }
  .artifact-icon { width: 30px; height: 36px; }
  .artifact-name { font-size: 12px; }
}

/* ── 模型选择菜单（输入框上方弹出，黑白双主题自适应）── */
.model-menu {
  position: fixed; z-index: 96; width: 300px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: none;
  flex-direction: column;
}
.model-menu.open { display: flex; }
.mm-list { overflow-y: auto; max-height: 56vh; min-width: 0; }
.mm-group { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 10px 4px; font-size: 11px; letter-spacing: .8px; color: var(--dim); }
.mm-tip { font-size: 10px; opacity: .85; }
.mm-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.mm-item:hover { background: var(--hover-bg); }
.mm-item.sel { background: var(--hover-bg); font-weight: 600; }
.mm-item.lock { opacity: .55; }
.mm-item.off { opacity: .38; cursor: default; }
.mm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-right { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.mm-rate { font-size: 10px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--dim); }
.mm-tag { font-size: 10px; color: var(--dim); }
.mm-check { font-weight: 700; }
.mm-empty { padding: 16px; text-align: center; color: var(--dim); font-size: 12.5px; }
/* 档位卡：三列横排，与下方「指定模型」二选一 */
.mm-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 2px 6px 4px; }
.mm-tier {
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 8px 6px;
  cursor: pointer; transition: border-color .12s, background .12s; min-width: 0;
}
.mm-tier:hover { background: var(--hover-bg); border-color: var(--border-strong, var(--primary)); }
.mm-tier.sel { border-color: var(--primary); background: var(--primary-soft); }
.mt-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.mt-name { font-size: 12.5px; font-weight: 600; }
.mt-cap { font-size: 9.5px; color: var(--dim); border: 1px solid var(--border); border-radius: 5px; padding: 0 4px; }
.mt-hint {
  margin-top: 3px; font-size: 10px; line-height: 1.35; color: var(--dim);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mm-tier-tip { padding: 3px 10px 2px; font-size: 10.5px; line-height: 1.5; color: var(--dim); }

/* v1.4.112 M2：本对话上一轮用过的模型（一键切回）+ 键盘高亮 */
.mm-last { display: flex; align-items: center; gap: 6px; margin: 0 6px 4px; padding: 6px 8px; border-radius: 8px; background: var(--primary-soft); font-size: 11.5px; color: var(--text); }
.mm-last b { font-weight: 600; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-last-back { margin-left: auto; flex: none; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer; }
.mm-last-back:hover { border-color: var(--primary); color: var(--primary); }
.mm-item.hover, .mm-tier.hover { background: var(--hover-bg); outline: 1px solid var(--primary); outline-offset: -1px; }
.model-menu:focus { outline: none; }
.mm-sep { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px; font-size: 10.5px; color: var(--dim); letter-spacing: .5px; }
.mm-sep::before, .mm-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.mm-sync {
  flex: none; margin-top: 4px; padding: 8px 10px 5px; border-top: 1px solid var(--border);
  font-size: 10.5px; letter-spacing: .2px; color: var(--dim); cursor: default;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .model-menu { width: calc(100vw - 16px) !important; left: 8px !important; }
}

/* ═══════════ v1.3：套餐/加量包选中态 + 登录三 Tab ═══════════ */
/* 选中态：黑框 + 右上角「已选择」角标，一眼可辨 */
.plan-card, .pack-card { position: relative; }
.plan-card.selected, .pack-card.selected {
  border: 2px solid var(--text) !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.10);
  transform: translateY(-2px);
}
.plan-card.selected .plan-name, .pack-card.selected .pack-name { color: var(--text); }
.sel-badge {
  display: none; position: absolute; top: -11px; right: 12px; z-index: 2;
  background: var(--text); color: var(--bg); font-size: 10.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .5px;
}
.plan-card.selected .sel-badge, .pack-card.selected .sel-badge { display: inline-block; }
.plan-card.selected .plan-tag { display: none; }
.upg-sel-note:empty { display: none; }

/* 登录弹窗：三 Tab + 验证码行 + 第三方占位 */
.auth-modal .modal-body { padding-top: 4px; }
.auth-tabs {
  display: flex; gap: 4px; padding: 10px 20px 0;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1; border: none; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--dim);
  padding: 9px 0 10px; border-bottom: 2px solid transparent; transition: color .12s, border-color .12s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.auth-mode { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; }
.mode-link { border: none; background: transparent; cursor: pointer; font-family: inherit; font-size: 12.5px; color: var(--dim); padding: 0; }
.mode-link.on { color: var(--text); font-weight: 600; }
.mode-sep { color: var(--border); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-btn { flex-shrink: 0; white-space: nowrap; font-size: 12px; padding: 8px 12px; }
.code-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-terms { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.auth-terms a { color: var(--primary); cursor: pointer; text-decoration: none; }
/* v1.4.74：明示同意勾选框（弹窗版） */
.auth-agree { display: flex; align-items: flex-start; gap: 7px; margin-top: 2px; font-size: 11.5px; line-height: 1.6; color: var(--dim); cursor: pointer; }
.auth-agree input {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px;
  border: 1px solid var(--border); border-radius: 3px; background: transparent; cursor: pointer; position: relative;
  transition: background .18s, border-color .18s;
}
.auth-agree input:checked { background: var(--primary); border-color: var(--primary); }
.auth-agree input:checked::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--on-primary); font-weight: 700;
}
.auth-agree input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.auth-agree a { color: var(--primary); cursor: pointer; text-decoration: none; }
.auth-agree.need { animation: agreeShake .32s ease; }
.auth-agree.need input { border-color: var(--err); box-shadow: 0 0 0 3px rgba(220, 80, 80, .12); }
.oauth-box { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px 6px; }
.oauth-logo {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.wechat-bg { background: #07c160; }
.qq-bg { background: #12b7f5; }
.oauth-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.oauth-note { font-size: 12px; line-height: 1.8; color: var(--dim); margin-bottom: 14px; }
.oauth-back { font-size: 12.5px; }
/* 已接入微信/QQ 时的扫码入口（未配置时 display:none，保持占位文案） */
.oauth-go {
  display: inline-block; text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 9px 22px; margin-bottom: 12px; border-radius: 8px;
  background: var(--text); color: var(--panel); border: 1px solid var(--text);
}
.oauth-go:hover { opacity: .88; }

/* ═══════════ 追问方式选择（回复生成中又发一句） ═══════════ */
.queued-msg .msg-content { opacity: .6; }
.queued-tag {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .6px; color: var(--dim);
}
.queued-tag .qdot { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); animation: hudPulse 1.6s infinite; }
.queued-merge {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font-family: var(--mono); font-size: 10.5px; padding: 2px 8px; border-radius: 999px; cursor: pointer;
}
.queued-merge:hover { background: var(--hover-bg); }

.fu { position: fixed; inset: 0; z-index: 270; display: none; }
.fu.show { display: block; }
.fu-mask { position: absolute; inset: 0; background: rgba(8, 8, 8, .42); animation: fuFade .16s ease; }
.fu-card {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 540px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .22); animation: fuUp .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fuFade { from { opacity: 0; } }
@keyframes fuUp { from { transform: translate(-50%, 18px); opacity: 0; } }
@keyframes fuPop { from { transform: translate(-50%, -46%) scale(.97); opacity: 0; } }
@media (min-width: 761px) {
  .fu-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 12px; padding-bottom: 16px; animation: fuPop .2s ease; }
}
.fu-kicker { font-family: var(--mono); font-size: 9px; letter-spacing: 1.6px; color: var(--dim); }
.fu-head h4 { font-size: 15.5px; font-weight: 650; margin-top: 5px; letter-spacing: .2px; }
.fu-quote {
  margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--text); background: var(--hover-bg);
  font-size: 12.5px; line-height: 1.5; color: var(--dim); border-radius: 0 6px 6px 0;
  max-height: 60px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fu-quote:empty { display: none; }
.fu-opts { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 10px; }
.fu-opt {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 10px; padding: 11px 12px; cursor: pointer; transition: background .12s, border-color .12s;
}
.fu-opt:hover { background: var(--hover-bg); border-color: var(--text); }
.fu-opt:first-child { border-color: var(--text); }
.fu-ico {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; background: var(--text); color: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
}
.fu-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-t b { font-size: 13.5px; font-weight: 650; }
.fu-t em { font-style: normal; font-size: 11.5px; line-height: 1.5; color: var(--dim); }
.fu-badge {
  flex: 0 0 auto; font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  border: 1px solid var(--text); border-radius: 999px; padding: 2px 7px; align-self: center;
}
.fu-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.fu-remember { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); cursor: pointer; }
.fu-later {
  border: none; background: transparent; color: var(--dim); font-size: 12px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.fu-later:hover { color: var(--text); }

/* ═══════════ 语音输入面板（三种皮肤共用一套 DOM） ═══════════ */
.vs { position: fixed; inset: 0; z-index: 265; pointer-events: none; }
.vs.show { pointer-events: auto; }
.vs-mask {
  position: absolute; inset: 0; background: rgba(8, 8, 8, .38);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.vs.show .vs-mask { opacity: 1; pointer-events: auto; }
.vs-card {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 16px);
  width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--border);
  border-bottom: none; border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 48px rgba(0, 0, 0, .24);
  opacity: 0; transition: opacity .18s ease, transform .24s cubic-bezier(.2, .8, .2, 1);
}
.vs.show .vs-card { opacity: 1; transform: translate(-50%, 0); }

.vs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.vs-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: hudPulse 1.4s infinite; }
.vs-title { font-family: var(--mono); font-size: 10px; letter-spacing: 1.6px; color: var(--dim); text-transform: uppercase; }
.vs-lang {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px; color: var(--dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}
.vs-x {
  margin-left: auto; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 16px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.vs-x:hover { background: var(--hover-bg); }

.vs-stage { display: flex; align-items: center; gap: 14px; min-height: 76px; }
.vs-orb { position: relative; flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center; }
.vs-orb .vs-core {
  width: 46px; height: 46px; border-radius: 50%; background: var(--text);
  box-shadow: 0 0 0 6px var(--primary-soft); transition: transform .09s linear;
}
.vs-orb .vs-ring {
  position: absolute; inset: 2px; border-radius: 50%; border: 1px solid var(--text);
  opacity: 0; pointer-events: none;
}
.vs-orb.live .vs-ring { animation: vsPulse 2.1s ease-out infinite; }
.vs-orb.live .vs-ring:nth-child(2) { animation-delay: .9s; }
@keyframes vsPulse { 0% { transform: scale(.75); opacity: .45; } 100% { transform: scale(2); opacity: 0; } }

.vs-main { flex: 1; min-width: 0; }
.vs-wave { display: flex; align-items: center; gap: 3px; height: 24px; margin-bottom: 7px; }
.vs-wave i {
  flex: 1; height: 100%; min-width: 2px; border-radius: 2px; background: var(--text); opacity: .22;
  transform: scaleY(.1); transform-origin: center; transition: transform .09s linear, opacity .2s;
}
.vs-wave.on i { opacity: .85; }
.vs-text {
  font-size: 14.5px; line-height: 1.55; color: var(--text); min-height: 22px; max-height: 92px; overflow-y: auto;
  word-break: break-word;
}
.vs-text.live { color: var(--dim); }
.vs-text.ph { color: var(--dim); font-size: 13px; }
.vs-meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .8px; color: var(--dim); }
.vs-time { font-variant-numeric: tabular-nums; }

.vs-actions { display: flex; gap: 8px; margin-top: 14px; }
.vs-btn {
  flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 12.5px; letter-spacing: .3px; cursor: pointer;
  transition: background .12s, opacity .12s;
}
.vs-btn:hover { background: var(--hover-bg); }
.vs-btn.primary { background: var(--text); border-color: var(--text); color: var(--panel); font-weight: 600; }
.vs-btn.primary:hover { opacity: .88; background: var(--text); }
.vs-btn[disabled] { opacity: .4; cursor: default; }

/* 皮肤②：全屏沉浸 */
.vs[data-style="immersive"] .vs-mask { display: none; }
.vs[data-style="immersive"] .vs-card {
  inset: 0; left: 0; bottom: 0; transform: none; width: 100%; max-width: none; height: 100%;
  border: none; border-radius: 0; padding: 30px 22px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center; box-shadow: none;
}
.vs[data-style="immersive"] .vs-head { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 18px; right: 18px; margin: 0; }
.vs[data-style="immersive"] .vs-stage { flex-direction: column; gap: 26px; text-align: center; }
.vs[data-style="immersive"] .vs-orb { width: 128px; height: 128px; }
.vs[data-style="immersive"] .vs-orb .vs-core { width: 104px; height: 104px; box-shadow: 0 0 0 12px var(--primary-soft); }
.vs[data-style="immersive"] .vs-main { width: 100%; }
.vs[data-style="immersive"] .vs-wave { height: 44px; gap: 4px; margin-bottom: 22px; width: min(520px, 86%); margin-left: auto; margin-right: auto; }
.vs[data-style="immersive"] .vs-text { font-size: 19px; line-height: 1.6; max-height: 40vh; min-height: 30px; }
.vs[data-style="immersive"] .vs-meta { justify-content: center; margin-top: 12px; font-size: 10px; }
.vs[data-style="immersive"] .vs-actions { margin-top: 30px; }
.vs[data-style="immersive"] .vs-btn { height: 50px; border-radius: 12px; font-size: 13.5px; }
.vs[data-style="immersive"] .vs-card { opacity: 0; }
.vs[data-style="immersive"].show .vs-card,
.vs[data-style="immersive"] .vs-card { transition: opacity .2s ease; }
.vs[data-style="immersive"].show .vs-card { opacity: 1; }

/* 皮肤③：悬浮胶囊（桌面默认） */
.vs[data-style="capsule"] .vs-mask { background: rgba(8, 8, 8, .12); }
.vs[data-style="capsule"] .vs-card {
  bottom: 150px; width: min(520px, calc(100% - 28px)); border-radius: 999px; border-bottom: 1px solid var(--border);
  padding: 10px 12px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 34px rgba(0, 0, 0, .18);
}
.vs[data-style="capsule"] .vs-head,
.vs[data-style="capsule"] .vs-meta { display: none; }
.vs[data-style="capsule"] .vs-stage { flex: 1; min-width: 0; gap: 10px; min-height: 0; }
.vs[data-style="capsule"] .vs-orb { width: 36px; height: 36px; }
.vs[data-style="capsule"] .vs-orb .vs-core { width: 30px; height: 30px; box-shadow: 0 0 0 4px var(--primary-soft); }
.vs[data-style="capsule"] .vs-main { display: flex; align-items: center; gap: 10px; }
.vs[data-style="capsule"] .vs-wave { width: 74px; flex: 0 0 auto; height: 18px; margin: 0; gap: 2px; }
.vs[data-style="capsule"] .vs-wave i { min-width: 1px; }
.vs[data-style="capsule"] .vs-text {
  flex: 1; min-height: 0; max-height: 20px; font-size: 13px; line-height: 20px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vs[data-style="capsule"] .vs-actions { margin: 0; gap: 6px; flex: 0 0 auto; }
.vs[data-style="capsule"] .vs-btn { flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 11.5px; }
.vs[data-style="capsule"] .vs-btn#vs-toinput { display: none; }

@media (max-width: 760px) {
  .vs-card { max-width: none; border-radius: 16px 16px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .vs-stage { gap: 12px; min-height: 72px; }
  .vs-orb { width: 50px; height: 50px; }
  .vs-orb .vs-core { width: 42px; height: 42px; }
  .vs-actions { gap: 7px; }
  .vs-btn { height: 44px; }
  .vs[data-style="capsule"] .vs-card { bottom: calc(130px + env(safe-area-inset-bottom)); }
  .fu-card { max-width: none; }
}

/* ═══════════ 补充上文：免打字的自动承接标记 ═══════════ */
.fu-chip-btn {
  height: 28px; padding: 0 9px; border-radius: 999px; border: 1px dashed var(--border);
  background: transparent; color: var(--dim); font-family: inherit;
  font-size: 11px; letter-spacing: .3px; cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  transition: background .12s, color .12s, border-color .12s;
}
.fu-chip-btn:hover { color: var(--text); border-color: var(--text); }
.fu-chip-btn.on {
  background: var(--text); border-color: var(--text); border-style: solid;
  color: var(--panel); font-weight: 600;
}
.fu-mark {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px; color: var(--dim);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; width: fit-content;
}
@media (max-width: 420px) {
  .fu-chip-btn { padding: 0 7px; font-size: 10.5px; }
}

/* ═══════════ 语音面板 v2：麦克风图标 + 三层波纹 + 手机端重排 ═══════════ */
.vs-grip { display: none; }
.vs-core { display: flex; align-items: center; justify-content: center; color: var(--panel); }
.vs-core svg { width: 46%; height: 46%; display: block; }
.vs[data-style="capsule"] .vs-core svg { display: none; }
.vs-orb.live .vs-ring:nth-child(3) { animation-delay: 1.55s; }
.vs-orb.live .vs-ring { border-width: 1.2px; }

@media (max-width: 760px) {
  .vs[data-style="sheet"] .vs-grip { display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 14px; }
  .vs[data-style="sheet"] .vs-card {
    border-radius: 26px 26px 0 0; padding: 10px 22px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 60px rgba(0, 0, 0, .28);
    max-height: 86vh; max-height: 86dvh; overflow-y: auto;   /* 小屏（SE 这类）不溢出 */
  }
  .vs[data-style="sheet"] .vs-head { margin-bottom: 20px; }
  .vs[data-style="sheet"] .vs-stage { flex-direction: column; align-items: center; gap: 18px; min-height: 0; padding: 2px 0 6px; }
  .vs[data-style="sheet"] .vs-orb { width: 104px; height: 104px; }
  .vs[data-style="sheet"] .vs-orb .vs-core {
    width: 78px; height: 78px;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .18), transparent 60%), var(--text);
    /* 对称柔光，避免向下偏移的投影被外圈挡出月牙状灰影 */
    box-shadow: 0 0 0 9px var(--primary-soft), 0 0 30px rgba(0, 0, 0, .10);
  }
  .vs[data-style="sheet"] .vs-main { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .vs[data-style="sheet"] .vs-wave { width: min(240px, 74%); height: 30px; margin: 0 0 12px; gap: 3.5px; justify-content: center; }
  .vs[data-style="sheet"] .vs-wave i { flex: none; width: 3.5px; border-radius: 2px; }
  .vs[data-style="sheet"] .vs-text { text-align: center; font-size: 16.5px; line-height: 1.65; width: 100%; max-height: 112px; }
  .vs[data-style="sheet"] .vs-meta { justify-content: center; margin-top: 10px; gap: 12px; }
  .vs[data-style="sheet"] .vs-actions { margin-top: 22px; gap: 9px; }
  .vs[data-style="sheet"] .vs-btn { height: 50px; border-radius: 15px; font-size: 13.5px; }
  .vs[data-style="sheet"] .vs-btn.primary { flex: 1.35; font-size: 15px; letter-spacing: 2px; }
}

/* 胶囊：圆点光环保留完整，不被卡片内边距裁切 */
.vs[data-style="capsule"] .vs-orb { width: 40px; height: 40px; }
.vs[data-style="capsule"] .vs-orb .vs-core { width: 28px; height: 28px; box-shadow: 0 0 0 3px var(--primary-soft); }

/* ═══════════ v1.4.0：任务进度清单 / 会话搜索 / 欢迎示例 / 设置新卡 ═══════════ */
.steps-list { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.step-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.step-row.done { color: var(--text); opacity: .72; }
.step-no {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; border: 1px solid var(--border); color: var(--dim);
}
.step-row.done .step-no { background: var(--text); border-color: var(--text); color: var(--panel); font-size: 10px; }
.step-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.session-search { padding: 0 12px 8px; }
.session-search input {
  width: 100%; box-sizing: border-box; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font-family: inherit; font-size: 12.5px; padding: 0 10px; outline: none;
}
.session-search input:focus { border-color: var(--text); }
.session-search input::-webkit-search-cancel-button { cursor: pointer; }
.session-empty { padding: 18px 14px; font-size: 12px; color: var(--dim); text-align: center; }
/* v1.4.154：隔离区 —— 归属待确认的对话单独放，标题与正文都不显示，只留「是我的 / 删除」 */
.session-quarantine {
  margin: 8px 8px 10px; padding: 9px 11px;
  border: 1px solid var(--warn); border-radius: 10px;
  background: rgba(184, 118, 15, .07);
}
.sq-head { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.sq-hint { margin-top: 4px; font-size: 11.5px; line-height: 1.55; color: var(--dim); }
.sq-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.sq-when { flex: 1; min-width: 0; font-size: 11.5px; color: var(--dim); }
.sq-btn {
  flex: none; padding: 3px 9px; font-size: 11.5px; border-radius: 7px;
  border: 1px solid var(--line, rgba(128, 128, 128, .26));
  background: transparent; color: inherit; cursor: pointer;
}
.sq-btn:hover { background: rgba(128, 128, 128, .1); }
.sq-btn.danger { color: #d9534f; border-color: rgba(217, 83, 79, .38); }
/* v1.4.102：云端会话分页——列表尾部按需补拉云端更早对话 */
.session-load-more {
  display: block; width: calc(100% - 20px); margin: 4px 10px 10px; padding: 9px 10px;
  border: 1px dashed var(--border); border-radius: 10px; background: transparent;
  color: var(--dim); font-family: inherit; font-size: 12px; cursor: pointer; text-align: center;
}
.session-load-more:hover { color: var(--primary); border-color: var(--primary); background: var(--hover-bg); }
.session-load-more:disabled { opacity: .55; cursor: default; }
.session-item .s-sub {
  display: block; font-size: 10.5px; color: var(--dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px; opacity: .85;
}

.welcome-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; padding: 0 16px; }
.wx-chip {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-family: inherit;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.wx-chip:hover { background: var(--hover-bg); border-color: var(--text); }
/* v1.4.97：chip 内联 SVG 图标（帮助圆问号等）与文字对齐 */
.wx-chip .wx-chip-ico { vertical-align: -2.5px; margin-right: 5px; flex: none; }

.setting-textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text); font-family: inherit; font-size: 12.5px;
  line-height: 1.6; padding: 9px 11px; resize: vertical; outline: none; margin-top: 6px;
}
.setting-textarea:focus { border-color: var(--text); }
.setting-inline-btns { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.setting-inline-btns .primary-btn, .setting-inline-btns .ghost-btn { padding: 6px 14px; font-size: 12.5px; border-radius: 8px; }
.setting-inline-fields { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.setting-inline-fields .setting-row { flex: 1; min-width: 120px; }
.switch-row { flex: 0 0 auto !important; min-width: 70px !important; }
.setting-inline-fields input[type="time"] {
  border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; padding: 5px 8px; outline: none;
}

/* 窄屏：设置行里的下拉框不要顶出卡片（原 max-width:220px 在 390px 屏上会溢出） */
@media (max-width: 760px) {
  .setting-row { flex-wrap: wrap; row-gap: 6px; }
  .setting-row .setting-select { flex: 1 1 100%; max-width: 100%; min-width: 0; }
  .setting-row input[type="number"] { width: 100%; }
}

/* 冷银点缀色：账号面板等小面积高亮使用（原为黑洞换肤变量，黑洞移除后保留静态值） */
:root {
  --acc: 196 224 248;
  --acc-hi: 234 244 253;
  --acc-lo: 159 182 203;
}

/* ══════════ 账号面板（按主流版式重做，成长计划不做） ══════════ */
/* v1.4.122：面板底部贴着侧栏「用户卡」向上生长，窗口高 900 时本体约 806px，
   顶部会被窗口上沿切掉（走查在 1440×900 实测被裁 39px）。给个视口上限 + 内部滚动，
   保证任何窗口高度下头像卡与「管理看板」入口都够得着。 */
.acct-pop {
  width: 300px;
  /* 兜底值（无 JS 时）：侧栏页脚约 135px，再留 15px 呼吸 */
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.acct-card {
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 14px 12px; margin-bottom: 10px;
}
.acct-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acct-hero .av {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: linear-gradient(160deg, rgb(var(--acc) / .28), rgb(var(--acc) / .10));
  border: 1px solid rgb(var(--acc) / .28); color: var(--text);
}
.acct-hero .who { min-width: 0; }
.acct-hero .nm { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-hero .sub { font-size: 11px; color: var(--dim); margin-top: 2px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acct-cell .k { font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.acct-cell .v { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.acct-cell .v small { font-size: 11px; font-weight: 400; color: var(--dim); }
.acct-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.acct-acts button {
  font: inherit; font-size: 12.5px; padding: 9px 0; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  transition: background .18s, border-color .18s;
}
.acct-acts button:hover { background: var(--hover-bg); border-color: rgb(var(--acc) / .40); }
.acct-acts button.solid {
  background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600;
}
.acct-acts button.solid:hover { filter: brightness(.92); }
.acct-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 6px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
  color: var(--text); transition: background .16s;
}
.acct-row:hover { background: var(--hover-bg); }
.acct-row .ico { width: 18px; display: grid; place-items: center; color: var(--dim); flex-shrink: 0; }
.acct-row .lbl { flex: 1; min-width: 0; }
.acct-row .hint { font-size: 11.5px; color: var(--dim); margin-right: 4px; white-space: nowrap; }
.acct-row .chev { color: var(--dim); font-size: 15px; }
.acct-row .kbd { font-size: 11px; color: var(--dim); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.acct-row.danger { color: var(--danger); }
.acct-sep { height: 1px; background: var(--border); margin: 6px 4px; opacity: .7; }
.acct-dot { width: 6px; height: 6px; border-radius: 50%; background: #1fbf75; box-shadow: 0 0 8px 1px rgba(31,191,117,.6); }
.acct-tag { font-size: 10.5px; color: #1fbf75; }
@media (max-width: 760px) {
  .acct-pop { width: min(300px, calc(100vw - 40px)); }
  .welcome { padding: 0 20px 10vh; }
  /* 手机上表格数字经常被挤成两行（1,240 → "1,2"+"40"）：整表可横向滚动，单元格不换行 */
  .md table { display: block; width: max-content; min-width: 100%; max-width: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .md th, .md td { white-space: nowrap; }
  .msg-sources .msg-file-chip, a.msg-file-chip { font-size: 11px; padding: 3px 8px; margin: 0 4px 4px 0; }
}

/* 手机端：提示条抬到输入框上方，别压住 placeholder */
@media (max-width: 760px) {
  .toast { bottom: 178px; }
}

/* 手机端每日问候：挂在欢迎语下方的一行淡字，替代黑底 toast */
.welcome-greet {
  margin-top: 14px; font-size: 11.5px; letter-spacing: .08em; color: var(--dim);
  opacity: 0; transform: translateY(4px);
  transition: opacity .5s ease, transform .5s ease;
}
.welcome-greet.show { opacity: .82; transform: none; }

/* ═══════════ 手机端补充：非对话页的菜单入口 + 技能中心排版 ═══════════ */
/* 桌面端这些按钮不出现（桌面侧栏常驻，不需要） */
.btn-menu2 { display: none; }

/* ═══ v1.4.94 修复：桌面端折叠侧栏后的常驻展开入口 ═══
   折叠后侧栏（含「«」按钮）整体移出屏幕，各页标题栏左侧的汉堡键顶上——
   点击即展开（openDrawer 里识别折叠态），ChatGPT 式行为。
   v1.4.96 ④：汉堡出现带 pop 微动画（主区宽度随 margin 过渡逐帧联动，天然平滑让位）。 */
@media (min-width: 761px) {
  body.sidebar-collapsed .btn-menu,
  body.sidebar-collapsed .btn-menu2 { display: inline-flex; animation: menu-pop .26s cubic-bezier(.34, 1.3, .5, 1); }
  body.sidebar-collapsed .btn-menu2 {
    width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--panel); color: var(--text);
  }
}
@keyframes menu-pop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }

/* ═══ v1.4.97 ②：折叠态主区左缘淡阴影 ═══
   侧栏连边框一起移出后主区左缘失去了分隔线，补一条向右渐隐的竖向边界。
   浅色档加深灰渐影；深色档黑底加黑影不可见，改用亮线渐变（rim light 思路）。 */
@media (min-width: 761px) {
  body.sidebar-collapsed .main { position: relative; }
  body.sidebar-collapsed .main::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 20px; z-index: 5;
    pointer-events: none;
    border-left: 1px solid var(--border);
    background: linear-gradient(to right, rgba(15, 20, 25, .09), transparent);
  }
  html[data-theme="dark"] body.sidebar-collapsed .main::before {
    border-left-color: var(--border);
    background: linear-gradient(to right, rgba(255, 255, 255, .075), transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition-duration: .01s !important; }
  body.sidebar-collapsed .btn-menu, body.sidebar-collapsed .btn-menu2 { animation: none !important; }
}
.vh-row { display: flex; align-items: center; gap: 10px; }
/* 网格项默认 min-width:auto，长文本会把列撑破，这里统一收住 */
.cat-banner { min-width: 0; }

@media (max-width: 760px) {
  .btn-menu2 {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: 0 0 auto;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--panel); color: var(--text);
  }
  .btn-menu2:active { background: var(--hover-bg); }

  .view-header { padding: 14px 16px 6px; }
  .view-header .vh-row { gap: 10px; }
  .view-header h2 { font-size: 19px; }

  /* 技能中心：顶栏分两行（菜单 + Tab / 搜索），分类改两列，卡片单列 */
  .sk-topbar { flex-wrap: wrap; gap: 8px; padding: 12px 16px 2px; align-items: center; }
  .sk-tabs {
    order: 2; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .sk-tabs::-webkit-scrollbar { display: none; }
  .sk-tab { flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; font-size: 13.5px; }
  .sk-search { order: 3; flex: 1 1 100%; font-size: 16px; padding: 9px 14px; }
  .cat-banners { grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 16px 2px; }
  .cat-banner { min-height: 0; padding: 11px 12px; }
  .cb-item { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
  .cat-chips {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 10px 16px 2px;
  }
  .cat-chips::-webkit-scrollbar { display: none; }
  .cat-chip { flex: 0 0 auto; }
  .skills-grid { grid-template-columns: 1fr; padding: 12px 16px 40px; gap: 10px; }
  .skill-card { padding: 14px; }

  .kb-toolbar { padding: 12px 16px; }
  .kb-list { padding: 0 16px 40px; }
}

/* ═══════════ 用户协议 / 隐私政策弹窗 ═══════════ */
.legal-modal { width: min(620px, calc(100vw - 32px)); }
.legal-body {
  max-height: min(62vh, 560px); overflow-y: auto;
  font-size: 13px; line-height: 1.85; color: var(--text);
  padding-right: 6px;
}
.legal-body h4 { font-size: 13.5px; margin: 16px 0 6px; }
.legal-body h4:first-of-type { margin-top: 10px; }
.legal-body p { color: var(--dim); }
.legal-body b { color: var(--text); font-weight: 600; }
.legal-meta {
  font-size: 11.5px !important; color: var(--dim);
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.legal-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 18px 16px; border-top: 1px solid var(--border);
}

/* 手机端设置页：三个外观按钮挤成两行字，改成不换行 + 均分 */
@media (max-width: 760px) {
  .setting-card { padding: 16px; }
  .theme-picker { gap: 8px; }
  .theme-opt { flex: 1 1 0; min-width: 0; white-space: nowrap; padding: 8px 6px; font-size: 12.5px; }
}

/* 手机端没有 hover：会话删除按钮要一直露出来，不然根本发现不了 */
@media (max-width: 760px) {
  .session-item .s-del { opacity: .55; width: 30px; height: 30px; font-size: 13px; }
  .session-item .s-del:active { opacity: 1; background: var(--hover-bg); }
}

/* 矮屏（手机横屏 / 小窗口）：欢迎区不能整块堆在一起被裁掉 */
@media (max-height: 540px) {
  .welcome { padding-top: 4px; padding-bottom: 4px; }
  .welcome-inner { gap: 0; }
  .welcome-logo { display: none; }
  .welcome-title { font-size: 24px; letter-spacing: .16em; }
  .welcome-rule { margin: 10px auto 8px; }
  .welcome-sub, .welcome-sub2 { display: none; }
  .welcome-hint { margin-top: 4px; }
  .welcome-greet { display: none; }
  .chat-header { padding: 6px 14px; }
  .composer-zone { padding-top: 2px; }
}

/* 空消息容器会带上 24/12 的 padding，把欢迎块顶偏 36px；空的时候不占位 */
#messages:empty { display: none; }

/* 升级页：没有二维码时的联系方式卡片 */
.upg-contact {
  width: 180px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--panel);
}
.upg-contact-k { font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.upg-contact-v { font-size: 15px; font-weight: 700; word-break: break-all; }
.upg-contact-s { font-size: 11.5px; color: var(--dim); line-height: 1.6; }
.upg-contact .ghost-btn { padding: 6px 12px; font-size: 12px; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SG-LAUNCHER · 游戏启动器式登录门厅
   全屏黑洞 CG 作背景，左侧紧凑登录面板，右侧品牌区。
   追加在文件末尾，用 #bh-gate 前缀覆盖早期门厅（居中大标题）样式。
   ═══════════════════════════════════════════════════════════════════════════ */
#bh-gate {
  align-items: center; justify-content: flex-start;
  padding-left: clamp(28px, 6.2vw, 104px);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
/* 左侧压暗：面板要压得住吸积盘亮弧；底部沿用原有渐变压住白雾 */
#bh-gate::before { height: 58%; }
#bh-gate::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 54%;
  background: linear-gradient(to right,
    rgba(3, 5, 9, .90) 0%, rgba(3, 5, 9, .72) 34%,
    rgba(3, 5, 9, .34) 68%, rgba(3, 5, 9, 0) 100%);
  pointer-events: none;
}
/* 顶栏 */
#bh-gate .gate-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(22px, 3.4vw, 46px);
  animation: lgFade .9s ease .05s both;
}
#bh-gate .gate-brand { display: flex; align-items: center; gap: 10px; }
#bh-gate .gate-brand-logo { width: 25px; height: 25px; border-radius: 50%; display: block; }
#bh-gate .gate-brand-name { font-size: 14px; font-weight: 300; letter-spacing: .05em; color: #eef2f6; }
#bh-gate .gate-brand-name span { color: #a9b4be; font-size: 13px; margin-left: 3px; }
#bh-gate .gate-win { display: flex; gap: 2px; pointer-events: auto; }
#bh-gate .win-btn {
  width: 34px; height: 30px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.055);
  color: #c2ccd5; font-size: 17px; line-height: 1; border-radius: 6px;
  font-family: inherit; transition: background .18s, color .18s, border-color .18s;
}
#bh-gate .win-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
#bh-gate .win-close:hover { background: rgba(220,80,76,.82); color: #fff; }

/* 左侧登录器 */
#bh-gate .launcher {
  position: relative; z-index: 2; pointer-events: auto;
  width: 336px; max-width: calc(100vw - 40px);
  padding: 26px 26px 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18,22,29,.90), rgba(9,12,17,.94));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 26px 80px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: lgRise .85s cubic-bezier(.18,.72,.22,1) .16s both;
}
@keyframes lgRise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lgFade { from { opacity: 0; } to { opacity: 1; } }

#bh-gate .lg-kicker {
  font-size: 9.5px; letter-spacing: .30em; color: #7f94a8; text-transform: uppercase;
}
#bh-gate .lg-kicker i { color: #4d5d6c; font-style: normal; margin: 0 3px; }
#bh-gate .lg-title {
  margin: 11px 0 5px; font-size: 23px; font-weight: 300; letter-spacing: .07em;
  color: #f1f5f9; line-height: 1.3;
}
#bh-gate .lg-desc { font-size: 11.5px; color: #84919e; line-height: 1.6; margin: 0 0 21px; }

#bh-gate .lg-tabs {
  display: flex; gap: 22px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.085);
}
#bh-gate .lg-tab {
  position: relative; padding: 0 0 11px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #7f8b98; letter-spacing: .04em;
  transition: color .2s;
}
#bh-gate .lg-tab:hover { color: #cbd5de; }
#bh-gate .lg-tab.on { color: #f0f5f9; }
#bh-gate .lg-tab.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, #e7f0f8, #8fb4d4); border-radius: 2px;
}
/* v1.4.178：微信是与「手机号 / 手机端扫码」同级的登录入口；
   v1.4.183：按用户要求并排即可 —— 去掉绿色字与前面的绿点，视觉上与其它两个标签完全一致，
   只保留 lg-tab-wx 这个类做 JS 钩子；三个标签在极窄屏允许换行，不挤成一条 */
#bh-gate .lg-tabs { flex-wrap: wrap; }

/* 扫码区 */
#bh-gate .lg-pane { min-height: 240px; }
#bh-gate .qr-box {
  position: relative; width: 180px; height: 180px; margin: 0 auto 13px;
  padding: 9px; border-radius: 12px; background: #f4f7fa;
  box-shadow: 0 0 0 1px rgba(255,255,255,.13), 0 10px 30px rgba(0,0,0,.4);
}
#bh-gate #qr-canvas { display: block; width: 162px; height: 162px; image-rendering: pixelated; }
#bh-gate .qr-mask {
  position: absolute; inset: 9px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(246,248,251,.96); color: #16202a;
  font-size: 12.5px; line-height: 1.6; padding: 16px;
}
#bh-gate .qr-status {
  text-align: center; font-size: 12.5px; color: #dbe5ee; letter-spacing: .02em; margin-bottom: 5px;
}
#bh-gate .qr-hint {
  text-align: center; font-size: 10.5px; color: #788692; line-height: 1.65;
  padding: 0 6px;
}
#bh-gate .lg-link {
  display: block; margin: 9px auto 0; padding: 5px 8px;
  border: 0; background: none; cursor: pointer; font-family: inherit;
  font-size: 11px; color: #8ea8bd; transition: color .18s;
}
#bh-gate .lg-link:hover { color: #d5e6f4; text-decoration: underline; text-underline-offset: 3px; }

/* ── v1.4.187 门厅内嵌微信二维码 ─────────────────────────────────────────
 * 里面是开放平台的官方扫码页（白底、自带「微信登录」标题），所以这块不跟门厅的
 * 暗色走：二维码必须白底才扫得出来，硬染成深色等于做一张废码。
 * 与自家 canvas 码的区别只在容器尺寸（284×410，官方页的固定版式）与边框处理：
 * 官方页自带一圈浅灰描边，外面再套 1px 亮边容易看起来像「两个框」，故只留投影。 */
#bh-gate .wx-qr-box {
  position: relative; width: 284px; max-width: 100%; height: 410px;
  margin: 0 auto 11px; border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
#bh-gate #lg-wx-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
#bh-gate .wx-qr-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 26px; background: rgba(246,248,251,.97); color: #16202a;
  font-size: 13.5px; line-height: 1.75; letter-spacing: .01em;
}
/* 一行小字飘在 410px 的白框里既不好读也不像话；限宽成两三行的块，落在视觉中心 */
#bh-gate .wx-qr-mask > span { display: block; max-width: 218px; }
/* 没有码可展示时（加载失败 / 已过期）把白框收短：空着一个 410px 的白板比提示本身更显眼 */
#bh-gate .wx-qr-box.is-flat { height: 148px; transition: height .18s ease; }
#bh-gate .wx-qr-mask[hidden] { display: none !important; }
#bh-gate .wx-qr-mask.bad { color: #8a3c38; }
/* 窄屏：官方页是流式版式（284 与 340 都不裁切），按容器缩即可，别做 transform 缩放 ——
   二维码被重采样会发虚，扫码识别率下降。 */
@media (max-width: 400px) {
  #bh-gate .wx-qr-box { height: 372px; }
}

/* ── v1.4.188：官方扫码页自带的那行「“产品名”」是跨源的，改不了它的 DOM ──
 * 只能在同一块白底上盖一条白条。扫码成功后官方页会把这块换成「扫描成功」，
 * 那行反而有信息量，所以 .scanned 时把白条淡出（JS 收到 wxScanned 就加这个类）。 */
#bh-gate .wx-qr-cover { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: #fff; pointer-events: none; transition: opacity .18s ease; }
#bh-gate .wx-qr-box.scanned .wx-qr-cover { opacity: 0; }

/* 确认成功的一拍：勾 + 一句「正在进入」，替掉遮罩里的加载态 */
#bh-gate .wx-qr-mask.ok, #sgb-wrap .sgb-mask.ok { animation: qrOkIn .26s cubic-bezier(.2,.8,.2,1) both; }
#bh-gate .wx-qr-mask.ok > span::before, #sgb-wrap .sgb-mask.ok > span::before {
  content: '✓'; display: grid; place-items: center; width: 34px; height: 34px;
  margin: 0 auto 10px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  font-size: 17px; font-weight: 600; line-height: 1;
}
@keyframes qrOkIn {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ── v1.4.188：设置 → 账号 → 绑定微信（扫码弹窗） ── */
#sgb-wrap {
  position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center;
  padding: 20px; background: rgba(0, 0, 0, .34);
}
#sgb-wrap[hidden] { display: none !important; }
#sgb-wrap .sgb-card {
  width: 344px; max-width: 94vw; padding: 14px 16px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .32); color: var(--text);
}
#sgb-wrap .sgb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#sgb-wrap .sgb-title { font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
#sgb-wrap .sgb-x {
  width: 26px; height: 26px; border: 0; background: transparent; color: var(--dim);
  border-radius: 7px; cursor: pointer; font-size: 16px; line-height: 1;
}
#sgb-wrap .sgb-x:hover { background: var(--hover-bg); color: var(--text); }
#sgb-wrap .sgb-box {
  position: relative; width: 284px; max-width: 100%; height: 410px; margin: 0 auto;
  border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--border);
}
#sgb-wrap .sgb-box.is-flat { height: 168px; transition: height .18s ease; }
#sgb-wrap .sgb-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
#sgb-wrap .sgb-cover {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: #fff; pointer-events: none; transition: opacity .18s ease;
}
#sgb-wrap .sgb-box.scanned .sgb-cover { opacity: 0; }
#sgb-wrap .sgb-mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 26px; background: rgba(246, 248, 251, .97); color: #16202a;
  font-size: 13.5px; line-height: 1.75; letter-spacing: .01em;
}
#sgb-wrap .sgb-mask[hidden] { display: none !important; }
#sgb-wrap .sgb-mask.bad { color: #8a3c38; }
#sgb-wrap .sgb-mask > span { display: block; max-width: 218px; }
#sgb-wrap .sgb-tip { margin-top: 10px; font-size: 12px; line-height: 1.7; color: var(--dim); text-align: center; }

/* 账号卡里的「微信 / 未绑定 / 绑定微信」一行：标签、状态、按钮三段对齐，
   状态过长时省略 —— 昵称可能是任意长度，不能把按钮挤出去。 */
.setting-card .oauth-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.setting-card .oauth-k { flex: 0 0 auto; font-size: 13px; color: var(--text); font-weight: 550; }
.setting-card .oauth-v { flex: 0 1 auto; min-width: 0; font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 按钮紧跟状态文字，不推到卡片最右 —— 设置卡是单列宽卡，推到底会和文字失去关系 */
.setting-card .oauth-row .ghost-btn { flex: 0 0 auto; }

/* ── v1.4.189 强制补手机号 ──
   与 sgb-wrap 的区别：这一层不可关闭（没有 ×、点遮罩无效、Escape 无效），
   所以遮罩更实一点，视觉上明确表达「这是个关口，不是提示」。 */
#bp-wrap {
  position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center;
  padding: 20px; background: rgba(8, 12, 18, .52); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
#bp-wrap[hidden] { display: none !important; }
#bp-wrap .bp-card {
  width: 368px; max-width: 94vw; padding: 20px 20px 18px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 28px 72px rgba(0, 0, 0, .38); color: var(--text);
}
#bp-wrap .bp-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
#bp-wrap .bp-desc { margin: 0 0 16px; font-size: 12.5px; line-height: 1.75; color: var(--dim); }
#bp-wrap .bp-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 550; color: var(--text); }
#bp-wrap .setting-input { width: 100%; box-sizing: border-box; }
#bp-wrap .bp-row { display: flex; gap: 8px; margin-top: 10px; }
#bp-wrap .bp-row .setting-input { flex: 1 1 auto; min-width: 0; }
#bp-wrap .bp-row .ghost-btn { flex: 0 0 auto; min-width: 104px; }
#bp-wrap .bp-status { min-height: 18px; margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--dim); }
#bp-wrap .bp-status.is-bad { color: var(--danger); }
#bp-wrap .bp-status.is-ok { color: var(--primary); }
#bp-wrap .bp-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
#bp-wrap .bp-actions .primary-btn { flex: 1 1 auto; }
#bp-wrap .bp-actions .ghost-btn { flex: 0 0 auto; }
body.bp-on { overflow: hidden; }

/* ── v1.4.189 登录记录 ── */
.setting-card .ll-list { display: flex; flex-direction: column; gap: 1px; margin: 10px 0 0; }
.setting-card .ll-item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text); background: var(--hover-bg);
}
.setting-card .ll-item.cur { box-shadow: inset 2px 0 0 var(--primary); }
.setting-card .ll-k { font-weight: 550; }
.setting-card .ll-t, .setting-card .ll-dev, .setting-card .ll-ip { color: var(--dim); }
.setting-card .ll-t, .setting-card .ll-ip { font-variant-numeric: tabular-nums; }
.setting-card .ll-dev { text-align: right; }
.setting-card .ll-dev, .setting-card .ll-ip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-card .ll-cur {
  padding: 1px 7px; border-radius: 999px; font-size: 11px;
  color: var(--primary); background: var(--panel);
}
.setting-card .ll-empty { padding: 12px 2px; font-size: 12.5px; color: var(--dim); }
/* v1.4.190：关于分区。版本号对齐右端并走等宽数字，多次打开不会因位数变化而跳动；
   安装路径允许折行 + 撑满剩余宽度，Windows 的长路径要能一眼看全。 */
.setting-card .about-ver-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Cascadia Mono", monospace;
  font-size: 13px; letter-spacing: .2px; color: var(--primary);
}
.setting-card .about-path-row code {
  flex: 1 1 auto; min-width: 0; margin-left: auto; text-align: right;
}
.setting-card .about-check-list { margin-top: 2px; }
.setting-card .about-check-foot { margin-top: 14px; }
@media (max-width: 720px) {
  .setting-card .ll-item { grid-template-columns: 76px minmax(0, 1fr) auto auto; }
  .setting-card .ll-ip { display: none; }
  .setting-card .ll-item .ll-cur { display: none; }
  .setting-card .ll-item.cur { box-shadow: inset 2px 0 0 var(--primary); }
}

/* 手机号 */
#bh-gate .lg-field {
  display: flex; gap: 8px; align-items: center; height: 42px; margin-bottom: 10px;
  padding: 0 12px; border-radius: 9px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.10);
  transition: border-color .18s, background .18s;
}
#bh-gate .lg-field:focus-within { border-color: rgba(154,197,232,.55); background: rgba(255,255,255,.065); }
#bh-gate .lg-field input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none;
  color: #edf3f8; font-size: 13px; font-family: inherit; letter-spacing: .03em;
}
#bh-gate .lg-field input::placeholder { color: #64717e; }
#bh-gate .lg-field-code { padding-right: 5px; }
#bh-gate #lg-send {
  flex-shrink: 0; height: 31px; padding: 0 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  color: #cbd8e4; font-size: 11px; font-family: inherit; white-space: nowrap;
}
#bh-gate #lg-send:disabled { opacity: .45; cursor: default; }
#bh-gate .lg-opts {
  display: flex; gap: 18px; margin: 13px 0 16px; font-size: 11px; color: #8b98a5;
}
#bh-gate .lg-opts label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
#bh-gate .lg-opts input { accent-color: #b9d3e8; width: 13px; height: 13px; margin: 0; cursor: pointer; }
/* v1.4.120：验证码 ↔ 密码换的是同一块输入位，不新增行高
 * .lg-field 是 flex，会顶掉 hidden 属性，必须兜底 */
#bh-gate .lg-field[hidden] { display: none !important; }
#bh-gate .lg-opts { align-items: center; }
#bh-gate .lg-opts .lg-switch {
  display: block; margin: 0 0 0 auto; padding: 2px 0;
  font-size: 11px; white-space: nowrap;
}
/* v1.4.180：新设备验证。只有「陌生设备 + 密码登录」才会出现这两块，
 * 其余情况一律 hidden —— display:flex 会顶掉 hidden 属性，必须补兜底。 */
#bh-gate .lg-devnote {
  display: flex; flex-direction: column; gap: 3px;
  margin: 0 0 12px; padding: 9px 11px; border-radius: 8px;
  background: rgba(154,197,232,.09); border: 1px solid rgba(154,197,232,.20);
}
#bh-gate .lg-devnote b { font-size: 12px; font-weight: 500; color: #d5e6f4; }
#bh-gate .lg-devnote span { font-size: 11px; line-height: 1.6; color: #8ea8bd; }
#bh-gate .lg-devnote[hidden],
#bh-gate .lg-devrem[hidden] { display: none !important; }
#bh-gate .lg-devrem {
  display: flex; align-items: center; gap: 6px; margin: 4px 0 16px;
  font-size: 11px; color: #a3b6c6; cursor: pointer;
}
#bh-gate .lg-devrem input { accent-color: #b9d3e8; width: 13px; height: 13px; margin: 0; cursor: pointer; }
/* 切到新设备验证时「用密码登录」这个开关要收起来（display:block 会顶掉 hidden） */
#bh-gate .lg-opts .lg-switch[hidden] { display: none !important; }
/* v1.4.120：.setting-input 本身没有基础宽度（各处靠自己父容器撑），
   密码卡直接摆在卡里，必须显式占满，否则只有浏览器默认的 ~180px；
   默认 input 高度只有 ~19px，在卡片里过扁，补一点内边距 */
#pass-card .setting-input {
  display: block; width: 100%; height: 32px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-family: inherit;
}
#pass-card #pass-status:empty { display: none; }
#bh-gate .lg-primary {
  width: 100%; height: 44px; border: 0; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, #f0f5fa, #c8d8e6); color: #0d131a;
  font-size: 14px; font-weight: 600; letter-spacing: .22em; font-family: inherit;
  transition: transform .15s, filter .15s, opacity .2s;
}
#bh-gate .lg-primary:hover:not(:disabled) { filter: brightness(1.06); }
#bh-gate .lg-primary:active:not(:disabled) { transform: scale(.985); }
#bh-gate .lg-primary:disabled { opacity: .38; cursor: not-allowed; }

#bh-gate .lg-third {
  display: flex; align-items: center; gap: 12px; margin-top: 17px;
  padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07);
}
#bh-gate .lg-third-label { font-size: 10.5px; color: #687583; margin-right: auto; }
#bh-gate .lg-third-btn {
  padding: 5px 11px; border-radius: 6px; cursor: pointer; font-family: inherit;
  font-size: 11px; color: #9dacba; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10); transition: color .18s, border-color .18s;
}
#bh-gate .lg-third-btn:hover { color: #e4eef6; border-color: rgba(255,255,255,.24); }
#bh-gate .lg-err { min-height: 16px; margin-top: 9px; font-size: 11px; color: #f0a09a; line-height: 1.5; }
/* v1.4.119：短信发不出时把已有的「不注册，先试一下」点亮，不再多造一个同功能按钮 */
#bh-gate #lg-guest.urge { color: #cfe0ee; text-decoration: underline; text-underline-offset: 3px; }

/* 已登录态 */
#bh-gate .ready-user {
  display: flex; align-items: center; gap: 12px; padding: 15px 14px; margin: 4px 0 20px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 11px;
}
#bh-gate .ready-av {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #43586c, #202b36); color: #e2edf6; font-size: 12px;
}
#bh-gate .ready-meta b { display: block; font-size: 13.5px; font-weight: 500; color: #eaf1f7; }
#bh-gate .ready-meta small { display: block; font-size: 10.5px; color: #7f8c99; margin-top: 3px; }
#bh-gate .lg-dive { height: 50px; font-size: 15px; letter-spacing: .32em; }
#bh-gate .ready-hint {
  text-align: center; font-size: 10.5px; color: #778592; margin-top: 10px; line-height: 1.6;
}

#bh-gate .lg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.065);
  font-size: 9.5px; color: #626f7c; line-height: 1.5;
}
#bh-gate .lg-foot a { color: #8698a8; text-decoration: none; cursor: pointer; }
#bh-gate .lg-foot a:hover { color: #d3e2ee; text-decoration: underline; }
#bh-gate .lg-ver { flex-shrink: 0; letter-spacing: .06em; }

/* 右侧品牌区：从旧的居中底部大标题改成右下角，给黑洞让出画面中心 */
#bh-gate .bh-title-wrap {
  position: absolute; z-index: 2; right: clamp(26px, 5.4vw, 86px); bottom: clamp(42px, 8vh, 96px);
  width: auto; margin: 0; text-align: right;
  opacity: 0; transform: translateY(14px);
  transition: opacity 1.7s ease .42s, transform 1.7s ease .42s;
}
#bh-gate .bh-title-wrap.show { opacity: 1; transform: none; }
#bh-gate .bh-title {
  font-size: clamp(30px, 3.5vw, 48px); font-weight: 200; letter-spacing: .14em; margin-right: -.14em;
  color: #f2f7fb; text-shadow: 0 0 48px rgba(190,220,246,.34), 0 3px 22px rgba(0,0,0,.8);
}
#bh-gate .bh-sub {
  font-size: 10.5px; letter-spacing: .28em; color: #b6c2cd; margin-top: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,.9);
}
#bh-gate .bh-tagline {
  font-size: 12px; letter-spacing: .14em; color: #d7e0e8; margin-top: 13px;
  text-shadow: 0 2px 14px rgba(0,0,0,.9);
}
#bh-gate .bh-enter { display: none !important; }
#bh-gate .lg-dive.bh-enter { display: block !important; }
#bh-gate .bh-skip { display: none !important; }

/* 中小屏：面板收窄，品牌区缩小 */
@media (max-width: 1080px) {
  #bh-gate { padding-left: clamp(20px, 4vw, 52px); }
  #bh-gate .launcher { width: 312px; padding: 22px 22px 16px; }
  #bh-gate::after { width: 68%; }
}
/* 手机竖屏：登录器改成底部卡片，品牌区移到顶部，黑洞留在中间 */
@media (max-width: 640px) {
  #bh-gate {
    align-items: flex-end; justify-content: center; padding: 0 12px calc(14px + env(safe-area-inset-bottom));
  }
  #bh-gate::before { height: 46%; }
  #bh-gate::after {
    inset: auto 0 0 0; width: 100%; height: 66%;
    background: linear-gradient(to top,
      rgba(3,5,9,.96) 0%, rgba(3,5,9,.88) 36%, rgba(3,5,9,.46) 72%, rgba(3,5,9,0) 100%);
  }
  #bh-gate .gate-topbar { padding: calc(14px + env(safe-area-inset-top)) 18px 8px; }
  #bh-gate .gate-win { display: none !important; }
  #bh-gate .launcher {
    width: 100%; max-width: 430px; padding: 19px 19px 13px; border-radius: 16px;
  }
  #bh-gate .lg-kicker { font-size: 9px; }
  #bh-gate .lg-title { font-size: 19px; margin: 8px 0 3px; }
  #bh-gate .lg-desc { font-size: 10.5px; margin-bottom: 15px; }
  #bh-gate .lg-tabs { margin-bottom: 14px; }
  #bh-gate .lg-pane { min-height: 0; }
  #bh-gate .qr-box { width: 148px; height: 148px; padding: 7px; margin-bottom: 10px; }
  #bh-gate #qr-canvas { width: 134px; height: 134px; }
  #bh-gate .qr-hint { font-size: 10px; }
  #bh-gate .lg-third { margin-top: 12px; padding-top: 11px; }
  #bh-gate .bh-title-wrap {
    top: calc(72px + env(safe-area-inset-top)); bottom: auto; left: 0; right: 0;
    text-align: center;
  }
  #bh-gate .bh-title { font-size: 30px; }
  #bh-gate .bh-sub { font-size: 9px; letter-spacing: .2em; margin-top: 8px; }
  #bh-gate .bh-tagline { font-size: 11px; margin-top: 9px; }
}
/* 横屏矮窗口：面板整体压缩，避免超出可视区 */
@media (max-height: 620px) and (min-width: 641px) {
  #bh-gate .launcher { padding: 15px 20px 12px; width: 306px; }
  #bh-gate .lg-title { font-size: 19px; margin: 7px 0 3px; }
  #bh-gate .lg-desc { margin-bottom: 12px; }
  #bh-gate .qr-box { width: 132px; height: 132px; }
  #bh-gate #qr-canvas { width: 118px; height: 118px; }
  #bh-gate .lg-pane { min-height: 0; }
  #bh-gate .lg-foot { margin-top: 9px; padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  #bh-gate .launcher, #bh-gate .gate-topbar { animation: none; }
}

/* SG-LAUNCHER-MOBILE-TIGHT · 手机竖屏再压一档：把黑洞从卡片后面露出来 */
@media (max-width: 640px) {
  #bh-gate .launcher { padding: 14px 16px 10px; }
  #bh-gate .lg-kicker { font-size: 8.5px; }
  #bh-gate .lg-title { font-size: 17px; margin: 6px 0 2px; }
  #bh-gate .lg-desc { font-size: 10px; margin-bottom: 11px; }
  #bh-gate .lg-tabs { margin-bottom: 11px; gap: 18px; }
  #bh-gate .lg-tab { padding-bottom: 8px; font-size: 12px; }
  #bh-gate .lg-field { height: 38px; margin-bottom: 8px; }
  #bh-gate .lg-opts { margin: 9px 0 11px; font-size: 10.5px; gap: 12px; }
  #bh-gate .lg-opts .lg-switch { font-size: 10.5px; }
  #bh-gate .lg-primary { height: 40px; font-size: 13px; }
  #bh-gate .lg-third { margin-top: 10px; padding-top: 9px; }
  #bh-gate .lg-foot { margin-top: 10px; padding-top: 8px; }
  #bh-gate .qr-box { width: 132px; height: 132px; }
  #bh-gate #qr-canvas { width: 118px; height: 118px; }
  #bh-gate .qr-hint { font-size: 9.5px; }
  #bh-gate .bh-title-wrap { top: calc(52px + env(safe-area-inset-top)); }
  #bh-gate .bh-title { font-size: 26px; }
  #bh-gate .bh-sub { margin-top: 5px; font-size: 8.5px; }
  #bh-gate .bh-tagline { margin-top: 6px; font-size: 10px; }
  #bh-gate::after { height: 58%; }
  #bh-gate::before { height: 40%; }
}

/* 离线桌面版的扫码说明文字较长，缩小并允许换行 */
#bh-gate .qr-mask { font-size: 10.5px; line-height: 1.55; padding: 10px; }

/* 离线桌面版：二维码位改成深色说明区，不留一块突兀的白方块 */
#bh-gate .qr-box.qr-disabled {
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
#bh-gate .qr-box.qr-disabled #qr-canvas { visibility: hidden; }
#bh-gate .qr-box.qr-disabled .qr-mask {
  inset: 0; background: transparent; color: #aab8c5;
  font-size: 10.5px; line-height: 1.7; padding: 10px;
}

/* ═══════ 坠入后的空对话页：深色只留黑洞，浅色才出品牌文案 ═══════
 * 深色主题下画面本身就是黑洞 CG，中央再叠 logo / 标题 / slogan / 提示会糊在
 * 吸积盘亮面上（手机竖屏尤其乱）。整块欢迎区连它那层径向暗底一起收掉，
 * 只留输入框；切回浅色（白底、黑洞停渲染）时这些元素照常出现。
 * 用 !important 盖过 renderChat() 写进 style 的 display，主题切换即时生效；
 * 有消息时 JS 本来就写 display:none，与深色规则一致，不冲突。 */
html[data-theme="dark"] #welcome { display: flex; }
/* 深色与浅色一致：都展示同样的欢迎头（已去掉轨道 logo，只留文字），仅靠配色区分 */

/* 手机端设置：温度行原来的「标签 + 滑块 + 数值」挤在一行，390px 下数值会被
   顶到第二行单挂一个字，看着像错位。窄屏改成两行——标签一行，滑块与数值一行。 */
@media (max-width: 760px) {
  .setting-row.range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 10px;
  }
  .setting-row.range-row input[type="range"] {
    grid-row: 2; grid-column: 1;
    width: 100%; min-width: 0; margin: 0;
  }
  .setting-row.range-row > span {
    grid-row: 2; grid-column: 2;
    font-variant-numeric: tabular-nums;
  }
}

/* ═══════════ 遥控电脑（手机下发 / 桌面执行） ═══════════ */
.view-remote { display: none; flex-direction: column; min-height: 0; }
.view-remote.active { display: flex; }
.remote-body {
  flex: 1; overflow-y: auto; min-height: 0;
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 4px 20px 40px;
}
.remote-state {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); margin-bottom: 14px;
}
.remote-state-text { flex: 1; min-width: 0; }
.remote-state-text b { display: block; font-size: 14px; font-weight: 600; }
.remote-state-text small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--dim); line-height: 1.5; }
.remote-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: #9a9a9a; box-shadow: 0 0 0 3px rgba(154,154,154,.14);
}
.remote-dot.on { background: #1fbf75; box-shadow: 0 0 0 3px rgba(31,191,117,.16), 0 0 10px 1px rgba(31,191,117,.55); }
.remote-dot.warn { background: #e0a63a; box-shadow: 0 0 0 3px rgba(224,166,58,.16); }
.remote-refresh { flex: 0 0 auto; font-size: 12px; padding: 6px 12px; }

.remote-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .remote-acts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.remote-act {
  text-align: left; padding: 12px 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font: inherit; transition: background .16s, border-color .16s;
  min-width: 0;
}
.remote-act:hover { background: var(--hover-bg); border-color: var(--text); }
.remote-act:active { transform: translateY(1px); }
.remote-act b { display: block; font-size: 13.5px; font-weight: 600; }
.remote-act span { display: block; margin-top: 3px; font-size: 11px; color: var(--dim); line-height: 1.45; }

.remote-field { margin-bottom: 14px; }
.remote-field > label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
.remote-field > label i { font-style: normal; font-size: 10.5px; color: #e0a63a; margin-left: 4px; }
.remote-row { display: flex; gap: 8px; align-items: center; }
.remote-row input {
  flex: 1; min-width: 0; padding: 9px 12px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text); outline: none;
}
.remote-row input:focus { border-color: var(--text); }
.remote-row .primary-btn { flex: 0 0 auto; padding: 9px 16px; font-size: 13px; }

.remote-list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px; font-size: 11.5px; letter-spacing: .12em; color: var(--dim);
}
.remote-list { display: flex; flex-direction: column; gap: 10px; }
.remote-empty { padding: 26px 0; text-align: center; font-size: 12.5px; color: var(--dim); }
.remote-item { border: 1px solid var(--border); border-radius: 11px; background: var(--panel); overflow: hidden; }
.remote-item-head { display: flex; align-items: center; gap: 8px; padding: 10px 13px; font-size: 12.5px; }
.remote-item-head b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-item-head time { margin-left: auto; flex: 0 0 auto; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.remote-badge { flex: 0 0 auto; font-size: 10px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--border); color: var(--dim); }
.remote-badge.ok { color: #1fbf75; border-color: rgba(31,191,117,.45); }
.remote-badge.failed { color: #d05b4a; border-color: rgba(208,91,74,.45); }
.remote-badge.sent { color: #e0a63a; border-color: rgba(224,166,58,.45); }
.remote-out {
  margin: 0; padding: 10px 13px 12px; border-top: 1px dashed var(--border);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow-y: auto;
}
.remote-out.muted { color: var(--dim); font-family: inherit; }

@media (max-width: 760px) {
  .remote-body { padding: 2px 16px 32px; }
  .remote-row { gap: 6px; }
  .remote-row .primary-btn { padding: 9px 13px; }
  .remote-out { max-height: 200px; }
}

/* 微信 / QQ 未接开放平台：虚线 + 降透明度，点进去给明确说明，不像坏按钮 */
#bh-gate .lg-third-btn.off { opacity: .45; border-style: dashed; }

/* 遥控页的「清空已完成」复用登录器的 .lg-link，那里是浅底块状按钮，
   放在深色记录区上方太抢眼，这里还原成一行淡字链接 */
#remote-clear {
  background: none; border: 0; padding: 2px 0; height: auto;
  color: var(--dim); font-size: 11.5px; letter-spacing: 0;
}
#remote-clear:hover { color: var(--text); background: none; }

/* ═══════════ 桌面端无边框窗口：拖动区 ═══════════ */
/* v1.4.36 起 — □ × 改由 Windows 原生 titleBarOverlay 绘制（main.js 里配），
   网页不再画按钮：真实鼠标下 Chromium 会把 drag 区当标题栏，覆盖其上的网页
   按钮点击被吞（1.4.34/1.4.35 两版都栽在这里）。此处只剩拖动区与让位规则。
   浏览器/手机里 body 没有 .is-desktop，下面所有规则一律不生效。 */

/* 拖动区：登录器顶栏、对话页头、各视图页头、侧栏品牌区 —— 抓住就能拖。
   其中的按钮/输入框标记 no-drag，点击不受影响 */
body.is-desktop .gate-topbar,
body.is-desktop .chat-header,
body.is-desktop .view-header,
body.is-desktop .sidebar-brand { -webkit-app-region: drag; }
body.is-desktop :is(.gate-topbar, .chat-header, .view-header, .sidebar-brand)
  :is(button, input, textarea, select, a) { -webkit-app-region: no-drag; }

/* 桌面端右上角是原生按钮条（40px 高 × 约 140px 宽）：不留白的话，
   页头右侧的模型/设置/导出会被原生按钮压住，点不到也看不清 */
body.is-desktop .chat-header { padding-right: 168px; }
body.is-desktop .view-header { padding-right: 168px; }
body.is-desktop #bh-gate .gate-topbar { padding-right: 168px; }

/* ═══════════ v1.4.40 在线支付：升级页支付按钮 + 支付弹窗 ═══════════ */
#upg-btns .solid,
.modal .solid {
  border: 1px solid var(--text); background: var(--text); color: var(--bg);
  padding: 8px 16px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
}
#upg-btns .solid:hover,
.modal .solid:hover { filter: brightness(.92); }
#upg-btns .solid:disabled { opacity: .6; cursor: default; }
#upg-btns { max-width: 100%; }
#upg-btns .solid { flex: 0 0 auto; }

/* ═══════════ v1.4.42 在线热更新小条（左下角，用户区上方） ═══════════ */
.web-update-chip {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 12px; margin-bottom: 6px;
  border: 1px solid color-mix(in srgb, var(--ok, #2ecc71) 45%, transparent);
  background: color-mix(in srgb, var(--ok, #2ecc71) 12%, transparent);
  color: var(--text); border-radius: 10px; cursor: pointer; text-align: left;
}
.web-update-chip:hover { background: color-mix(in srgb, var(--ok, #2ecc71) 20%, transparent); }
.wuc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px;
  background: var(--ok, #2ecc71); animation: wucPulse 1.6s ease-in-out infinite;
}
@keyframes wucPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.wuc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wuc-ver { font-size: 12.5px; font-weight: 700; }
.wuc-note { font-size: 10.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wuc-arr { font-size: 12px; color: var(--dim); flex: 0 0 auto; }
.web-update-chip.busy { opacity: .55; cursor: default; pointer-events: none; }

/* ── v1.4.56 用户头像：预设几何图形 + 配色 ──────────────────────────
   同一个 data-av/data-tone 走遍侧边栏、消息气泡、账号面板、门户与桌面端；
   auto 由昵称/手机号散列选 tone，不存图片、不依赖外链。 */
.sg-av {
  position: relative; isolation: isolate; overflow: hidden;
  color: #fff !important; border-color: rgba(255, 255, 255, .22) !important;
}
.sg-av[data-tone="0"] { background: linear-gradient(145deg, #5b8cff, #8a5bff) !important; }
.sg-av[data-tone="1"] { background: linear-gradient(145deg, #12b8a6, #1478c8) !important; }
.sg-av[data-tone="2"] { background: linear-gradient(145deg, #ff9a5a, #e2547d) !important; }
.sg-av[data-tone="3"] { background: linear-gradient(145deg, #7c6bff, #c45bd6) !important; }
.sg-av[data-tone="4"] { background: linear-gradient(145deg, #35a7ff, #2f5bd7) !important; }
.sg-av[data-tone="5"] { background: linear-gradient(145deg, #f2b53c, #e0662f) !important; }
.sg-av[data-tone="6"] { background: linear-gradient(145deg, #3fc98b, #168a8a) !important; }
.sg-av[data-tone="7"] { background: linear-gradient(145deg, #ef6ea8, #8d5bd6) !important; }
.sg-av::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(255, 255, 255, .38);
}
.sg-av[data-av="auto"]::before { display: none; }
.sg-av[data-av="g0"]::before { clip-path: circle(25% at 76% 26%); }
.sg-av[data-av="g1"]::before { clip-path: polygon(50% 6%, 97% 92%, 3% 92%); }
.sg-av[data-av="g2"]::before { clip-path: polygon(50% 2%, 98% 50%, 50% 98%, 2% 50%); }
.sg-av[data-av="g3"]::before { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 35%, 39% 35%); }
.sg-av[data-av="g4"]::before { clip-path: circle(62% at 6% 108%); }
.sg-av[data-av="g5"]::before { clip-path: polygon(0 0, 46% 0, 46% 46%, 100% 46%, 100% 100%, 0 100%); }
.sg-av[data-av="g6"]::before { clip-path: polygon(0 62%, 22% 38%, 44% 62%, 66% 38%, 88% 62%, 100% 48%, 100% 100%, 0 100%); }
.sg-av[data-av="g7"]::before { clip-path: polygon(0 0, 100% 0, 100% 34%, 0 92%); }
/* 资料弹窗里的头像选择器 */
.av-pick-label { margin-top: 14px; font-size: 11.5px; color: var(--dim); }
.av-pick-label span { opacity: .8; }
.av-pick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.av-pick {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer;
  font-size: 13.5px; font-weight: 700; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.av-pick:hover { transform: translateY(-2px); }
.av-pick.on { border-color: #fff !important; box-shadow: 0 0 0 2px rgb(var(--acc) / .45); }

/* ══════════ 外部文件拖拽 / 粘贴提示遮罩（v1.4.57） ══════════ */
#drop-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(7, 11, 18, .46);
  /* 关键：遮罩不吃鼠标事件，dragenter/drop 才能稳定冒泡到 document */
  pointer-events: none;
}
#drop-overlay.show { display: flex; }
.drop-card {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  width: min(86vw, 500px); padding: 34px 38px;
  border: 2px dashed rgb(var(--acc) / .72); border-radius: 18px;
  background: var(--panel); color: var(--text);
  box-shadow: 0 20px 66px rgba(0, 0, 0, .32);
  text-align: center;
}
.drop-card svg { width: 38px; height: 38px; color: rgb(var(--acc)); flex-shrink: 0; }
.drop-card b { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.drop-card span { font-size: 13px; opacity: .82; }
.drop-card small { font-size: 11.5px; color: var(--dim); line-height: 1.6; }
#drop-overlay.working .drop-card { border-style: solid; }
#drop-overlay.working .drop-card svg { animation: dp-pulse 1.1s ease-in-out infinite; }
@keyframes dp-pulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}
@media (max-width: 560px) {
  .drop-card { padding: 26px 20px; }
  .drop-card b { font-size: 15px; }
}

/* ══════════════════ v1.4.61：资料库 / 版本 / 引用 / 对比 / 合规 / 按住说话 ══════════════════ */
.attach-tools { display: flex; align-items: center; gap: 8px; padding: 0 4px 4px; }
.attach-tools:empty { display: none; }
.compliance-badge {
  font-size: 11.5px; color: var(--dim); border: 1px dashed var(--border);
  border-radius: 999px; padding: 2px 8px;
}

/* 版本徽标 */
.ver-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; height: 17px; line-height: 17px;
  font-size: 10.5px; font-family: var(--mono); border-radius: 5px;
  border: 1px solid var(--border); color: var(--dim); cursor: pointer; vertical-align: middle;
}
.ver-badge:hover { color: var(--text); border-color: var(--text); }
.ver-menu {
  position: fixed; z-index: 400; min-width: 240px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 4px;
}
.ver-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text); padding: 7px 9px;
  border-radius: 7px; cursor: pointer; font-size: 12.5px;
}
.ver-item:hover { background: var(--hover-bg); }
.ver-item.on { background: var(--primary-soft); }
.ver-item span { color: var(--dim); font-size: 11.5px; }

/* 资料库 */
.lib-head { margin: 22px 0 8px; }
.lib-head h3 { font-size: 13px; letter-spacing: .12em; color: var(--dim); font-weight: 600; margin: 0 0 8px; }
.lib-search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-search-row input { flex: 1; min-width: 200px; }
.lib-item { flex-wrap: wrap; }
.lib-item .lib-ops { display: flex; gap: 6px; margin-left: auto; }
.lib-hit {
  flex-basis: 100%; margin: 6px 0 0 30px; font-size: 12px; color: var(--dim);
  line-height: 1.55; border-left: 2px solid var(--border); padding-left: 8px;
}

/* 引用 chip */
.cite-chip {
  display: inline; border-bottom: 1px dashed currentColor; cursor: pointer;
  color: var(--text); opacity: .92;
}
.cite-chip:hover { opacity: 1; border-bottom-style: solid; }
.cite-modal {
  position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.cite-box {
  width: min(760px, 100%); max-height: 82vh; overflow: auto; background: var(--panel);
  color: var(--text); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35); padding: 16px 18px;
}
.cite-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cite-head b { flex: 1; font-size: 14px; }
.cite-close {
  border: 1px solid var(--border); background: transparent; color: var(--text);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.cite-close:hover { background: var(--hover-bg); }
.cite-box img { display: block; max-width: 100%; border-radius: 10px; margin: 6px 0 10px; border: 1px solid var(--border); }
.cite-text {
  white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.7; background: var(--code-bg); color: var(--code-text);
  border-radius: 10px; padding: 12px 14px; margin: 0; max-height: 46vh; overflow: auto;
}
/* v1.4.148：提示条独立在滚动区外——以前它跟在列表末尾，列表一长就被裁在视口外 */
.cite-tip {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; line-height: 1.65; color: var(--dim);
}

/* 数字校验 chip */
.numcheck-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; cursor: pointer;
}
.numcheck-chip:hover { color: var(--text); border-color: var(--text); }
.numcheck-chip.warn { color: var(--danger); border-color: currentColor; }

/* 按住说话 */
.ptt-btn { width: auto; padding: 0 10px; gap: 5px; }
.ptt-btn .ptt-label { font-size: 11.5px; }
.ptt-btn.rec { color: #fff; background: #d33; border-color: #d33; }
.ptt-hint {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  display: none; align-items: center; gap: 8px; z-index: 480;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 16px; font-size: 12.5px; box-shadow: var(--shadow);
  font-family: var(--mono);
}
.ptt-hint.rec { border-color: #d33; }
.ptt-hint.busy { border-color: var(--text); }

/* 截屏框选 */
.cap-overlay {
  position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, .72);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.cap-tip { color: #fff; font-size: 13px; opacity: .9; }
.cap-stage { position: relative; max-width: 92vw; max-height: 82vh; cursor: crosshair; }
.cap-img { display: block; max-width: 92vw; max-height: 82vh; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
.cap-sel {
  position: absolute; border: 2px solid #fff; background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); pointer-events: none; border-radius: 2px;
}
.cite-modal[hidden], .cap-overlay[hidden] { display: none !important; }

/* ══════════ v1.4.62：来源面板 / 表格导出 / 定时任务 ══════════ */
.cite-panel { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 8px; }
.cite-panel-btn {
  flex: none; font-size: 11.5px; font-family: var(--mono); letter-spacing: .02em;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--dim); border: 1px solid var(--border);
}
.cite-panel-btn:hover, .cite-panel-btn.on { color: var(--text); border-color: var(--text); }
.cite-panel-list {
  flex-basis: 100%; display: flex; flex-direction: column; gap: 4px;
  border-left: 2px solid var(--border); padding-left: 10px; margin-top: 2px;
}
/* v1.4.134：hidden 必须真的隐藏 —— 上面这条 display:flex 会盖掉 UA 对 [hidden] 的处理，
   导致来源列表一直默认展开、点「信息来源 N」像是没反应（同 .rp-pane[hidden] 踩过的坑） */
.cite-panel-list[hidden] { display: none !important; }
.cite-panel-item {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: transparent; border: 0; padding: 3px 2px; cursor: pointer;
  color: var(--text); font-size: 12.5px; border-radius: 6px;
}
.cite-panel-item:hover { background: var(--hover, rgba(127, 127, 127, .08)); }
.cp-idx {
  flex: none; width: 18px; height: 18px; border-radius: 5px; font-size: 10.5px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--dim); font-family: var(--mono);
}
.cp-txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-tag { flex: none; font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.sheet-export-chip { margin-left: 8px; }

.cron-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 8px; }
.cron-empty {
  padding: 26px 18px; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.9;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.cron-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  background: var(--panel); display: flex; flex-direction: column; gap: 8px;
}
.cron-card.off { opacity: .58; }
.cron-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cron-card-head b { font-size: 14px; }
.cron-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cron-tag {
  font-size: 11px; font-family: var(--mono); padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--dim);
}
.cron-when { font-size: 11.5px; color: var(--dim); margin-left: auto; }
.cron-prompt { font-size: 12.5px; color: var(--dim); line-height: 1.65; white-space: pre-wrap; }
.cron-result {
  font-size: 12px; line-height: 1.7; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  max-height: 128px; overflow: auto; white-space: pre-wrap;
}
.cron-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cron-acts .ghost-btn { font-size: 12px; padding: 5px 12px; }
.ghost-btn.danger { color: var(--danger); }
.cron-switch { position: relative; display: inline-flex; width: 38px; height: 21px; cursor: pointer; flex: none; }
.cron-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cron-switch span {
  flex: 1; border-radius: 999px; background: var(--border); position: relative; transition: background .16s;
}
.cron-switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--panel); transition: transform .16s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.cron-switch input:checked + span { background: var(--primary); }
.cron-switch input:checked + span::after { transform: translateX(17px); }

.cron-editor {
  margin: 4px 20px 24px; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel); display: flex; flex-direction: column; gap: 12px;
}
.cron-editor[hidden] { display: none !important; }
.cron-editor-head { display: flex; align-items: center; justify-content: space-between; }
.cron-field { display: flex; flex-direction: column; gap: 6px; }
.cron-field > span { font-size: 12px; color: var(--dim); }
.cron-field[hidden] { display: none !important; }
.cron-freq, .cron-days { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; }
.cron-freq label, .cron-days label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.cron-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); }
.cron-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* MCP 连接器 */
.mcp-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mcp-empty { font-size: 12.5px; color: var(--dim); }
.mcp-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.mcp-item-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mcp-ok { font-size: 11px; color: var(--primary); font-family: var(--mono); }
.mcp-bad { font-size: 11px; color: var(--danger); font-family: var(--mono); }
.mcp-cmd { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-top: 4px; word-break: break-all; }
.mcp-tools { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.mcp-tools code { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--dim); }
.mcp-err { margin-top: 6px; font-size: 11.5px; color: var(--danger); }
.mcp-json { font-family: var(--mono); font-size: 12px; width: 100%; resize: vertical; }
.mcp-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.mcp-hint { font-size: 11.5px; color: var(--dim); }
/* v1.4.64 远端 MCP：管理员口令输入 + 汇总行 */
.mcp-admin { max-width: 260px; font-family: var(--mono); font-size: 12px; }
.mcp-sum { font-size: 11.5px; color: var(--dim); font-family: var(--mono); }

/* ══════════ v1.4.63：相册 ══════════ */
.media-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.media-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.media-tab { border: 1px solid var(--border); background: var(--panel); color: var(--dim); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; transition: .15s; }
.media-tab:hover { color: var(--text); border-color: var(--text); }
.media-tab.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.media-tab span { opacity: .65; font-size: 11px; margin-left: 2px; }
.media-search-row { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 220px; }
.media-search-row .setting-input { max-width: 320px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding-bottom: 24px; }
.media-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.media-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--hover-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.media-thumb.is-audio { flex-direction: column; gap: 8px; cursor: default; }
.media-thumb.is-audio audio { width: 88%; }
.media-audio-ico { font-size: 26px; }
.media-badge { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; font-family: var(--mono); }
.media-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 6px; }
.media-prompt { font-size: 12.5px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-meta { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.media-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.media-ops a.ghost-btn { text-decoration: none; display: inline-flex; align-items: center; }
.media-empty { text-align: center; color: var(--dim); font-size: 13px; padding: 60px 20px; line-height: 1.9; }
.media-empty span { font-size: 12px; opacity: .8; }

/* ══════════ v1.4.63：团队空间 ══════════ */
.team-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.team-empty { font-size: 12.5px; color: var(--dim); padding: 6px 0; }
.team-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--hover-bg); }
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-head b { font-size: 13.5px; }
.team-tag { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.team-code-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.team-code-label { font-size: 11.5px; color: var(--dim); }
.team-code { font-family: var(--mono); font-size: 14px; letter-spacing: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.team-members { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.team-member { font-size: 11.5px; font-family: var(--mono); border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 2px 8px; color: var(--dim); }
.team-member.self { color: var(--text); border-color: var(--text); }
.team-member.kickable { cursor: pointer; }
.team-member.kickable:hover { color: #c0392b; border-color: #c0392b; }
.team-ops { display: flex; gap: 8px; flex-wrap: wrap; }
.team-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.team-actions .setting-input { flex: 1; min-width: 160px; }
.team-code-input { text-transform: uppercase; letter-spacing: 2px; font-family: var(--mono); }
.team-hint { font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.team-badge { font-size: 10.5px; font-family: var(--mono); color: var(--dim); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; margin-left: 6px; }
.lib-item.is-team { border-left: 2px solid var(--text); }
.cron-tag.team { color: var(--text); border-color: var(--text); }

/* ══════════ v1.4.63：移动端（安装引导 / 离线 / 底部导航） ══════════ */
.pwa-banner { position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 900; display: flex; align-items: center; gap: 10px; background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .28); font-size: 12.5px; }
.pwa-txt { flex: 1; line-height: 1.4; }
.pwa-btn { background: var(--on-primary); color: var(--primary); border: 0; border-radius: 6px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.pwa-x { background: transparent; border: 0; color: var(--on-primary); opacity: .7; font-size: 14px; cursor: pointer; }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 950; background: #c0392b; color: #fff; text-align: center; font-size: 12.5px; padding: 5px 10px; }
.mobile-tabbar { display: none; }
@media (max-width: 760px) {
  .mobile-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 880; background: var(--panel); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .mt-btn { flex: 1; border: 0; background: transparent; color: var(--dim); font-size: 10.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; cursor: pointer; }
  .mt-btn.on { color: var(--text); }
  .mt-btn svg { width: 20px; height: 20px; }
  body.kb-open { padding-bottom: 0; }
  /* 应用本身是 100dvh 的 flex 壳：给底部导航留出高度，输入框才不会被压到栏下面 */
  #app { height: calc(100dvh - 52px - env(safe-area-inset-bottom)); }
  body.kb-open #app { height: 100dvh; }
  body.kb-open .mobile-tabbar { display: none; }
  .pwa-banner { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .media-search-row .setting-input { max-width: none; }
}

/* ───────── v1.4.80 设置页：平铺卡片 + 右上角关闭 ─────────
   旧「常用 / 高级 / 全部 + 搜索 + 22 个快速跳转标签」整块已下线，
   所有卡片恒可见；关闭按钮回到进入设置前的那一页。 */
.set-close-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--dim); font: inherit; font-size: 12.5px;
  white-space: nowrap; cursor: pointer;
}
.set-close-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.set-desktop-note { font-size: 12px; color: var(--dim); line-height: 1.7; padding: 10px 14px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.set-desktop-note[hidden] { display: none; }
.set-desktop-note a { color: var(--text); text-decoration: underline; }

/* 自动画像（v1.4.71） */
.profile-auto-box { margin-top: 12px; border-top: 1px dashed var(--line, rgba(127,127,127,.25)); padding-top: 12px; }
.profile-auto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-auto-head .switch-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.profile-auto-text { margin: 8px 0 6px; font-size: 13px; line-height: 1.7; color: var(--fg2, #888); background: var(--panel2, rgba(127,127,127,.07)); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }

/* 腾讯文档导入（v1.4.71） */
.lib-import-row { display: flex; gap: 8px; margin-top: 8px; }
.lib-import-row .setting-input { flex: 1; }

/* 第三方登录真实头像（v1.4.73）：微信/QQ 头像原图铺满，盖掉配色渐变 */
.sg-av.sg-av-img {
  background-image: var(--av-url) !important;
  background-size: cover !important;
  background-position: center !important;
  background-color: #1c1c1e !important;
  color: transparent !important;
}

/* ══════════ v1.4.74 登录器：明示同意 + 二维码有效期 ══════════ */
#bh-gate .lg-agree {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 14px;
  font-size: 10.5px; line-height: 1.65; color: #7f8b98; cursor: pointer;
}
#bh-gate .lg-agree input {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 3px; background: transparent;
  cursor: pointer; position: relative; transition: border-color .18s, background .18s;
}
#bh-gate .lg-agree input:checked { background: #dfeaf5; border-color: #dfeaf5; }
#bh-gate .lg-agree input:checked::after {
  content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #0b1016; font-weight: 700;
}
#bh-gate .lg-agree input:focus-visible { outline: 1px solid rgba(207, 227, 247, .7); outline-offset: 2px; }
#bh-gate .lg-agree a { color: #9db0c2; text-decoration: none; }
#bh-gate .lg-agree a:hover { color: #e2eef8; text-decoration: underline; }
#bh-gate .lg-agree.need { animation: agreeShake .32s ease; }
#bh-gate .lg-agree.need input { border-color: #f0a09a; box-shadow: 0 0 0 3px rgba(240, 160, 154, .16); }
@keyframes agreeShake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

#bh-gate .qr-foot { display: flex; align-items: center; justify-content: center; gap: 13px; margin-top: 3px; }
#bh-gate .qr-ttl { font-size: 10px; color: #6f7d8b; letter-spacing: .04em; }
#bh-gate .qr-ttl.warn { color: #e0b083; }

/* ══════════ v1.4.74 执行过程可展开：参数 / 结果 / 耗时 / 失败原因 ══════════ */
.step-row.det { display: block; }
.step-row.det > summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer; border-radius: 6px;
  padding: 2px 4px; margin: 0 -4px;
  transition: background .15s;
}
.step-row.det > summary:hover { background: var(--hover-bg); }
.step-row.det > summary::-webkit-details-marker { display: none; }
.step-row.det > summary::after {
  content: '⌄'; flex: 0 0 auto; font-size: 9px; color: var(--dim-2);
  transform: translateY(-1px); transition: transform .18s;
}
.step-row.det[open] > summary::after { transform: rotate(180deg); }
.step-row.det > summary .step-txt { flex: 1; min-width: 0; }
.step-ms { flex: 0 0 auto; font-size: 9.5px; color: var(--dim-2); letter-spacing: .02em; }
.step-badge {
  flex: 0 0 auto; font-size: 9px; line-height: 1; padding: 2px 5px; border-radius: 4px;
  background: var(--hover-bg); color: var(--dim);
}
.step-badge.bad { color: var(--err); background: rgba(220, 80, 80, .10); }
.step-badge.warn { color: var(--warn); background: rgba(230, 160, 60, .12); }
.step-kv.warn b { color: var(--warn); }
.step-detail {
  margin: 3px 0 6px 24px; padding: 2px 0 2px 10px;
  border-left: 1px solid var(--border);
}
.step-kv { margin: 4px 0; }
.step-kv > b {
  display: block; font-size: 9px; letter-spacing: .1em; font-weight: 500;
  color: var(--dim-2); text-transform: uppercase;
}
.step-kv > pre {
  margin: 2px 0 0; font-family: var(--mono); font-size: 10.5px; line-height: 1.65;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow: auto; opacity: .88;
}
/* 结果被截到 600 字时给一个展开入口：折叠影响的是送给模型的上下文，
   用户要自己核对原文时不该也被挡住。样式做成次要按钮，别抢「参数」的注意力。 */
.step-more {
  margin: 4px 0 0; padding: 2px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  font: inherit; font-size: 10.5px; line-height: 1.6; cursor: pointer;
}
.step-more:hover { color: var(--text); border-color: var(--dim-2); }
.step-kv.bad > pre { color: var(--err); }

/* v1.4.74：长回答最大行宽收到 760px 内（原 820 太宽，一行四十多字读起来串行） */
.messages { max-width: 780px; }
.msg.ai .msg-content { max-width: 720px; }
.msg { margin-bottom: 22px; }

/* ══════════ v1.4.74 会话条目：标题 + 条数/时间 ══════════ */
.session-item .s-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.session-item .s-title { display: block; max-width: 100%; }
.session-item .s-meta {
  font-size: 10px; color: var(--dim); opacity: .78; font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-item.active .s-meta { color: inherit; opacity: .68; }

/* v1.4.74：最小高度只给扫码面板（二维码是固定 180 + 说明），手机号面板按内容自然高，
   否则登录按钮下方会空出一大块，协议行被推到卡片底部 */
#bh-gate .lg-pane { min-height: 0; }
#bh-gate #lg-pane-qr { min-height: 236px; }
#bh-gate .lg-agree { margin-top: 13px; }
#bh-gate #lg-guest { margin-top: 10px; display: inline-block; }
.step-row.bad .step-no { border-color: var(--err); color: var(--err); background: transparent; }
.step-row.bad.done .step-no { background: transparent; color: var(--err); border-color: var(--err); }

/* v1.4.74：长会话折叠「显示更早」 */
.load-earlier {
  display: block; margin: 4px auto 18px; padding: 6px 16px;
  border: 1px solid var(--border); border-radius: 999px; background: transparent;
  color: var(--dim); font-family: inherit; font-size: 11.5px; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.load-earlier:hover { color: var(--text); border-color: var(--text); background: var(--hover-bg); }

/* v1.4.101：长会话滚动性能——视口外的消息跳过布局与绘制（content-visibility）。
   DOM 节点全部保留：Ctrl+K 锚点跳转、结果区 rpJumpTo、「显示更早」折叠都照常工作，
   浏览器滚到附近才真正排版；contain-intrinsic-size 的 auto 让它记住每个块
   上次渲染的真实高度，滚动条不会抖。选 .msg 一层即可（消息体才是高度大头）。 */
#messages .msg {
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}
/* 流式中的活跃消息与「显示更早」按钮不参与跳过：增量渲染每帧都在写 DOM，
   交给 cv:auto 的可见性判定反而可能引入布局抖动 */
#messages .msg.msg-live, #messages .load-earlier {
  content-visibility: visible;
}

/* v1.4.74：键盘焦点环（深色底上默认 outline 太弱） */
.msg-content a:focus-visible, .session-item:focus-visible, .nav-item:focus-visible,
button:focus-visible, [role="button"]:focus-visible, input:focus-visible, textarea:focus-visible,
[contenteditable="true"]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* v1.4.74 起思考状态：v1.4.86 改为「不抢注意力」——浅灰一行小字 + 极弱呼吸点，
   思维链默认折叠，点开才看；不再用强调色/粗体把等待过程做成一个显眼模块。 */
.thinking-block.live summary { opacity: .9; color: var(--dim); font-weight: 400; }
.thinking-block.live summary::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%; margin-left: 2px;
  background: var(--dim); opacity: .6; animation: thinkPulse 1.5s ease-in-out infinite;
}
@keyframes thinkPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: .7; transform: scale(1); } }
.thinking-block.live .thinking-content { border-left-color: var(--border); opacity: .8; }

/* ══════════ v1.4.75 右侧结果区：产物 / 网页 / 变更 ══════════ */
/* 对话列与结果区并排：chat-main 是 flex 行，chat-col 包住原来的消息流与输入框 */
.chat-main { flex: 1; display: flex; min-height: 0; position: relative; min-width: 0; }
.chat-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.result-panel {
  flex: none; width: 0; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid transparent;
  transition: width .24s ease, border-color .24s ease;
}
.view-chat.rp-open .result-panel { width: 320px; border-left-color: var(--border); }

.rp-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 0; border-bottom: 1px solid var(--border);
  min-width: 320px;   /* 收起动画期间内容不被压变形 */
}
.rp-tabs { display: flex; gap: 2px; }
.rp-tab {
  border: 0; background: transparent; color: var(--dim); font-family: inherit;
  font-size: 12.5px; padding: 7px 10px 9px; cursor: pointer; position: relative;
  border-bottom: 2px solid transparent; transition: color .15s;
}
.rp-tab:hover { color: var(--text); }
.rp-tab.on { color: var(--text); border-bottom-color: var(--primary); }
.rp-n {
  display: inline-block; min-width: 15px; padding: 0 4px; margin-left: 3px;
  font-size: 10px; line-height: 15px; text-align: center; border-radius: 8px;
  background: var(--hover-bg); color: var(--dim);
}
.rp-tab.on .rp-n { color: var(--text); }
.rp-head .icon-btn { margin-bottom: 4px; }

.rp-body { flex: 1; overflow-y: auto; min-width: 320px; padding: 10px; }
.rp-pane { display: flex; flex-direction: column; gap: 8px; }

.rp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s;
}
a.rp-item:hover { border-color: var(--primary); }
.rp-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex: none; background: var(--hover-bg); }
.rp-tag {
  flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; border-radius: 8px;
  background: var(--hover-bg); color: var(--dim);
}
.rp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rp-info b {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-info small { font-size: 10.5px; color: var(--dim); }
.rp-info p { font-size: 11px; color: var(--dim); line-height: 1.5; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rp-ops { flex: none; display: flex; gap: 4px; }
.rp-op {
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  font-family: inherit; font-size: 11px; padding: 4px 8px; border-radius: 7px;
  cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s;
}
.rp-op:hover { color: var(--text); border-color: var(--text); }
.rp-op.primary { color: var(--primary); border-color: var(--primary); }

.rp-web-ico { flex: none; font-size: 15px; opacity: .8; }
.rp-change-ico { flex: none; width: 22px; text-align: center; font-size: 13px; color: var(--dim); }
.rp-change.bad .rp-change-ico { color: var(--err); }
.rp-change.bad .rp-info b { color: var(--err); }

.rp-empty {
  padding: 34px 16px; text-align: center; font-size: 12.5px; color: var(--dim);
  border: 1px dashed var(--border); border-radius: 10px; line-height: 1.9;
}
.rp-empty span { font-size: 11px; opacity: .8; }

/* 头部开关按钮上的产物计数徽标 */
#btn-result-panel { position: relative; }
.rp-badge {
  position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 8px; background: var(--primary); color: #fff;
  font-size: 9.5px; line-height: 15px; text-align: center; pointer-events: none;
}
#btn-result-panel[aria-pressed="true"] { color: var(--primary); }

.rp-mask { display: none; }

/* 移动端：结果区变成右侧抽屉，罩住对话 */
@media (max-width: 860px) {
  .result-panel {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 30;
    width: min(320px, 88vw); border-left: 1px solid var(--border);
    transform: translateX(105%); transition: transform .24s ease;
  }
  .view-chat.rp-open .result-panel { width: min(320px, 88vw); transform: none; box-shadow: -12px 0 32px rgba(0, 0, 0, .35); }
  .rp-mask {
    display: block; position: absolute; inset: 0; z-index: 29;
    background: rgba(0, 0, 0, .4);
  }
}
/* hidden 必须真的隐藏：.rp-pane 的 display:flex 会盖掉 UA 对 [hidden] 的处理 */
.result-panel .rp-pane[hidden] { display: none !important; }

/* ══════════ v1.4.76 · UX 走查收口 ══════════ */
/* P0-1：移动端结果抽屉收起时 translateX(105%) 会撑出整页横向滚动。
   chat-main 是它的定位父级，在这里裁掉，document.scrollWidth 才等于视口宽。
   v1.4.180：断点必须与抽屉的断点一致 —— 抽屉在 ≤1024px 改绝对定位，
   这里却只在 ≤860px 裁切，861–1024 这一段一直可以横向滑到一片空白。 */
@media (max-width: 1024px) {
  .chat-main { overflow: hidden; }
}

/* P0-2：删除按钮给足可见尺寸；撤销按钮要能点（toast 本身 pointer-events:none） */
.session-item .s-del { width: 28px; height: 28px; font-size: 13px; opacity: .4; }
.session-item:hover .s-del, .session-item.active .s-del { opacity: .9; }
.toast { max-width: min(92vw, 560px); gap: 12px; line-height: 1.55; }
.toast-act {
  pointer-events: auto; flex: none; border: 1px solid currentColor; background: transparent;
  color: inherit; font: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.toast-act:hover { background: rgba(127, 127, 127, .2); }

/* P1-1：首次价值 —— 示例 chips 与常驻上手入口 */
.welcome-examples { max-width: 720px; margin: 18px auto 0; }
.welcome-guide { margin-top: 12px; }
.welcome-guide[hidden] { display: none !important; }
.wx-chip.ghost { border-style: dashed; opacity: .82; font-size: 11.5px; }
.guest-tip {
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  font: inherit; font-size: 11px; padding: 5px 10px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; margin-right: 4px;
}
.guest-tip b { color: var(--primary); font-weight: 600; margin-left: 4px; }
.guest-tip:hover { border-color: var(--primary); color: var(--text); }
@media (max-width: 860px) { .guest-tip { font-size: 10px; padding: 4px 8px; } }
/* 手机上顶栏只有 390px：长文案会把整行撑出横向滚动，收成一个 28px 圆点，点击行为不变 */
@media (max-width: 860px) {
  .guest-tip {
    width: 28px; height: 28px; flex: none; padding: 0; border-radius: 50%;
    font-size: 0; overflow: hidden; white-space: nowrap;
  }
  .guest-tip::before { content: '客'; font-size: 11px; }
  .guest-tip b { display: none; }
}

/* P1-2：定时任务结果红点 */
.nav-badge {
  margin-left: auto; flex: none; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--err, #e5484d); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 700;
}
.nav-badge[hidden] { display: none !important; }

/* P1-3：结果区条目可跳回产出它的消息 */
.rp-item[data-eid] { cursor: pointer; }
.rp-item[data-eid]:hover { border-color: var(--primary); }
.rp-jump {
  flex: none; font-size: 11px; color: var(--dim); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 6px; cursor: pointer;
}
.rp-jump:hover { color: var(--primary); border-color: var(--primary); }
.msg.rp-flash { animation: rpFlash 1.6s ease-out; }
@keyframes rpFlash {
  0%, 55% { box-shadow: 0 0 0 2px var(--primary), 0 0 22px rgba(99, 102, 241, .28); }
  100% { box-shadow: none; }
}

/* 30 秒上手浮层 */
.guide-body { display: flex; flex-direction: column; gap: 12px; }
.guide-row { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 1.65; color: var(--dim); }
.guide-row b { color: var(--text); font-size: 12.5px; letter-spacing: .3px; }
.guide-row span { padding-left: 2px; }

/* v1.4.80：设置页工具条已下线，锚点 / 搜索计数 / 高亮样式一并移除 */

/* ══════════ v1.4.77 · 资料库视觉重做 ══════════
   旧版三个问题：① 区块没有左右内边距，和上方的知识库列表不对齐；
   ② 两个裸输入框平铺，没有层次；③ 空状态只有一行灰字，大片留白没有引导。 */
.lib-panel {
  margin: 18px 36px 0; flex: none;
  border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--panel) 46%);
  padding: 20px 22px 18px; box-shadow: 0 2px 14px rgba(0,0,0,.035);
}
.lib-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.lib-kicker { display: block; font: 600 10px/1.4 var(--mono, monospace); letter-spacing: .16em; color: var(--primary); margin-bottom: 6px; }
.lib-title-wrap h3 { font-size: 17px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.2px; }
.lib-title-wrap p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--dim); }
.lib-stat {
  flex: none; min-width: 96px; text-align: center; border: 1px solid var(--border);
  background: var(--panel); border-radius: 12px; padding: 9px 12px;
}
.lib-stat[hidden] { display: none !important; }
.lib-stat b { display: block; font-size: 21px; line-height: 1.2; color: var(--primary); font-weight: 700; }
.lib-stat span { display: block; font-size: 10.5px; color: var(--dim); margin-top: 2px; }

.lib-controls { margin-top: 16px; }
.lib-search-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-search-box {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--panel);
  padding: 0 12px; height: 40px; transition: border-color .15s, box-shadow .15s;
}
.lib-search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lib-search-ico { width: 16px; height: 16px; flex: none; color: var(--dim); }
.lib-search-box input {
  flex: 1; min-width: 0; border: none !important; outline: none !important; background: transparent !important;
  box-shadow: none !important; padding: 0 !important; height: 38px !important; font-size: 13px; color: var(--text);
}
.lib-tdoc-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; white-space: nowrap; border-radius: 11px; }
.lib-import-row {
  display: flex; gap: 8px; margin-top: 10px; padding: 10px;
  border: 1px dashed var(--border); border-radius: 11px; background: var(--panel);
}
.lib-import-row[hidden] { display: none !important; }
.lib-import-row .setting-input { flex: 1; min-width: 0; }
.lib-import-row .primary-btn { white-space: nowrap; }

/* 空状态：插画 + 三步引导，取代原来的一行灰字 */
.lib-list { padding-top: 14px !important; min-height: 240px; }
.lib-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 22px 20px 34px; }
.lib-empty-art { width: 132px; height: 96px; color: var(--primary); opacity: .75; margin-bottom: 8px; }
.lib-empty-art svg { width: 100%; height: 100%; }
.lea-paper { fill: var(--panel); stroke: currentColor; opacity: .55; }
.lea-paper.front { opacity: 1; }
.lea-lens { fill: var(--primary-soft); stroke: currentColor; }
.lea-spark { opacity: .55; }
.lib-empty > b { font-size: 15.5px; font-weight: 600; margin-bottom: 5px; }
.lib-empty > p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; color: var(--dim); max-width: 420px; }
.lib-empty-steps { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.lib-empty-steps span {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px 5px 6px;
}
.lib-empty-steps i {
  display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 10px; font-style: normal; font-weight: 700;
}
.lib-empty-steps em { font-style: normal; color: var(--dim); font-size: 12px; }
.lib-empty-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lib-empty-types span {
  font: 500 10.5px/1 var(--mono, monospace); color: var(--dim);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px;
}
.lib-empty-search .lib-empty-art { width: 96px; height: 72px; }
.lib-empty-search .ghost-btn { margin-top: 2px; }

/* 列表：左侧类型色条 + 图标底色，hover 轻微抬升 */
.lib-item { position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lib-item:hover { border-color: var(--primary); box-shadow: 0 3px 14px rgba(0,0,0,.06); transform: translateY(-1px); }
.lib-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dim); opacity: .45; }
.lib-item .kb-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 9px; font-size: 17px; background: var(--hover-bg);
}
.lib-file-pdf::before { background: #e5484d; } .lib-file-pdf .kb-icon { background: rgba(229,72,77,.1); }
.lib-file-sheet::before { background: #2f9e63; } .lib-file-sheet .kb-icon { background: rgba(47,158,99,.1); }
.lib-file-slide::before { background: #e5822b; } .lib-file-slide .kb-icon { background: rgba(229,130,43,.1); }
.lib-file-image::before { background: #8b5cf6; } .lib-file-image .kb-icon { background: rgba(139,92,246,.1); }
.lib-file-zip::before { background: #d4a017; } .lib-file-zip .kb-icon { background: rgba(212,160,23,.1); }
.lib-file-doc::before { background: var(--primary); } .lib-file-doc .kb-icon { background: var(--primary-soft); }

@media (max-width: 760px) {
  .lib-panel { margin: 14px 14px 0; padding: 16px 14px 14px; }
  .lib-panel-head { flex-direction: column; gap: 10px; }
  .lib-stat { align-self: flex-start; min-width: 0; display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; }
  .lib-stat b { font-size: 16px; }
  .lib-title-wrap h3 { font-size: 15.5px; }
  .lib-empty-steps em { display: none; }
  .lib-list { padding-left: 14px !important; padding-right: 14px !important; }
}

/* v1.4.77 视觉复核后的两处收口：
   ① 插画放大镜斜线离标题太近；② 知识库/资料库两个 flex:1 列表各占半屏，中间空一大块。
   改成整页滚动后，空库时资料库卡片会紧跟着知识库提示，留白明显收敛。 */
.lib-empty-art { margin-bottom: 18px; }
.view-knowledge { overflow-y: auto; }
.view-knowledge .kb-list, .view-knowledge .lib-list { flex: none; overflow: visible; min-height: 0; }
.view-knowledge .kb-list:has(.kb-empty) { padding-bottom: 10px; }
.view-knowledge .lib-list { padding-bottom: 40px; }
@media (max-width: 760px) {
  .view-knowledge .lib-list { padding-bottom: 28px; }
}
/* 空库时上半区再收紧一点；插画与标题留足呼吸 */
.view-knowledge .kb-list:has(.kb-empty) .kb-empty { padding: 26px 0 12px; }
.lib-empty-art { margin-bottom: 24px; }

/* ══════════ v1.4.78 · 默认浅色 ══════════
   移动端结果区遮罩靠 JS 写 hidden 属性开关，但 @media(max-width:860px) 里的
   .rp-mask{display:block} 会盖掉浏览器给 [hidden] 的 display:none —— 结果抽屉
   收着时整块对话区也被压暗 40%（浅色下尤其明显，还吞掉点击）。这里把它收回来。
   同理，侧栏与结果抽屉收起时仍会在屏幕左右边缘投出淡灰影，白底下像两条脏边，
   所以投影改为只在展开态出现（见上方两处 @media 规则）。 */
.rp-mask[hidden] { display: none !important; }

/* ══════════ v1.4.81 · 设置页分区布局（左侧目录 + 右侧分区内容） ══════════
   用户反馈：23 张卡一长串往下排，最后一项要翻很久。改成点目录切分区，
   每区只有 3~7 张卡，一屏看完；卡片内部结构一行未动，所有绑定保持原样。 */
.set-sidebar { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.set-search-wrap { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--dim); }
.set-search-wrap:focus-within { border-color: var(--primary); }
.set-search-wrap svg { flex: 0 0 auto; }
.set-side-search { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; }
.set-side-search::placeholder { color: var(--dim); }
.set-nav { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; }
.set-nav-group { margin: 14px 0 4px 10px; font-size: 11px; color: var(--dim); letter-spacing: .4px; }
.set-nav-group:first-child { margin-top: 0; }
.set-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--dim); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.set-nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .8; }
.set-nav-item:hover { background: var(--panel); color: var(--text); }
.set-nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* v1.4.190：底部留 64px。右下角有常驻浮动条（#sg-float-bar，fixed，距底 24px、高 32px），
   分区内容一旦滚到底（登录记录满 20 行就会），最后一张卡的按钮会贴到它下面。
   留白按「浮动条占用高度 + 一点呼吸」给，任何分区的收尾按钮都不钻到浮动条底下。 */
.set-content { min-height: 0; overflow-y: auto; padding-right: 4px; padding-bottom: 64px; }
.set-content-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 14px; }
.set-content-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.set-sec-count { font-size: 11px; color: var(--dim); }
/* v1.4.124 设置页底部合规行：属于 set-content 而非任何分区，切分区不会消失 */
.set-legal {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 22px 0 4px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11px; line-height: 1.6; color: var(--dim);
}
.set-legal a { color: var(--dim); text-decoration: none; border-bottom: 1px dotted currentColor; }
.set-legal a:hover { color: var(--text); }
/* v1.4.153：公安联网备案号前挂官方徽标。用伪元素而不是 <img> ——
   applyIcp 刷新时直接写 textContent，塞进去的子节点会被一起清掉。 */
#set-police::before {
  content: ""; display: inline-block; width: 13px; height: 13px;
  margin-right: 4px; vertical-align: -2px;
  background: url("/beian-police.png") center / contain no-repeat;
}
.set-legal-sep { opacity: .45; }
.set-legal-mute { opacity: .8; }
/* 用 class 显隐，不碰卡片的 inline style：管理员卡 / 桌面端专属卡仍由各自的逻辑控制 */
.set-content > .setting-card.set-hide { display: none !important; }
.set-content .setting-card h3 { font-size: 14px; margin-bottom: 12px; }
/* 行式：左标题说明、右控件，贴近设置面板的观感 */
.set-content .setting-row { justify-content: space-between; gap: 16px; }
.set-content .setting-row > select,
.set-content .setting-row > input[type="number"],
.set-content .setting-row > input[type="checkbox"] { margin-left: auto; }
.set-content .setting-select { max-width: 62%; }

/* ══════════ v1.4.82 · 设置页左侧栏贴边铺满 ══════════
   用户反馈：左栏只是浮在底色上的一列文字，窗口最左边空一大条、往下也没有延伸。
   现在给 #view-settings 一层从窗口左边缘起、全高的独立面板，标题 / 搜索 / 目录
   都收进面板里；右栏不再受 1040px 居中限宽，直接铺到窗口右侧。
   面板底色跟 --panel，深色模式自动适配；≤860px 仍走下面的横向分区条。 */
#view-settings { position: relative; }
#view-settings::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 252px;
  background: var(--panel); border-right: 1px solid var(--border);
  z-index: 0; pointer-events: none;
}
#view-settings > .view-header { position: relative; z-index: 2; padding: 26px 28px 10px; }
#view-settings > .view-header p { margin-top: 4px; }
#view-settings .settings-body { position: relative; z-index: 1; }
#view-settings .set-sidebar { padding: 18px 18px 24px 28px; }
#view-settings .set-search-wrap { background: var(--bg); }
#view-settings .set-nav-group { margin-left: 12px; }
#view-settings .set-nav-item { padding: 10px 12px; }
#view-settings .set-nav-item.on { box-shadow: inset 3px 0 0 var(--primary); }
#view-settings .set-content { padding: 18px 28px 40px 34px; }
#view-settings .set-content .setting-card { max-width: 940px; }

@media (max-width: 860px) {
  #view-settings::before { display: none; }
  #view-settings > .view-header { padding: 18px 16px 8px; }
  #view-settings .settings-body { display: flex; flex-direction: column; gap: 0; padding: 0 14px 28px; overflow-y: auto; }
  #view-settings .set-sidebar { position: sticky; top: 0; z-index: 6; flex: 0 0 auto; gap: 8px; padding: 10px 0 8px; background: var(--bg); border-bottom: 1px solid var(--border); overflow: visible; }
  .set-nav { flex-direction: row; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav-group { display: none; }
  #view-settings .set-nav-item { flex: 0 0 auto; width: auto; white-space: nowrap; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
  #view-settings .set-nav-item svg { display: none; }
  #view-settings .set-nav-item.on { box-shadow: none; border-color: var(--primary); }
  #view-settings .set-content { flex: 0 0 auto; overflow: visible; padding: 0; }
  .set-content-head { margin: 14px 0 12px; }
}

/* ═══════════ v1.4.87 收银台 + 资产与发票 ═══════════ */
.cashier-top { padding: 2px 2px 10px; border-bottom: 1px solid var(--border); }
.cashier-label { font-size: 14px; font-weight: 600; }
.cashier-grain { font-size: 12px; color: var(--dim); margin-top: 2px; }
.cashier-amount { font-size: 26px; font-weight: 700; margin-top: 4px; }
.cashier-chs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.cashier-ch { padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; position: relative; }
.cashier-ch.on { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.cashier-ch-tag { display: inline-block; margin-left: 6px; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--primary-soft, rgba(0, 122, 99, .12)); color: var(--primary); }
.cashier-note { font-size: 11.5px; color: var(--dim); line-height: 1.7; margin: 10px 0 0; }
#cashier-body .solid { width: 100%; margin-top: 14px; }
.cashier-qr-wrap { text-align: center; padding-top: 14px; }
.cashier-countdown { font-size: 12px; color: var(--dim); margin-top: 8px; font-variant-numeric: tabular-nums; }
.cashier-st { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.cashier-mocktip { font-size: 11px; color: var(--dim); background: var(--primary-soft, rgba(0, 122, 99, .08)); border-radius: 8px; padding: 6px 10px; margin-top: 10px; }
.cashier-btns { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cashier-no { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--border); font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: center; }
.cashier-paid { text-align: center; padding: 18px 0 6px; }
.cashier-paid-ico { width: 54px; height: 54px; line-height: 54px; margin: 0 auto; border-radius: 50%; background: var(--primary); color: #fff; font-size: 26px; font-weight: 700; animation: cashierPop .5s cubic-bezier(.2, 1.6, .4, 1); }
.cashier-paid-ico.fail { background: #d05656; }
@keyframes cashierPop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.cashier-paid-title { font-size: 17px; font-weight: 700; margin-top: 12px; }
.cashier-paid-grain { font-size: 15px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.cashier-paid-sub { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.7; }
/* 资产与发票 */
.wallet-box .wl-grid { display: flex; flex-direction: column; gap: 18px; }
.wallet-box section > h4 { font-size: 13px; margin: 0 0 8px; }
.wl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wl-table th { text-align: left; font-weight: 600; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.wl-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.wl-no { font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.wl-st { font-weight: 600; }
.wl-st.ok { color: var(--ok, #2e9e5b); }
.wl-st.bad { color: #d05656; }
.wl-inv { font-size: 12px; color: var(--dim); }
.wl-inv.ok { color: var(--ok, #2e9e5b); }
.wl-inv.bad { color: #d05656; }
.wl-inv-btn, .wl-claim-btn { font-size: 11px; padding: 3px 9px; margin: 0; }
.wl-claim-btn { margin-left: 6px; }
.wl-bal { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 52px; }
.wl-nts { display: flex; flex-direction: column; gap: 6px; }
.wl-nt { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; padding: 8px 10px; border-radius: 9px; background: var(--panel); font-size: 12.5px; cursor: default; }
.wl-nt.unread { cursor: pointer; border-left: 3px solid var(--primary); }
.wl-nt-t { font-weight: 600; }
.wl-nt-b { color: var(--dim); grid-column: 2; }
.wl-nt-d { color: var(--dim); font-size: 11px; align-self: center; text-align: right; }
.wl-unread { display: inline-block; margin-left: 8px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; }

/* ═══════════ v1.4.87 ①②③：等待态收口 / 后台任务胶囊 / 文档流 ═══════════ */
.stream-meta:empty { display: none; }
.run-pill {
  position: fixed; top: 14px; right: 18px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
  animation: runPillIn .25s ease;
  max-width: 60vw;
}
.run-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: runPillPulse 1.2s ease-in-out infinite; flex: 0 0 auto; }
@keyframes runPillPulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes runPillIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.run-pill-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-pill-stop { font-size: 11.5px; color: var(--dim); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); flex: 0 0 auto; }
.run-pill-stop:hover { color: #d05656; border-color: #d05656; }
@media (max-width: 860px) { .run-pill { top: auto; bottom: 92px; right: 12px; max-width: 74vw; } }
/* ③ 用户气泡与回答元素更贴文档流：气泡浅色块无边框；引用去底色只留左线；表格只留行线 */
.msg.user .msg-content { background: var(--primary-soft); color: var(--text); border: none; border-radius: 12px 12px 12px 4px; }
.md blockquote { background: transparent; border-left: 3px solid var(--border); color: var(--dim); border-radius: 0; padding: 2px 12px; }
.md th, .md td { border: none; border-bottom: 1px solid var(--border); }
.md th { background: transparent; border-bottom: 2px solid var(--dim); font-weight: 700; }
.md table { font-variant-numeric: tabular-nums; }

/* ═══════════ v1.4.88 自动技能管理区（技能页签顶部）+ 编辑弹窗 ═══════════ */
.auto-skills-wrap { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px 6px; margin-bottom: 4px; }
.auto-sk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.auto-sk-title b { font-size: 15px; }
.auto-sk-title span { display: block; font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.auto-sk-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-sk-gswitch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); cursor: pointer; user-select: none; }
.auto-sk-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 10px; }
.auto-sk-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: border-color .15s; }
.auto-sk-card:hover { border-color: var(--primary); }
.auto-sk-card.off { opacity: .55; }
.auto-sk-card.off:hover { opacity: 1; }
.ask-row1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ask-name { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.ask-builtin { font-style: normal; font-size: 11px; color: var(--primary); border: 1px solid var(--primary); border-radius: 5px; padding: 0 5px; font-weight: 600; }
.ask-ops { display: inline-flex; align-items: center; gap: 10px; }
.ask-ops button { border: none; background: none; cursor: pointer; font-size: 14px; color: var(--dim); padding: 2px 4px; border-radius: 6px; }
.ask-ops button:hover { color: var(--text); background: var(--primary-soft); }
.ask-toggle { cursor: pointer; }
.ask-desc { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.ask-keys { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.ask-keys span { font-size: 11.5px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 1px 7px; }
.ask-peek { font-size: 12px; color: var(--dim); margin-top: 7px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-sw { display: inline-block; width: 34px; height: 20px; border-radius: 10px; background: var(--border); position: relative; transition: background .18s; vertical-align: middle; }
.ask-sw i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ask-sw.on { background: var(--primary); }
.ask-sw.on i { left: 16px; }
.ask-f { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 12px; }
.ask-f .setting-input { display: block; width: 100%; margin-top: 5px; }
.ask-f textarea.setting-input { resize: vertical; font-family: inherit; line-height: 1.7; }
.ask-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }
.ask-hint { font-size: 12px; color: var(--dim); }

/* ═══════════ v1.4.89 每日签到卡 + 资产中心签到区 ═══════════ */
.sg-card { padding-top: 2px; }
.sg-amount { font-size: 17px; margin-bottom: 4px; }
.sg-amount b { color: var(--primary); font-size: 24px; }
.sg-streak { font-size: 13px; color: var(--dim); margin-bottom: 14px; }
.sg-streak b { color: var(--text); }
.sg-ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.sg-ms { border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px; text-align: center; }
.sg-ms-n { display: block; font-weight: 700; font-size: 13px; }
.sg-ms-a { display: block; font-size: 11px; color: var(--dim); margin-top: 3px; }
.sg-ms.hit { border-color: var(--primary); background: var(--primary-soft); }
.sg-ms.hit .sg-ms-n { color: var(--primary); }
.sg-note { font-size: 12px; color: var(--dim); line-height: 1.6; margin: 0 0 12px; }
.wl-signin { grid-column: 1 / -1; }
.sg-wl-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.sg-wl-st { font-size: 14px; }
.sg-wl-st b { color: var(--primary); }
.sg-wl-info { font-size: 13px; color: var(--dim); }
.sg-wl-info b { color: var(--text); }
.sg-wl-row .primary-btn { margin-left: auto; }
@media (max-width: 640px) { .sg-ladder { grid-template-columns: repeat(2, 1fr); } .sg-wl-row .primary-btn { margin-left: 0; } }

/* ═══════════ v1.4.89 编辑已发消息（hover ✎ + 内联编辑 + 二选一） ═══════════ */
.msg-edit-btn { border: 1px solid var(--border); background: var(--panel); color: var(--dim); border-radius: 7px; width: 26px; height: 22px; font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; margin-top: 4px; }
.msg.user:hover .msg-edit-btn { opacity: 1; }
.msg-edit-btn:hover { color: var(--primary); border-color: var(--primary); }
.msg-editor { display: block; width: 100%; min-height: 64px; border: 1.5px solid var(--primary); border-radius: 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.7; padding: 10px 12px; resize: vertical; margin-top: 6px; }
.msg-editor:focus { outline: none; }
.msg-editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.msg-editor-bar .primary-btn, .msg-editor-bar .ghost-btn { padding: 5px 14px; font-size: 12.5px; border-radius: 8px; }
.msg-editor-hint { font-size: 12.5px; color: var(--dim); margin-right: 4px; }

/* ═══════════ v1.4.90 rewind 回溯 + 消息跳转高亮 ═══════════ */
.msg-rewind-btn { margin-left: 6px; font-size: 11px; }
.msg.user:hover .msg-rewind-btn { opacity: 1; }
.msg-flash { animation: msgFlash 1.6s ease-out; }
@keyframes msgFlash { 0% { background: var(--primary-soft); } 100% { background: transparent; } }
.msg.msg-flash { border-radius: 12px; }

/* ═══════════ v1.4.90 签到连签日历 + 进度条 ═══════════ */
.sg-prog { margin-bottom: 12px; }
.sg-prog-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.sg-prog-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .4s; }
.sg-prog-txt { display: block; font-size: 12px; color: var(--dim); margin-top: 5px; }
.sg-prog-max { color: var(--primary); font-size: 12px; margin-bottom: 12px; }
.sg-cal-wrap { margin: 0 0 4px; }
.sg-cal-head { font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
.sg-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sg-cal-wk { text-align: center; font-size: 11px; color: var(--dim); padding: 2px 0; }
.sg-cal-cell { text-align: center; font-size: 12px; padding: 5px 0; border-radius: 8px; color: var(--dim); position: relative; }
.sg-cal-cell.blank { visibility: hidden; }
.sg-cal-cell.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.sg-cal-cell.on::after { content: ''; position: absolute; inset: 0; border-radius: 8px; border: 1px solid transparent; }
.sg-cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--primary); color: var(--text); }
.sg-cal-cell.today.on { color: var(--primary); }
.wl-signin .sg-cal { margin-top: 10px; max-width: 320px; }

/* ═══════════ v1.4.90 Ctrl+K 全局会话搜索（命令面板） ═══════════ */
.cmdk-mask { position: fixed; inset: 0; background: rgba(15, 18, 22, .4); z-index: 1500; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; backdrop-filter: blur(2px); }
.cmdk { width: min(600px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden; }
.cmdk-input { display: block; width: 100%; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 15px 18px; }
.cmdk-input:focus { outline: none; }
.cmdk-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.cmdk-row { padding: 9px 12px; border-radius: 10px; cursor: pointer; display: grid; grid-template-columns: 1fr; gap: 3px; }
.cmdk-row:hover, .cmdk-row.sel { background: var(--primary-soft); }
.cmdk-title { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-snippet { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-snippet mark { background: var(--primary-soft); color: var(--primary); border-radius: 3px; padding: 0 2px; }
.cmdk-meta { font-size: 11px; color: var(--dim); opacity: .8; }
.cmdk-empty { text-align: center; font-size: 13px; color: var(--dim); padding: 26px 0; }
.cmdk-foot { font-size: 11.5px; color: var(--dim); padding: 8px 14px; border-top: 1px solid var(--border); }

/* ═══════════ v1.4.90 旁路会话 /side 浮层卡片 ═══════════ */
#side-stack { position: fixed; right: 18px; bottom: 118px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.side-card { pointer-events: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 12px 14px; }
.side-card.live { border-color: var(--primary); }

/* ═══════════ v1.4.93 ④：旁路小会话挂消息流（替代右下角浮层） ═══════════ */
.side-stream { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 14px; align-items: flex-end; }
.side-stream .side-card { width: min(560px, 100%); box-shadow: 0 6px 20px rgba(0,0,0,.07); }
@media (max-width: 860px) { .side-stream { align-items: stretch; } .side-stream .side-card { width: 100%; } }
.side-head { display: flex; align-items: center; gap: 8px; }
.side-q { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.side-x { border: none; background: none; color: var(--dim); font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.side-x:hover { color: #d05656; }
.side-body { font-size: 13px; line-height: 1.65; margin-top: 8px; max-height: 34vh; overflow-y: auto; }
.side-body p { margin: 0 0 6px; }
.side-err { color: #d05656; font-size: 12.5px; }

/* ═══════════ v1.4.94 追问卡片（```ask 块 → 交互卡，对齐主流提问卡体验） ═══════════ */
.ask-wait { margin: 8px 0; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 10px; font-size: 12.5px; color: var(--dim); }
.ask-card { margin: 10px 0 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.ask-card .ask-q { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 10px; }
.ask-card .ask-q::before { content: '? '; color: var(--primary); font-weight: 800; }
.ask-opts { display: flex; flex-direction: column; gap: 7px; }
.ask-opts .ask-opt-wrap { display: flex; flex-direction: column; gap: 5px; }
.ask-opt { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); color: var(--text); cursor: pointer; transition: border-color .12s, transform .12s, box-shadow .12s; }
.ask-opt:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.ask-opt:active:not(:disabled) { transform: translateY(0); }
.ask-opt .ask-opt-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ask-opt .ask-opt-hint { font-size: 11.5px; color: var(--dim); }
.ask-opt.has-sub::after { content: '▸ 展开选择'; font-size: 11px; color: var(--primary); }
.ask-opt.has-sub.open::after { content: '▾ 收起'; }
.ask-sub { padding: 2px 0 2px 12px; border-left: 2px solid var(--border); margin-left: 8px; display: flex; flex-direction: column; gap: 6px; }
.ask-sub .ask-sub-q { font-size: 12.5px; color: var(--dim); padding: 2px 0; }
.ask-opt.picked { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--panel)); }
.ask-opt.picked .ask-opt-label::before { content: '✓ '; color: var(--primary); }
.ask-card .ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ask-card .ask-count { font-size: 12px; color: var(--dim); }
.ask-card .ask-go { border: none; background: var(--primary); color: var(--panel); font-size: 13px; font-weight: 600; padding: 7px 18px; border-radius: 9px; cursor: pointer; }
.ask-card .ask-go:disabled, .ask-card .ask-opt:disabled { opacity: .55; cursor: not-allowed; }
.ask-card .ask-custom { display: flex; gap: 8px; margin-top: 10px; }
.ask-card .ask-custom input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 13px; color: var(--text); outline: none; }
.ask-card .ask-custom input:focus { border-color: var(--primary); }
.ask-card .ask-custom button { border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 13px; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.ask-card .ask-custom button:hover { border-color: var(--primary); color: var(--primary); }
.ask-card .ask-done-row { margin-top: 10px; padding: 7px 12px; border-radius: 9px; background: var(--bg); border: 1px dashed var(--border); font-size: 12.5px; color: var(--dim); }
.ask-card.ask-done .ask-q::before { content: '✓ '; color: var(--primary); }
@media (max-width: 860px) { .ask-card { padding: 10px 11px; } }

/* ═══════════ v1.4.98 开票回执卡：```invoice JSON → 结构化静态卡（主题变量自适应换肤） ═══════════ */
.inv-card { margin: 10px 0 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.inv-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.inv-ico { width: 16px; height: 16px; color: var(--primary); flex: 0 0 auto; }
.inv-st { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.inv-st-pend { color: #9a6700; background: rgba(233, 176, 42, .16); border: 1px solid rgba(233, 176, 42, .45); }
.inv-st-done { color: #0a7d4f; background: rgba(35, 165, 96, .14); border: 1px solid rgba(35, 165, 96, .4); }
.inv-st-rej { color: #b42318; background: rgba(240, 68, 56, .12); border: 1px solid rgba(240, 68, 56, .4); }
.inv-rows { padding: 8px 0 2px; }
.inv-row { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; }
.inv-k { width: 52px; flex: 0 0 auto; color: var(--dim); }
.inv-v { color: var(--text); word-break: break-all; line-height: 1.45; }
.inv-amt { font-size: 14.5px; color: var(--primary); font-weight: 700; }
.inv-tag { font-style: normal; font-size: 11px; color: #9a6700; background: rgba(233, 176, 42, .16); border: 1px solid rgba(233, 176, 42, .4); border-radius: 999px; padding: 1.5px 8px; margin-left: 6px; white-space: nowrap; }
.inv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--border); }
.inv-no { font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-go { border: none; background: var(--primary); color: var(--panel); font-size: 12.5px; font-weight: 600; padding: 6px 15px; border-radius: 9px; cursor: pointer; flex: 0 0 auto; }
.inv-go:hover { filter: brightness(1.06); }
@media (max-width: 860px) { .inv-card { padding: 10px 11px; } .inv-k { width: 40px; } }
:root[data-theme="dark"] .inv-st-pend { color: #ffc53d; border-color: rgba(255, 197, 61, .4); }
:root[data-theme="dark"] .inv-st-done { color: #35c98a; border-color: rgba(53, 201, 138, .4); }
:root[data-theme="dark"] .inv-st-rej { color: #ff7a6e; border-color: rgba(255, 122, 110, .4); }
:root[data-theme="dark"] .inv-tag { color: #ffc53d; border-color: rgba(255, 197, 61, .4); }
.side-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 8px; }
.side-copy { border: 1px solid var(--border); background: transparent; color: var(--dim); border-radius: 999px; font-size: 11px; padding: 2px 10px; cursor: pointer; }
.side-copy:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 860px) { #side-stack { bottom: 130px; right: 12px; width: calc(100vw - 24px); } }

/* ═══════════ v1.4.90 后台任务面板（胶囊点击展开，仿 agent view） ═══════════ */
.run-panel { position: fixed; top: 64px; right: 18px; z-index: 1450; width: min(340px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 6px; }
.run-panel-head { font-size: 12px; color: var(--dim); padding: 6px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.run-panel-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; }
.run-panel-row:hover { background: var(--primary-soft); }
.run-panel-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: runPillPulse 1.2s ease-in-out infinite; flex: 0 0 auto; }
.run-panel-title { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.run-panel-dur { font-size: 11.5px; color: var(--dim); flex: 0 0 auto; }
.run-panel-view, .run-panel-stop { border: 1px solid var(--border); background: transparent; color: var(--dim); border-radius: 999px; font-size: 11.5px; padding: 3px 10px; cursor: pointer; flex: 0 0 auto; }
.run-panel-view:hover { color: var(--primary); border-color: var(--primary); }
.run-panel-stop:hover { color: #d05656; border-color: #d05656; }
.run-panel-empty { font-size: 12.5px; color: var(--dim); text-align: center; padding: 14px 0; }
@media (max-width: 860px) { .run-panel { top: auto; bottom: 132px; right: 12px; } }

/* ═══════════ v1.4.90 定时任务预算上限输入 ═══════════ */
.cron-budget-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 2px; }
.cron-budget-row label { font-size: 12.5px; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.cron-budget-row input { width: 84px; }

/* ═══════════ v1.4.91 旁路上下文徽标 / 快照面板 / 旁路历史条 ═══════════ */
.side-ctx { flex: 0 0 auto; font-size: 10.5px; line-height: 1; padding: 4px 7px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.side-ctx-mini { font-style: normal; font-size: 10px; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); margin-left: 6px; font-weight: 600; }

.msg-topbars { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 10px; }
.snap-chip, .sidelog-bar { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--border); background: var(--panel); color: var(--dim); font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.snap-chip:hover, .sidelog-bar:hover { border-color: var(--primary); color: var(--text); }
.snap-chip b, .sidelog-bar b { color: var(--primary); }
.snap-ico { font-size: 13px; }
/* v1.4.112 S3：多端冲突提示——用警示色，但保持与快照胶囊同一形状，不新造一种控件 */
.conflict-chip { border-style: solid; border-color: var(--warn, #b8760f); color: var(--warn, #b8760f); }
.conflict-chip:hover { border-color: var(--warn, #b8760f); color: var(--warn, #b8760f); background: var(--primary-soft); }
.conflict-chip .snap-tip { opacity: .85; }
.snap-tip { font-size: 10.5px; opacity: .7; }
.snap-panel { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 6px; }
.snap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.snap-row + .snap-row { border-top: 1px solid var(--border); }
.snap-info b { font-size: 12.5px; color: var(--text); display: block; }
.snap-info span { font-size: 11.5px; color: var(--dim); }
.snap-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.snap-btns .ghost-btn { padding: 4px 10px; font-size: 11.5px; }
/* v1.4.114：窄屏摘要行默认隐藏（桌面端用完整说明） */
.snap-brief { display: none; }
/* v1.4.113：手机上说明文字变长（本机 4 条 + 云端 4 条 → 现在 6 条），
   和按钮挤一行会把文字压成竖条——窄屏就上下排，按钮贴右。
   v1.4.114：标题与完整说明在窄屏都收进摘要（14:20 · 4 + 4 → 6 条），
   面板从三行压到两行，尽量少挡对话。 */
@media (max-width: 560px) {
  .snap-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 8px; }
  .snap-btns { justify-content: flex-end; }
  .snap-info b { display: none; }
  .snap-full { display: none; }
  .snap-brief { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.sidelog-list { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 4px; }
.sidelog-item { padding: 8px 10px; }
.sidelog-item + .sidelog-item { border-top: 1px solid var(--border); }
.sidelog-q { font-size: 12.5px; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.sidelog-q time { float: right; font-size: 10.5px; color: var(--dim); font-weight: 400; }
.sidelog-a { font-size: 12px; color: var(--dim); max-height: 180px; overflow: auto; }
.sidelog-a p { margin: 0 0 4px; }

/* ═══════════ v1.4.92 旁路追问（迷你会话） ═══════════ */
.side-chain { max-height: 132px; overflow: auto; border-bottom: 1px dashed var(--border); margin-bottom: 8px; padding-bottom: 6px; }
.side-turn { padding: 4px 0; }
.side-turn + .side-turn { border-top: 1px dotted var(--border); margin-top: 4px; padding-top: 8px; }
.side-tq { font-size: 11.5px; color: var(--text); font-weight: 600; margin-bottom: 3px; }
.side-ta { font-size: 11.5px; color: var(--dim); max-height: 56px; overflow: hidden; }
.side-ta p { margin: 0 0 3px; }
.side-fq { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.side-fq-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text); font-size: 12.5px; padding: 6px 10px; outline: none; }
.side-fq-input:focus { border-color: var(--primary); }
.side-fq-btn { flex: 0 0 auto; padding: 6px 14px; font-size: 12px; }

/* ═══════════ v1.4.105 B2：云端回收站列表（设置 · 数据与反馈） ═══════════ */
.trash-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.trash-empty {
  padding: 14px 12px; border: 1px dashed var(--border); border-radius: 10px;
  font-size: 12px; color: var(--dim); text-align: center;
}
.trash-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
}
.trash-item:hover { background: var(--hover-bg); }
.trash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trash-title { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-meta { font-size: 11px; color: var(--dim); }
.trash-item .small-btn { flex: 0 0 auto; }

/* v1.4.106 ①：回收站体检——到期预警条 + 多选批量恢复 */
.trash-alert {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn, #e0a33a) 40%, var(--border));
  background: color-mix(in srgb, var(--warn, #e0a33a) 10%, var(--panel));
  font-size: 12px; color: var(--text);
}
.trash-alert b { color: var(--warn, #c8811c); }
.trash-alert .ta-text { flex: 1; min-width: 160px; }
.trash-batch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12px; color: var(--dim);
}
.trash-pick { flex: 0 0 auto; width: 14px; height: 14px; accent-color: var(--primary); cursor: pointer; }
.trash-badge {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 5px;
  font-size: 10px; line-height: 15px; vertical-align: 1px;
  color: var(--warn, #b8760f); background: color-mix(in srgb, var(--warn, #e0a33a) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn, #e0a33a) 36%, transparent);
}
.trash-left { color: var(--dim); }
.trash-left.warn { color: var(--warn, #b8760f); font-weight: 600; }

/* ═══════════ v1.4.106 ③：云端产物库 ═══════════ */
.files-usage { margin-top: 10px; font-size: 11.5px; color: var(--dim); }
.files-bar {
  position: relative; height: 4px; border-radius: 3px; background: var(--border);
  margin-top: 6px; overflow: hidden;
}
.files-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 3px; }
.files-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.files-empty {
  padding: 14px 12px; border: 1px dashed var(--border); border-radius: 10px;
  font-size: 12px; color: var(--dim); text-align: center;
}
.file-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel);
}
.file-item:hover { background: var(--hover-bg); }
.file-kind {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-name { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-keep { flex: 0 0 auto; color: var(--primary); }
.file-item .small-btn { flex: 0 0 auto; }

/* ═══════════ v1.4.107 ①：产物库空间治理（预警条 / 类型筛选 / 按会话分组） ═══════════ */
.files-alert {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 10px; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--warn, #b8760f) 34%, transparent);
  background: color-mix(in srgb, var(--warn, #b8760f) 8%, transparent);
  font-size: 12px; color: var(--text);
}
.files-alert[hidden] { display: none !important; }
.files-alert .fa-txt { flex: 1; min-width: 170px; line-height: 1.5; }
.files-alert .fa-txt b { color: var(--warn, #b8760f); }
.files-search { position: relative; margin-top: 10px; }
.files-search input {
  width: 100%; box-sizing: border-box;
  padding: 7px 30px 7px 10px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 12.5px; font-family: inherit; outline: none;
}
.files-search input::placeholder { color: var(--dim); }
.files-search input:focus { border-color: color-mix(in srgb, var(--primary) 46%, transparent); }
.files-search input::-webkit-search-cancel-button { display: none; }
.files-q-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: transparent; color: var(--dim); cursor: pointer;
  font-size: 11px; line-height: 1; font-family: inherit;
}
.files-q-clear:hover { color: var(--text); background: var(--hover-bg); }
.files-q-clear[hidden] { display: none !important; }
.files-hit {
  margin: 8px 2px 2px; font-size: 11.5px; color: var(--dim); line-height: 1.5;
}
.files-hit b { color: var(--text); }

.files-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.files-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.files-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  font-family: inherit; transition: color .15s, border-color .15s, background .15s;
}
.files-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.files-chip.on {
  color: var(--primary); font-weight: 600;
  border-color: color-mix(in srgb, var(--primary) 46%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}
.files-group-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--dim); cursor: pointer; user-select: none;
}
.files-group-toggle input { accent-color: var(--primary); margin: 0; }
.files-group-h {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 12px; padding: 0 2px;
  font-size: 11.5px; color: var(--dim);
}
.files-group-h span { font-size: 10.5px; opacity: .8; }
.files-list .files-group-h:first-child { margin-top: 2px; }
.file-soon { color: var(--warn, #b8760f); font-weight: 600; }

/* ═══════════ v1.4.109 ①：按会话批量 / ②：时间范围 / ④：回收站产物清单 ═══════════ */
.files-range { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.files-group-acts { margin-left: auto; display: flex; gap: 4px; opacity: 1 !important; }
.files-mini {
  font-size: 10.5px; padding: 1px 7px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--dim);
  font-family: inherit; line-height: 1.7;
}
.files-mini:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.files-mini.danger:hover { color: #c0392b; border-color: color-mix(in srgb, #c0392b 40%, transparent); }
.trash-files-btn {
  border: 0; background: transparent; padding: 0; margin: 0 2px;
  color: var(--primary); font-size: 11px; font-family: inherit; cursor: pointer;
}
.trash-files-btn:hover { text-decoration: underline; }
.trash-files {
  margin: -2px 0 2px 26px; padding: 8px 10px; border-radius: 9px;
  border: 1px dashed var(--border); background: var(--panel);
  display: flex; flex-direction: column; gap: 5px;
}
.trash-files[hidden] { display: none !important; }
.tf-head { font-size: 11px; color: var(--dim); line-height: 1.5; }
.tf-head b { color: var(--text); }
.tf-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.tf-kind {
  flex: 0 0 auto; padding: 0 6px; border-radius: 6px; font-size: 10px;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.tf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tf-meta { flex: 0 0 auto; color: var(--dim); font-size: 10.5px; }
.tf-more { font-size: 10.5px; color: var(--dim); }
/* v1.4.109 G1：诊断卡（仅在有未捕获错误时出现） */
.diag-list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; max-height: 200px; overflow: auto; }
.diag-row { font-size: 11px; color: var(--dim); line-height: 1.5; display: flex; gap: 6px; flex-wrap: wrap; }
.diag-kind { color: var(--warn, #b8760f); font-weight: 600; }
.diag-msg { color: var(--text); word-break: break-all; flex: 1; min-width: 0; }
.diag-more { font-size: 10.5px; color: var(--dim); }
/* v1.4.109：手机上「下载/保留/删除」三个按钮把文件名挤成「2026Q…」——按钮换到第二行，名字能看全 */
@media (max-width: 520px) {
  .file-item { flex-wrap: wrap; row-gap: 6px; }
  .file-main { flex: 1 1 calc(100% - 42px); }
  /* v1.4.112：按钮从 4 个变 5 个（多了「↩ 来源」），平分宽度会把「预览」压成一字一行 → 按内容排、放不下就整颗换行 */
  .file-item .small-btn { flex: 0 0 auto; min-width: 52px; text-align: center; white-space: nowrap; }
  .files-group-acts { gap: 6px; }
}

/* v1.4.115：受控浏览器「最近操作记录」——出问题时能回答「它为什么点了那个按钮」 */
.bl-box { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.bl-box > summary { cursor: pointer; font-size: 12.5px; color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; }
.bl-box > summary::-webkit-details-marker { display: none; }
.bl-box > summary::before { content: '\25B8'; color: var(--dim); font-size: 10px; }
.bl-box[open] > summary::before { content: '\25BE'; }
.bl-hint { font-size: 11px; color: var(--dim); font-weight: 400; }
.bl-list { margin-top: 8px; max-height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--dim); }
.bl-row { display: flex; gap: 6px; align-items: baseline; }
.bl-t { color: var(--dim); flex: 0 0 auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bl-a { color: var(--primary); font-weight: 600; flex: 0 0 auto; }
.bl-a.bad { color: var(--warn); }
.bl-m { flex: 1; min-width: 0; word-break: break-all; }
@media (max-width: 560px) {
  .bl-row { flex-wrap: wrap; }
  .bl-m { flex: 1 1 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.4.127 登录门厅（#bh-gate）两处收口
   1. 左上角品牌隐去：首屏简洁口径从门户延续到登录页，只留黑洞与登录面板。
      顶栏改为右对齐，桌面端的窗口按钮仍贴在右上角（拖拽区不受影响）。
   2. 鉴权遮罩：工作台默认由 body.booting 挡住，等 /api/bootstrap 判定完
      登录态再撤——此前会先露出对话页约一秒再跳登录器。
   ═══════════════════════════════════════════════════════════════════════════ */

#bh-gate .gate-brand { display: none !important; }
#bh-gate .gate-topbar { justify-content: flex-end; }

body.booting { background: var(--bg); }
body.booting #app { visibility: hidden; }

/* 门厅期间不弹「装到桌面」横幅：它 fixed 在底部，正好压住登录面板的游客入口与版本号 */
body.bh-on .pwa-banner { display: none !important; }

/* ── v1.4.128：撤遮罩时补一个短淡入 ───────────────────────────────────
   已登录用户会先看到约 200ms 的纯色底（等 /api/bootstrap 判完登录态），
   撤掉 booting 的那一刻工作台「啪」地整屏出现。给 #app 一个 120ms 的
   opacity 过渡把它接顺；门厅态 #app 仍是 visibility:hidden，动画看不见，
   也不会影响登录器。prefers-reduced-motion 用户直接跳过。 */
body.boot-fade #app { animation: appBootFade 120ms ease-out both; }
@keyframes appBootFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body.boot-fade #app { animation: none; }
}

/* ═══════════ v1.4.150 卡片底色（v1.4.144 的跟随光效已整条移除）═══════════ */
/* v1.4.144/145/146/147 那套「光标附近变色 + 2px 亮边」下线了：三处载体每次指针移动
   都要重算渐变圆心，读长回答时是干扰而不是指引；它还和皮肤色强绑定（--gc-rgb），
   换配色就整片跟着变。回答卡留下的只是半透明底 —— 它解决「正文贴背景分不清边界」，
   与光无关，所以改名 --card-glass，别再叫「光效卡」。 */
:root { --card-glass: rgba(255, 255, 255, .72); }
html[data-theme="dark"] { --card-glass: rgba(18, 18, 18, .74); }

/* ① AI 回答卡本体：v1.4.150 之后它只剩「一张有边界的半透明卡」这一件事。
   原来的光斑、2px 亮边、hover 提亮、caret 跟随全部删除 —— 那套东西每次指针移动
   都要重算一次渐变圆心，阅读长回答时反而干扰视线。 */
.msg.ai .msg-content.ai-card {
  position: relative;
  max-width: 720px;
  padding: 14px 16px;
  background-color: var(--card-glass);
  border: 1px solid var(--border);
  border-radius: 14px;
}
/* 输入框：光斑下线后，边框与阴影过渡是它唯一的动效 */
.composer { transition: box-shadow .18s ease; }

/* ═══════════ v1.4.163 设置页卡片改为纯静态 ═══════════
   v1.4.145 的「跟随光标轻微 3D 倾斜」整条下线（用户要求取消设置页的扭曲特效）：
   卡片一转，正文就在动，读字容易发晕；表单卡还会让可编辑区与命中区错开。
   v1.4.150 已删掉光斑与亮边环，这里再把倾斜与它的 0.18s 过渡一并拿掉，
   JS 侧 initCardTilt / 开关行 / data-motion 同步删除，不留「看不见但还在算」的残链。 */
.set-content > .setting-card {
  position: relative;
}

/* v1.4.163：外观卡里的「卡片倾斜」开关行连同 .glow-row 一起删除
   （没有可开关的特效了，留一行只会让人以为还有东西没关掉）。 */

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.4.146 ① 执行过程默认折叠
 * 一次联网问答会连出七八行「搜索 · 关键词 245ms / 读取网页 · 域名」，每行 22px，
 * 把正文一路往下挤。改成一行摘要：平时只显示「执行过程 · N 步 · 总耗时」，
 * 执行中显示「正在执行 · 搜索 · 关键词」，点开才铺开明细。
 * 折叠头不遮挡进度：spinner 与当前动作都留在这一行里，不会「点了没反应」。
 * ═══════════════════════════════════════════════════════════════════════════ */
.steps-fold { width: 100%; min-width: 0; }
.steps-fold-head {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0;
  padding: 3px 4px; margin: 0; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; color: var(--dim);
  text-align: left; border-radius: 6px; font-weight: inherit;
}
.steps-fold-head:hover { color: var(--text); background: var(--hover-bg); }
.steps-fold-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -1px; }
.steps-fold-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-fold-n {
  flex: 0 0 auto; padding: 0 5px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 9.5px; line-height: 15px;
}
.steps-fold-ar { flex: 0 0 auto; width: 10px; height: 10px; opacity: .55; transition: transform .18s ease; }
.steps-fold.open .steps-fold-ar { transform: rotate(180deg); }
/* 收起时只留一行摘要 + 待确认徽章：说明行跟明细一起藏起来。
   否则每条消息都多一行，而 v1.4.146 起步骤条的约定就是「折叠成一行」。 */
.steps-fold:not(.open) .steps-warn-row { display: none; }
/* 收起时不渲染明细：display 而不是 height，避免每行仍参与布局计算 */
.steps-fold .steps-list { display: none; }
.steps-fold.open .steps-list { display: flex; }
/* v1.4.153：可能已执行的步骤数放在折叠头（收起状态也可见）。
   执行态已整体灰阶化，这里用暖色描边而非实底，提醒够用又不抢正文注意力。 */
.steps-fold-warn {
  flex: 0 0 auto; padding: 0 5px; border-radius: 999px;
  border: 1px solid rgba(200, 140, 40, .45);
  color: var(--warn); font-size: 9.5px; line-height: 14px;
}
.steps-warn-row {
  margin: 0 0 6px; padding: 6px 8px; border-radius: 6px;
  background: rgba(200, 140, 40, .08);
  color: var(--dim); font-size: 10.5px; line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.4.147 ④ 步骤条「耗时分布」
 * 明细列表能看出「做了什么」，看不出「时间花在哪一步」。展开后先给一条按耗时
 * 占比分段的横条：谁最慢一眼就看得到（多半是某个网页抓取或代码执行）。
 * 并行步（同轮并发）在条上画成半高 —— 它们的时段互相重叠，按各自耗时并排铺开
 * 是唯一诚实的画法，半高是为了和串行的满高段区分开，不额外引入色值。
 * ═══════════════════════════════════════════════════════════════════════════ */
.steps-fold .steps-time { display: none; }
.steps-fold.open .steps-time {
  display: flex; gap: 2px; height: 12px; margin: 0 2px 4px;
  align-items: center; background: none;
}
/* v1.4.150：每段是按钮（原来只是 <i>，点不了）。
   高度 12px 里只画中间 4px（background-clip: content-box + 上下 4px padding），
   视觉与原来的 4px 条一致，命中区大三倍。 */
.steps-time button {
  display: block; height: 12px; min-width: 4px; padding: 4px 0; margin: 0;
  border: 0; border-radius: 2px; cursor: pointer;
  background: var(--primary); background-clip: content-box; opacity: .26;
  transition: opacity .15s ease;
}
.steps-time button:nth-child(odd) { opacity: .46; }
.steps-time button.par { padding: 5px 0; opacity: .7; }
.steps-time button:hover, .steps-time button:focus-visible { opacity: .95; outline: none; }
/* 点完之后那一步闪一下：否则跳过去了也看不出是哪一行 */
.step-row.step-hit { background: var(--primary-soft); border-radius: 6px; }
/* 收口后的「接着做」用强调色：它是这条回答上的唯一可继续动作 */
.fl-mb.fl-cont { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.4.146 ② 输入框里的「引用块」
 * 原来引用一段回答只是往输入框插一行 `> 摘要` 纯文本，看不出是引用、也不能收。
 * 现在是一个 contenteditable=false 的胶囊：折叠时一行摘要 + 「展开」，点开显示全文；
 * 序列化仍输出 `> 摘要`，所以发出去的气泡与以前完全一致，不动消息链路。
 * ═══════════════════════════════════════════════════════════════════════════ */
.inline-att.quote-chip {
  display: inline-flex; flex-direction: column; gap: 2px; align-items: flex-start;
  max-width: 100%; padding: 5px 10px 5px 11px; margin: 4px 2px;
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: 8px; background: var(--primary-soft); cursor: pointer;
  font-family: inherit; font-size: 12.5px; line-height: 1.55; white-space: normal; text-align: left;
}
.inline-att.quote-chip:hover { border-color: var(--primary); }
.inline-att.quote-chip .qc-b {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text); opacity: .92;
  /* v1.4.147：引用范围扩到整条后，段落换行必须留着，否则三段结论会连成一片 */
  white-space: pre-wrap; word-break: break-word;
}
/* v1.4.147：引用范围扩到 1200 字，展开时不能再靠 line-clamp 8 行硬截 ——
   放开行数并给一个 300px 的滚动上限，既看得到整段，又不会把输入框顶到天上去。 */
.inline-att.quote-chip.open .qc-b {
  display: block; -webkit-line-clamp: unset;
  max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
}
.inline-att.quote-chip .qc-n { font-size: 10px; color: var(--dim); letter-spacing: .02em; }
.inline-att.quote-chip .qc-more { color: var(--primary); font-size: 10px; }

/* v1.4.163：分区切换扫光也一并取消（设置页要求完全静态）。
   以前切分区会给每张卡扫一道浅光，现在只换内容，不做任何过渡。
   同时把 v1.4.146 留下的 html[data-motion="off"] 兜底规则删掉 —— 倾斜已经不存在了。 */

/* ── v1.4.171 · 44 号：粘贴折叠条 ──────────────────────────────────
 * 一次粘贴只走一个出口：短文本内联、中长文本折叠、大规模强结构进文档档。
 * 折叠条沿用 inline-att 的黑白灰变量；不用 --pre-bg（代码块近黑底，会把提示块
 * 压成莫名其妙的黑框），不加彩色、不加动效，与设置页「完全静态」口径一致。 */
.inline-att.paste-fold {
  display: inline-flex; flex-direction: column; align-items: stretch; gap: 4px;
  max-width: 100%; vertical-align: middle; margin: 2px 0;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--hover-bg); color: var(--text);
  font-size: 12.5px; line-height: 1.5; white-space: normal;
}
.pf-head { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pf-tag {
  flex: 0 0 auto; font-size: 10px; font-weight: 400; color: var(--dim);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 5px;
  background: var(--panel);
}
.pf-body {
  white-space: pre-wrap; word-break: break-word; max-height: 92px; overflow: hidden;
  color: var(--dim); font-weight: 400;
}
.pf-foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--dim); }
.pf-restore {
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px;
  background: var(--panel); color: var(--text); font-size: 10.5px; cursor: pointer;
}
.pf-restore:hover { background: var(--hover-bg); }

/* ── v1.4.172 · 44 号方向 3 / 5：展开预览、范围注入、另存为文档 ──────────
 * 仍只用 --panel / --hover-bg / --border / --text / --dim；不用 --pre-bg（代码块近黑底，
 * 会把提示块压成莫名其妙的黑框），不加彩色、不加动效，与设置页「完全静态」口径一致。
 * 展开只改 pf-body 的高度上限：序列化只读 dataset，pf-body 里的全文不会混进发送体。 */
.pf-foot { flex-wrap: wrap; }
.pf-btn {
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px;
  background: var(--panel); color: var(--text); font-size: 10.5px; cursor: pointer;
}
.pf-btn:hover { background: var(--hover-bg); }
.pf-btn.on { border-color: var(--text); }
.pf-body.pf-open { max-height: 360px; overflow: auto; }
.pf-doc-name { color: var(--dim); font-size: 10px; word-break: break-all; }
.file-chip .fc-dl {
  border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; margin-left: 4px;
  background: var(--panel); color: var(--text); font-size: 10.5px; cursor: pointer;
}
.file-chip .fc-dl:hover { background: var(--hover-bg); }

/* ── v1.4.174：注入预算可见化 + 知识库检索 / 版本正文对比 ────────── */
.pf-head { flex-wrap: wrap; }
.pf-budget {
  flex: 0 1 auto; font-size: 10px; font-weight: 400; color: var(--dim);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 5px;
  background: var(--panel); word-break: keep-all;
}
.kb-search {
  width: 100%; box-sizing: border-box; margin: 8px 0 10px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 9px; outline: none;
  background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px;
}
.kb-search:focus { border-color: var(--dim); }
.kb-ops { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.kb-diff-mask {
  position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 22px; background: rgba(20, 25, 35, .38); box-sizing: border-box;
}
.kb-diff-panel {
  width: min(980px, 100%); height: min(760px, 92vh); display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text);
  box-shadow: 0 18px 60px rgba(20, 25, 35, .18); overflow: hidden;
}
.kb-diff-head, .kb-diff-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.kb-diff-head { justify-content: space-between; border-bottom: 1px solid var(--border); }
.kb-diff-bar { border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.kb-diff-bar select {
  min-width: 90px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--hover-bg); color: var(--text);
}
.kb-diff-summary { color: var(--dim); font-size: 12px; }
.kb-diff-body { flex: 1; overflow: auto; padding: 8px 0; font: 12px/1.55 var(--mono, monospace); }
.kb-diff-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); min-height: 22px; }
.kb-diff-row .ln { padding: 2px 10px; color: var(--dim); text-align: right; user-select: none; }
.kb-diff-row .txt { padding: 2px 14px 2px 4px; white-space: pre-wrap; word-break: break-word; }
.kb-diff-row.add { background: rgba(40, 140, 90, .08); }
.kb-diff-row.del { background: rgba(180, 60, 60, .08); }
.kb-diff-row.meta { color: var(--dim); background: var(--hover-bg); }
@media (max-width: 640px) {
  .pf-budget { flex-basis: 100%; width: fit-content; }
  .kb-diff-mask { padding: 8px; }
  .kb-diff-panel { height: 96vh; }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * v1.4.184 质感层：把「AI 生成感」的三件事拆开处理
 *   ① 层级靠 1%–3% 背景色差（--panel / --raise），边框只留发丝线，聚焦只加深阴影；
 *   ② 暗色降一档字重并压低文字亮度，抵消亮字在暗底上的光渗（halation）；
 *   ③ 数字等宽、段落收尾不留孤字，长文排版不出现「最后一行只剩一个字」。
 * 这里只放跨组件的通用规矩，组件级覆盖写回各自原规则，避免级联顺序打架。
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ① 数字等宽：时间、积分、计数、表格数值在任何位置都不再跳宽（拉丁数字 + 中文数字场景都继承） */
body { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.quota-hint, .stream-meta, .msg-meta, .rp-n, .s-meta { font-variant-numeric: tabular-nums; }

/* ② 段落收尾不留孤字：Chrome 117+ 原生 pretty，老浏览器自动忽略，不产生副作用 */
.msg.ai .msg-content p,
.msg.ai .msg-content li,
.msg.ai .msg-content blockquote,
.msg.ai .msg-content td,
.msg.ai .msg-content th,
.set-desc, .sg-desc, .card-desc, .pm-note, .onboard-note,
.composer-hint > span { text-wrap: pretty; }

/* ③ 暗色降字重：正文/加粗/标题各降一档；字体没有中间字重时浏览器取最近可用档，
      再由暗色 token 里的文字亮度（--text #e9e9e9）与抗锯齿兜底，不会出现「降了没变化」 */
html[data-theme="dark"] .msg.ai .msg-content { font-weight: var(--fw-body); }
html[data-theme="dark"] .msg.ai .msg-content strong,
html[data-theme="dark"] .msg.ai .msg-content b,
html[data-theme="dark"] .msg.ai .msg-content th,
html[data-theme="dark"] .msg.ai .msg-content dt { font-weight: var(--fw-strong); }
html[data-theme="dark"] .msg.ai .msg-content h1,
html[data-theme="dark"] .msg.ai .msg-content h2,
html[data-theme="dark"] .msg.ai .msg-content h3,
html[data-theme="dark"] .msg.ai .msg-content h4,
html[data-theme="dark"] .msg.ai .msg-content h5,
html[data-theme="dark"] .msg.ai .msg-content h6 { font-weight: var(--fw-head); }
/* 暗色里纯白会「发光」，把最亮的字色压一档（正文用 --text，代码块保留 --pre-text） */
html[data-theme="dark"] .msg.ai .msg-content code { color: #dcdcdc; }

/* ④ 图标与文字同一视觉中线：内联 SVG 默认基线对齐，中文行里会低 1px，看着像没对齐 */
button > svg, .cap-btn .cap-ico, .wx-chip-ico, .msg-actions button svg, .hud-dot { display: block; flex: none; }
.cap-btn, .wx-chip, .model-pill, .quota-hint { align-items: center; }

/* ⑤ 浮层比面板再亮一档：靠「更近光源」而不是更黑的边框表示更靠前 */
html[data-theme="light"] .plus-menu,
html[data-theme="light"] .model-menu { background: var(--bg); }
html[data-theme="dark"] .plus-menu,
html[data-theme="dark"] .model-menu { background: var(--raise); }

/* ⑥ 回答定稿的逐字渐显：模糊→清晰 + 2px 上浮归位，延迟由 JS 按字符序号写入 --d。
     用 inline-block 才能吃到 filter/transform；换行由每个字自己决定，中文不影响断行。 */
@keyframes wvIn {
  from { opacity: 0; filter: blur(3.5px); transform: translateY(2px); }
  to   { opacity: 1; filter: blur(0);    transform: translateY(0); }
}
.msg.ai .msg-content .wv {
  display: inline-block;
  animation: wvIn .46s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: var(--d, 0ms);
  will-change: opacity, filter, transform;
}
/* 动画跑完就摘掉 will-change，避免整屏长期占合成层 */
.msg.ai .msg-content .wv { animation-fill-mode: both; }
@media (prefers-reduced-motion: reduce) {
  .msg.ai .msg-content .wv { animation: none !important; }
}

/* ⑦ 拖拽与按压都「干脆」：拖拽中禁掉一切过渡（否则内容比手指慢半拍，看着像晃），
      松手给一次 1.8 倍宽度的收窄回弹；按钮按下缩 4%，松开用回弹曲线而不是线性复位。 */
body.rs-col-resize, body.rs-col-resize * { cursor: col-resize !important; }
body.rs-col-resize { user-select: none; }
#result-panel.rs-dragging, #result-panel.rs-dragging * { transition: none !important; }
.rs-splitter.on { background: var(--text); opacity: .5; }
.rs-splitter.rs-settle { transform-origin: center; animation: rsSettle .24s cubic-bezier(.34, 1.45, .64, 1); }
@keyframes rsSettle { 0% { transform: scaleX(1.9); opacity: .6; } 100% { transform: scaleX(1); opacity: 1; } }

.cap-btn, .icon-btn, .send-btn, .model-pill, .plus-btn, #btn-mic, .quota-hint, .ghost-btn {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease,
              transform .22s cubic-bezier(.34, 1.5, .64, 1);
}
.cap-btn:not(:disabled):active, .icon-btn:not(:disabled):active, .send-btn:not(:disabled):active,
.model-pill:active, .plus-btn:active, #btn-mic:active, .quota-hint:active, .ghost-btn:not(:disabled):active {
  transform: scale(.96);
}
@media (prefers-reduced-motion: reduce) {
  .cap-btn, .icon-btn, .send-btn, .model-pill, .plus-btn, #btn-mic, .quota-hint, .ghost-btn { transition: none; }
  .cap-btn:active, .icon-btn:active, .send-btn:active, .model-pill:active, .plus-btn:active, #btn-mic:active, .quota-hint:active, .ghost-btn:active { transform: none; }
  .rs-splitter.rs-settle { animation: none; }
}

/* ═══════════════ v1.4.197 付款页（public/pay-v2.js） ═══════════════
 * 配色只有一套中性灰阶 + 一个低饱和强调色（深墨蓝），语义色只用于状态。
 * 卡片 92px 三层信息（名称 / 价格 / 摘要），宁缺毋滥：不加分割线、不加装饰徽章。
 * 量值全部走变量，深色主题只换变量，不改任何尺寸。 */
#view-upgrade, #view-buy {
  --pay-bg: #FAFAFA;
  --pay-card: #FFFFFF;
  --pay-line: #EAEAEA;
  --pay-ink: #1A1A1A;
  --pay-ink2: #6B6B6B;
  --pay-ink3: #9B9B9B;
  --pay-acc: #1F3A5F;
  --pay-acc-soft: #EEF3F9;
  --pay-acc-line: #C6D5E6;
  --pay-acc-hover: #2A4C78;
  --pay-ok: #0F6E56;
  --pay-ok-soft: #E1F5EE;
  --pay-err: #A32D2D;
  --pay-err-soft: #FCEBEB;
  --pay-shadow: 0 4px 24px rgba(0, 0, 0, .06);
  background: var(--pay-bg);
}
html[data-theme="dark"] #view-upgrade, html[data-theme="dark"] #view-buy {
  --pay-bg: #12161C;
  --pay-card: #171C23;
  --pay-line: #262C35;
  --pay-ink: #E8EAED;
  --pay-ink2: #9AA3AD;
  --pay-ink3: #6F7883;
  --pay-acc: #8FB4DE;
  --pay-acc-soft: #1B2733;
  --pay-acc-line: #33506E;
  --pay-acc-hover: #A6C4E8;
  --pay-ok: #5FD3AF;
  --pay-ok-soft: #112A23;
  --pay-err: #F09696;
  --pay-err-soft: #2C1717;
  --pay-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
/* 视图主体改成「内容区 + 常驻结算条」两段，不再靠 padding 给底部留白 */
#upgrade-body, #buy-body {
  flex: 1; min-height: 0; width: 100%;
  max-width: none; margin: 0; padding: 0;
  overflow: hidden; display: flex; flex-direction: column;
}
.pay-page {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  background: var(--pay-bg); color: var(--pay-ink);
  font-size: 13px; line-height: 1.5;
}
.pay-page * { box-sizing: border-box; }
.pay-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
/* 内容比一屏短时垂直居中（margin:auto 在溢出时会自动变 0，不会吃掉滚动） */
.pay-inner { flex: none; }
/* 1440 是桌面内容的常用上限：再宽一行三张卡会拉成细长条，
   窗口缩到 1100 也不会挤成一团（列数在下面两处断点里降） */
.pay-inner { width: 100%; max-width: 1440px; margin: auto; padding: 20px 36px 30px; }
.pay-state { padding: 60px 0; text-align: center; color: var(--pay-ink2); }

/* ── 区块与商品卡片 ── */
.pay-block + .pay-block { margin-top: clamp(24px, 3.2vh, 42px); }
.pay-block-h {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--pay-ink);
}
.pay-block-h em { font-style: normal; font-size: 12px; font-weight: 400; color: var(--pay-ink3); }
.pay-grid { display: grid; gap: clamp(10px, .85vw, 16px); }
.pay-grid-sub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-grid-pack { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pay-card {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 3px;
  min-height: clamp(112px, 12.5vh, 160px); padding: clamp(16px, 1.3vh, 22px) clamp(16px, 1.1vw, 22px);
  text-align: left; cursor: pointer;
  background: var(--pay-card); border: 1px solid var(--pay-line); border-radius: 12px;
  color: var(--pay-ink); font: inherit;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.pay-card:hover { transform: translateY(-2px); box-shadow: var(--pay-shadow); }
.pay-card:focus-visible { outline: 2px solid var(--pay-acc); outline-offset: 2px; }
/* 推荐与已选必须一眼分得开：两者都用浅底 + 描边时，用户会把「推荐」当成已选。
   现在推荐 = 只换描边 + 浅色小徽标（提示）；已选 = 浅底 + 实描边 + 左侧色条 + 实心勾。 */
.pay-card.is-rec { background: var(--pay-card); border-color: var(--pay-acc-line); }
.pay-card.is-sel {
  background: var(--pay-acc-soft); border-color: var(--pay-acc);
  box-shadow: inset 0 0 0 1px var(--pay-acc);
}
.pay-card.is-sel:hover { box-shadow: inset 0 0 0 1px var(--pay-acc), var(--pay-shadow); }
.pay-card.is-sel::before {
  content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--pay-acc);
}
.pay-card.is-sel .pay-card-price { color: var(--pay-acc); }
.pay-card-name { font-size: clamp(14px, 1.05vw, 16px); font-weight: 600; line-height: 1.45; }
.pay-card-price {
  font-size: clamp(24px, 1.8vw, 30px); font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.pay-card-price i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--pay-ink3); margin-left: 2px; }
.pay-card-sum { font-size: clamp(12px, .88vw, 13px); line-height: 1.5; color: var(--pay-ink2); }
.pay-cur { font-size: .6em; vertical-align: top; line-height: 1.1; margin-right: 1px; }
.pay-badge {
  position: absolute; top: 10px; right: 10px;
  display: none; align-items: center; justify-content: center;
  height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--pay-acc); color: #fff; font-size: 11px; font-weight: 500;
}
.pay-card.is-rec .pay-badge {
  display: inline-flex; background: var(--pay-acc-soft); color: var(--pay-acc);
  box-shadow: inset 0 0 0 1px var(--pay-acc-line);
}
.pay-card.is-sel .pay-badge {
  display: inline-flex; width: 18px; padding: 0; border-radius: 50%;
  font-size: 0;
}
.pay-card.is-sel .pay-badge::after { content: '✓'; font-size: 11px; font-weight: 700; }
html[data-theme="dark"] .pay-badge { color: #10151B; }
html[data-theme="dark"] .pay-card.is-rec .pay-badge { color: var(--pay-acc); }

/* ── 团队版：一行细条 ── */
.pay-team {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 10px 16px; margin-top: 14px;
  background: var(--pay-card); border: 1px solid var(--pay-line); border-radius: 12px;
}
.pay-team-l { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pay-team-l b { font-size: 14px; font-weight: 600; }
.pay-team-l span { font-size: 12px; color: var(--pay-ink2); }
.pay-team-r { display: flex; align-items: center; gap: 16px; flex: none; }
.pay-team-price { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-team-price i { font-style: normal; font-size: 12px; font-weight: 400; color: var(--pay-ink3); margin-left: 2px; }

/* ── 结算条 ── */
.pay-bar {
  flex: none; position: relative; z-index: 2;
  background: var(--pay-card);
  border-top: 1px solid var(--pay-line);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .06);
}
.pay-bar-main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 28px;
  max-width: 1440px; margin: 0 auto; padding: 16px 36px 12px;
}
.pay-pick { min-width: 0; }
.pay-pick-k { font-size: 12px; color: var(--pay-ink3); margin-right: 6px; }
.pay-pick b { font-size: 14px; font-weight: 600; }
.pay-pick-s {
  display: block; margin-top: 3px; font-size: 12px; color: var(--pay-ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pay-amt {
  justify-self: end; font-size: 30px; font-weight: 600; line-height: 1;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pay-amt-u { font-size: 13px; font-weight: 400; color: var(--pay-ink3); margin-left: 3px; }
.pay-act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pay-seg {
  display: inline-flex; padding: 2px; border-radius: 999px;
  background: var(--pay-bg); border: 1px solid var(--pay-line);
}
.pay-seg-i {
  border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px;
  color: var(--pay-ink2); padding: 3px 12px; border-radius: 999px;
  transition: background-color .18s ease, color .18s ease;
}
.pay-seg-i.on { background: var(--pay-card); color: var(--pay-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.pay-cta {
  min-width: 208px; height: 44px; padding: 0 20px;
  border: 0; border-radius: 12px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--pay-acc); color: #fff; font-variant-numeric: tabular-nums;
  transition: background-color .18s ease;
}
.pay-cta:hover:not(:disabled) { background: var(--pay-acc-hover); }
.pay-cta:focus-visible { outline: 2px solid var(--pay-acc); outline-offset: 2px; }
.pay-cta:disabled { background: var(--pay-line); color: var(--pay-ink3); cursor: not-allowed; }
.pay-cta.small { min-width: 132px; height: 38px; font-size: 13px; }
html[data-theme="dark"] .pay-cta { color: #10151B; }
.pay-trust { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--pay-ink3); }
.pay-bar-foot {
  display: flex; gap: 18px; max-width: 1440px; margin: 0 auto; padding: 0 36px 10px;
}
.pay-link {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 12px;
  color: var(--pay-acc); text-decoration: underline; text-underline-offset: 3px;
}
.pay-link:hover { color: var(--pay-acc-hover); }
.pay-page[data-view="online"] [data-act="to-online"] { display: none; }
.pay-page[data-view="corp"] [data-act="to-corp"] { display: none; }
.pay-page[data-view="corp"] .pay-seg { display: none; }
/* 支付层展开后结算条上的渠道开关收起：同一组按钮一屏只出现一次 */
.pay-page.sheet-open .pay-act > .pay-seg { display: none; }

/* ── 支付层：结算条内部同宽展开，不是浮层 ── */
.pay-sheet {
  max-height: 0; overflow: hidden; opacity: 0; transform: translateY(8px);
  border-top: 1px solid transparent;
  transition: max-height .18s ease, opacity .18s ease, transform .18s ease, border-color .18s ease;
}
/* 上限留够开票表单（三行输入 + 按钮）；短内容不会被拉高，max-height 只是上限 */
.pay-sheet.is-open { max-height: 560px; opacity: 1; transform: none; border-top-color: var(--pay-line); }
.pay-sheet-in {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  max-width: 1440px; margin: 0 auto; padding: 18px 36px 20px;
}
/* 信息列不铺满整条：靠左一片文字、右边一大片空，看起来像没做完 */
.pay-sheet-in > .pay-sheet-main { flex: 0 1 520px; }
.pay-qr-box {
  flex: none; width: 148px; height: 148px; padding: 5px;
  background: #fff; border: 1px solid var(--pay-line); border-radius: 12px;
}
.pay-qr { display: block; width: 136px; height: 136px; border-radius: 8px; }
.pay-qr-box { position: relative; }
.pay-qr-mask {
  position: absolute; inset: 5px; display: flex; align-items: center; justify-content: center;
  padding: 0 10px; text-align: center; font-size: 12px; line-height: 1.5;
  color: var(--pay-ink3); background: var(--pay-card); border-radius: 8px;
}
.pay-qr-mask[hidden] { display: none; }
.pay-qr-mask.bad { color: var(--pay-err); }
.pay-sheet-main { min-width: 0; flex: 1; }
.pay-sheet-amt { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pay-sheet-ord { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--pay-ink2); }
.pay-sheet-k { color: var(--pay-ink3); }
.pay-sheet-ord code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--pay-ink); }
.pay-sheet-hint { margin-top: 6px; font-size: 12px; color: var(--pay-ink2); }
.pay-sheet-mock {
  margin-top: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--pay-acc-soft); color: var(--pay-ink2); font-size: 12px;
}
.pay-sheet-btns { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pay-ghost {
  height: 34px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--pay-line); background: var(--pay-card); color: var(--pay-ink);
  font: inherit; font-size: 12px; transition: border-color .18s ease, color .18s ease;
}
.pay-ghost:hover { border-color: var(--pay-acc-line); color: var(--pay-acc); }
/* 演示渠道的「模拟支付」是旁路动作，绝不能和主 CTA 一样是实心强调色 */
.pay-ghost.accent { border-color: var(--pay-acc-line); color: var(--pay-acc); }
.pay-sheet-note { margin-top: 10px; font-size: 12px; color: var(--pay-ink3); }
.pay-ok-ico {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--pay-ok-soft); color: var(--pay-ok); font-size: 14px; font-weight: 700;
}
.pay-ok-ico.bad { background: var(--pay-err-soft); color: var(--pay-err); }
.pay-ok-title { font-size: 16px; font-weight: 600; }
.pay-mini {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 2px 6px; border-radius: 6px;
  color: var(--pay-acc); font: inherit; font-size: 12px; cursor: pointer;
}
.pay-mini:hover { background: var(--pay-acc-soft); }

/* ── 视图 B：两栏小卡片 ── */
.pay-corp { display: grid; grid-template-columns: 1fr 1.05fr; gap: 16px; align-items: start; }
.pay-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pay-pane {
  background: var(--pay-card); border: 1px solid var(--pay-line);
  border-radius: 12px; padding: 18px 20px; min-width: 0;
}
.pay-lead { margin: 0 0 4px; font-size: 12px; color: var(--pay-ink2); }
.pay-chip {
  font-style: normal; font-size: 12px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
  background: var(--pay-err-soft); color: var(--pay-err);
}
.pay-chip.ok { background: var(--pay-ok-soft); color: var(--pay-ok); }
.pay-field { display: block; margin-top: 14px; }
.pay-field-k { display: block; margin-bottom: 6px; font-size: 12px; color: var(--pay-ink2); }
.pay-field input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--pay-line); border-radius: 10px;
  background: var(--pay-card); color: var(--pay-ink); font: inherit; font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.pay-field input:focus {
  outline: none; border-color: var(--pay-acc); box-shadow: 0 0 0 3px var(--pay-acc-soft);
}
.pay-field.bad input { border-color: var(--pay-err); background: var(--pay-err-soft); }
.pay-err { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--pay-err); }
.pay-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pay-hint { font-size: 12px; color: var(--pay-ink3); }
.pay-pv-name {
  margin: 6px 0 12px; font-size: 20px; font-weight: 600; line-height: 1.35; word-break: break-all;
}
/* 抬头未填时用弱化小字，别让 20px 的「—」看着像一条分隔线 */
.pay-pv-name.is-empty { font-size: 13px; font-weight: 400; color: var(--pay-ink3); }
.pay-pv-rows { border-top: 1px solid var(--pay-line); }
.pay-pv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--pay-line);
}
.pay-pv-k { flex: none; width: 96px; font-size: 12px; color: var(--pay-ink3); }
.pay-pv-v {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.pay-pv-note { margin-top: 12px; font-size: 12px; color: var(--pay-ink3); }
.pay-recent-list { display: flex; flex-direction: column; }
.pay-recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--pay-line); font-size: 12px;
}
.pay-recent-row:first-child { border-top: 0; }
.pay-recent-t { flex: none; width: 78px; color: var(--pay-ink3); font-variant-numeric: tabular-nums; }
.pay-recent-row b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-recent-amt { font-variant-numeric: tabular-nums; }
.pay-recent-st { color: var(--pay-ink2); }
.pay-recent-empty { padding: 14px 0; font-size: 12px; color: var(--pay-ink3); }

/* ── 团队版（对公视图的报价变体）：金额栏写「按报价」，不写 0 ── */
.pay-amt-q { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.pay-corp.is-team .pay-team-pane { grid-column: 1; }
.pay-corp.is-team .pay-fields { grid-column: 1; }
.pay-corp.is-team .pay-preview { grid-column: 2; grid-row: 1 / span 2; }
.pay-corp.is-team .pay-recent { grid-column: 1 / -1; }
.pay-team-pane .pay-pv-k { width: 56px; }
.pay-team-pane .pay-pv-row:last-child { border-bottom: 0; }
.pay-team-pane .pay-pv-v { font-weight: 400; }

/* ── 支付层内换渠道：小一号的分段控件，跟在订单号下面 ── */
.pay-sheet-ch { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pay-sheet-ch .pay-seg { background: var(--pay-card); }
.pay-sheet-ch .pay-seg-i { font-size: 11px; padding: 2px 10px; }
.pay-sheet-ch .pay-seg-i.on { background: var(--pay-acc-soft); color: var(--pay-acc); box-shadow: none; }

/* ── 开票表单：抬头独占一行，税号与邮箱并排 ── */
.pay-inv-form { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pay-inv-form .pay-field { margin-top: 10px; }
.pay-inv-form .pay-field:first-child { grid-column: 1 / -1; }
.pay-inv-form .pay-field input { height: 36px; }

/* ── 窄屏：先收内边距，再降列，最后把结算条竖排 ── */
@media (max-width: 1320px) {
  .pay-inner, .pay-bar-main, .pay-bar-foot, .pay-sheet-in { padding-left: 28px; padding-right: 28px; }
}
/* 1100 附近加量包 4 列会瘦到 200 以下，先降到 2 列（4 张正好两行） */
@media (max-width: 1100px) {
  .pay-grid-pack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-corp { grid-template-columns: 1fr; }
  /* 单栏后必须把 is-team 的显式列号清掉，否则 2 号列会把隐式列撑出来 */
  .pay-corp.is-team .pay-preview { grid-column: 1; grid-row: auto; }
  .pay-corp.is-team .pay-recent { grid-column: 1; }
  .pay-inv-form { grid-template-columns: 1fr; }
  .pay-inv-form .pay-field { grid-column: 1; }
}
@media (max-width: 980px) {
  .pay-grid-sub { grid-template-columns: 1fr; }
  .pay-inner, .pay-bar-main, .pay-bar-foot, .pay-sheet-in { padding-left: 20px; padding-right: 20px; }
  .pay-bar-main { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .pay-act { grid-column: 1 / -1; align-items: stretch; }
  .pay-cta { width: 100%; }
  .pay-trust { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pay-card, .pay-cta, .pay-sheet, .pay-seg-i, .pay-field input { transition: none; }
  .pay-card:hover { transform: none; }
}

/* v1.4.201 C06：产物卡片上的冒烟未通过角标（与交付门禁失败块同色系） */
.artifact-smoke-bad { margin-left:8px; padding:1px 8px; border-radius:10px; font-size:11px; color:var(--warn); background:var(--hover-bg); border:1px solid var(--warn); white-space:nowrap; }
