/* cache-bust: 改本文件后提高 index.html 的 ?v=（如 20260825an） */
:root {
  --bg: #0e0e0c;
  --bg-2: #161613;
  --bg-3: #1d1c18;
  --bg-card: #181815;
  --line: #2c2a24;
  --line-light: rgba(255, 255, 255, 0.08);
  --ink: #eceae3;
  --ink-secondary: #c2bfb5;
  --muted: #8a877c;
  --accent: #e8a87c;
  --accent-ink: #1a120c;
  --primary-blue: #3b82f6;
  --primary-blue-glow: rgba(59, 130, 246, 0.25);
  --danger: #ef4444;
  --ok: #10b981;
  --focus: #f0d3b0;
  --font: "SF Pro Text", "PingFang SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  --mono: "SF Mono", Menlo, Monaco, Consolas, ui-monospace, monospace;
  --nav-w: 260px;
  --list-w: 360px;
}

* { box-sizing: border-box; }

/* 全局极简暗黑滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: transparent; }
button:disabled { opacity: .4; cursor: not-allowed; }
.hidden { display: none !important; }

kbd {
  font: 11px var(--mono);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
  background: var(--bg-3);
}

/* ==========================================================================
   登录页面
   ========================================================================== */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 20% 0%, #2a2118 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: min(440px, 92vw);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.eyebrow { letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-size: 11px; margin: 0 0 8px; font-weight: 600; }
.login-card h1 { font-size: 32px; letter-spacing: -.03em; margin: 0 0 10px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 13px; line-height: 1.5; }
.honest-banner {
  background: rgba(232, 168, 124, 0.08);
  border: 1px solid rgba(232, 168, 124, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 18px;
  line-height: 1.45;
}
.honest-banner code { font-family: var(--mono); font-weight: 600; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.login-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  margin-bottom: 14px;
}
.login-card input:focus { border-color: var(--focus); }
.btn-primary-full {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 11px;
  border-radius: 10px;
  margin-top: 6px;
  transition: opacity 0.15s;
}
.btn-primary-full:hover { opacity: 0.9; }

/* ==========================================================================
   主工作区 App 布局 (纯 Flexbox 架构，确保拖拽缩放与大屏切换 100% 顺滑)
   ========================================================================== */
.app {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* 拖拽分割线 Resizers */
.resizer {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--line);
  position: relative;
  z-index: 20;
  transition: background 0.15s;
}
.resizer:hover, .resizer.dragging {
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}
body.is-resizing {
  user-select: none !important;
  cursor: col-resize !important;
}
body.is-resizing iframe {
  pointer-events: none !important;
}

/* ==========================================================================
   左侧导航栏 Nav
   ========================================================================== */
.nav {
  width: var(--nav-w, 260px);
  min-width: 180px;
  max-width: 480px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 14px 12px;
  position: relative;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.brand-logo {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* 集中操作按钮组 */
.nav-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.btn-action {
  width: 100%;
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 550;
  font-size: 13px;
  transition: all 0.15s ease;
}
.compose-btn {
  background: var(--accent);
  color: var(--accent-ink);
  justify-content: space-between;
}
.compose-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.compose-btn span { display: flex; align-items: center; gap: 6px; }

.analytics-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
.analytics-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(139, 92, 246, 0.3));
  border-color: rgba(96, 165, 250, 0.6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* 文件夹列表 */
.folder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.folder-list button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s, color 0.15s;
}
.folder-list button:hover { background: var(--bg-3); color: var(--ink); }
.folder-list button.on {
  background: var(--bg-3);
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--line);
}
.folder-list button span.folder-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
}
.folder-list button.on span.folder-badge {
  color: var(--accent);
  background: rgba(232, 168, 124, 0.15);
}

/* 工具箱折叠面板 */
.toolbox {
  border: 1px solid var(--line);
  background: var(--bg-3);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: auto;
}
.toolbox-header {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}
.toolbox-header:hover { color: var(--ink); }
.toolbox-arrow { font-size: 11px; transition: transform 0.2s; }
.toolbox-arrow.open { transform: rotate(180deg); }
.toolbox-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.tb-tab {
  flex: 1;
  padding: 6px 2px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-bottom: 2px solid transparent;
}
.tb-tab:hover { color: var(--ink); }
.tb-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tb-panel {
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.contact-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.contact-add-form input, .contact-add-form select, .contact-add-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}
.contact-add-form button {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.contact-add-form button:hover { border-color: var(--focus); }

/* 左下角精致底部卡片：上排按钮 + 底部用户名称 */
.nav-bottom-card {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.bottom-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-bottom-status {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-bottom-status:hover {
  background: var(--bg-2);
  border-color: var(--focus);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online { background: var(--ok); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }

.badge-warn {
  font-size: 10px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 0 5px;
  font-family: var(--mono);
  font-weight: 600;
}
.btn-bottom-action {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-bottom-action:hover { color: var(--ink); background: var(--bg-2); }
.btn-bottom-action.logout:hover { color: var(--danger); border-color: rgba(239, 68, 68, 0.4); }

.bottom-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.user-avatar { font-size: 12px; }
.user-email-text {
  font-family: var(--mono);
  color: #93c5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 悬浮 Popover */
.status-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 12px;
  z-index: 50;
}
.popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.popover-close { font-size: 12px; color: var(--muted); }
.popover-body { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.popover-log {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  max-height: 80px;
  overflow-y: auto;
}
.popover-ai { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.popover-info { line-height: 1.4; color: var(--ink-secondary); }

/* ==========================================================================
   中间邮件列表 List
   ========================================================================== */
.list {
  width: var(--list-w, 360px);
  min-width: 240px;
  max-width: 650px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.list-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
}
.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-wrap input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.search-clear-inline {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 10px;
  transition: background 0.15s, color 0.15s;
}
.search-clear-inline:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.btn-icon-head {
  padding: 7px 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.3));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 8px;
  font-size: 14px;
  color: #93c5fd;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-head:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(37, 99, 235, 0.5));
  border-color: #60a5fa;
  color: #fff;
  transform: scale(1.03);
}

/* 美化后的搜索状态提示条 */
.search-banner {
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.08));
  border-bottom: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  animation: fadeIn 0.15s ease-out;
}
.search-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-badge {
  color: #93c5fd;
  font-weight: 550;
}
.search-badge strong {
  color: #fff;
  background: rgba(59, 130, 246, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
}
.search-count {
  color: var(--muted);
  font-size: 11px;
}
.search-clear-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
  transition: all 0.15s;
}
.search-clear-btn:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.items {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.item:hover {
  background: var(--bg-3);
  border-color: var(--line-light);
}
.item.selected {
  background: var(--bg-3);
  border-color: var(--primary-blue);
  box-shadow: inset 3px 0 0 var(--primary-blue);
}
.item.unread .subject-line {
  font-weight: 650;
  color: #fff;
}
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.item-from {
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.item-when { font-size: 11px; font-family: var(--mono); color: var(--muted); }
.subject-line {
  font-size: 13px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.snippet-line {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcpt-badge {
  font-size: 10px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 4px;
  border-radius: 4px;
  margin-right: 4px;
}

/* 列表底部现代化分页栏 */
.pagination-bar {
  padding: 10px 14px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.page-btn {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--focus);
}
.page-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ==========================================================================
   右侧邮件正文阅读区 Read
   ========================================================================== */
.read {
  flex: 1;
  min-width: 320px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.empty-icon { font-size: 48px; opacity: 0.4; }

.letter {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.letter-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.letter-head h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.meta-from { font-weight: 600; color: var(--ink); }
.meta-when { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.to-line { font-size: 12px; color: var(--muted); }

/* 工具栏 Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar button {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}
.toolbar button:hover { background: var(--bg); border-color: var(--focus); }
.toolbar button.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
  color: #93c5fd;
}
.toolbar button.danger:hover { color: var(--danger); border-color: var(--danger); }
.toolbar button.ai {
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.15), rgba(168, 85, 247, 0.15));
  border-color: rgba(232, 168, 124, 0.35);
  color: var(--accent);
}
.toolbar button.ai:hover { border-color: var(--accent); color: #fff; }
.toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}
.grow { flex-grow: 1; }

/* 邮件内容容器与富文本 iframe */
.letter-body-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}
.rich-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.plain-frame {
  width: 100%;
  height: 100%;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

/* ==========================================================================
   Admin 独立统计分析大屏
   ========================================================================== */
.analytics-view {
  flex: 1;
  min-width: 320px;
  background: var(--bg);
  padding: 24px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
}
.analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.analytics-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.analytics-back-btn {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: opacity 0.15s;
}
.analytics-back-btn:hover { opacity: 0.9; }
.analytics-head h2 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
.analytics-sub { margin: 0; color: var(--muted); font-size: 12px; }
.analytics-actions { display: flex; align-items: center; gap: 12px; }
.analytics-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.analytics-btn-sm {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}
.analytics-btn-sm:hover { border-color: var(--focus); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.kpi-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.kpi-meta { flex: 1; }
.kpi-label { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.kpi-val { font-size: 20px; font-weight: 700; font-family: var(--mono); color: var(--ink); }
.accent-blue { border-left: 4px solid #3b82f6; }
.accent-green { border-left: 4px solid #10b981; }
.accent-indigo { border-left: 4px solid #6366f1; }
.accent-amber { border-left: 4px solid #f59e0b; }
.accent-purple { border-left: 4px solid #a855f7; }
.accent-teal { border-left: 4px solid #14b8a6; }

.analytics-row { display: flex; gap: 16px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.analytics-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.box-head { display: flex; align-items: center; justify-content: space-between; }
.box-head h3 { font-size: 14px; margin: 0; font-weight: 600; }
.box-head .hint { font-size: 11px; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.dot-legend { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-legend.in { background: #3b82f6; }
.dot-legend.out { background: #10b981; }

.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  padding: 10px 8px 0;
  border-bottom: 1px dashed var(--line);
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  width: 44px;
}
.bar-group {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  width: 100%;
  justify-content: center;
}
.bar { width: 12px; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.3s; }
.bar.inbound { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.bar.outbound { background: linear-gradient(180deg, #34d399, #059669); }
.col-label { font-size: 11px; font-family: var(--mono); color: var(--muted); }

.health-checklist { display: flex; flex-direction: column; gap: 8px; }
.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-3);
  font-size: 12px;
  border: 1px solid var(--line);
}
.health-item.ok { border-color: rgba(16, 185, 129, 0.25); color: #e2e8f0; }

.ranking-list { display: flex; flex-direction: column; gap: 6px; }
.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rank-item:hover { background: var(--bg); border-color: #3b82f6; transform: translateX(3px); }
.rank-main { display: flex; align-items: center; gap: 8px; flex: 1; }
.rank-idx { width: 18px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rank-name { font-family: var(--mono); font-weight: 550; color: #93c5fd; }
.rank-bar-wrap { width: 90px; height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; margin: 0 12px; }
.rank-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 3px; }
.rank-cnt { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* ==========================================================================
   写邮件 & 弹窗 Composer
   ========================================================================== */
.composer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
}
.sheet {
  width: min(640px, 94vw);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet header strong { font-size: 16px; font-weight: 650; }
.sheet header div { display: flex; gap: 8px; }
.sheet header button {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-size: 12px;
  font-weight: 550;
}
.sheet header button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.sheet input, .sheet textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  outline: none;
  font-size: 13px;
}
.sheet textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.attach-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.attach-pick {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.attach-hint { font-size: 11px; color: var(--muted); }
.attach-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 10px;
  z-index: 150;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

@media (max-width: 980px) {
  .app { flex-direction: column; }
  .resizer { display: none !important; }
  .list { width: 100% !important; max-width: none !important; }
}
