/* ============================================================
   Q轻聊服务器 · 设计系统（macOS 风格）
   - 统一半透明窗口外壳：工具栏 + 侧栏同一材质，发丝分隔线
   - 圆角矩形按钮 / 内凹输入框 / 分段控件 / 内嵌分组列表
   - 13px 正文体系，自动适配浅色与深色模式
   - 响应式：表格转卡片、弹窗变底部抽屉、容器查询断点
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei UI", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ececec;
  --sidebar-material: rgba(246, 246, 246, 0.72);
  --bg-elevated: rgba(250, 250, 250, 0.8);
  --card: #ffffff;
  --card-2: #f5f5f7;
  --card-3: #ececee;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #9a9aa0;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);

  --accent: #0a7cff;
  --accent-hover: #0071e3;
  --accent-soft: rgba(10, 124, 255, 0.12);
  --accent-ring: rgba(10, 124, 255, 0.3);
  --green: #28a745;
  --orange: #f08c00;
  --red: #e5484d;
  --purple: #8e4ec6;
  --teal: #0d9aa8;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-btn: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-raised: 0 1px 1px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 12px 48px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  --nav-h: 52px;
  --sidebar-w: 224px;
  --ctl-h: 28px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --sidebar-material: rgba(38, 38, 40, 0.72);
    --bg-elevated: rgba(44, 44, 46, 0.78);
    --card: #2c2c2e;
    --card-2: #3a3a3c;
    --card-3: #48484a;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #7c7c81;
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.2);

    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --accent-ring: rgba(10, 132, 255, 0.38);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --purple: #bf5af2;
    --teal: #40c8e0;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-raised: 0 1px 1px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 16px 56px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
::selection { background: var(--accent-soft); }

/* ---------- 工具栏（磨砂玻璃，与侧栏同一材质） ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--sidebar-material);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.topnav .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; color: var(--text); letter-spacing: -0.01em;
  white-space: nowrap;
}
.topnav .brand:hover { text-decoration: none; }
.brand-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(160deg, #3aa0ff, #0a7cff);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.topnav .brand-sub { color: var(--text-2); font-weight: 500; font-size: 12.5px; margin-left: 1px; }
.topnav .nav-links { display: flex; gap: 2px; margin-left: 6px; }
.topnav .nav-links a {
  color: var(--text-2); padding: 4px 10px; border-radius: var(--radius-btn);
  font-size: 13px; font-weight: 500; transition: background .15s, color .15s;
}
.topnav .nav-links a:hover { color: var(--text); background: rgba(120, 120, 128, 0.14); text-decoration: none; }
.topnav .nav-links a.active { color: var(--accent); background: var(--accent-soft); }
.topnav .spacer { flex: 1; }
.topnav .nav-user { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 8px; }

/* ---------- 布局 ---------- */
.page { max-width: 1000px; margin: 0 auto; padding: 24px 20px 72px; }
.page-wide { max-width: 1200px; }
.layout { display: flex; min-height: calc(100dvh - var(--nav-h)); }
.layout.with-sidebar { padding-top: 0; }

.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; bottom: 0; left: 0;
  padding: calc(var(--nav-h) + 8px) 10px 16px;
  background: var(--sidebar-material);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto; z-index: 90;
}
.sidebar .side-title {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: .03em;
  padding: 12px 8px 4px;
}
.sidebar a.side-item {
  display: flex; align-items: center;
  padding: 5px 9px; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 500;
  line-height: 20px; transition: background .12s;
}
.sidebar a.side-item:hover { background: rgba(120, 120, 128, 0.14); text-decoration: none; }
.sidebar a.side-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.main { flex: 1; margin-left: var(--sidebar-w); padding: 22px clamp(16px, 2.2vw, 32px) 56px; min-width: 0; container-type: inline-size; }
.main > .section-title { margin-top: 0; }

/* 用户中心：工具栏下方的分段标签栏（移动端必须可达） */
.user-tabs {
  display: flex; align-items: center; gap: 2px;
  max-width: 1000px; margin: 0 auto; padding: 14px 20px 0;
  overflow-x: auto; scrollbar-width: thin;
}
.user-tabs a {
  flex-shrink: 0; padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px; font-weight: 500;
}
.user-tabs a:hover { background: rgba(120, 120, 128, 0.14); color: var(--text); text-decoration: none; }
.user-tabs a.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px;
  margin-bottom: 16px;
}
.card.tight { padding: 0; overflow: hidden; }
.card h3.card-title { font-size: 14px; margin-bottom: 3px; }
.card .card-sub { color: var(--text-2); font-size: 12.5px; margin-bottom: 12px; }
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.card-head h3 { font-size: 13.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 880px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 520px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- 统计卡片 ---------- */
.stat {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line); padding: 14px 16px;
}
.stat .stat-label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.stat .stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; overflow-wrap: anywhere; }
.stat .stat-value small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 5px; }

/* ---------- 按钮（macOS 圆角矩形 push button） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; min-height: var(--ctl-h);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 0 12px; border-radius: var(--radius-btn);
  background: var(--card); color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-raised);
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--card-2); }
.btn:active { background: var(--card-3); box-shadow: none; }
.btn.primary {
  background: var(--accent); color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(10, 124, 255, 0.3);
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { background: var(--accent-hover); }
.btn.danger { background: rgba(229, 72, 77, 0.1); color: var(--red); border-color: rgba(229, 72, 77, 0.24); }
.btn.danger:hover { background: rgba(229, 72, 77, 0.18); }
.btn.plain { background: var(--card); }
.btn.plain:hover { background: var(--card-2); }
.btn.sm { font-size: 12px; padding: 0 9px; min-height: 24px; border-radius: 5px; }
.btn.lg { font-size: 14px; padding: 0 18px; min-height: 34px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; font-family: var(--font); font-size: 13px; color: var(--text);
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn); padding: 5px 9px;
  min-height: var(--ctl-h);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
select.input { padding-right: 6px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--card); }
textarea.input { resize: vertical; min-height: 84px; padding: 7px 9px; }
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; min-width: 0; }

/* ---------- 表格（内嵌分组列表） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; color: var(--text-3); font-weight: 600;
  padding: 7px 14px; border-bottom: 1px solid var(--line);
  background: var(--card-2); white-space: nowrap;
}
.tbl td { padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--accent-soft); }
.tbl .mono { font-family: var(--mono); font-size: 12px; }
.tbl .actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 5px;
  background: var(--card-3); color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.green { background: rgba(40, 167, 69, .14); color: var(--green); }
.badge.orange { background: rgba(240, 140, 0, .15); color: var(--orange); }
.badge.red { background: rgba(229, 72, 77, .13); color: var(--red); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.purple { background: rgba(142, 78, 198, .14); color: var(--purple); }
.badge.gray { background: var(--card-3); color: var(--text-3); }

/* ---------- 分段控件 ---------- */
.segmented {
  display: inline-flex; background: var(--card-3);
  border-radius: var(--radius-sm); padding: 2px; gap: 2px;
  max-width: 100%; overflow-x: auto;
}
.segmented button {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--text-2);
  padding: 4px 13px; border-radius: 5px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmented button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-raised); }

/* ---------- 弹窗（macOS sheet / alert） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .16s ease;
}
.modal {
  background: var(--card); border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  width: 100%; max-width: 480px; max-height: 86vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.1);
}
.modal.lg { max-width: 640px; }
.modal-head {
  padding: 14px 16px 0; display: flex; align-items: flex-start; gap: 10px;
}
.modal-head h3 { font-size: 14px; flex: 1; line-height: 26px; }
.modal-close {
  border: none; background: var(--card-3); color: var(--text-2);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.modal-close:hover { background: var(--line-strong); color: var(--text); }
.modal-body { padding: 12px 16px 4px; overflow-y: auto; }
.modal-foot {
  padding: 12px 16px 14px; display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--line); background: var(--card-2);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }

/* ---------- Toast ---------- */
#toast-wrap {
  position: fixed; top: calc(var(--nav-h) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  background: var(--bg-elevated);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  color: var(--text); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  padding: 7px 16px;
  animation: toastIn .22s cubic-bezier(.2, .9, .3, 1.1);
}
.toast.err { color: var(--red); }
.toast.ok { color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: var(--text-2); padding: 32px 20px; }
.empty-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.empty-detail { font-size: 12.5px; line-height: 1.65; max-width: 420px; margin: 0 auto; }
.log-note { padding: 10px 16px 14px; color: var(--text-2); font-size: 12px; }
.log-viewer {
  margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); color: var(--text); font: 12px/1.75 var(--mono);
  max-height: 460px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.copy-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-family: var(--mono); font-size: 11.5px;
  background: var(--card-2); border: 1px solid var(--line-strong);
  border-radius: 5px; padding: 3px 8px; word-break: break-all; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.copy-chip:hover { border-color: var(--accent); color: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { word-break: break-all; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: none; }
.announcement {
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-size: 12.5px; margin-bottom: 14px; white-space: pre-wrap; word-break: break-word;
}
.section-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 14px; }
.muted { color: var(--text-2); font-size: 12.5px; }
.small { font-size: 12px; color: var(--text-3); }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: 10px 14px; font-size: 12.5px; color: var(--text-2); }
.search-box { min-width: 160px; max-width: 280px; }
.btn:focus-visible, a:focus-visible, .input:focus-visible, .modal-close:focus-visible, .log-viewer:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 60px 20px 34px; }
.hero h1 { font-size: 40px; letter-spacing: -0.03em; margin-bottom: 10px; }
.hero p { color: var(--text-2); font-size: 16px; max-width: 540px; margin: 0 auto 22px; }
.hero .btn-row { justify-content: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { margin-left: 0; padding: 16px 14px calc(64px + env(safe-area-inset-bottom)); }

  /* 侧栏 → 下拉面板 */
  .sidebar {
    top: var(--nav-h); bottom: auto; left: 0; right: 0; width: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--line);
    display: none; max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { display: flex; }
  .sidebar .side-title { display: none; }
  .sidebar a.side-item { padding: 5px 10px; }

  .menu-btn { display: inline-flex !important; }
  .topnav .nav-links { display: none; }
  .topnav .brand-sub { display: none; }
  .topnav .nav-user > span { display: none; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }
  .hero { padding: 40px 20px 24px; }
}

@media (min-width: 901px) {
  .menu-btn { display: none !important; }
}

@media (max-width: 640px) {
  .page { padding: 16px 14px 56px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topnav { gap: 8px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .topnav .brand { font-size: 13.5px; }
  .topnav .nav-user { gap: 5px; }
  .user-tabs { padding: 10px 14px 0; }
  .user-tabs a { padding: 5px 10px; font-size: 12.5px; }
  .card { padding: 14px; }
  .card-head, .card-body { padding: 12px 14px; }
  .stat { padding: 12px 14px; }
  .form-row { flex-direction: column; }
  .card-head .search-box { flex: 1 1 100%; max-width: none; }
  .pagination { justify-content: center; padding: 10px 8px; }
  .log-viewer { padding: 10px; max-height: 360px; }
  .card-title { overflow-wrap: anywhere; }

  /* 表格转卡片 */
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: none; }
  .tbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: none; padding: 3px 0; }
  .tbl td::before { content: attr(data-th); color: var(--text-3); font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
  .tbl td.actions { justify-content: flex-end; }
  .tbl td.actions::before { content: none; }

  /* 弹窗 → 底部抽屉 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: 14px 14px 0 0; max-height: 92vh;
    animation: sheetIn .26s cubic-bezier(.2, .9, .3, 1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  @keyframes sheetIn { from { opacity: .4; transform: translateY(48px); } }

  .stat .stat-value { font-size: 22px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 7px; }
}

/* ---------- 登录卡 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-wrap.auth-below-nav { min-height: calc(100dvh - var(--nav-h)); }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: var(--shadow-raised);
  padding: 28px 26px;
}
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 18px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }

/* ---------- 群聊模拟测试 ---------- */
.sim-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr) 264px; gap: 12px; align-items: start; }
@container (max-width: 1000px) {
  .sim-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .sim-members-panel { grid-column: 1 / -1; }
}
@container (max-width: 700px) { .sim-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .sim-layout { grid-template-columns: minmax(0, 1fr); } }
.sim-layout > * { min-width: 0; }
.sim-list { display: flex; flex-direction: column; gap: 6px; }
.sim-group-item {
  padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); transition: background .12s, border-color .12s;
}
.sim-group-item:hover { border-color: var(--line-strong); }
.sim-group-item.active { border-color: var(--accent); background: var(--accent-soft); }
.sim-group-item .g-name { font-weight: 600; font-size: 13px; }
.sim-group-item .g-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.sim-chat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; height: clamp(420px, 68dvh, 720px); overflow: hidden;
}
.sim-timeline { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.sim-msg { display: flex; gap: 8px; max-width: 82%; }
.sim-msg.self { align-self: flex-end; flex-direction: row-reverse; }
.sim-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, #7a7ae0, #0a7cff);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 600;
}
.sim-bubble { background: var(--card-2); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 6px 10px; }
.sim-msg.self .sim-bubble { background: var(--accent); border-color: transparent; color: #fff; border-radius: 12px 4px 12px 12px; }
.sim-msg .m-name { font-size: 11.5px; color: var(--text-3); margin-bottom: 1px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.sim-msg .m-text { font-size: 13.5px; word-break: break-word; white-space: pre-wrap; }
.sim-msg .m-time { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.sim-msg.self .m-time { color: rgba(255, 255, 255, .78); }
.sim-composer { border-top: 1px solid var(--line); padding: 10px 12px; background: var(--card-2); }
.sim-cast { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 7px; }
.sim-cast-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--card); min-width: 60px;
  transition: border-color .12s, background .12s; flex-shrink: 0;
}
.sim-cast-item:hover { border-color: var(--line-strong); }
.sim-cast-item.active { border-color: var(--accent); background: var(--accent-soft); }
.sim-cast-item .c-name { font-size: 11.5px; font-weight: 500; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-cast-item .c-badge { font-size: 10px; color: var(--orange); }
.sim-cast-item.self-cast .c-name { color: var(--accent); }
.sim-input-row { display: flex; gap: 8px; align-items: center; }
.sim-input-row .input { flex: 1; min-width: 0; }
.sim-member-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sim-member-row:last-child { border-bottom: none; }
