/* Copyright (c) 2026 晓夜 (xiaoye). All rights reserved.
 * Licensed for non-commercial use only.
 */
/* redesign.css — 2026-09 工业实用主义 UI 层
 *
 * 原则：
 *   - 只做视觉升级，不改结构、不删任何按钮/配置页
 *   - 本文件最后加载，同级特异性下覆盖旧样式
 *   - 平面 + 发丝线：无渐变、无玻璃、阴影仅用于浮层
 *   - 图标一律 Lucide（.lucide 基准见 theme.css）
 */

/* ============================================================
   一、头像组件
   ============================================================ */

.dm-avatar, .gc-avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  position: relative;
}
.dm-avatar .avatar-img, .gc-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dm-avatar.avatar-fallback, .gc-avatar.avatar-fallback {
  border-radius: var(--radius-sm);
}

.ws-contact-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  vertical-align: -7px;
  flex-shrink: 0;
}
.ws-tag-avatar { width: 18px; height: 18px; border-radius: 3px; vertical-align: -4px; }

.ws-chat-header-icon { overflow: visible; }
.ws-header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  vertical-align: -9px;
  outline: 1px solid var(--border);
}

.login-member-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  outline: 1px solid var(--border);
}

.agents-card-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  background: var(--bg-hover);
}
.agents-card-avatar img { width: 100%; height: 100%; object-fit: cover; }

.agent-avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
  cursor: pointer;
  transition: border-color var(--transition);
}
.agent-avatar-preview:hover { border-color: var(--accent-gold); }
.agent-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   二、链路追踪面板
   ============================================================ */

.trace-empty {
  color: var(--text-sub);
  text-align: center;
  padding: 40px 20px;
  font-size: 12px;
  line-height: 1.8;
}

.trace-live-badge {
  font-size: 11px;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 2px;
  padding: 0 8px;
  animation: trace-pulse 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes trace-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.trace-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.trace-item:hover { background: var(--bg-hover); border-left-color: var(--accent-gold); }
.trace-item-row1 { display: flex; align-items: center; gap: 8px; }
.trace-status {
  font-size: 11px;
  border-radius: 2px;
  padding: 0 6px;
  white-space: nowrap;
}
.trace-status.st-ok  { color: var(--success); border: 1px solid rgba(85, 183, 122, 0.35); }
.trace-status.st-run { color: var(--accent-gold); border: 1px solid var(--accent-gold); }
.trace-status.st-bad { color: var(--danger); border: 1px solid rgba(224, 82, 82, 0.4); }
.trace-agent { font-size: 13px; font-weight: 600; color: var(--text-main); }
.trace-time { margin-left: auto; font-size: 11px; color: var(--text-sub); font-family: var(--font-mono); }
.trace-item-trigger {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trace-item-row2 {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-sub);
  font-family: var(--font-mono);
}
.trace-has-err { color: var(--warning); }

.trace-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-panel);
  z-index: 5;
}
.trace-detail-title { font-size: 13px; font-weight: 600; font-family: var(--font-mono); }
.trace-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 7px 14px;
  font-size: 11px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}

.trace-replay-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 11px;
  font-family: var(--font-mono);
}
.trace-replay-progress {
  flex: 1;
  height: 3px;
  background: var(--bg-hover);
  overflow: hidden;
}
.trace-replay-progress > div {
  height: 100%;
  width: 0;
  background: var(--accent-gold);
  transition: width 400ms ease;
}

.trace-timeline { padding: 8px 0 30px; }
.tl-node {
  position: relative;
  padding: 2px 14px 2px 38px;
  border-left: 1px solid var(--border);
  margin-left: 26px;
  transition: background var(--transition);
}
.tl-node::before {
  content: '';
  position: absolute;
  left: -4.5px;
  top: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
}
.tl-node.tl-llm::before  { border-color: var(--accent-gold); }
.tl-node.tl-tool::before { border-color: var(--text-sub); }
.tl-node.tl-key::before  { border-color: var(--warning); }
.tl-node.tl-start::before, .tl-node.tl-end::before { border-color: var(--success); }
.tl-node.tl-bad::before { border-color: var(--danger) !important; }

.tl-node.replaying {
  background: var(--accent-soft);
  border-left-color: var(--accent-gold);
}
.tl-node.replayed { opacity: 0.55; }

.tl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  cursor: pointer;
  min-height: 20px;
}
.tl-icon { font-size: 13px; flex-shrink: 0; }
.tl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}
.tl-summary {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tl-summary pre { display: inline; font-family: inherit; }
.tl-time { font-size: 10px; color: var(--text-sub); font-family: var(--font-mono); flex-shrink: 0; opacity: 0.8; }
.tl-tool-id { color: var(--text-sub); font-family: var(--font-mono); font-size: 10px; }

.tl-body { padding: 2px 0 10px; display: none; }
.tl-node.open .tl-body { display: block; }
.tl-kv { margin-top: 6px; }
.tl-kv > span {
  display: block;
  font-size: 10px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.tl-kv pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.55;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
  color: var(--text-main);
}
.tl-kv pre.tl-bad { border-color: rgba(224, 82, 82, 0.5); color: var(--danger); }

/* ============================================================
   三、富内容：卡片协议 + Markdown 表格
   ============================================================ */

.rich-card {
  margin: 8px 0;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rich-card-title {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}

.card-error-pre { position: relative; }
.card-error-banner {
  font-size: 11px;
  color: var(--warning);
  border: 1px dashed var(--warning);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  margin-bottom: 6px;
}

.md-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 8px 0;
}
.md-table-wrap table, .rich-table {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 60%;
  margin: 0;
}
.rich-table-card .md-table-wrap { margin: 0; border: none; }
.md-table-wrap th, .rich-table th {
  text-align: left;
  padding: 6px 12px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.md-table-wrap td, .rich-table td {
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: top;
}
.md-table-wrap tr:last-child td, .rich-table tr:last-child td { border-bottom: none; }
.md-table-wrap tbody tr:nth-child(even), .rich-table tbody tr:nth-child(even) { background: rgba(127, 127, 127, 0.05); }
.md-table-wrap tbody tr:hover, .rich-table tbody tr:hover { background: var(--accent-soft); }
.rich-table-card .rich-table { min-width: 100%; }

.rich-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--border);
}
.rich-stat { background: var(--bg-deep); padding: 12px 14px; text-align: center; }
.rich-stat-label { font-size: 11px; color: var(--text-sub); margin-bottom: 4px; }
.rich-stat-value { font-size: 20px; font-weight: 700; color: var(--text-main); font-family: var(--font-mono); }
.rich-stat-unit { font-size: 11px; font-weight: 400; color: var(--text-sub); margin-left: 3px; }
.rich-stat-delta { font-size: 11px; margin-top: 3px; color: var(--text-sub); font-family: var(--font-mono); }
.rich-stat-delta.up { color: var(--danger); }
.rich-stat-delta.down { color: var(--success); }

.rich-list-item { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.rich-list-item:last-child { border-bottom: none; }
.rich-list-row { display: flex; align-items: center; gap: 8px; }
.rich-list-title { font-size: 13px; color: var(--text-main); flex: 1; }
.rich-list-desc { font-size: 12px; color: var(--text-sub); margin-top: 3px; line-height: 1.5; }
.rich-list-tag {
  font-size: 10px;
  border-radius: 2px;
  padding: 1px 8px;
  white-space: nowrap;
  background: var(--bg-hover);
  color: var(--text-sub);
}
.rich-tag-success { color: var(--success); border: 1px solid rgba(85, 183, 122, 0.35); }
.rich-tag-warning { color: var(--warning); border: 1px solid var(--warning); }
.rich-tag-error   { color: var(--danger); border: 1px solid rgba(224, 82, 82, 0.4); }

.rich-info-card { display: flex; gap: 10px; padding: 11px 14px; align-items: flex-start; }
.rich-info-icon { font-size: 15px; line-height: 1.3; }
.rich-info-title { font-size: 13px; font-weight: 600; color: var(--text-main); }
.rich-info-msg { font-size: 12px; color: var(--text-sub); margin-top: 2px; line-height: 1.6; }
.rich-info-info    { border-left: 2px solid var(--accent-gold); }
.rich-info-success { border-left: 2px solid var(--success); }
.rich-info-warning { border-left: 2px solid var(--warning); }
.rich-info-error   { border-left: 2px solid var(--danger); }

.rich-unknown-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--warning);
  border: 1px solid var(--warning);
  border-radius: 2px;
  padding: 0 8px;
}
.rich-unknown-json {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-sub);
}

/* ============================================================
   四、全局视觉：工业实用主义
   ============================================================ */

/* 顶栏：平实横条，发丝线分割 */
.topbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.topbar-logo {
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-main) !important;
  -webkit-text-fill-color: var(--text-main) !important;
  background: none !important;
}
.topbar-logo span {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 6px;
  letter-spacing: 0.18em;
  -webkit-text-fill-color: var(--text-sub);
  color: var(--text-sub);
}
.topbar-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent !important;
  background: transparent !important;
  font-size: 15px !important;
  cursor: pointer;
  opacity: 0.8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-main) !important;
  padding: 0 !important;
}
.topbar-icon-btn:hover {
  opacity: 1;
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
}
.topbar-icon-btn .lucide { width: 16px; height: 16px; }

/* 右侧标签页：文本 + 琥珀下划线（工业 tab） */
.right-tabs {
  gap: 2px;
  padding: 0 8px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.right-tabs::-webkit-scrollbar { display: none; }
.right-tab {
  padding: 9px 11px 7px;
  border-radius: 0;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.right-tab .lucide { width: 13px; height: 13px; stroke-width: 1.6; }
.right-tab:hover { color: var(--text-main); background: transparent; }
.right-tab.active {
  color: var(--accent-gold);
  background: transparent;
  border-bottom-color: var(--accent-gold);
  font-weight: 600;
}

/* 联系人列表 */
.ws-contact-list-header { border-bottom: 1px solid var(--border); }
.ws-contact-tab {
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.ws-contact-tab.active { background: var(--accent-soft); color: var(--accent-gold); }
.ws-contact-item {
  margin: 1px 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.ws-contact-item:hover { background: var(--bg-hover); }
.ws-contact-item.active {
  background: var(--bg-hover);
  border-left-color: var(--accent-gold);
}

/* 聊天消息气泡：我的消息暖陶土渐变，对方抬升暖面 */
.dm-msg-bubble, .gc-bubble {
  border-radius: var(--radius-md);
  line-height: 1.65;
}
.dm-msg .dm-msg-bubble { border-top-left-radius: 4px; }
.dm-msg.mine .dm-msg-bubble { border-top-right-radius: 4px; }
.gc-bubble { border-top-left-radius: 4px; }
.gc-mine .gc-bubble { border-top-right-radius: 4px; }
.dm-msg.mine .dm-msg-bubble, .gc-mine .gc-bubble {
  background: linear-gradient(135deg, #2A3245, #232B3D) !important;
  border: 1px solid rgba(77, 107, 254, 0.30) !important;
  color: #F0EBE2 !important;
}

.date-separator-label {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.sys-notice {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sys-notice .lucide { width: 13px; height: 13px; color: var(--accent-gold); }

/* 未读徽章：方形小签 */
.ws-unread-badge, .ws-tab-unread-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 2px;
  padding: 0 4px;
  min-width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--font-mono);
}
.ws-tab-unread-badge { position: absolute; top: -4px; right: -6px; }

/* 发送按钮：陶土渐变 */
.ws-chat-send-btn {
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: filter var(--transition);
}
.ws-chat-send-btn:hover { filter: brightness(1.1); }
.ws-chat-send-btn:active { filter: brightness(0.95); }

/* 登录页 */
.login-member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.login-member-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

/* 底部抽屉 */
.drawer-handle { background: var(--bg-panel); }
.drawer-tab.active {
  color: var(--accent-gold);
  background: transparent;
  border-bottom-color: var(--accent-gold);
}

/* 文件树 / 面板通用 hover */
.file-tree-item:hover { filter: brightness(1.15); }

/* Agent 工作状态气泡 */
.awb-bubble { border: 1px solid var(--border); }

/* 通用按钮工具类 */
.gh-btn {
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  padding: 5px 14px;
  transition: all var(--transition);
  font-family: inherit;
}
.gh-btn-accent {
  background: var(--accent-gold);
  color: #0C0D0F;
  border: none;
  font-weight: 600;
}
.gh-btn-accent:hover { filter: brightness(1.1); }
.gh-btn-accent.playing { filter: brightness(1.15); }
.gh-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-sub);
}
.gh-btn-ghost:hover { color: var(--text-main); background: var(--bg-hover); }
.gh-btn-sm { padding: 3px 10px; font-size: 11px; }

/* 聊天头部模型胶囊 */
#wsModelChip {
  font-family: var(--font-mono);
  font-size: 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(217, 119, 87, 0.3);
  color: var(--accent-gold);
  padding: 3px 12px;
}
#wsModelChip:hover { border-color: var(--accent-gold); color: var(--text-main); }
#wsModelChip .lucide { width: 12px; height: 12px; }

/* ============================================================
   五、右侧栏折叠/展开（默认隐藏，右缘把手展开）
   ============================================================ */

body.ws-right-hidden .ws-doc-pane { display: none !important; }
body.ws-right-hidden .ws-resizer { display: none !important; }
body.ws-right-hidden .ws-chat-pane {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#wsRightToggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 64px;
  border-radius: 3px 0 0 3px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-sub);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  transition: all var(--transition);
  padding: 0;
  font-family: inherit;
}
#wsRightToggle:hover {
  color: var(--accent-gold);
  background: var(--bg-hover);
  width: 22px;
}

/* ============================================================
   六、收件箱式联系人 + 浮动输入卡片 + 消息列
   ============================================================ */

/* 双行联系人行：头像 + 名称 + 最后消息预览 */
.ws-contact-inbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}
.ws-contact-inbox .ws-inbox-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ws-contact-inbox .ws-contact-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-contact-inbox .ws-contact-snippet {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 13px;
}
.ws-contact-inbox.active .ws-contact-snippet { color: var(--text-main); }
.ws-contact-item .ws-unread-badge { position: absolute; top: 6px; right: 8px; }
.ws-contact-item { position: relative; }

/* 消息列：居中限宽，阅读节奏 */
.ws-chat-messages {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 14px 18px 10px;
}

/* 浮动输入卡片（ChatGPT/Claude 式 composer） */
.ws-chat-input-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  box-shadow: var(--shadow-1);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ws-chat-input-row:focus-within {
  border-color: rgba(77, 107, 254, 0.45);
  box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.10);
}
.ws-chat-input-row .ws-chat-input {
  background: transparent !important;
  border: none !important;
  font-size: 13.5px;
}
.ws-chat-input-row .ws-chat-input:focus { outline: none; }

/* 上下文容量胶囊 */
#wsContextChip .lucide { width: 12px; height: 12px; }

/* ============================================================
   群聊行操作按钮：常显（低透明度，悬停增强）
   ============================================================ */
#contactGroupGroup .ws-contact-item .row-actions,
#contactGroupGroup .ws-contact-archived .row-actions {
  display: inline-flex;
  opacity: 0.45;
  position: static;
  margin-left: auto;
  background: none;
  border: none;
  padding: 0 2px;
}
#contactGroupGroup .ws-contact-item:hover .row-actions,
#contactGroupGroup .ws-contact-archived:hover .row-actions {
  opacity: 1;
}
#contactGroupGroup .ws-inbox-body { padding-right: 46px; }
#contactGroupGroup .ws-contact-archived .ws-inbox-body { padding-right: 0; }

/* 聊天头部：底部微分层 */
.ws-chat-header { border-bottom: 1px solid var(--border); background: var(--bg-panel); }

/* ============================================================
   七、左栏收件箱宽度修正 + 收起时滚动条跟随
   ============================================================ */

/* 收件箱双行行需要足够宽度（旧 72px 导致文字展不开） */
.ws-contact-list {
  width: 208px;
}
.ws-contact-inbox .ws-contact-name,
.ws-contact-inbox .ws-contact-snippet {
  display: block;
  max-width: 100%;
}
/* 右栏收起 → 聊天占满，消息列与滚动条贴边 */
body.ws-right-hidden .ws-chat-messages {
  max-width: none !important;
}

/* ============================================================
   八、群聊归档 / 删除（行悬停操作 + 归档分区）
   ============================================================ */

.ws-contact-item .row-actions {
  position: absolute;
  top: 6px;
  right: 8px;
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
}
.ws-contact-item:hover .row-actions { display: inline-flex; }
.row-actions .lucide {
  width: 13px;
  height: 13px;
  cursor: pointer;
  color: var(--text-sub);
  transition: color var(--transition);
}
.row-actions .lucide:hover { color: var(--accent-gold); }
.row-actions .lucide[data-lucide="trash-2"]:hover { color: var(--danger); }

.ws-archive-divider {
  margin: 10px 8px 4px;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  border-top: 1px dashed var(--border);
}
.ws-contact-archived { opacity: 0.55; }
.ws-contact-archived:hover { opacity: 0.85; }

/* 输入行布局加固：胶囊不收缩，textarea 保底宽度 */
.ws-chat-input-row { flex-wrap: nowrap; }
.ws-chat-input-row .ws-chat-input {
  flex: 1 1 auto;
  min-width: 140px;
}
#wsModelChip { flex: 0 0 auto; }

/* 群操作两段式确认：待确认态（红色“确认?”） */
.row-actions .act-icon {
  cursor: pointer;
  color: var(--text-sub);
  transition: color var(--transition);
  font-size: 11px;
  line-height: 1;
}
.row-actions .act-icon:hover { color: var(--accent-gold); }
.row-actions .act-icon.armed,
.row-actions .act-icon[data-armed="1"] {
  color: var(--danger);
  font-weight: 600;
  background: rgba(224, 82, 82, 0.12);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}
.row-actions .act-icon[data-armed="1"] { color: var(--danger); }

/* ═══ [2026-09-24] ZCode 侧栏模式:元信息行替代对话预览 + 状态槽 ═══ */
.ws-contact-meta {
  font-size: 10px; color: var(--text-sub); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%; text-align: center; font-family: 'Noto Sans SC', sans-serif;
  opacity: .85;
}
.ws-contact-item.active .ws-contact-meta { color: var(--accent-purple); opacity: 1; }
.status-dot.sd-running {
  background: #d97706;
  animation: sd-pulse 1.6s ease-in-out infinite;
}
@keyframes sd-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(217, 119, 6, .45); }
  50% { opacity: .55; box-shadow: 0 0 0 4px rgba(217, 119, 6, 0); }
}
