/* 群小助 · 后台与演示页样式（克制、留白、单一强调色） */
:root {
  --ink: #0f172a; --muted: #64748b; --line: #e6ebf2; --bg: #f6f8fb;
  --accent: #2563eb; --green: #07c160; --card: #ffffff;
  --wait-bg: #fff7e6; --wait-fg: #b45309;
  --contacted-bg: #e8f1ff; --contacted-fg: #1d4ed8;
  --done-bg: #e9f9ef; --done-fg: #15803d;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.error { color: #dc2626; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 36px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand .muted { font-weight: 400; font-size: 13px; margin-left: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
.topbar nav a { margin-left: 24px; color: var(--muted); padding: 6px 0; }
.topbar nav a.active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.topbar nav a:hover { color: var(--ink); text-decoration: none; }

.container { max-width: 1180px; margin: 30px auto 60px; padding: 0 28px; }
.foot { text-align: center; padding: 24px 0 40px; font-size: 12.5px; }

/* 页头 */
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head .muted { font-size: 14px; font-weight: 400; margin-left: 8px; }
.actions { display: flex; gap: 10px; align-items: center; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 24px; margin-bottom: 20px; }
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* 按钮 */
.btn { display: inline-block; background: var(--accent); color: #fff; border: none; cursor: pointer;
  border-radius: 8px; padding: 8px 16px; font-size: 13.5px; font-family: inherit; }
.btn:hover { opacity: .92; text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 10px 0; }

/* 筛选 */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { font-family: inherit; font-size: 13.5px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.filters input[type="text"] { width: 200px; }
.filters input[type="date"] { width: 150px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: none; }
.table.plain th { width: 132px; color: var(--muted); font-weight: 500; }
.table .empty { text-align: center; padding: 36px 0; }

/* 状态胶囊 */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.st-wait { background: var(--wait-bg); color: var(--wait-fg); }
.st-contacted { background: var(--contacted-bg); color: var(--contacted-fg); }
.st-done { background: var(--done-bg); color: var(--done-fg); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 18px; }

/* 登录 */
.login-wrap { display: flex; justify-content: center; padding: 80px 0; }
.login-card { width: 360px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p { margin-bottom: 18px; }
.login-card label { display: block; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
.login-card .error { margin-bottom: 12px; }
.login-card .btn.wide { margin-top: 6px; }

/* 栅格与指标 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 16px; }
.metric .num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* 会话回溯 */
.trace { max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.trace-row { display: flex; flex-direction: column; gap: 3px; }
.trace-row.in { align-items: flex-start; }
.trace-row.in .trace-bubble { background: #f1f5f9; }
.trace-row.out { align-items: flex-end; }
.trace-row.out .trace-bubble { background: #e9f9ef; }
.trace-meta { font-size: 11.5px; color: var(--muted); }
.trace-bubble { display: inline-block; max-width: 88%; padding: 8px 12px; border-radius: 10px;
  white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }

.status-form { display: flex; gap: 10px; margin-top: 16px; }
.status-form select, .status-form input { font-family: inherit; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.status-form input { flex: 1; }

/* 模拟群聊页 */
.sim-body { background: linear-gradient(180deg, #eef3f8, #f6f8fb); min-height: 100vh; }
.sim-wrap { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.sim-head { margin-bottom: 14px; }
.sim-title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.sim-sub { font-size: 12.5px; margin-top: 4px; }
.sim-config { display: flex; gap: 12px; align-items: center; margin: 14px 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.sim-config label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sim-config input { font-family: inherit; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; width: 120px; }
.chat { background: #fff; border: 1px solid var(--line); border-radius: 14px;
  height: 480px; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 78%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.bot { align-self: flex-start; }
.msg.sys { align-self: center; max-width: 100%; }
.msg-meta { font-size: 11.5px; color: var(--muted); }
.msg-bubble { padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.msg.me .msg-bubble { background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .msg-bubble { background: #f1f5f9; border-bottom-left-radius: 4px; }
.msg.sys .msg-bubble { background: transparent; color: var(--muted); font-size: 12px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chips button { background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; font-family: inherit; cursor: pointer; color: var(--ink); }
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.composer { display: flex; gap: 10px; }
.composer input { flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; }
