/* ============================================================
   邦邦 · 三主题样式
   penecho(默认,PenEcho 设计语言) / obsidian(墨蓝金) / celadon(青瓷)
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root, html[data-theme="penecho"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --bg: #eef0f3; --surface: #ffffff; --surface-2: #f6f7f9; --surface-3: #edeff3;
  --ink: #20242c; --ink-2: #4e5764; --ink-3: #8a93a1;
  --line: rgba(31,36,45,.14); --line-strong: rgba(31,36,45,.22);
  --hover: rgba(31,36,45,.055);
  --accent: #4f46e5; --accent-strong: #4338ca; --accent-soft: rgba(79,70,229,.09);
  --accent-ink: #ffffff;
  --success: #277a4c; --warning: #9a5b12; --danger: #b4232c;
  --r-sm: 5px; --r-md: 10px; --r-lg: 14px;
  --ctl-h: 30px;
  --shadow: 0 6px 14px rgba(17,24,39,.10);
  --shadow-lg: 0 14px 30px rgba(17,24,39,.16);
  --bubble-user: var(--accent); --bubble-user-ink: #fff;
  --logo-bg: linear-gradient(135deg,#4f46e5,#7c6cf0);
}

html[data-theme="obsidian"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --bg: #0d141f; --surface: #151f2e; --surface-2: #1a2637; --surface-3: #20304a;
  --ink: #e9edf5; --ink-2: #aeb8c9; --ink-3: #6d7a90;
  --line: rgba(210,220,240,.13); --line-strong: rgba(210,220,240,.24);
  --hover: rgba(210,220,240,.07);
  --accent: #d4a94e; --accent-strong: #c29434; --accent-soft: rgba(212,169,78,.13);
  --accent-ink: #1a1405;
  --success: #4caf7d; --warning: #d9a13b; --danger: #e06c6c;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --ctl-h: 32px;
  --shadow: 0 8px 18px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 40px rgba(0,0,0,.45);
  --bubble-user: #2a3a55; --bubble-user-ink: #eef2f9;
  --logo-bg: linear-gradient(135deg,#d4a94e,#8a6a24);
}

html[data-theme="celadon"] {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --bg: #f4f2ea; --surface: #fffdf7; --surface-2: #f8f5ec; --surface-3: #efeadd;
  --ink: #26312e; --ink-2: #4f5f5b; --ink-3: #8b978f;
  --line: rgba(38,49,46,.13); --line-strong: rgba(38,49,46,.22);
  --hover: rgba(15,118,110,.07);
  --accent: #0f766e; --accent-strong: #0b5f59; --accent-soft: rgba(15,118,110,.10);
  --accent-ink: #ffffff;
  --success: #2c7a4c; --warning: #a06a10; --danger: #b4402f;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --ctl-h: 34px;
  --shadow: 0 4px 14px rgba(38,49,46,.08);
  --shadow-lg: 0 14px 34px rgba(38,49,46,.13);
  --bubble-user: var(--accent); --bubble-user-ink: #fff;
  --logo-bg: linear-gradient(135deg,#0f766e,#14b8a6);
}

body { font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.recognition-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:8px 16px; border-top:1px solid var(--line); }
.recognition-panel { padding:16px; background:var(--surface-2); border-top:1px solid var(--line); overflow:auto; max-height:45vh; }
.recognition-panel label { display:block; margin-top:12px; }
.recognition-panel textarea { display:block; width:100%; margin:8px 0; resize:vertical; }
#cm-resource-picker { padding:12px 16px; border-top:1px solid var(--line); }
#cm-resource-list { max-width:100%; }
.cm-resource .res-card { color:var(--ink); border:0; margin:0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 6px 10px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 按钮 ---------- */
.btn-primary { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-sm);
  height: var(--ctl-h); padding: 0 14px; font-size: 13px; font-weight: 500; transition: .15s; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-block { width: 100%; height: 36px; font-size: 14px; }
.btn-ghost { color: var(--ink-2); border-radius: var(--r-sm); padding: 4px 10px; font-size: 13px; }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 32px 28px 24px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo, .brand-logo, .welcome-logo {
  background: var(--logo-bg); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; }
.auth-logo { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; margin: 0 auto 12px; }
.auth-brand h1 { font-size: 19px; font-weight: 600; }
.auth-brand p { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 2px; margin-bottom: 18px; }
.auth-tab { flex: 1; height: 28px; border-radius: calc(var(--r-sm) - 1px); font-size: 13px; color: var(--ink-2); }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.auth-form input { height: 34px; }
.auth-hint { font-size: 12px; color: var(--ink-3); text-align: center; }
.btn-wechat { height: 36px; border-radius: var(--r-sm); background: #07c160; color: #fff;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-wechat:hover { background: #06ad56; }
.btn-wechat::before { content: "◉"; font-size: 16px; }
.wechat-note { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: -4px; }
.auth-error { margin-top: 12px; padding: 8px 12px; border-radius: var(--r-sm); font-size: 12.5px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.auth-foot { margin-top: 20px; color: var(--ink-3); font-size: 12px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100dvh; }
.sidebar { width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px 10px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; }
.brand-text span { font-size: 11px; color: var(--ink-3); }
.btn-new-chat { margin: 0 4px 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px;
  border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); text-align: left; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-ico { width: 17px; text-align: center; font-size: 13px; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3);
  background: var(--surface-3); border-radius: 8px; padding: 0 6px; min-width: 18px; text-align: center; }
.nav-badge:empty { display: none; }
.session-list { flex: 1; overflow-y: auto; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px;
  display: flex; flex-direction: column; gap: 1px; }
.session-item { padding: 7px 10px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.session-item:hover { background: var(--hover); }
.session-item.active { background: var(--surface-3); color: var(--ink); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.theme-switch { display: flex; gap: 8px; padding: 0 8px; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; }
.theme-dot[data-theme="penecho"] { background: linear-gradient(135deg,#fff 55%,#4f46e5 55%); border-color: var(--line-strong); }
.theme-dot[data-theme="obsidian"] { background: linear-gradient(135deg,#151f2e 55%,#d4a94e 55%); }
.theme-dot[data-theme="celadon"] { background: linear-gradient(135deg,#f4f2ea 55%,#0f766e 55%); border-color: var(--line-strong); }
.theme-dot.active { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-row { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.user-name { font-size: 12.5px; color: var(--ink-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- 对话 ---------- */
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px clamp(16px, 6vw, 72px) 12px; }
.welcome { text-align: center; padding: 5vh 0 30px; }
.welcome-logo { width: 60px; height: 60px; border-radius: 16px; font-size: 27px; margin: 0 auto 16px; }
.welcome h2 { font-size: 22px; font-weight: 600; margin-bottom: 10px; }
.welcome-sub { color: var(--ink-2); font-size: 13.5px; max-width: 520px; margin: 0 auto 26px; }
.welcome-sub b { color: var(--accent); font-weight: 600; }
.quick-prompts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 640px; margin: 0 auto; }
.quick-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 14px; text-align: left; transition: .15s; display: flex; flex-direction: column; gap: 5px; }
.quick-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.quick-card strong { font-size: 13px; color: var(--accent); }
.quick-card span { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

.messages { display: flex; flex-direction: column; gap: 16px; max-width: 780px; margin: 0 auto; }
.msg { display: flex; gap: 10px; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; font-size: 13px; }
.msg.assistant .msg-avatar { background: var(--logo-bg); color: #fff; }
.msg.user .msg-avatar { background: var(--surface-3); color: var(--ink-2); }
.msg-body { max-width: 82%; display: flex; flex-direction: column; gap: 8px; }
.msg.user .msg-body { align-items: flex-end; }
.msg-text { padding: 9px 13px; border-radius: var(--r-md); font-size: 13.5px; white-space: pre-wrap;
  word-break: break-word; }
.msg.assistant .msg-text { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.user .msg-text { background: var(--bubble-user); color: var(--bubble-user-ink); border-top-right-radius: 4px; }
.msg-text b { font-weight: 600; }
.msg-text ul, .msg-text ol { padding-left: 18px; margin: 4px 0; }

.typing { display: flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 12.5px;
  max-width: 780px; margin: 10px auto 0; padding-left: 42px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.composer { display: flex; gap: 8px; padding: 12px clamp(16px, 6vw, 72px) 16px; }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 40px; padding: 9px 12px; line-height: 1.5; }
.btn-send { width: 44px; height: 40px; font-size: 15px; border-radius: var(--r-sm); }

/* ---------- 卡片(对话内) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-title { font-size: 13.5px; font-weight: 600; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.badge.green { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.badge.orange { background: color-mix(in srgb, var(--warning) 13%, transparent); color: var(--warning); }
.badge.gray { background: var(--surface-3); color: var(--ink-3); }
.card-desc { font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; }
.attr-row { display: flex; flex-wrap: wrap; gap: 5px; }
.attr-chip { font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 2px 8px; color: var(--ink-2); }
.attr-chip b { color: var(--ink); font-weight: 500; }
.card-actions { display: flex; gap: 8px; margin-top: 2px; }
.match-list { display: flex; flex-direction: column; gap: 7px; border-top: 1px dashed var(--line); padding-top: 9px; }
.match-item { display: flex; flex-direction: column; gap: 3px; }
.match-top { display: flex; align-items: center; gap: 7px; }
.match-name { font-size: 12.5px; font-weight: 600; }
.match-title { font-size: 11.5px; color: var(--ink-3); }
.score-bar { flex: 1; max-width: 90px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.score-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.score-num { font-size: 11px; color: var(--accent); font-weight: 600; }
.match-summary { font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.match-empty { font-size: 12.5px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 9px; }

/* ---------- 页面通用 ---------- */
.page-head { padding: 20px clamp(16px, 5vw, 48px) 12px; display: flex; flex-direction: column; gap: 10px; }
.page-head h2 { font-size: 18px; font-weight: 600; }
.page-sub { font-size: 12.5px; color: var(--ink-3); margin-top: -6px; }
.lib-tools { display: flex; gap: 8px; }
.lib-tools input { flex: 1; max-width: 420px; height: var(--ctl-h); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 3px 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.card-grid { flex: 1; overflow-y: auto; padding: 4px clamp(16px, 5vw, 48px) 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-content: start; }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; transition: .15s; }
.res-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.res-summary { font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.res-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.res-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.res-tag { font-size: 10.5px; color: var(--ink-3); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.res-ops { display: flex; gap: 2px; opacity: 0; transition: .15s; }
.res-card:hover .res-ops { opacity: 1; }
.icon-btn { font-size: 12px; color: var(--ink-3); padding: 2px 6px; border-radius: var(--r-sm); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.list { flex: 1; overflow-y: auto; padding: 4px clamp(16px, 5vw, 48px) 24px; display: flex; flex-direction: column; gap: 10px; }
.list .card { max-width: 760px; width: 100%; }
.demand-matches { margin-top: 2px; }
.task-row { display: flex; align-items: flex-start; gap: 10px; }
.task-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  margin-top: 2px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; }
.task-check.done { background: var(--success); border-color: var(--success); }
.task-main { flex: 1; }
.task-title { font-size: 13.5px; font-weight: 500; }
.task-title.done { text-decoration: line-through; color: var(--ink-3); }
.task-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.empty-tip { color: var(--ink-3); font-size: 13px; text-align: center; padding: 40px 0; }

/* ---------- 模态 / Toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.22); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; padding: 20px 22px; }
.modal h3 { font-size: 15px; margin-bottom: 14px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 9px 18px; border-radius: var(--r-md);
  font-size: 13px; z-index: 99; box-shadow: var(--shadow-lg); }

/* ---------- v0.2 人脉网络组件 ---------- */
.nav-badge.hot { background: var(--danger); color: #fff; }
.btn-mini { font-size: 11.5px; padding: 2px 8px; align-self: flex-start; }
.btn-attach { font-size: 16px; padding: 0 8px; height: 40px; }
.attr-chip.contact { border-color: var(--accent); background: var(--accent-soft); }
.contact-locked { font-size: 11.5px; color: var(--ink-3); background: var(--surface-2);
  border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 3px 8px; width: fit-content; }
.contact-hint { font-size: 11.5px; color: var(--warning); }
.card-notice { border-style: dashed; box-shadow: none; }
.card.unread { border-color: var(--accent); }
.notice-ico { font-size: 15px; }
.friend-avatar { width: 26px; height: 26px; border-radius: 7px; background: var(--logo-bg);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.section-title { font-size: 13px; color: var(--ink-3); font-weight: 500; margin: 8px 0 2px; }
.modal-wide { max-width: 560px; }
.fm-row { display: flex; align-items: center; gap: 10px; }
.fm-label { font-size: 12.5px; color: var(--ink-2); }
.fm-block { display: flex; flex-direction: column; gap: 6px; }
.fm-block-title { font-size: 12px; color: var(--ink-3); border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.fm-grants, .fm-shares { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.grant-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.grant-name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant-state { font-size: 11.5px; color: var(--success); }
.grant-state.dim { color: var(--ink-3); }
.grant-row select { font-size: 12px; height: 26px; padding: 0 6px; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px;
  padding: 4px 0; border-bottom: 1px dashed var(--line); }

/* ---------- 消息 / 聊天串 ---------- */
.conv-card { cursor: pointer; transition: .15s; }
.conv-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.chat-modal { display: flex; flex-direction: column; height: min(70dvh, 560px); }
.chat-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chat-modal-head h3 { margin: 0; }
.cm-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  background: var(--surface-2); border-radius: var(--r-md); padding: 12px; }
.cm-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.cm-msg.mine { align-self: flex-end; align-items: flex-end; }
.cm-from { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.cm-bubble { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  border-top-left-radius: 4px; padding: 7px 11px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.cm-msg.mine .cm-bubble { background: var(--bubble-user); color: var(--bubble-user-ink);
  border-color: transparent; border-radius: var(--r-md); border-top-right-radius: 4px; }
.cm-time { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.cm-composer { display: flex; gap: 8px; margin-top: 10px; }
.cm-composer input { flex: 1; height: 36px; }

/* ---------- 侧栏双 Tab / 会话列表(微信式) ---------- */
.side-tabs { display: flex; background: var(--surface-2); border-radius: var(--r-sm);
  padding: 2px; margin: 10px 4px 0; }
.side-tab { flex: 1; height: 26px; border-radius: calc(var(--r-sm) - 1px); font-size: 12px;
  color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 5px; }
.side-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.conv-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 8px; border-radius: var(--r-sm); }
.conv-item:hover { background: var(--hover); }
.conv-item.active { background: var(--surface-3); }
.conv-item .friend-avatar { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; font-size: 13px; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-name { font-size: 12.5px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.conv-time { font-size: 10px; color: var(--ink-3); }
.conv-unread { font-size: 10px; background: var(--danger); color: #fff; border-radius: 8px;
  min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* ---------- 语音 / 富媒体气泡 ---------- */
.cm-voice { display: flex; flex-direction: column; gap: 4px; }
.cm-voice audio { height: 32px; max-width: 220px; }
.cm-img { max-width: 220px; max-height: 220px; border-radius: var(--r-sm); display: block; }
#cm-voice.recording { background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger); font-size: 12px; min-width: 52px; }

/* ---------- 响应式(微信小程序内嵌等窄屏) ---------- */
@media (max-width: 860px) {
  .sidebar { width: 60px; padding: 12px 6px 8px; }
  .brand-text, .nav-label, .user-name, .session-list, .btn-new-chat { display: none; }
  .side-tabs { display: none; }
  .nav-item { position: relative; min-height: 44px; }
  .nav-badge { position: absolute; right: 0; top: 0; }
  .brand { justify-content: center; padding-bottom: 10px; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { align-items: center; }
  .theme-switch { flex-direction: column; gap: 6px; padding: 0; }
  .user-row { justify-content: center; padding: 0; }
  .quick-prompts { grid-template-columns: 1fr; }
  .msg-body { max-width: 92%; }
  .card { max-width: 100%; }
}
/* Invitation onboarding extends the existing three-theme visual system. */
.invitation-banner { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; flex-shrink: 0; }
.invitation-banner p { margin: 0 0 10px; line-height: 1.65; }
.invite-consent { display: flex !important; align-items: flex-start; gap: 8px; line-height: 1.6; }
.invite-consent input { width: 20px !important; height: 20px; flex-shrink: 0; margin-top: 3px; }
#invite-output { width: 100%; }
#btn-create-invite, #invite-copy, #invite-revoke { min-height: 44px; }
#invite-link { width: 100%; min-width: 0; box-sizing: border-box; }
.invitation-banner button { min-height: 44px; margin: 4px; }
