/* ============================================================
   跨域 AI 团队 · WorkBuddy 风格对话界面
   左侧边栏（核心骨干/部门/会话） + 中间聊天流 + 右侧详情面板
   ============================================================ */

:root {
  --bg: #05060a;
  --sidebar-bg: #0b0d14;
  --panel: #11131c;
  --panel-hover: #161925;
  --glass: rgba(255, 255, 255, 0.04);
  --stroke: rgba(255, 255, 255, 0.07);
  --stroke-strong: rgba(255, 255, 255, 0.14);
  --text: #f0f1f5;
  --text-soft: #c8ccd6;
  --text-dim: #8a92a6;
  --brand: #ff3b5c;
  --brand-2: #ff6b8a;
  --brand-glow: rgba(255, 59, 92, 0.35);
  --manager: #ffb224;
  --manager-2: #ff9242;
  --online: #34d399;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --shadow: 0 20px 60px rgba(0,0,0,0.55);
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   布局
   ============================================================ */
.app {
  display: flex;
  width: 100vw; height: 100vh;
}

/* ============================================================
   左侧边栏
   ============================================================ */
.sidebar {
  width: 260px; min-width: 220px; max-width: 300px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-avatar {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, #ff8fab 100%);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 6px 18px rgba(255,59,92,0.25), inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand-meta { min-width: 0; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.brand-row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.brand-badge {
  font-size: 9px; font-weight: 700; color: #1a1205;
  background: linear-gradient(135deg, var(--manager) 0%, var(--manager-2) 100%);
  padding: 2px 6px; border-radius: 5px;
}
.brand-version { font-size: 10px; color: var(--text-dim); }

.sidebar-body {
  flex: 1; overflow-y: auto; padding: 10px 10px;
}
.sidebar-section { margin-bottom: 14px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 7px; margin-bottom: 6px;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.8px; text-transform: uppercase;
}
.section-head .count {
  background: var(--glass); color: var(--text-soft);
  padding: 1px 6px; border-radius: 9px; font-size: 9px; letter-spacing: 0;
}
.new-session {
  width: 20px; height: 20px; border-radius: 6px; border: none;
  background: var(--glass); color: var(--text-soft); font-size: 14px; line-height: 1;
  cursor: pointer; transition: all 0.16s var(--ease);
}
.new-session:hover { background: rgba(255,59,92,0.15); color: var(--brand-2); }

/* Agent 列表 */
.agent-list { display: flex; flex-direction: column; gap: 1px; }
.agent-list.compact { gap: 0; }
.agent-group { margin-bottom: 6px; }
.agent-group-title {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 7px 8px 3px;
}
.agent-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--r-sm);
  cursor: pointer; transition: background 0.14s var(--ease);
}
.agent-item:hover { background: var(--panel-hover); }
.agent-item.core-item { padding: 6px 8px; }
.agent-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid var(--stroke); position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.agent-avatar.small { width: 28px; height: 28px; }
.agent-avatar::after {
  content: ''; position: absolute; right: -1px; bottom: -1px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--online);
  border: 2px solid var(--sidebar-bg);
}
.ai-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-info { min-width: 0; }
.agent-name { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.agent-role {
  font-size: 10px; color: var(--text-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.core-badge {
  display: inline-block; margin-left: 5px; vertical-align: middle;
  font-size: 8px; font-weight: 700; line-height: 1;
  color: #1a1205;
  background: linear-gradient(135deg, #f5b301 0%, #ff8a00 100%);
  padding: 1px 4px; border-radius: 4px;
}
.core-badge.shared { background: linear-gradient(135deg, #8a94a6 0%, #5f6b80 100%); color: #fff; }
.core-badge.admin { background: linear-gradient(135deg, #534ab7 0%, #7f77dd 100%); color: #fff; }

/* 核心骨干悬浮详情提示 */
#coreTooltip {
  position: fixed; z-index: 9999; max-width: 280px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(32, 30, 50, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
  color: var(--text); font-size: 12px; line-height: 1.55;
  pointer-events: none;
}
.cp-detail { background: transparent; border: none; padding: 0; margin: 0; }
.cp-row { margin: 3px 0; }
.cp-row > span { display: inline-block; min-width: 32px; margin-right: 6px; color: #9ea3ff; font-weight: 700; }
.cp-row span + * { color: var(--text); }

/* 会话列表 */
.session-list { display: flex; flex-direction: column; gap: 1px; }
.session-item {
  padding: 8px 9px 8px 11px; border-radius: var(--r-sm);
  font-size: 12px; color: var(--text-soft); cursor: pointer;
  transition: background 0.14s var(--ease);
  display: flex; align-items: center; gap: 7px;
  position: relative;
}
.session-item .s-icon { font-size: 10px; opacity: 0.7; flex-shrink: 0; }
.session-item .s-title {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item .s-actions {
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity 0.14s var(--ease);
}
.session-item:hover .s-actions { opacity: 1; }
.session-item:hover { background: var(--panel-hover); }
.session-item.active { background: var(--glass); color: var(--text); font-weight: 600; }
.session-item.pinned { background: rgba(255,178,36,0.05); }
.session-item.pinned .s-icon { color: var(--manager); opacity: 1; }
.s-btn {
  width: 20px; height: 20px; border-radius: 5px; border: none;
  background: transparent; color: var(--text-dim); font-size: 11px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.14s var(--ease);
}
.s-btn:hover { background: var(--glass); color: var(--text); }
.session-item .s-edit {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--stroke-strong);
  border-radius: 5px; padding: 2px 6px; color: var(--text); font-size: 12px; outline: none;
}

/* 用户信息 */
.sidebar-footer {
  padding: 10px 12px; border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,0.15);
}
.user-card {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 7px; border-radius: var(--r-sm); transition: background 0.14s var(--ease);
}
.user-card:hover { background: var(--panel-hover); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b9dff, #6b8cff);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.user-name { font-size: 12px; font-weight: 600; }
.user-status { font-size: 10px; color: var(--text-dim); margin-top: 1px; }

/* ============================================================
   右侧会话详情面板
   ============================================================ */
.detail-panel {
  width: 300px; min-width: 260px; max-width: 360px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--stroke);
  display: flex; flex-direction: column;
  z-index: 10;
}
.detail-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--stroke);
}
.detail-title { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.detail-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.detail-tabs {
  display: flex; gap: 4px; padding: 10px 14px 0;
  border-bottom: 1px solid var(--stroke);
}
.detail-tab {
  flex: 1; padding: 7px 8px; border-radius: 8px 8px 0 0;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.14s var(--ease);
}
.detail-tab:hover { color: var(--text-soft); }
.detail-tab.active { background: var(--panel); color: var(--text); }

.detail-body { flex: 1; overflow-y: auto; padding: 12px; }
.detail-pane { display: none; }
.detail-pane.active { display: block; }
.detail-section { margin-bottom: 16px; }
.detail-section-title {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 8px;
}

.detail-member-list { display: flex; flex-direction: column; gap: 6px; }
.detail-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--stroke);
  cursor: pointer; transition: all 0.16s var(--ease);
}
.detail-member:hover { border-color: var(--stroke-strong); }
.detail-member.selected { border-color: var(--brand); background: rgba(255,59,92,0.08); }
.detail-member.active { box-shadow: 0 0 0 1px rgba(52,211,153,0.4); }
.dm-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.dm-info { min-width: 0; }
.dm-name { font-size: 12px; font-weight: 700; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.dm-role { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.dm-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--online);
  animation: pulse 1.4s ease-in-out infinite;
}

.detail-chain { display: flex; flex-direction: column; gap: 8px; }
.chain-row { display: flex; align-items: flex-start; gap: 10px; }
.chain-label {
  width: 58px; flex-shrink: 0; font-size: 10px; color: var(--text-dim);
  padding-top: 4px;
}
.chain-agents { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.chain-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 5px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--stroke);
  font-size: 11px; color: var(--text-soft);
}
.chain-chip img, .chain-chip svg { width: 18px; height: 18px; border-radius: 50%; }

.detail-record-list { display: flex; flex-direction: column; gap: 10px; }
.detail-empty { font-size: 12px; color: var(--text-dim); text-align: center; padding: 30px 10px; }
.detail-record {
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); padding: 10px 12px;
}
.dr-time { font-size: 10px; color: var(--text-dim); margin-bottom: 6px; }
.dr-content { font-size: 12px; color: var(--text-soft); line-height: 1.6; }
.dr-content p { margin: 4px 0; }

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

.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(11,13,20,0.65); backdrop-filter: blur(16px);
  z-index: 5;
}
.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: 0 6px 18px rgba(255,59,92,0.22);
}
.chat-name { font-size: 15px; font-weight: 700; }
.chat-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--online);
  box-shadow: 0 0 0 3px rgba(52,211,153,0.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 3px rgba(52,211,153,.15);} 50%{ box-shadow: 0 0 0 6px rgba(52,211,153,.04);} }

.main-actions { display: flex; align-items: center; gap: 9px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--stroke);
  color: var(--text-dim); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.16s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--stroke-strong); background: rgba(255,255,255,0.08); }

/* ============================================================
   聊天流
   ============================================================ */
.chat-body {
  flex: 1; overflow-y: auto; padding: 20px 22px 10px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}

.msg {
  display: flex; gap: 12px; max-width: 88%; align-items: flex-start;
  animation: msgIn 0.4s var(--ease) both;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.system { align-self: center; max-width: 92%; }
.msg.plan { }
.msg.manager { }

.msg .avatar {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 1px solid var(--stroke); margin-top: 2px;
}
.msg.user .avatar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-color: rgba(255,59,92,0.35);
}
.msg .body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.msg .speaker { font-size: 11px; font-weight: 600; color: var(--text-dim); padding-left: 2px; }
.msg .bubble {
  background: var(--panel); border: 1px solid var(--stroke);
  padding: 12px 15px; border-radius: var(--r-md); border-top-left-radius: 5px;
  font-size: 14px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  color: var(--text-soft); box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}
.msg.user .bubble {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border: none; border-radius: var(--r-md); border-top-right-radius: 5px;
  font-weight: 500;
}
.msg.system .bubble {
  background: transparent; border: 1px dashed var(--stroke);
  color: var(--text-dim); font-size: 11px; text-align: center;
  padding: 5px 13px; border-radius: 18px; box-shadow: none;
}
.msg.plan .avatar, .msg.manager .avatar {
  background: linear-gradient(135deg, var(--manager) 0%, var(--manager-2) 100%);
  border-color: rgba(255,178,36,0.35);
}
.msg.plan .speaker, .msg.manager .speaker { color: var(--manager); }
.msg.plan .bubble, .msg.manager .bubble {
  background: rgba(255,178,36,0.07);
  border-color: rgba(255,178,36,0.22);
}
.msg .badge {
  display: inline-block; font-size: 9px; font-weight: 700; color: #1a1205;
  background: linear-gradient(135deg, var(--manager) 0%, var(--manager-2) 100%);
  padding: 1px 6px; border-radius: 5px; margin-left: 5px; vertical-align: middle;
}

/* 思考过程（可折叠） */
.reasoning {
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--stroke);
  border-radius: var(--r-sm);
  overflow: hidden;
  font-size: 12.5px;
  color: var(--text-dim);
}
.reasoning-toggle {
  padding: 7px 12px;
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.14s var(--ease);
}
.reasoning-toggle:hover { background: rgba(255,255,255,0.04); color: var(--text-soft); }
.reasoning-toggle span { font-size: 10px; color: var(--text-dim); }
.reasoning-body {
  padding: 0 12px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s var(--ease), padding 0.25s var(--ease);
}
.reasoning.expanded .reasoning-body {
  padding: 8px 12px 12px;
  max-height: 2000px;
}

/* 表格 / 代码块 */
.bubble table {
  width: 100%; border-collapse: collapse; margin: 10px 0;
  font-size: 12.5px; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden;
}
.bubble th, .bubble td {
  padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--stroke);
}
.bubble th { background: rgba(255,255,255,0.05); color: var(--text); font-weight: 700; }
.bubble tr:last-child td { border-bottom: none; }
.bubble tr:hover td { background: rgba(255,255,255,0.02); }
.bubble code {
  background: rgba(255,255,255,0.08); padding: 2px 5px; border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
.bubble pre {
  background: rgba(0,0,0,0.35); border: 1px solid var(--stroke);
  padding: 11px; border-radius: 10px; overflow-x: auto; margin: 9px 0;
}
.bubble pre code { background: transparent; padding: 0; }
.bubble h1, .bubble h2, .bubble h3 { color: var(--text); margin: 12px 0 7px; font-weight: 700; }
.bubble h1 { font-size: 16px; }
.bubble h2 { font-size: 14px; }
.bubble h3 { font-size: 13px; }
.bubble ul, .bubble ol { padding-left: 18px; margin: 7px 0; }
.bubble li { margin: 3px 0; }
.bubble strong { color: var(--text); }
.bubble blockquote {
  border-left: 3px solid var(--brand); margin: 9px 0; padding: 3px 12px;
  color: var(--text-dim); background: rgba(255,59,92,0.04); border-radius: 0 8px 8px 0;
}
.bubble p { margin: 6px 0; line-height: 1.65; }
.bubble hr { border: none; border-top: 1px solid var(--stroke); margin: 11px 0; }

/* 流式光标 */
.cursor::after { content: '▌'; animation: blink 1.05s steps(2) infinite; color: var(--brand-2); margin-left: 2px; font-weight: 300; }
@keyframes blink { 0%,50%{opacity:1} 50.01%,100%{opacity:0.15} }

/* 正在输入 */
.typing { display: flex; gap: 5px; align-items: center; padding: 4px 2px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim);
  animation: bounce 1.3s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes bounce { 0%,60%,100%{ transform: translateY(0); opacity:0.4 } 30%{ transform: translateY(-5px); opacity:1 } }

/* ============================================================
   欢迎语
   ============================================================ */
.welcome { align-self: center; text-align: center; max-width: 90%; margin: 4px 0 2px; animation: msgIn 0.5s var(--ease) both; }
.welcome .w-card {
  background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  padding: 22px 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.welcome .w-emoji { font-size: 36px; }
.welcome .w-title { font-size: 17px; font-weight: 800; margin-top: 10px; }
.welcome .w-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 9px; line-height: 1.7; }
.welcome .w-desc b { color: var(--text-soft); font-weight: 700; }
.welcome .w-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.welcome .w-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 20px;
  background: rgba(255,59,92,0.12); color: var(--brand-2); font-weight: 600;
  border: 1px solid rgba(255,59,92,0.18);
}

/* ============================================================
   媒体产出卡片
   ============================================================ */
.media-holder { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.media-card {
  border: 1px solid rgba(83,74,183,0.25); border-radius: 10px; overflow: hidden;
  background: rgba(83,74,183,0.05); max-width: 320px;
}
.media-card img { display: block; width: 100%; height: auto; }
.media-video {
  display: block; padding: 12px 14px; color: #534ab7; font-weight: 700;
  text-decoration: none; background: rgba(83,74,183,0.08);
}
.media-video:hover { background: rgba(83,74,183,0.16); }
.media-cap { padding: 6px 10px; font-size: 11px; color: #555; line-height: 1.4; }
.media-fail {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  color: #a23; background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.22);
}

/* ============================================================
   调试信息卡
   ============================================================ */
.dbg-card {
  align-self: center; max-width: 92%; width: 420px; margin: 4px auto;
  background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 12px; font-size: 12px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}
.dbg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; cursor: pointer; color: var(--text-dim); user-select: none;
}
.dbg-head:hover { color: var(--text); }
.dbg-sum { font-size: 11px; color: var(--brand-2); }
.dbg-toggle { transition: transform 0.2s var(--ease); }
.dbg-card.open .dbg-toggle { transform: rotate(180deg); }
.dbg-body { max-height: 0; overflow: hidden; transition: max-height 0.25s var(--ease); padding: 0 12px; }
.dbg-card.open .dbg-body { max-height: 400px; padding: 4px 12px 10px; }
.dbg-row { display: grid; grid-template-columns: 1fr 56px 70px; gap: 6px; padding: 3px 0; color: var(--text-soft); }
.dbg-row span:last-child, .dbg-row span:nth-child(2) { text-align: right; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.dbg-h { color: var(--text-dim); border-bottom: 1px solid var(--stroke); margin-bottom: 2px; font-weight: 600; }
.dbg-foot { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--stroke); color: var(--text-dim); font-size: 11px; }

/* ============================================================
   输入区
   ============================================================ */
.chat-composer {
  border-top: 1px solid var(--stroke);
  background: var(--panel);
  padding: 11px 20px 16px;
}
.composer-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 9px;
}
.composer-tip { font-size: 11px; color: var(--text-dim); }

.wb-toggle {
  display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none;
}
.wb-toggle input { display: none; }
.toggle-track {
  width: 32px; height: 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--stroke);
  position: relative; transition: all 0.2s var(--ease);
}
.toggle-track::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim);
  transition: all 0.2s var(--ease);
}
.wb-toggle input:checked + .toggle-track { background: rgba(52,211,153,0.18); border-color: rgba(52,211,153,0.35); }
.wb-toggle input:checked + .toggle-track::after { left: 17px; background: var(--online); }
.toggle-label { font-size: 11px; color: var(--text-soft); }

.composer-row { display: flex; gap: 10px; align-items: flex-end; }
#input {
  flex: 1; resize: none; background: var(--bg); border: 1px solid var(--stroke);
  border-radius: var(--r-md); color: var(--text); padding: 12px 15px; font-size: 14px;
  font-family: inherit; max-height: 130px; line-height: 1.55;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
#input::placeholder { color: var(--text-dim); }
#input:focus { outline: none; border-color: rgba(255,59,92,0.5); background: rgba(0,0,0,0.35); box-shadow: 0 0 0 3px rgba(255,59,92,0.10); }
.send-btn {
  width: 44px; height: 44px; border-radius: var(--r-md); border: none; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(255,59,92,0.28), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), filter 0.14s var(--ease);
}
.send-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.send-btn:active { transform: translateY(0) scale(0.96); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(0.3); }

/* ============================================================
   成员抽屉
   ============================================================ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(5, 6, 9, 0.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease); z-index: 20;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.members-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 360px; max-width: 88vw;
  background: var(--sidebar-bg); backdrop-filter: blur(34px) saturate(150%);
  border-left: 1px solid var(--stroke);
  box-shadow: -16px 0 50px rgba(0,0,0,0.5);
  transform: translateX(100%); transition: transform 0.32s var(--ease);
  z-index: 21; display: flex; flex-direction: column;
}
.members-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--stroke);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.m-group-title { font-size: 10px; color: var(--text-dim); font-weight: 700; letter-spacing: 1px; margin: 10px 4px 8px; }
.m-group-title:first-child { margin-top: 0; }
.m-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 13px;
  cursor: pointer; transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
  border: 1.5px solid transparent;
}
.m-item:hover { background: var(--panel-hover); }
.m-item.sel { background: rgba(255,59,92,0.10); border-color: rgba(255,59,92,0.40); }
.m-item .m-emoji {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 1px solid var(--stroke);
}
.m-item.sel .m-emoji { border-color: rgba(255,59,92,0.5); box-shadow: 0 4px 14px rgba(255,59,92,0.18); }
.m-item .m-name { font-size: 13px; font-weight: 600; color: var(--text); }
.m-item .m-role { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.m-item .m-check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--stroke-strong); display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; transition: all 0.16s var(--ease);
}
.m-item.sel .m-check { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); border-color: transparent; }

.drawer-foot { padding: 14px 18px; border-top: 1px solid var(--stroke); display: flex; flex-direction: column; gap: 10px; }
.drawer-foot .hint { font-size: 11px; color: var(--text-dim); line-height: 1.5; }
.primary-btn {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border: none; padding: 12px; border-radius: var(--r-md); cursor: pointer;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(255,59,92,0.25);
  transition: transform 0.14s var(--ease), filter 0.14s var(--ease);
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.primary-btn:active { transform: translateY(0) scale(0.98); }

/* 滚动条 */
.chat-body::-webkit-scrollbar, .drawer-body::-webkit-scrollbar, .sidebar-body::-webkit-scrollbar, .detail-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb, .sidebar-body::-webkit-scrollbar-thumb, .detail-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 8px; }
.chat-body::-webkit-scrollbar-thumb:hover, .drawer-body::-webkit-scrollbar-thumb:hover, .sidebar-body::-webkit-scrollbar-thumb:hover, .detail-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1200px) {
  .detail-panel { position: fixed; right: 0; top: 0; bottom: 0; transform: translateX(100%); transition: transform 0.28s var(--ease); }
  .detail-panel.open { transform: translateX(0); }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.28s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .main { width: 100vw; }
  .detail-panel { width: 88vw; max-width: 340px; }
}
