/* groupbot admin — Raycast-inspired dark system
   Tokens: design-md raycast (canvas #07080a, surface #0d0d0d,
   primary #ffffff, hairline rgba(255,255,255,.08), accent-* for status only) */

:root {
  --canvas: #07080a;
  --surface: #0d0d0d;
  --surface-elevated: #101111;
  --surface-card: #121212;

  --ink: #f4f4f6;
  --body: #cdcdcd;
  --mute: #9c9c9d;
  --ash: #6a6b6c;
  --stone: #434345;

  --primary: #ffffff;
  --primary-pressed: #e8e8e8;
  --on-primary: #000000;

  --hairline: #242728;
  --hairline-soft: rgba(255, 255, 255, .08);
  --hairline-strong: rgba(255, 255, 255, .16);

  --blue: #57c1ff;
  --blue-soft: rgba(87, 193, 255, .15);
  --red: #ff6161;
  --red-soft: rgba(255, 97, 97, .15);
  --green: #59d499;
  --green-soft: rgba(89, 212, 153, .15);
  --yellow: #ffc533;
  --yellow-soft: rgba(255, 197, 51, .15);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 16px;

  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 14px/1.6 var(--font);
  font-feature-settings: "calt", "kern", "liga", "ss03";
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--mute); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.error { color: var(--red); min-height: 1.2em; margin: 8px 0 0; font-size: 13px; }
.hint { color: var(--ash); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
code {
  font-family: var(--mono);
  font-size: .92em;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xs);
  padding: 2px 4px;
}

/* ---------- 登录 ---------- */
.login {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--canvas);
}
.login-card {
  width: min(380px, 100%);
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
  padding: 32px 24px 24px;
  text-align: center;
}
.login-card h1 {
  font-size: 22px; font-weight: 500; line-height: 1.15;
  margin: 16px 0 4px; letter-spacing: 0;
}
.login-card p.muted { font-size: 14px; margin: 0; }
.login-card .field { text-align: left; margin: 24px 0 16px; }

.logo {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  color: var(--ink);
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md);
}
.logo svg { width: 18px; height: 18px; display: block; }
.logo.big { width: 56px; height: 56px; margin: 0 auto; border-radius: var(--r-md); }
.logo.big svg { width: 28px; height: 28px; }

/* ---------- 框架 ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--canvas);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 14px; font-weight: 500; letter-spacing: .2px;
  margin: 0; white-space: nowrap;
}
.brand-text p {
  margin: 0; font-size: 12px; line-height: 1.5;
  color: var(--ash); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-actions { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 12px; line-height: 1;
  color: var(--mute);
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-soft);
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--stone); }
.pill.ok { color: var(--green); background: var(--green-soft); border-color: transparent; }
.pill.ok i { background: var(--green); }
.pill.off { color: var(--red); background: var(--red-soft); border-color: transparent; }
.pill.off i { background: var(--red); }

.layout {
  flex: 1; min-height: 0; min-width: 0;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}
.layout > * { min-width: 0; }

/* ---------- 侧栏 ---------- */
.sidebar {
  border-right: 1px solid var(--hairline-soft);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  background: var(--canvas);
}
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 16px 8px;
  font-size: 12px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--ash);
}
.side-tools { padding: 0 8px 8px; }
.search {
  width: 100%;
  height: 36px;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-soft);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font: 14px/1.4 var(--font);
  outline: none;
}
.search::placeholder { color: var(--stone); }
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.chat-list { overflow-y: auto; padding: 4px 8px 12px; flex: 1; min-height: 0; min-width: 0; }
.chat-item {
  width: 100%;
  display: block; text-align: left;
  padding: 8px 12px;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: background .12s, border-color .12s;
}
.chat-item:hover { background: var(--surface); }
.chat-item.is-active { background: var(--surface-card); }
.chat-item .t {
  display: block; font-size: 13px; font-weight: 500; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item .m {
  display: flex; gap: 8px; align-items: center;
  margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ash);
  font-family: var(--mono);
}
.chat-item .m em { font-style: normal; color: var(--body); }

.chat-item.overview-item {
  width: auto;
  margin: 0 8px 4px;
  background: var(--surface-elevated);
  border-color: var(--hairline-soft);
  border-radius: var(--r-md);
}
.chat-item.overview-item.is-active { background: var(--surface-card); border-color: var(--hairline); }
.chat-item.overview-item .m { color: var(--ash); }

.side-empty { padding: 16px; color: var(--ash); font-size: 12px; line-height: 1.6; }
.side-foot {
  border-top: 1px solid var(--hairline-soft);
  padding: 12px 16px;
  font-size: 12px; color: var(--ash);
  min-height: 36px;
}

/* ---------- 内容 ---------- */
.content { overflow-y: auto; padding: 24px 32px 96px; min-width: 0; }
.content > * { max-width: 1040px; }

.empty-card {
  margin-top: 12vh;
  text-align: center;
  color: var(--mute);
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
  padding: 32px 24px;
  background: transparent;
}
.empty-card h2 { color: var(--ink); font-size: 20px; font-weight: 500; margin: 12px 0 4px; }
.empty-icon { color: var(--stone); }
.empty-icon svg { width: 28px; height: 28px; display: block; margin: 0 auto; }

.chat-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.chat-head h2 {
  margin: 0; font-size: 22px; font-weight: 500; line-height: 1.15; letter-spacing: 0;
}
.chat-id-wrap { min-width: 0; }
.chat-id-wrap .mono { margin-top: 4px; color: var(--ash); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.chips.tiny { gap: 4px; justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px;
  font-size: 12px; border-radius: var(--r-xs);
  border: 1px solid var(--hairline-soft);
  color: var(--mute);
  background: var(--surface-elevated);
  white-space: nowrap;
}
.chip.on { color: var(--green); background: var(--green-soft); border-color: transparent; }
.chip.warn { color: var(--yellow); background: var(--yellow-soft); border-color: transparent; }
.chips.tiny .chip { height: 20px; padding: 0 6px; font-size: 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: 16px;
}
.stat b { display: block; font-size: 24px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.stat span { font-size: 12px; color: var(--mute); }
.stat em { font-style: normal; font-size: 12px; color: var(--ash); margin-left: 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--mute);
  margin-bottom: 12px;
}
.chart-card { margin-bottom: 16px; }
.chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 128px;
  padding-top: 8px;
}
.bar {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 4px;
}
.bar i {
  display: block; width: 100%; max-width: 44px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--hairline);
  min-height: 2px;
  transition: height .3s ease;
}
.bar.today i { background: var(--blue); }
.bar span { font-size: 12px; color: var(--ash); font-family: var(--mono); }
.bar b { font-size: 12px; color: var(--mute); font-weight: 400; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: transparent;
  border: 1px solid var(--hairline-soft);
  border-radius: 9999px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  flex: 1 0 auto;
  padding: 8px 12px;
  border: 0; border-radius: 9999px;
  background: transparent; color: var(--mute);
  font: 14px/1.4 var(--font); font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface-elevated); color: var(--ink); }

.tab-panel { animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.panel-card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 500; color: var(--ink); }
.panel-card .sub { color: var(--ash); font-size: 12px; line-height: 1.5; margin: 0 0 16px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.field > span { font-size: 12px; line-height: 1.5; color: var(--mute); letter-spacing: .2px; }
input[type="text"], input[type="password"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  height: 36px;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-soft);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font: 14px/1.4 var(--font);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 96px; resize: vertical; line-height: 1.6; padding: 8px 12px; }
input::placeholder, textarea::placeholder { color: var(--stone); }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%),
                    linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.switch {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.switch:last-child { border-bottom: 0; }
.switch .label { font-size: 14px; line-height: 1.4; color: var(--ink); }
.switch .label small { display: block; color: var(--ash); font-size: 12px; margin-top: 2px; }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 40px; height: 24px; flex: 0 0 40px;
  border-radius: 9999px;
  background: var(--hairline);
  position: relative; cursor: pointer;
  transition: background .15s;
  margin: 0;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--mute); transition: transform .15s, background .15s;
}
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); background: var(--on-primary); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft);
  background: var(--surface-elevated);
  color: var(--ink);
  font: 14px/1 var(--font); font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-card); border-color: var(--hairline); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-pressed); border-color: var(--primary-pressed); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--body); }
.btn.ghost:hover { background: var(--surface-elevated); border-color: transparent; }
.btn.danger { background: transparent; border-color: transparent; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: transparent; }
.btn.sm { height: 32px; padding: 6px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; display: block; }
.btn.icon {
  width: 36px; height: 36px; padding: 0;
  background: transparent; border-color: transparent;
  color: var(--mute); font-size: 16px;
}
.btn.icon:hover { color: var(--ink); background: var(--surface-elevated); }
.btn.wide { width: 100%; height: 36px; }

/* ---------- 词库 / 表格 ---------- */
.cell-title { font-weight: 500; color: var(--ink); }
.word-form { display: flex; gap: 8px; margin-bottom: 16px; }
.word-form input { flex: 1; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 4px 0 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-sm);
  font-size: 12px; color: var(--body);
}
.word button svg { width: 12px; height: 12px; }
.word button {
  width: 20px; height: 20px; border: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--ash);
  cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.word button:hover { background: var(--red-soft); color: var(--red); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 8px 8px;
  color: var(--ash); font-weight: 400; font-size: 12px;
  letter-spacing: .4px; text-transform: uppercase;
  border-bottom: 1px solid var(--hairline-soft);
  white-space: nowrap;
}
.table td {
  padding: 8px 8px; border-bottom: 1px solid var(--hairline-soft);
  vertical-align: middle; color: var(--body);
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-elevated); }
.table .num { font-family: var(--mono); color: var(--mute); }
.table .right { text-align: right; }
.table input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary);
  vertical-align: -2px; cursor: pointer;
}
.batchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.batchbar:last-child { margin-bottom: 0; }
.batchbar select { width: auto; min-width: 120px; max-width: 180px; }
.batchbar input[type="text"] { width: auto; flex: 1; min-width: 140px; }
.checkline {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--mute); white-space: nowrap;
}
.checkline input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---------- 聊天记录 ---------- */
.msg-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.msg-toolbar input[type="search"] { flex: 1; min-width: 140px; }
.msg-toolbar select { width: auto; min-width: 92px; }
.msg-list { display: flex; flex-direction: column; gap: 1px; }
.msg-item { padding: 8px 8px; border-bottom: 1px solid var(--hairline-soft); border-radius: var(--r-xs); }
.msg-item:nth-child(odd) { background: rgba(255, 255, 255, .014); }
.msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--mute); }
.msg-name { color: var(--ink); font-weight: 500; }
.msg-head time { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ash); }
.msg-text { font-size: 13px; line-height: 1.6; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.msg-item.is-deleted { opacity: .55; }
.msg-item.is-deleted .msg-text { text-decoration: line-through; }
.badge {
  font-size: 12px; line-height: 1.4; padding: 2px 6px; border-radius: var(--r-xs);
  background: var(--red-soft); color: var(--red); white-space: nowrap;
}

/* ---------- 日志 ---------- */
.log-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.log-line {
  font-family: var(--mono);
  font-size: 12px; line-height: 1.5;
  color: var(--mute);
  padding: 4px 8px;
  border-radius: var(--r-xs);
  white-space: pre-wrap; word-break: break-all;
}
.log-line:nth-child(odd) { background: rgba(255, 255, 255, .014); }
.audit-item {
  display: grid; grid-template-columns: 48px 1fr auto;
  gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 13px;
}
.audit-item:last-child { border-bottom: 0; }
.audit-item time { color: var(--ash); font-family: var(--mono); font-size: 12px; }
.audit-item .kind { color: var(--ink); font-weight: 500; }
.audit-item .actor { color: var(--ash); font-size: 12px; white-space: nowrap; }

/* ---------- Dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(13, 13, 13, .94);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dock-item {
  width: 76px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 8px;
  border: 0; border-radius: 9999px;
  background: transparent;
  color: var(--mute);
  font: 12px/1.2 var(--font);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.dock-item svg { width: 18px; height: 18px; display: block; }
.dock-item span { font-size: 12px; line-height: 1.2; }
.dock-item:hover { color: var(--ink); }
.dock-item.is-active { background: var(--surface-elevated); color: var(--ink); }

/* ---------- 弹窗 / 提示 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(7, 8, 10, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-card {
  width: min(460px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-xl);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--hairline-soft);
  position: sticky; top: 0;
  background: var(--surface-card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 500; }
.modal-body { padding: 24px; }
.modal-foot { margin-top: 24px; display: flex; justify-content: flex-end; gap: 8px; }
.divider { height: 1px; background: var(--hairline-soft); margin: 24px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 16px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: var(--green-soft); }
.toast.err { border-color: var(--red-soft); color: var(--red); }

.spin {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--stone); border-top-color: var(--ink);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 移动端卡片表格 ---------- */
@media (max-width: 720px) {
  .table.responsive { display: block; }
  .table.responsive thead { display: none; }
  .table.responsive tbody { display: block; }
  .table.responsive tr {
    display: block;
    position: relative;
    padding: 8px;
    margin-bottom: 8px;
    background: var(--surface-elevated);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--r-md);
  }
  .table.responsive td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px;
    border: 0;
  }
  .table.responsive td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--ash);
    font-size: 12px;
  }
  .table.responsive td[data-label=""]::before { content: none; }
  .table.responsive td.cell-main {
    display: block;
    padding: 2px 32px 6px 4px;
  }
  .table.responsive td.cell-main::before { content: none; }
  .table.responsive td.col-check {
    position: absolute;
    top: 12px; right: 10px;
    display: block; padding: 0;
  }
  .table.responsive td.col-check::before { content: none; }
  .table.responsive td.col-num { display: none; }
  .table.responsive td.right { justify-content: flex-end; padding-top: 8px; }
  .table.responsive td .chips.tiny { justify-content: flex-end; }
  .table.responsive tr:hover { background: var(--surface-elevated); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
    max-height: 248px;
  }
  .side-head { display: none; }
  .side-tools { padding: 0 12px 8px; }
  .chat-item.overview-item { margin: 0 12px 4px; }
  .chat-list {
    display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden;
    padding: 2px 12px 8px;
  }
  .chat-item { min-width: 210px; margin-bottom: 0; }
  .chat-item .tag { display: none; }
  .chat-list { min-height: 56px; }
  .side-empty, .side-foot { display: none; }
  .content { padding: 16px 16px calc(6rem + env(safe-area-inset-bottom)); }
  .dock {
    width: calc(100% - 24px);
    max-width: 420px;
    justify-content: space-around;
    border-radius: 16px;
    padding: 6px 8px;
  }
  .dock-item { width: auto; flex: 1; }
  .topbar {
    height: auto; min-height: 56px;
    flex-wrap: wrap;
    padding: 8px 16px;
    gap: 8px;
  }
  .brand { flex: 1 1 auto; }
  .brand-text { flex: 1 1 auto; min-width: 0; }
  .brand-text h1 { overflow: hidden; text-overflow: ellipsis; }
  .top-actions { flex: 0 0 100%; justify-content: flex-end; }
  .brand-text p { display: none; }
  .chat-head { flex-direction: column; gap: 8px; }
  .chips { justify-content: flex-start; }
  .panel-card { padding: 16px; }
  .audit-item { grid-template-columns: 44px 1fr; }
  .audit-item .actor { display: none; }
}

@media (max-width: 520px) {
  .brand-text h1 { font-size: 13px; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .pill { padding: 0 6px; font-size: 12px; }
  .stat b { font-size: 20px; }
  .chart { height: 112px; }
  .tab { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
