/* =====================================================
   丰顺 AI · Fooshun AI — 正式产品界面样式 (v5)
   PC 端：AI 产品工作台
   移动端：独立 App 化 UI（非 PC 压缩）
   品牌色：FS 渐变 #46D4FF → #1C9BFF → #1E40C9
   ===================================================== */

:root {
  /* 品牌色 */
  --fs-cyan: #46D4FF;
  --fs-blue: #1C9BFF;
  --fs-indigo: #1E40C9;
  --fs-grad: linear-gradient(135deg, #46D4FF 0%, #1C9BFF 48%, #1E40C9 100%);
  --fs-grad-soft: linear-gradient(135deg, #E8F6FF 0%, #EEF3FF 100%);

  /* 中性色（浅色产品主题） */
  --bg: #F7F9FC;
  --bg-elev: #FFFFFF;
  --bg-sidebar: #0B1220;
  --bg-sidebar-2: #0F1A2E;
  --line: #E6EAF0;
  --line-soft: #EEF1F6;
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --text-inv: #E6EDF7;
  --text-inv-2: #8FA1BC;

  --radius: 16px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 6px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 48px rgba(15,23,42,.14);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 60px;
  --sidebar-w: 264px;

  --font-size: 15px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow: hidden; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.4); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   品牌 LOGO 组件（HTML 合成，避免背景 rect）
   ============================================================ */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-symbol { width: 30px; height: 30px; flex: none; }
.brand-symbol.sm { width: 24px; height: 24px; }
.brand-symbol.lg { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text .bt-main {
  font-weight: 800; font-size: 16px; letter-spacing: .2px; color: var(--text);
}
.brand-text .bt-main .ai-grad {
  background: var(--fs-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; font-weight: 800;
}
.brand-text .bt-sub { font-size: 10.5px; color: var(--text-3); font-weight: 600; letter-spacing: .4px; }
/* 暗底变体 */
.brand-text.on-dark .bt-main { color: #fff; }
.brand-text.on-dark .bt-sub { color: var(--text-inv-2); }

/* ============================================================
   APP 总框架
   ============================================================ */
.app { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* ========== PC 左侧栏 ========== */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: linear-gradient(180deg, var(--bg-sidebar) 0%, var(--bg-sidebar-2) 100%);
  color: var(--text-inv);
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
  transition: margin-left .26s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed { margin-left: calc(var(--sidebar-w) * -1); }
.sb-head { padding: 16px 16px 12px; display: flex; align-items: center; justify-content: space-between; }
.sb-collapse-btn { color: var(--text-inv-2); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; transition: background .15s; }
.sb-collapse-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

.sb-new {
  margin: 4px 14px 12px;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 11px 14px; border-radius: 12px;
  background: var(--fs-grad); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 18px rgba(28,155,255,.35); transition: transform .12s, box-shadow .2s;
}
.sb-new:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(28,155,255,.45); }

.sb-section { padding: 6px 14px; flex: 1; overflow-y: auto; }
.sb-label { font-size: 11px; font-weight: 700; color: var(--text-inv-2); letter-spacing: 1px; text-transform: uppercase; padding: 12px 8px 6px; }
.sb-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: 10px; color: var(--text-inv);
  font-size: 13.5px; font-weight: 500; text-align: left; transition: background .14s, color .14s;
}
.sb-nav-item i { width: 18px; text-align: center; font-size: 14px; color: var(--text-inv-2); }
.sb-nav-item:hover { background: rgba(255,255,255,.06); }
.sb-nav-item.active { background: rgba(28,155,255,.18); color: #fff; }
.sb-nav-item.active i { color: var(--fs-cyan); }

/* 最近对话项 */
.sb-history-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--text-inv-2); font-size: 13px; cursor: pointer; transition: background .14s; position: relative; }
.sb-history-item:hover { background: rgba(255,255,255,.06); color: var(--text-inv); }
.sb-history-item .hi-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-history-item .hi-actions { display: none; gap: 2px; }
.sb-history-item:hover .hi-actions { display: flex; }
.hi-act-btn { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text-inv-2); font-size: 11px; }
.hi-act-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sb-empty-hint { padding: 14px 10px; color: var(--text-inv-2); font-size: 12.5px; line-height: 1.6; }

/* 侧栏底部（功能 + 弱化的管理后台） */
.sb-foot { padding: 8px 12px calc(12px + var(--safe-bottom)); border-top: 1px solid rgba(255,255,255,.05); }
.sb-foot-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; color: var(--text-inv-2); font-size: 13px; transition: background .14s, color .14s; }
.sb-foot-item i { width: 16px; text-align: center; }
.sb-foot-item:hover { background: rgba(255,255,255,.06); color: var(--text-inv); }
.sb-foot-admin { color: #5B6B85; font-size: 12px; margin-top: 2px; opacity: .75; }
.sb-foot-admin:hover { opacity: 1; color: var(--text-inv-2); }

/* ========== PC 主区 ========== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); position: relative; }

/* 顶部栏 */
.topbar {
  height: var(--header-h); flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-toggle { width: 36px; height: 36px; border-radius: 9px; display: none; place-items: center; color: var(--text-2); }
.topbar-toggle:hover { background: var(--line-soft); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.btn-ghost { padding: 8px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); border: 1px solid var(--line); background: #fff; transition: all .14s; }
.btn-ghost:hover { border-color: var(--fs-blue); color: var(--fs-blue); }
.btn-primary { padding: 8px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: #fff; background: var(--fs-grad); box-shadow: 0 4px 14px rgba(28,155,255,.32); transition: transform .12s; }
.btn-primary:hover { transform: translateY(-1px); }

.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--fs-grad); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; }

/* 主内容滚动区 */
/* 内容区：上方滚动 stage + 底部固定 dock（首页态/会话态共用） */
.content { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.pc-stage { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }

/* ============================================================
   首页态（极简欢迎区，垂直居中于 stage）
   ============================================================ */
.home-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.app.in-chat .home-hero { display: none; }
.hero-symbol { width: 64px; height: 64px; margin-bottom: 18px; filter: drop-shadow(0 8px 22px rgba(28,155,255,.3)); }
.hero-title { font-size: 32px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.hero-title .ai-grad { background: var(--fs-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.hero-sub { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }

/* 底部固定输入区 */
.pc-dock { flex: none; padding: 10px 24px calc(14px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(247,249,252,0), var(--bg) 26%); }
.pc-dock .prompt-box { max-width: 780px; margin: 0 auto; }
.dock-terms { max-width: 780px; margin: 8px auto 0; text-align: center; color: var(--text-3); font-size: 11.5px; }
.dock-terms a { color: var(--text-2); text-decoration: underline; }

/* PC 主输入框（视觉核心） */
.prompt-box {
  width: 100%;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  transition: border-color .16s, box-shadow .16s;
  overflow: hidden;
}
.prompt-box:focus-within { border-color: var(--fs-blue); box-shadow: 0 10px 34px rgba(28,155,255,.18); }
.prompt-mode-bar { display: none; align-items: center; gap: 8px; padding: 12px 16px 0; }
.mode-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 12px; border-radius: 999px; background: var(--fs-grad-soft); color: var(--fs-indigo); font-size: 12.5px; font-weight: 700; }
.mode-chip .mc-x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--fs-indigo); font-size: 10px; }
.mode-chip .mc-x:hover { background: rgba(30,64,201,.12); }

.prompt-input { width: 100%; border: none; outline: none; resize: none; padding: 18px 20px 6px; font-size: 16px; line-height: 1.6; color: var(--text); background: transparent; min-height: 30px; max-height: 220px; font-family: inherit; }
.prompt-input::placeholder { color: var(--text-3); }
.prompt-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 12px; gap: 8px; }
.pt-left { display: flex; align-items: center; gap: 4px; }
.pt-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--text-2); font-size: 16px; transition: background .14s, color .14s; }
.pt-btn:hover { background: var(--line-soft); color: var(--fs-blue); }
.pt-model { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: background .14s; }
.pt-model:hover { background: var(--line-soft); }
.pt-model .mdot { width: 8px; height: 8px; border-radius: 50%; background: var(--fs-blue); }
.pt-send { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--fs-grad); color: #fff; font-size: 16px; box-shadow: 0 5px 16px rgba(28,155,255,.36); transition: transform .12s, opacity .14s; }
.pt-send:hover { transform: translateY(-1px); }
.pt-send.stop-mode { background: #475569; box-shadow: none; }

/* 四大能力卡片 */
.feat-grid { width: 100%; margin-top: 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feat-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px 18px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); transition: transform .14s, box-shadow .18s, border-color .14s;
  position: relative;
}
.feat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: transparent; }
.feat-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 19px; color: #fff; }
.feat-ico.c1 { background: linear-gradient(135deg,#1C9BFF,#1E40C9); }
.feat-ico.c2 { background: linear-gradient(135deg,#46D4FF,#1C9BFF); }
.feat-ico.c3 { background: linear-gradient(135deg,#7C5CFF,#1E40C9); }
.feat-ico.c4 { background: linear-gradient(135deg,#FF8A4C,#FF5C7C); }
.feat-body { flex: 1; min-width: 0; }
.feat-body .ft-title { display: block; font-size: 15px; font-weight: 700; margin: 0 0 3px; color: var(--text-1); }
.feat-body .ft-desc { display: block; font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feat-arrow { color: var(--text-3); font-size: 14px; transition: transform .14s, color .14s; }
.feat-card:hover .feat-arrow { color: var(--fs-blue); transform: translateX(3px); }

/* 快捷提示词 */
.chips { width: 100%; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.chip { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 500; transition: all .14s; }
.chip:hover { border-color: var(--fs-blue); color: var(--fs-blue); background: #F5FAFF; }

/* 页脚合规 */
.foot-notice { width: 100%; max-width: 820px; margin: 30px auto 6px; text-align: center; color: var(--text-3); font-size: 11.5px; line-height: 1.7; }
.foot-notice a { color: var(--text-2); text-decoration: underline; }

/* ============================================================
   会话态
   ============================================================ */
.chat-view { display: none; flex-direction: column; flex: 1; padding: 24px 0 12px; }
.app.in-chat .chat-view { display: flex; }
.chat-inner { max-width: 780px; margin: 0 auto; padding: 0 24px; width: 100%; }

.msg-row { display: flex; gap: 12px; margin-bottom: 22px; }
.msg-row.user { flex-direction: row-reverse; }
.msg-avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.msg-avatar.ai { background: var(--fs-grad); color: #fff; }
.msg-avatar.user { background: #E2E8F0; color: var(--text-2); }
.msg-col { max-width: 76%; min-width: 0; }
.msg-row.user .msg-col { display: flex; flex-direction: column; align-items: flex-end; }
.msg-bubble { padding: 12px 16px; border-radius: 16px; font-size: var(--font-size); line-height: 1.72; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-row.ai .msg-bubble { background: #fff; border: 1px solid var(--line); color: var(--text); border-top-left-radius: 5px; }
.msg-row.user .msg-bubble { background: var(--fs-grad); color: #fff; border-top-right-radius: 5px; }
.msg-actions { display: flex; gap: 6px; margin-top: 7px; }
.msg-action-btn { padding: 4px 10px; border-radius: 8px; font-size: 11.5px; color: var(--text-2); border: 1px solid var(--line); background: #fff; transition: all .14s; }
.msg-action-btn:hover { border-color: var(--fs-blue); color: var(--fs-blue); }

.typing-dots { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: td 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2){ animation-delay: .15s; } .typing-dots span:nth-child(3){ animation-delay: .3s; }
@keyframes td { 0%,60%,100%{ transform: translateY(0); opacity:.5 } 30%{ transform: translateY(-5px); opacity:1 } }

/* 会话态底部输入（复用 prompt-box 但贴底） */
.chat-input-dock { flex: none; padding: 12px 24px calc(16px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(247,249,252,0), var(--bg) 28%); }
.chat-input-dock .prompt-box { max-width: 780px; margin: 0 auto; margin-top: 0; }

/* ============================================================
   模型下拉
   ============================================================ */
.model-pop { position: fixed; z-index: 200; width: 300px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; display: none; }
.model-pop.open { display: block; animation: pop .14s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.mp-group-label { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 10px 10px 4px; letter-spacing: .5px; }
.model-option { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.model-option:hover { background: var(--line-soft); }
.model-option.selected { background: #F0F7FF; }
.mo-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mo-name { flex: 1; font-size: 13.5px; font-weight: 600; }
.mo-badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.mo-badge.ready { background: #E7F8EF; color: #16A34A; }
.mo-badge.pending { background: #FFF4E5; color: #D97706; }
.model-option.selected .fa-check { color: var(--fs-blue); }

/* ============================================================
   通用 Modal / Toast
   ============================================================ */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px; }
.overlay.open, .overlay.show { display: flex; }
.modal { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; animation: pop .18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); }
.modal-close:hover { background: var(--line-soft); color: var(--text); }
.modal-body { padding: 20px; }

.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0F172A; color: #fff; padding: 11px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 9999; max-width: 88vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #16A34A; } .toast.error { background: #DC2626; }

/* 登录弹窗（沿用结构） */
.auth-tabs { display: flex; gap: 4px; background: var(--line-soft); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: all .14s; }
.auth-tab.active { background: #fff; color: var(--fs-blue); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.auth-input-wrap { position: relative; }
.auth-field input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 14px; outline: none; transition: border-color .14s; }
.auth-field input:focus { border-color: var(--fs-blue); }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 28px; height: 28px; border-radius: 7px; }
.auth-submit { padding: 12px; border-radius: 12px; background: var(--fs-grad); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 6px 18px rgba(28,155,255,.32); }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text); }
.auth-google:hover { background: var(--line-soft); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-err { color: #DC2626; font-size: 12.5px; min-height: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 16px; }

/* ============================================================
   移动端遮罩 + PC 侧栏遮罩
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(11,18,32,.5); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.scrim.active { opacity: 1; pointer-events: auto; }

/* ============================================================
   移动端 App 化 UI（独立设计，<= 860px 启用）
   ============================================================ */
.mobile-only { display: none; }

@media (min-width: 861px) {
  .m-shell { display: none !important; }
}

@media (max-width: 860px) {
  body { overflow: hidden; }
  /* 隐藏 PC 结构 */
  .app { display: none !important; }
  .mobile-only { display: block; }

  .m-shell {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    background: var(--bg-elev);
    overflow: hidden;
  }

  /* 顶部轻导航 */
  .m-header {
    flex: none; height: calc(54px + var(--safe-top)); padding-top: var(--safe-top);
    display: flex; align-items: center; justify-content: space-between;
    padding-left: 14px; padding-right: 14px;
    background: var(--bg-elev); border-bottom: 1px solid var(--line-soft);
    z-index: 30;
  }
  .m-hd-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--text); font-size: 18px; }
  .m-hd-btn:active { background: var(--line-soft); }
  .m-hd-center { display: flex; align-items: center; gap: 8px; }
  .m-hd-mode { font-size: 11px; font-weight: 700; color: var(--fs-blue); background: #EAF4FF; padding: 3px 9px; border-radius: 999px; margin-left: 6px; }
  .m-hd-right { display: flex; align-items: center; gap: 4px; }

  /* 主滚动区 */
  .m-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }

  /* 首页态：欢迎 + 快捷 */
  .m-home { display: flex; flex-direction: column; min-height: 100%; padding: 8px 18px 16px; }
  .m-welcome { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 8vh 0 4vh; text-align: center; }
  .m-welcome .mw-symbol { width: 56px; height: 56px; margin-bottom: 18px; filter: drop-shadow(0 8px 20px rgba(28,155,255,.28)); }
  .m-welcome .mw-title { font-size: 25px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
  .m-welcome .mw-title .ai-grad { background: var(--fs-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
  .m-welcome .mw-sub { margin: 10px 0 0; color: var(--text-3); font-size: 13.5px; line-height: 1.6; }

  /* 模式态内容（图片/聊天/文档...） */
  .m-mode-pane { padding: 18px; display: none; }
  .m-mode-pane.active { display: block; }
  .m-mode-h { font-size: 21px; font-weight: 800; margin: 4px 0 4px; }
  .m-mode-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.7; margin: 0 0 16px; }
  .m-img-scroller { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .m-img-scroller::-webkit-scrollbar { display: none; }
  .m-img-card { flex: none; width: 130px; }
  .m-img-thumb { width: 130px; height: 130px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; color: #fff; box-shadow: var(--shadow-sm); }
  .m-img-card .ic-title { font-size: 13px; font-weight: 600; margin-top: 8px; text-align: center; }
  .m-cap-list { display: flex; flex-direction: column; gap: 10px; }
  .m-cap-item { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg); border-radius: 14px; }
  .m-cap-item i { width: 36px; height: 36px; border-radius: 10px; background: var(--fs-grad-soft); color: var(--fs-blue); display: grid; place-items: center; font-size: 15px; flex: none; }
  .m-cap-item .ci-txt { font-size: 14px; font-weight: 600; }
  .m-info-card { background: var(--bg); border-radius: 16px; padding: 18px; }
  .m-info-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.9; }
  .m-pending-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #D97706; background: #FFF4E5; padding: 4px 10px; border-radius: 999px; margin-top: 12px; }

  /* 会话态 */
  .m-chat { padding: 16px 16px 8px; display: none; }
  .m-chat.active { display: block; }

  /* 快捷功能入口（输入卡片上方） */
  .m-quick { flex: none; padding: 6px 14px 0; }
  .m-quick-row { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .m-quick-row::-webkit-scrollbar { display: none; }
  .m-quick-btn { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; min-width: 70px; background: var(--bg); border-radius: 16px; transition: background .14s; }
  .m-quick-btn:active { background: #EAF1F9; }
  .m-quick-btn i { font-size: 19px; color: var(--fs-blue); }
  .m-quick-btn span { font-size: 11.5px; font-weight: 600; color: var(--text-2); }

  /* 底部主输入卡片 */
  .m-dock {
    flex: none; padding: 8px 12px calc(8px + var(--safe-bottom));
    background: var(--bg-elev); border-top: 1px solid var(--line-soft);
    z-index: 30;
  }
  .m-prompt-card { background: var(--bg); border: 1px solid var(--line); border-radius: 22px; padding: 6px 6px 6px 6px; transition: border-color .14s; }
  .m-prompt-card:focus-within { border-color: var(--fs-blue); background: #fff; }
  .m-mode-chip-bar { display: none; padding: 8px 10px 2px; }
  .m-mode-chip-bar.show { display: flex; }
  .m-prompt-input { width: 100%; border: none; outline: none; resize: none; background: transparent; padding: 10px 14px 4px; font-size: 16px; line-height: 1.5; max-height: 140px; min-height: 24px; font-family: inherit; }
  .m-prompt-input::placeholder { color: var(--text-3); }
  .m-prompt-tools { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 2px; }
  .m-pt-left { display: flex; align-items: center; gap: 4px; }
  .m-pt-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); font-size: 17px; }
  .m-pt-btn:active { background: var(--line-soft); }
  .m-pt-model { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: #fff; border: 1px solid var(--line); }
  .m-pt-model .mdot { width: 7px; height: 7px; border-radius: 50%; background: var(--fs-blue); }
  .m-pt-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fs-grad); color: #fff; font-size: 16px; box-shadow: 0 4px 12px rgba(28,155,255,.34); }
  .m-pt-send.stop-mode { background: #475569; box-shadow: none; }

  /* 键盘弹起：隐藏快捷区，保证输入框可见 */
  .m-shell.kb-open .m-quick { display: none; }
  .m-shell.kb-open .m-welcome { padding: 4vh 0 2vh; }

  /* 模式 chip（输入框内） */
  .m-mode-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px 5px 12px; border-radius: 999px; background: var(--fs-grad-soft); color: var(--fs-indigo); font-size: 12.5px; font-weight: 700; }
  .m-mode-chip .mc-x { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
  .m-mode-chip .mc-x:active { background: rgba(30,64,201,.14); }

  /* 底部弹窗（加号面板） */
  .m-sheet-wrap { position: fixed; inset: 0; z-index: 400; display: none; }
  .m-sheet-wrap.open { display: block; }
  .m-sheet-scrim { position: absolute; inset: 0; background: rgba(11,18,32,.5); opacity: 0; transition: opacity .25s; }
  .m-sheet-wrap.open .m-sheet-scrim { opacity: 1; }
  .m-sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: #fff; border-radius: 24px 24px 0 0;
    padding: 10px 18px calc(20px + var(--safe-bottom));
    transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
    box-shadow: 0 -10px 40px rgba(15,23,42,.16);
  }
  .m-sheet-wrap.open .m-sheet { transform: translateY(0); }
  .m-sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: #D6DCE5; margin: 4px auto 16px; }
  .m-sheet-top { display: flex; gap: 12px; margin-bottom: 16px; }
  .m-sheet-top button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; background: var(--bg); border-radius: 18px; }
  .m-sheet-top i { font-size: 22px; color: var(--fs-blue); }
  .m-sheet-top span { font-size: 12.5px; font-weight: 600; }
  .m-sheet-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 8px; border-radius: 12px; font-size: 14.5px; font-weight: 500; text-align: left; }
  .m-sheet-list button:active { background: var(--line-soft); }
  .m-sheet-list i { width: 24px; text-align: center; color: var(--text-2); font-size: 16px; }
  .m-sheet-list .sl-pending { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #D97706; background: #FFF4E5; padding: 2px 8px; border-radius: 999px; }

  /* 左侧抽屉菜单 */
  .m-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 410;
    width: 82vw; max-width: 320px;
    background: linear-gradient(180deg, var(--bg-sidebar), var(--bg-sidebar-2));
    color: var(--text-inv); display: flex; flex-direction: column;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    padding-top: var(--safe-top);
  }
  .m-drawer.open { transform: translateX(0); }
  .m-drawer-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
  .m-drawer-body { flex: 1; overflow-y: auto; padding: 6px 12px; }
  .m-drawer-new { margin: 4px 6px 14px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--fs-grad); color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 6px 18px rgba(28,155,255,.35); }
  .m-drawer-item { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 11px; color: var(--text-inv); font-size: 14.5px; font-weight: 500; }
  .m-drawer-item i { width: 20px; text-align: center; color: var(--text-inv-2); }
  .m-drawer-item:active { background: rgba(255,255,255,.08); }
  .m-drawer-foot { padding: 10px 18px calc(16px + var(--safe-bottom)); border-top: 1px solid rgba(255,255,255,.06); }
  .m-drawer-admin { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: #5B6B85; font-size: 12.5px; }
  .m-drawer-admin i { width: 18px; text-align: center; }

  /* 全屏语音模式 */
  .m-voice {
    position: fixed; inset: 0; z-index: 500;
    background: linear-gradient(165deg, #0B1220 0%, #0F1E3A 55%, #122B5E 100%);
    color: #fff; display: none; flex-direction: column;
    padding-top: var(--safe-top); padding-bottom: calc(24px + var(--safe-bottom));
  }
  .m-voice.open { display: flex; }
  .m-voice-head { flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
  .mv-hd-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 18px; }
  .mv-hd-btn:active { background: rgba(255,255,255,.1); }
  .m-voice-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
  .voice-ball {
    width: 150px; height: 150px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #6FE0FF, #1C9BFF 55%, #1E40C9);
    box-shadow: 0 0 60px rgba(28,155,255,.55), inset 0 0 30px rgba(255,255,255,.25);
    animation: vball 2.4s ease-in-out infinite;
  }
  @keyframes vball { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
  .m-voice.listening .voice-ball { animation: vball 1.1s ease-in-out infinite; }
  .m-voice.thinking .voice-ball { animation: vspin 1.6s linear infinite; }
  @keyframes vspin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
  .voice-state { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
  .voice-hint { color: rgba(255,255,255,.6); font-size: 13px; margin-top: -18px; }
  .m-voice-foot { flex: none; display: flex; align-items: center; justify-content: center; gap: 28px; }
  .mv-foot-btn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
  .mv-foot-btn.plus { background: rgba(255,255,255,.12); color: #fff; }
  .mv-foot-btn.mic { width: 72px; height: 72px; background: #fff; color: var(--fs-indigo); font-size: 26px; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
  .mv-foot-btn.close { background: rgba(255,255,255,.12); color: #fff; }
}

/* 安装横幅 */
.install-banner { position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--safe-bottom)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 14px 16px; display: none; align-items: center; gap: 12px; z-index: 250; }
.install-banner.show { display: flex; }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; }
.install-banner .ib-body { flex: 1; }
.install-banner .ib-title { font-weight: 700; font-size: 14px; }
.install-banner .ib-desc { font-size: 12px; color: var(--text-3); }
.install-banner .ib-install { padding: 8px 14px; border-radius: 10px; background: var(--fs-grad); color: #fff; font-weight: 700; font-size: 13px; }
.install-banner .ib-close { color: var(--text-3); width: 30px; height: 30px; }

/* ============================================================
   v6 — 加号菜单 / 侧栏收起 / 手机号注册
   ============================================================ */

/* PC 加号菜单（从输入框左下弹出） */
.pt-plus { font-size: 18px; }
.plus-menu {
  position: fixed; z-index: 320; display: none;
  width: 280px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 8px; animation: pmIn .14s ease;
}
.plus-menu.open { display: block; }
@keyframes pmIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.pm-group { padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.pm-group:last-of-type { border-bottom: none; }
.pm-label { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .6px; padding: 7px 12px 4px; text-transform: uppercase; }
.pm-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--text); text-align: left; transition: background .12s; }
.pm-item i { width: 20px; text-align: center; color: var(--text-2); font-size: 15px; }
.pm-item:hover { background: var(--line-soft); }
.pm-item .pm-pending { margin-left: auto; font-size: 10px; font-weight: 700; color: #D97706; background: #FFF4E5; padding: 2px 7px; border-radius: 999px; }
.pm-prompts { margin-top: 4px; font-weight: 600; color: var(--fs-blue); }
.pm-prompts i { color: var(--fs-blue); }

/* 侧栏收起态：浮动展开按钮（明显 + hover 文字提示） */
.sb-reopen {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  display: none; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px 0 8px;
  background: linear-gradient(180deg, var(--bg-sidebar), var(--bg-sidebar-2));
  color: var(--text-inv); border-radius: 12px;
  box-shadow: var(--shadow-lg); transition: transform .14s;
}
.sb-reopen img { width: 26px; height: 26px; }
.sb-reopen i { font-size: 13px; color: var(--fs-cyan); }
.sb-reopen::after {
  content: "展开侧边栏"; position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #111827; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 7px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s;
}
.sb-reopen:hover { transform: translateY(-1px); }
.sb-reopen:hover::after { opacity: 1; }
.app.sb-collapsed .sb-reopen { display: flex; }
.app.sb-collapsed .topbar-left { padding-left: 52px; }

/* 手机号注册 / 注册方式切换 */
.reg-method-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.rm-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .14s; }
.rm-tab.active { border-color: var(--fs-blue); color: var(--fs-blue); background: #F5FAFF; }
.phone-row { display: flex; align-items: center; gap: 8px; }
.cc-select { flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px; color: var(--text); background: #fff; font-family: inherit; }
.cc-select:focus { outline: none; border-color: var(--fs-blue); }
.cc-prefix { flex: none; padding: 11px 12px; background: var(--line-soft); border-radius: 11px; font-size: 14px; font-weight: 700; color: var(--text-2); min-width: 58px; text-align: center; }
.phone-row input[type="tel"], .phone-row input#regSmsCode { flex: 1; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px; font-family: inherit; }
.phone-row input:focus { outline: none; border-color: var(--fs-blue); }
.sms-btn { flex: none; padding: 0 14px; height: 42px; border-radius: 11px; border: 1px solid var(--fs-blue); color: var(--fs-blue); font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .14s; }
.sms-btn:hover:not(:disabled) { background: #F5FAFF; }
.sms-btn:disabled { border-color: var(--line); color: var(--text-3); cursor: not-allowed; }
.reg-hint { font-size: 12px; color: #D97706; background: #FFF7ED; border-radius: 10px; padding: 9px 12px; margin: 4px 0 12px; line-height: 1.6; }
.reg-hint i { margin-right: 5px; }

/* 移动端加号弹窗分组标题 */
@media (max-width: 860px) {
  .m-sheet-grp { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .6px; text-transform: uppercase; padding: 12px 8px 4px; }
  .m-sheet { max-height: 82vh; overflow-y: auto; }
}
