:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #059669;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, Segoe UI, sans-serif;
}

a { color: var(--accent); }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: .5px; font-size: 14px;
}
.brand h1 { margin: 0; font-size: 17px; font-weight: 600; }
.brand p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- 按钮/表单 */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
  font-family: inherit;
}
.btn:hover { border-color: #c7d2e3; background: #f8fafc; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: var(--danger); border-color: #f3c9c9; }
.btn.danger:hover { background: #fef2f2; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: #f1f5f9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 13px; }

input[type="text"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------- 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.login-card h1 { margin: 0 0 4px; font-size: 19px; }
.login-card .sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.error-msg {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.ok-msg {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--ok);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ---------------------------------------------------------------- 搜索页布局 */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 20px;
  padding: 20px 26px 40px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.searchbox { display: flex; gap: 10px; }
.searchbox input { font-size: 15.5px; padding: 11px 14px; }

.filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.filters .grp { display: flex; align-items: center; gap: 8px; }
.filters select { width: auto; min-width: 140px; }

.tagbar { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.summary { margin: 15px 0 8px; font-size: 13px; color: var(--muted); }
.summary .warn { color: var(--warn); }

.results { list-style: none; margin: 0; padding: 0; }
.result {
  padding: 13px 14px;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: .12s;
}
.result:last-child { border-bottom-color: transparent; }
.result:hover { background: var(--accent-soft); border-color: #dbe6ff; }
.result.active { background: var(--accent-soft); border-color: #c7d9ff; }
.result h3 { margin: 0 0 5px; font-size: 15.5px; font-weight: 600; }
.result .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.result .snippet { font-size: 13.5px; color: #4b5563; }
.result .badge {
  background: #eef2f7; border-radius: 5px; padding: 1px 7px; font-size: 12px; color: #475569;
}
mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 3px; }

.empty { padding: 34px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }

/* ---------------------------------------------------------------- 搜索反馈 */
/* 员工侧：搜不到时的反馈框 */
.fbbox {
  margin: 16px auto 0;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
}
.fb-comment {
  font: inherit;
  font-size: 13.5px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
}
.fb-comment:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* 员工侧：每条结果下方、以及详情正文末尾的反馈入口 */
.fbrow {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.detail-fb {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.fbhint { font-size: 12px; color: var(--muted); }

/* 「结果不对」必须一眼看出来：原来是灰底的，看着像禁用按钮，员工根本不会点 */
.btn.fb {
  color: #92400e;
  background: #fffbeb;
  border-color: #fbbf24;
  font-weight: 600;
}
.btn.fb:hover { background: #fef3c7; border-color: #f59e0b; color: #78350f; }
.btn.fb.fb-done {
  color: #166534;
  background: #f0fdf4;
  border-color: #86efac;
  font-weight: 400;
}
/* 整行做成一条淡黄色操作带，让它在结果列表里有存在感 */
.result .fbrow {
  padding: 8px 10px;
  margin-top: 10px;
  background: #fffdf5;
  border: 1px dashed #fde68a;
  border-radius: 7px;
}

/* 「搜不到」时：自动记录的提示要显眼，员工才知道不用再操作 */
.autofb { margin-top: 14px; }
.autofb-note {
  display: block;
  max-width: 460px;
  margin: 0 auto;
  padding: 9px 12px;
  border-radius: 7px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  font-size: 13.5px;
  text-align: left;
}
.btn.fb-big {
  align-self: flex-start;
  color: #92400e;
  background: #fffbeb;
  border-color: #fbbf24;
  font-weight: 600;
}
.btn.fb-big:hover { background: #fef3c7; border-color: #f59e0b; }

/* ---------------------------------------------------- AI 模型配置帮助 */
.ai-help {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  background: #fbfcfe;
  margin: 12px 0 16px;
  font-size: 13px;
  line-height: 1.75;
}
.ai-help summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.ai-help-list { margin: 9px 0 10px; padding-left: 22px; }
.ai-help-list li { margin-bottom: 4px; }
.ai-help-table { border-collapse: collapse; width: 100%; margin: 6px 0 8px; font-size: 12.5px; }
.ai-help-table th, .ai-help-table td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.ai-help-table th { background: #f3f6fb; font-weight: 600; }
.ai-help code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ------------------------------------------------- 排版效果预览（自动排版） */
#autoFormatResult {
  margin-top: 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fbff;
}
.fmt-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.fmt-audit {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.fmt-audit.ok { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.fmt-audit.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.fmt-diff {
  font-size: 12.5px;
  color: #78716c;
  background: #fafaf9;
  border: 1px dashed #e7e5e4;
  border-radius: 6px;
  padding: 7px 9px;
  margin: -4px 0 8px;
  word-break: break-all;
}
.fmt-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  max-height: 360px;
  overflow: auto;
  margin-bottom: 10px;
}

/* ------------------------------------------------------------ 资料入库 */
.intake-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fcfdff;
  margin-bottom: 18px;
}
.intake-modes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.intake-box textarea {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  resize: vertical;
}
.intake-record {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.intake-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.intake-tag {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.intake-tag.pending { background: #fff7ed; border-color: #fed7aa; color: #9a3412; font-weight: 600; }
.intake-tag.done { background: #f0fdf4; border-color: #86efac; color: #166534; }
.intake-tag.ok { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.intake-tag.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.intake-tag.muted { background: #f3f4f6; }
.intake-notes {
  margin: 10px 0;
  padding: 8px 10px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
}
.intake-sugs { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.intake-sug {
  border: 1px solid #e6eaf2;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fdfefe;
}
.intake-sug.done { opacity: 0.62; background: #fafafa; }
.intake-sug-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.intake-summary { margin: 6px 0 8px; font-size: 13px; color: #475569; }
.intake-fields { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: #475569; margin-bottom: 8px; }
.intake-field b { color: var(--text); margin-right: 5px; }
.intake-pick { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
.intake-pick select,
.intake-pick input,
.intake-pick-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}
/* 重点补充（置顶通告）：要一眼看见，所以用醒目的左边条 + 淡黄底，跟正文区分开 */
.pinbox { margin: 0 0 12px; }
/* 分区：短提示一区、整篇文章一区，各带区名（员工一眼分得清哪块是什么） */
.pin-zone { margin-bottom: 12px; }
.pin-zone:last-child { margin-bottom: 0; }
.pin-zone-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8a6d3b;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
  padding-left: 2px;
}
.pin-zone-label::before {
  content: '';
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: #e0a93b;
  align-self: center;
}
.pin-zone-hint { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.pin-zone-entry .pin-zone-label { color: #8a5a1e; }
.pin-zone-entry .pin-zone-label::before { background: #c8801f; }
.pinbox-detail { margin: 12px 0 4px; }
.pin {
  border: 1px solid #f0d9a8;
  border-left: 4px solid #e0a93b;
  background: #fffaf0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.pin:last-child { margin-bottom: 0; }
.pin-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pin-tag {
  background: #e0a93b;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.pin-cat { font-size: 12.5px; color: #8a6d3b; }
.pin-time { font-size: 12px; color: var(--muted); }
.pin-body { font-size: 14px; color: #3f3320; }
/* 补充里也允许用小标题/要点/重点/警示（跟正文同一套标记），但在琥珀色底上把标题也调成同色系 */
.pin-body .kb-h { color: #8a6d3b; }
.pin-body .kb-p { margin: 0 0 6px; }
.pin-body .kb-p:last-child { margin-bottom: 0; }
.pin-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* 置顶的「一篇文章」：标题单独一行，正文可折叠 */
.pin-article .pin-title {
  font-size: 15px;
  font-weight: 600;
  color: #7a5a1e;
  margin: 2px 0 4px;
  cursor: pointer;
}
.pin-article .pin-title:hover { text-decoration: underline; }
.pin-sub { font-size: 12.5px; color: #8a6d3b; margin-bottom: 4px; }
.pin-clip { max-height: 132px; overflow: hidden; position: relative; }
.pin-clip::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  background: linear-gradient(rgba(255, 250, 240, 0), #fffaf0);
}
.pin-foot { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.pin-toggle, .pin-open {
  border: 1px solid #e0c9a0;
  background: #fff;
  color: #8a6d3b;
  font-size: 12.5px;
  padding: 2px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.pin-toggle:hover, .pin-open:hover { background: #fdf3e0; }
.pin-group { margin-bottom: 14px; }
.pin-group h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* 「写到」下面那行即时提示：有目标 / 要新建 / 找不到，三种状态用颜色分开 */
.intake-picked { margin: 4px 0 0; font-size: 12.5px; }
.intake-picked.is-new { color: var(--muted); }
.intake-picked.is-target { color: var(--ok, #1a7f37); }
.intake-picked.is-bad { color: var(--danger, #c62828); }
.intake-preview { margin: 8px 0; font-size: 13px; }
.intake-preview summary { cursor: pointer; color: var(--accent); }

/* 资料入库：按置信度筛选 + 批量操作 */
.intake-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.intake-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.intake-chip {
  font: inherit;
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
.intake-chip b { font-weight: 600; margin-left: 2px; }
.intake-chip:hover { border-color: var(--accent); color: var(--accent); }
.intake-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.intake-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}
.intake-bulk .grow { flex: 1; }
.intake-check { display: flex; align-items: center; margin-right: 2px; }
.intake-check input { width: 15px; height: 15px; cursor: pointer; }
.intake-norows { margin: 4px 0 0; }
/* 筛选是给行加 hidden，得保证它真的看不见（万一以后给 .intake-sug 加了 display） */
.intake-sug[hidden] { display: none; }
.intake-preview pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.65;
  max-height: 260px;
  overflow: auto;
}

/* ---------------------------------------------------------------- 附件 */
.attachments {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.att-title { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}
.att-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.att-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f8fafc;
  flex: none;
}
.att-pdf {
  width: 46px;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}
.att-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-name { font-size: 13.5px; word-break: break-all; }
.att-size { font-size: 12px; color: var(--muted); }

/* 后台：附件行 */
.att-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.att-row:last-child { border-bottom: none; }
.att-row .att-meta { flex: 1; }

/* 管理侧：反馈列表 */
.fb-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  margin-bottom: 11px;
  background: #fff;
}
.fb-item.done { background: #f8fafc; opacity: .72; }
.fb-item .fb-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.fb-item .fb-q { font-weight: 600; font-size: 15px; }
.fb-type {
  border-radius: 5px;
  padding: 1px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.fb-type.no_result { background: #fee2e2; color: #b91c1c; }
.fb-type.wrong_result { background: #fef3c7; color: #92400e; }
.fb-type.done { background: #dcfce7; color: #166534; }
.fb-hits { font-size: 12px; color: var(--warn); font-weight: 600; }
.fb-src { font-size: 12px; color: var(--muted); }
.fb-item .fb-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.fb-comment-row {
  font-size: 13px;
  color: #374151;
  background: #f8fafc;
  border-left: 3px solid var(--line);
  padding: 6px 10px;
  margin: 6px 0;
  border-radius: 0 5px 5px 0;
}
.fb-item .row-actions { margin-top: 9px; }

/* ---------------------------------------------------------------- 详情 */
.detail { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; }
.detail h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.45; }
.detail .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.detail .content {
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.8;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- 正文渲染（render.js 生成） */
.kb-h2 {
  color: #1d4ed8;
  font-weight: 600;
  font-size: 15.5px;
  margin: 18px 0 8px;
  padding-left: 9px;
  border-left: 3px solid #2563eb;
}
.kb-h3 {
  display: inline-block;
  color: #0f172a;
  font-weight: 600;
  font-size: 14.5px;
  margin: 14px 0 6px;
  padding: 3px 10px;
  background: #eef2f7;
  border-radius: 6px;
}
.kb-li { margin: 5px 0; }
.kb-dot { color: #2563eb; font-weight: 700; margin-right: 7px; }
.kb-subli { margin: 4px 0 4px 20px; color: #475569; }
.kb-p { margin: 6px 0; }
.kb-gap { height: 6px; }
.kb-note { margin: 10px 0; color: #6b7280; font-size: 13px; }

/* 重点数据：蓝色加粗高亮 */
.kb-em {
  color: #1d4ed8;
  font-weight: 700;
  background: #eef4ff;
  border-radius: 3px;
  padding: 0 4px;
}
/* 风险/强提醒：红色加粗高亮 */
.kb-warn {
  color: #b91c1c;
  font-weight: 700;
  background: #fef2f2;
  border-radius: 3px;
  padding: 0 4px;
}
.detail .placeholder { color: var(--muted); font-size: 14px; text-align: center; padding: 30px 0; }

/* ---------------------------------------------------------------- 后台 */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
/* 标签上的待处理数量，让管理员一眼看到有事没做 */
.tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
}
.tabpane { display: none; }
.tabpane.active { display: block; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fafbfd; }
tbody tr:hover { background: #f8fafc; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
pre.sample { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12.5px; line-height: 1.6; }
