/* ============================================================
 * HotGEO · 生成式引擎优化平台 — 全局样式
 * 设计基调：专业 SaaS / 浅色内容区 + 深色侧边栏
 * ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e6e8f0;
  --border-2: #d8dbe8;
  /* 组件里习惯写 var(--line)；此前只有 --border 被定义，导致虚线描边退化成 currentColor */
  --line: #e6e8f0;

  --text: #1b2136;
  --text-2: #59617a;
  --text-3: #8b93ab;

  --brand: #4f5bf0;
  --brand-strong: #3b46d8;
  --brand-soft: #eef0fe;
  --brand-grad: linear-gradient(135deg, #4f5bf0, #7c4dff);

  --ok: #16a34a;   --ok-soft: #e8f7ee;
  --warn: #d97706; --warn-soft: #fdf3e3;
  --danger: #dc2626; --danger-soft: #fdeaea;
  --info: #0ea5b7; --info-soft: #e5f7f9;

  --sidebar: #12162b;
  --sidebar-2: #1a1f3d;
  --sidebar-text: #aab2d0;
  --sidebar-active: rgba(255, 255, 255, 0.08);

  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(23, 28, 60, 0.05);
  --shadow-md: 0 4px 16px rgba(23, 28, 60, 0.08);
  --shadow-lg: 0 12px 40px rgba(23, 28, 60, 0.16);

  --sb-w: 236px;
  --sb-w-min: 64px;
  --tb-h: 60px;

  --focus-ring: 0 0 0 3px rgba(79, 91, 240, 0.35);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
::selection { background: rgba(79, 91, 240, 0.2); }

/* 统一的焦点可见样式（可访问性核心） */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.sidebar :focus-visible, .sidebar a:focus-visible, .sidebar button:focus-visible {
  outline-color: #9aa5ff;
}

/* 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 跳过导航链接 */
.skip-link {
  position: fixed; top: -48px; left: 12px; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) var(--r-sm); font-size: 13px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* ---------- 通用工具 ---------- */
.ic { width: 16px; height: 16px; flex: none; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }
.muted { color: var(--text-3); }
.tip-wrap { position: relative; display: inline-flex; }
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #23294a; color: #fff; font-size: 12px; line-height: 1.4;
  padding: 5px 9px; border-radius: var(--r-sm); white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 60;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-tip^="bottom"]::after { bottom: auto; top: calc(100% + 8px); }

/* 键盘按键样式 */
.kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px;
  border: 1px solid var(--border-2); border-bottom-width: 2px;
  background: var(--surface-2); border-radius: 5px;
  font-size: 11px; font-family: inherit; color: var(--text-2);
  text-align: center; line-height: 1.6;
}
.kbd + .kbd { margin-left: 4px; }

/* ---------- 应用框架 ---------- */
.app { display: flex; height: 100vh; width: 100%; }

/* 侧边栏 */
.sidebar {
  width: var(--sb-w); flex: none; height: 100%;
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  transition: width 0.18s ease;
  position: relative; z-index: 30;
}
.app.collapsed .sidebar { width: var(--sb-w-min); }
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  height: var(--tb-h); padding: 0 16px; flex: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.logo-mark {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 15px;
  border-radius: 8px; letter-spacing: 0;
}
.logo-text { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 0.3px; white-space: nowrap; }
.logo-text small { font-size: 11px; font-weight: 400; color: var(--sidebar-text); display: block; letter-spacing: 1px; }
.sb-collapse {
  position: absolute; top: calc(var(--tb-h) / 2 - 10px); right: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border-2);
  display: grid; place-items: center; z-index: 5;
  box-shadow: var(--shadow-sm);
}
.sb-collapse .ic { width: 12px; height: 12px; transition: transform 0.18s ease; }
.app.collapsed .sb-collapse .ic { transform: rotate(180deg); }

.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }
.sb-group-label {
  font-size: 11px; color: #6d7494; text-transform: uppercase; letter-spacing: 1px;
  padding: 14px 12px 6px; white-space: nowrap; overflow: hidden;
}
.app.collapsed .sb-group-label { visibility: hidden; height: 0; padding: 0; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--r-md); color: var(--sidebar-text);
  font-size: 13.5px; text-align: left; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.sb-item:hover { background: var(--sidebar-active); color: #e8eafc; }
.sb-item[aria-current="page"] {
  background: var(--brand-grad); color: #fff;
  box-shadow: 0 4px 12px rgba(79, 91, 240, 0.35);
}
.sb-item .ic { width: 18px; height: 18px; }
.sb-item .sb-label { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.app.collapsed .sb-item { justify-content: center; padding: 10px; }
.app.collapsed .sb-item .sb-label { display: none; }

.sb-bottom { flex: none; border-top: 1px solid rgba(255, 255, 255, 0.06); padding: 10px; }
.sb-user {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  padding: 8px; border-radius: var(--r-md);
  background: var(--sidebar-2);
}
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--brand-grad); color: #fff; font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
}
.sb-user-info { flex: 1; min-width: 0; line-height: 1.3; white-space: nowrap; }
.sb-user-info strong { display: block; font-size: 13px; color: #fff; font-weight: 500; }
.sb-user-info span { font-size: 11px; color: var(--sidebar-text); }
.app.collapsed .sb-user-info, .app.collapsed .sb-user .icon-btn { display: none; }
.app.collapsed .sb-user { justify-content: center; padding: 8px 4px; }

/* 主栏 */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }

/* 顶栏 */
.topbar {
  height: var(--tb-h); flex: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; z-index: 20;
}
.tb-menu { display: none; }
.page-title { font-size: 17px; font-weight: 600; line-height: 1.2; }
.page-sub { font-size: 12px; color: var(--text-3); margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 图标按钮 */
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: inline-grid; place-items: center;
  color: var(--text-2); position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-expanded="true"] { background: var(--brand-soft); color: var(--brand); }
.badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  border-radius: 8px; display: grid; place-items: center;
  border: 1.5px solid var(--surface);
}

/* 搜索框（顶栏） */
.tb-search {
  height: 34px; padding: 0 10px; border-radius: var(--r-md);
  border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--text-3); font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  transition: border-color 0.12s ease;
}
.tb-search:hover { border-color: var(--brand); color: var(--text-2); }
.tb-search .ic { width: 14px; height: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .ic { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(79, 91, 240, 0.3); }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn-secondary { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fbdada; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-text { height: auto; padding: 2px 4px; color: var(--brand); font-size: 12.5px; }

/* 加载态 */
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.spin {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn.is-loading .ic { display: none; }

/* ---------- 内容区视图 ---------- */
.view {
  flex: 1; overflow-y: auto; padding: 20px 24px 40px;
  scroll-behavior: smooth;
}
.view:focus { outline: none; }
.view::-webkit-scrollbar { width: 8px; }
.view::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.view::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

/* ---------- 布局网格 ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.mt16 { margin-top: 16px; }

/* ---------- KPI 指标卡 ---------- */
.kpi {
  position: relative; display: block; text-align: left; width: 100%;
  padding: 16px 18px 14px; overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.kpi:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.kpi:focus-visible { outline-offset: -2px; }
.kpi-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.kpi-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.kpi-ic .ic { width: 16px; height: 16px; }
.kpi-ic.indigo { background: var(--brand-soft); color: var(--brand); }
.kpi-ic.teal { background: var(--info-soft); color: var(--info); }
.kpi-ic.green { background: var(--ok-soft); color: var(--ok); }
.kpi-ic.amber { background: var(--warn-soft); color: var(--warn); }
.kpi-value { margin-top: 10px; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.kpi-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.good { color: var(--ok); }
.delta .ic { width: 12px; height: 12px; }
.kpi-desc { color: var(--text-3); flex: 1; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-spark { position: absolute; right: 12px; top: 38px; opacity: 0.9; }
.kpi:hover .kpi-spark { opacity: 1; }

/* ---------- 分段控件 / 标签页 ---------- */
.seg {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; gap: 2px;
}
.seg button {
  height: 28px; padding: 0 12px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--brand); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.tabs button {
  position: relative; padding: 10px 14px; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.tabs .count {
  margin-left: 6px; font-size: 11px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 9px; padding: 0 6px; color: var(--text-3);
}
.tabs button[aria-selected="true"] .count { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

/* 模型 Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 14px;
  border: 1px solid var(--border-2); background: var(--surface);
  font-size: 12.5px; color: var(--text-2);
  transition: all 0.12s ease;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 500; }

/* ---------- 标签 Tag ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.green .dot { background: var(--ok); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.amber .dot { background: var(--warn); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.red .dot { background: var(--danger); }
.tag.gray { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.blue .dot { background: var(--brand); }
.tag.sev-high { background: var(--danger-soft); color: var(--danger); }
.tag.sev-mid { background: var(--warn-soft); color: var(--warn); }
.tag.sev-low { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3);
  padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background 0.1s ease; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .cell-main { font-weight: 500; }
.tbl .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: block; }
th.sortable { padding: 0; }
th.sortable button {
  width: 100%; display: flex; align-items: center; gap: 5px;
  padding: 11px 14px; font-size: 12px; color: var(--text-3); font-weight: 500;
  text-align: left;
}
th.sortable button:hover { color: var(--text); background: var(--surface); }
th.sortable[aria-sort] button { color: var(--brand); }
th.sortable .sort-ic { opacity: 0.4; font-size: 10px; }
th.sortable[aria-sort="ascending"] .sort-ic::after { content: "▲"; opacity: 1; }
th.sortable[aria-sort="descending"] .sort-ic::after { content: "▼"; opacity: 1; }
th.sortable:not([aria-sort]) .sort-ic::after { content: "▲▼"; font-size: 8px; }

/* 行内操作 */
.row-actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions .icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.row-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 进度条 */
.prog { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 3px; background: var(--brand-grad); transition: width 0.4s ease; }
.prog.green > i { background: var(--ok); }
.prog.amber > i { background: var(--warn); }
.prog-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.prog-cell .prog { flex: 1; }

/* 得分环 */
.ring { position: relative; width: 92px; height: 92px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 22px; font-weight: 700; line-height: 1;
}
.ring .ring-val small { display: block; font-size: 10px; color: var(--text-3); font-weight: 400; text-align: center; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label, .field .flabel { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field .error-msg { font-size: 11.5px; color: var(--danger); margin-top: 5px; display: none; }
.field.has-error .error-msg { display: block; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  background: var(--surface); font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea { height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus-ring);
}
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.input-wrap { position: relative; }
.input-wrap .ic {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.input-wrap .input { padding-left: 32px; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2359617a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}

/* 复选框 / 单选框 */
.cbox { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; }
.cbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cbox .box {
  width: 16px; height: 16px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--border-2); border-radius: 4px;
  display: grid; place-items: center; color: #fff;
  transition: all 0.12s ease; background: var(--surface);
}
.cbox .box .ic { width: 11px; height: 11px; opacity: 0; }
.cbox input:checked + .box { background: var(--brand); border-color: var(--brand); }
.cbox input:checked + .box .ic { opacity: 1; }
.cbox input:focus-visible + .box { box-shadow: var(--focus-ring); }
.cbox input:indeterminate + .box { background: var(--brand); border-color: var(--brand); }
.radio .box { border-radius: 50%; }
.radio .box::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; }
.radio input:checked + .box::after { opacity: 1; }
.radio input:checked + .box .ic { display: none; }

/* 开关 */
.switch {
  position: relative; width: 38px; height: 22px; flex: none; border-radius: 11px;
  background: var(--border-2); transition: background 0.15s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: left 0.15s ease;
}
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { left: 19px; }

/* 列表行（设置/待办等） */
.li-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.li-row:last-child { border-bottom: none; }
.li-row:hover { background: var(--surface-2); }
.li-row .grow { flex: 1; min-width: 0; }
.li-row .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- 空状态 ---------- */
.empty { padding: 48px 20px; text-align: center; }
.empty .empty-ic {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-3);
  display: grid; place-items: center;
}
.empty .empty-ic .ic { width: 22px; height: 22px; }
.empty h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }

/* ---------- 分页 ---------- */
.pg { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pg .pg-info { font-size: 12px; color: var(--text-3); margin-right: auto; }
.pg button {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text-2);
  display: grid; place-items: center;
}
.pg button:hover:not(:disabled):not(.cur) { background: var(--surface-2); color: var(--text); }
.pg button.cur { background: var(--brand); color: #fff; font-weight: 600; }
.pg button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 覆盖层（弹窗/抽屉/命令面板） ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 22, 43, 0.45);
  display: grid; place-items: center;
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(2px);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes slideInR { from { transform: translateX(40px); opacity: 0; } }
.modal {
  width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 60px);
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: popIn 0.18s ease;
}
.modal.sm { width: min(420px, calc(100vw - 40px)); }
.modal.lg { width: min(720px, calc(100vw - 40px)); }
.modal-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex: none;
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head .sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border); flex: none; flex-wrap: wrap;
}
.modal-foot .left { margin-right: auto; display: flex; align-items: center; gap: 8px; }

/* 抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(520px, 92vw); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slideInR 0.18s ease;
}
.drawer-head {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot {
  flex: none; display: flex; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}

/* 下拉菜单 */
.dd {
  position: absolute; z-index: 120; min-width: 208px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: 6px; animation: popIn 0.12s ease;
}
.dd.right { right: 0; }
.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--text);
  text-align: left;
}
.dd-item:hover { background: var(--surface-2); }
.dd-item.danger { color: var(--danger); }
.dd-item.danger:hover { background: var(--danger-soft); }
.dd-item .ic { width: 15px; height: 15px; color: var(--text-3); }
.dd-item.danger .ic { color: var(--danger); }
.dd-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.dd-head { padding: 8px 10px 6px; font-size: 11px; color: var(--text-3); }

/* ---------- 命令面板 ---------- */
.palette {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200;
  width: min(600px, calc(100vw - 40px));
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  overflow: hidden; animation: popIn 0.15s ease;
}
.palette-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.palette-input-row .ic { width: 18px; height: 18px; color: var(--text-3); }
.palette-input-row input {
  flex: 1; border: none; outline: none; font-size: 15px; background: none; color: var(--text);
}
.palette-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.pl-group { font-size: 11px; color: var(--text-3); padding: 8px 10px 4px; }
.pl-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 10px; border-radius: var(--r-md); font-size: 13.5px; text-align: left;
}
.pl-item .ic { width: 16px; height: 16px; color: var(--text-3); }
.pl-item .pl-k { margin-left: auto; color: var(--text-3); font-size: 12px; }
.pl-item.active, .pl-item:hover { background: var(--brand-soft); }
.pl-item.active .ic, .pl-item:hover .ic { color: var(--brand); }
.palette-foot {
  display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); align-items: center;
}
.palette-foot .spacer { flex: 1; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: #23294a; color: #fff; padding: 12px 14px;
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  font-size: 13px; animation: slideInToast 0.2s ease; line-height: 1.5;
}
@keyframes slideInToast { from { opacity: 0; transform: translateX(24px); } }
.toast-light { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.toast .t-ic { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.toast.ok .t-ic { color: #4ade80; }
.toast.info .t-ic { color: #7dd3fc; }
.toast.warn .t-ic { color: #fbbf24; }
.toast.error .t-ic { color: #f87171; }
.toast.ok.icon-less .t-ic { display: none; }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-body strong { display: block; font-weight: 600; margin-bottom: 1px; font-size: 13px; }
.toast .t-act { margin-top: 6px; display: flex; gap: 8px; }
.toast .t-act button { color: #93c5fd; font-size: 12px; padding: 2px 0; }
.toast .t-close { width: 22px; height: 22px; color: rgba(255, 255, 255, 0.6); flex: none; border-radius: 4px; display: grid; place-items: center; }
.toast .t-close:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.toast .t-close .ic { width: 12px; height: 12px; }
.toast.leaving { opacity: 0; transform: translateX(24px); transition: all 0.18s ease; }

/* ---------- 图表 ---------- */
.chart-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.chart-legend button {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2); padding: 3px 8px; border-radius: 10px;
}
.chart-legend button:hover { background: var(--surface-2); }
.chart-legend button .sw { width: 14px; height: 3px; border-radius: 2px; }
.chart-legend button[aria-pressed="false"] { opacity: 0.45; }
.chart-legend button[aria-pressed="false"] .sw { background: var(--text-3) !important; }
.chart-box { position: relative; }
.chart-box svg.line { width: 100%; height: auto; display: block; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: #23294a; color: #fff; font-size: 11.5px; line-height: 1.5;
  padding: 6px 10px; border-radius: var(--r-sm); white-space: nowrap;
  transform: translate(-50%, -110%); box-shadow: var(--shadow-md);
}
.chart-tip b { font-size: 12px; }
.chart-tip .row { color: #c7cdf0; }
.chart-tip .row i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }

.donut-wrap { display: flex; flex-direction: column; gap: 14px; }
.donut-box { position: relative; width: 190px; height: 190px; margin: 4px auto; }
.donut-box svg { width: 100%; height: 100%; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none;
}
.donut-center b { font-size: 20px; display: block; }
.donut-center span { font-size: 11px; color: var(--text-3); }
.donut-legend { display: grid; gap: 2px; }
.donut-legend button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border-radius: var(--r-sm); font-size: 12.5px; text-align: left;
}
.donut-legend button:hover { background: var(--surface-2); }
.donut-legend button[aria-pressed="false"] { opacity: 0.4; }
.donut-legend .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.donut-legend .lg { flex: 1; text-align: left; }
.donut-legend .lv { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 横向条形图 */
.hbar-rows { display: flex; flex-direction: column; gap: 14px; }
.hbar {
  display: block; width: 100%; text-align: left; cursor: pointer;
}
.hbar-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.hbar-top b { font-weight: 600; }
.hbar-top span { color: var(--text-3); }
.hbar-track { height: 9px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.hbar-fill {
  height: 100%; border-radius: 5px; width: 0;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hbar-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: block; }
.hbar:hover .hbar-fill { filter: brightness(1.08); }
.hbar:focus-visible .hbar-track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 抽屉详情内容 ---------- */
.ans-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--brand); border-radius: var(--r-md);
  padding: 14px 16px; font-size: 13px; line-height: 1.8; color: var(--text-2);
}
.ans-block mark { background: #fff3bf; color: var(--text); border-radius: 3px; padding: 0 3px; font-weight: 500; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meta-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; }
.meta-cell .k { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.meta-cell .v { font-size: 14px; font-weight: 600; }
.src-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 8px; font-size: 12.5px;
  transition: border-color 0.12s ease;
}
.src-item:hover { border-color: var(--brand); }
.src-item .fav { width: 20px; height: 20px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.src-item .fav .ic { width: 11px; height: 11px; }
.src-item .s-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-item .s-d { font-size: 11px; color: var(--text-3); display: block; }
.src-item .s-u { font-size: 11px; color: var(--info); display: block; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 得分构成（Iter1：可解释评分） ---------- */
.sbd { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface-2); }
.sbd-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.sbd-k { width: 88px; flex: none; font-size: 12px; color: var(--text-2); }
.sbd-k small { display: block; font-size: 10px; color: var(--text-3); }
.sbd-track { flex: 1; height: 7px; border-radius: 4px; background: #e8ebf3; overflow: hidden; }
.sbd-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), #7aa2ff); transition: width 0.3s ease; }
.sbd-v { width: 28px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.ev-note { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--text-3); margin: 10px 0 0; line-height: 1.7; }
.ev-note .ic { width: 12px; height: 12px; flex: none; margin-top: 2px; }
.sbd-legacy { background: #fffaf0; border-color: #f5c26b; }
.sbd-legacy .ev-note { margin: 0; color: #8a5a00; }

/* ---------- 内容执行表（多客户工作表） ---------- */
/* 渠道打勾：未发是虚线灰，已发是实线绿 —— 一眼能看出这篇还差哪几个平台 */
.ws-chs { display: flex; flex-wrap: wrap; gap: 4px; }
.ws-ch {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px;
  border: 1px dashed var(--line); background: transparent; color: var(--text-3);
  cursor: pointer; transition: all 0.15s ease; font-family: inherit;
}
.ws-ch:hover { border-color: var(--brand); color: var(--brand); }
.ws-ch.on { border-style: solid; border-color: #1a7f4b; background: #eaf7f0; color: #1a7f4b; font-weight: 600; }
/* 登记过但没回填链接：这是最容易烂尾的一步，用琥珀色单独标出来 */
.ws-ch.warn { border-style: solid; border-color: #d97706; background: #fffbeb; color: #b45309; font-weight: 600; }
.ws-ch.more { border-color: var(--brand-soft); color: var(--brand); }
.ws-ch:disabled { opacity: 0.5; cursor: default; }
.ws-tbl td { vertical-align: top; }
.ws-tbl tr.ws-done { background: #f7fdf9; }
.ws-tbl tr.ws-done td:first-child { box-shadow: inset 3px 0 0 #1a7f4b; }

/* ---------- 执行表「按平台看」 ---------- */
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.cb-card {
  text-align: left; padding: 12px 13px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); font-family: inherit;
  transition: all 0.15s ease; display: block;
}
.cb-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.cb-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.cb-card .k { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 5px; }
.cb-card .n { font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 6px; }
.cb-card .n.zero { color: var(--text-3); }
.cb-card .d { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }
.cb-card .d .lack { color: #b45309; font-weight: 600; }
.cb-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 8px; background: var(--line); }
.cb-bar i { display: block; }
.cb-bar .ok { background: #1a7f4b; }
.cb-bar .no { background: #f0b429; }
.geo-advice { margin: 10px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.9; }
.geo-advice li { margin-bottom: 3px; }
.geo-advice li::marker { color: var(--brand); }

/* 品牌级多维指标（Iter1：把「综合得分」拆成客户能追问的 4 个数） */
.dim-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dim-cell { border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 13px; background: var(--surface); }
.dim-cell .k { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.dim-cell .v { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dim-cell .d { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.dim-cell.warn { border-color: #f5c26b; background: #fffaf0; }
.dim-cell.warn .v { color: #b45309; }

/* 分页跳页（Iter1：修复第 6 页以后点不到） */
.pg .pg-gap { color: var(--text-3); font-size: 12px; padding: 0 2px; }
.pg .pg-jump { font-size: 12px; color: var(--text-3); margin-left: auto; display: flex; align-items: center; gap: 5px; }
.pg .pg-input { width: 52px; height: 26px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; text-align: center; }

/* 建议列表 */
.sug-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: 10px; background: var(--surface);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.sug-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.sug-item.adopted { opacity: 0.65; background: var(--surface-2); }
.sug-body { flex: 1; min-width: 0; }
.sug-body p { font-size: 13px; line-height: 1.65; margin: 6px 0 8px; }
.sug-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.sug-meta .imp { color: var(--ok); font-weight: 600; }

/* ---------- 内容列表 ---------- */
.doc-list { display: flex; flex-direction: column; }
.doc-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  transition: background 0.1s ease;
}
.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--surface-2); }
.doc-item[aria-current="true"] { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.doc-item .d-t { font-size: 13px; font-weight: 500; line-height: 1.5; }
.doc-item .d-m { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.doc-score { flex: none; text-align: center; min-width: 46px; }
.doc-score b { font-size: 17px; display: block; line-height: 1.1; }
.doc-score span { font-size: 10.5px; color: var(--text-3); }
.doc-score.good b { color: var(--ok); }
.doc-score.mid b { color: var(--warn); }
.doc-score.bad b { color: var(--danger); }

/* ---------- 竞品卡片 ---------- */
.comp-card {
  padding: 16px; text-align: left; width: 100%; display: block; position: relative;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.comp-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.comp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.comp-logo { width: 34px; height: 34px; border-radius: 9px; color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; flex: none; }
.comp-head .c-n { flex: 1; min-width: 0; }
.comp-head .c-n b { font-size: 14px; display: block; }
.comp-head .c-n span { font-size: 11px; color: var(--text-3); }
.comp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.comp-stat { background: var(--surface-2); border-radius: var(--r-md); padding: 8px 10px; }
.comp-stat .k { font-size: 10.5px; color: var(--text-3); }
.comp-stat .v { font-size: 15px; font-weight: 700; margin-top: 2px; }
.comp-stat .v .up { color: var(--danger); font-size: 10.5px; font-weight: 600; margin-left: 3px; }
.comp-stat .v .down { color: var(--ok); font-size: 10.5px; font-weight: 600; margin-left: 3px; }
.comp-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.comp-foot .btn-text { margin-left: auto; }

/* 漏斗热度条 */
.heat-cell { display: flex; align-items: center; gap: 8px; }
.heat-cell .prog { flex: 1; max-width: 90px; }

/* ---------- 通知面板 ---------- */
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; }
.notif-head b { font-size: 13px; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px; border-radius: var(--r-sm); font-size: 12.5px;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item .n-ic {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--brand);
}
.notif-item .n-ic .ic { width: 14px; height: 14px; }
.notif-item .dot-new { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.notif-item .n-t { flex: 1; min-width: 0; }
.notif-item .n-t b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.notif-item .n-t span { color: var(--text-3); font-size: 11.5px; line-height: 1.5; display: block; }
.notif-item .n-time { font-size: 10.5px; color: var(--text-3); flex: none; margin-top: 1px; }
.notif-foot { border-top: 1px solid var(--border); margin-top: 4px; padding: 8px 4px 2px; display: flex; }

/* ---------- 交互说明页 ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.guide-card {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  padding: 16px; transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.guide-card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.guide-card .g-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.guide-card .g-ic .ic { width: 17px; height: 17px; }
.guide-card b { font-size: 13.5px; display: block; margin-bottom: 4px; }
.guide-card p { font-size: 12px; color: var(--text-3); line-height: 1.6; }
.kbd-table td { padding: 8px 12px; }
.demo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.demo-row:last-child { border-bottom: none; }
.demo-row .demo-label { width: 150px; font-size: 12.5px; color: var(--text-2); flex: none; }
.demo-row .demo-label small { display: block; color: var(--text-3); font-size: 11px; margin-top: 2px; }
.state-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.state-dot:hover { background: var(--surface-2); }
.state-dot i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }
.checklist-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--border); cursor: pointer; border-radius: var(--r-sm); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--surface-2); }
.checklist-item .box { margin-top: 1px; }
.checklist-item.done { color: var(--text-3); }
.checklist-item.done .txt { text-decoration: line-through; }

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .kpi-spark { display: none; }
}
@media (max-width: 960px) {
  .app.collapsed .sidebar, .sidebar { width: var(--sb-w-min); }
  .app.collapsed .sb-item .sb-label, .sb-item .sb-label { display: none; }
  .sb-item { justify-content: center; padding: 10px; }
  .sb-group-label { display: none; }
  .sb-user-info, .sb-user .icon-btn { display: none; }
  .sb-user { justify-content: center; }
  .page-sub { display: none; }
  .meta-grid, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .tb-actions .tb-search { display: none; }
}

/* ---------- 侧边栏 Tooltip（仅折叠态显示，位于条目右侧） ---------- */
.sb-item[data-tip]::after { display: none; }
.app.collapsed .sb-item[data-tip]:hover::after,
.app.collapsed .sb-item[data-tip]:focus-visible::after {
  display: block;
  left: calc(100% + 14px);
  top: 50%; bottom: auto;
  transform: translateY(-50%);
  opacity: 1;
}

/* ---------- 后端连通性指示（图标化，无文字徽标） ---------- */
.api-status {
  display: grid; place-items: center;
  width: 100%; margin: 0 0 8px; padding: 9px 0;
  border-radius: var(--r-md);
  background: var(--sidebar-2);
  transition: background 0.12s ease, transform 0.12s ease;
}
.api-status:hover { background: var(--sidebar-active); transform: scale(1.03); }
/* ================= 内容列表 · 片段定位（采纳建议跳转高亮） ================= */
.frag-sec {
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 10px;
  scroll-margin: 12px;
  transition: background .3s, border-color .3s;
}
.frag-sec .frag-h { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; display: flex; align-items: center; }
.frag-sec .frag-t { font-size: 13px; line-height: 1.7; color: var(--text); margin: 0; }
.frag-sec.frag-target {
  background: var(--brand-soft, #eef0ff);
  border-color: var(--brand);
}
.frag-sec.frag-target .frag-h { color: var(--brand); }
.frag-sec.frag-target mark {
  background: #fff3bf;
  color: var(--text);
  border-radius: 3px;
  padding: 0 3px;
  font-weight: 500;
  outline: 2px solid rgba(217, 119, 6, .35);
}
.frag-sec:not(.frag-target) { opacity: .72; }

/* ================= 内容详情 · 连续文章排版 ================= */
.art-doc .art-h { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 20px 0 6px; }
.art-doc .art-h:first-child { margin-top: 2px; }
.art-doc .art-p { font-size: 13.5px; line-height: 1.9; color: var(--text-2); margin: 0 0 10px; text-align: justify; }
.art-doc .art-p:last-child { margin-bottom: 2px; }

/* ================= 编辑并采纳 · 双栏编辑器 ================= */
.modal.xl { width: min(1060px, calc(100vw - 40px)); }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.ed-grid .ed-preview {
  max-height: 56vh; overflow: auto; padding: 10px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--paper, #faf6f0);
}
.ed-grid .ed-preview .frag-sec { background: #fff; }
.ed-grid textarea#ed-body { height: 56vh; resize: vertical; font-size: 13px; line-height: 1.7; }
@media (max-width: 960px) {
  .ed-grid { grid-template-columns: 1fr; }
  .ed-grid .ed-preview { max-height: 26vh; }
  .ed-grid textarea#ed-body { height: 34vh; }
}

/* 编辑器双栏 · 字号与定位强化 */
.ed-grid textarea#ed-body { width: 100%; font-family: inherit; }
.ed-grid .ed-preview .frag-h { font-size: 14.5px; font-weight: 600; }
.ed-grid .ed-preview .frag-t { font-size: 14px; line-height: 1.85; }
.ed-grid .ed-preview .frag-sec.frag-target {
  outline: 2px solid var(--danger, #dc2626);
  outline-offset: -1px;
}

/* ================= 编辑器 · 近全屏模式 ================= */
.modal.full { width: calc(100vw - 48px); height: calc(100vh - 48px); max-width: none; max-height: none; }
.modal.full .modal-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.modal.full .ed-grid { flex: 1; min-height: 0; }
.modal.full .ed-grid > div { display: flex; flex-direction: column; min-height: 0; }
.modal.full .ed-preview { flex: 1; max-height: none; }
.modal.full textarea#ed-body { flex: 1; height: auto; max-height: none; }

/* ================= 编辑器 · 分节富文本 ================= */
.ed-sections { overflow: auto; padding-right: 4px; }
.sec-edit { background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; margin-bottom: 10px; padding: 10px 12px; }
.sec-edit:focus-within { border-color: var(--brand); }
.sec-edit-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sec-no { font-size: 12px; color: var(--text-3); font-weight: 600; margin-right: 4px; }
.sec-btn { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 6px; min-width: 26px; height: 24px; font-size: 12px; cursor: pointer; color: var(--text-2); display: inline-grid; place-items: center; }
.sec-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.sec-btn:disabled { opacity: .4; cursor: not-allowed; }
.sec-h-input { width: 100%; border: none; border-bottom: 1px dashed var(--border, #e5e7eb); font-size: 14.5px; font-weight: 600; padding: 4px 2px; margin-bottom: 8px; background: transparent; outline: none; color: var(--text); }
.sec-h-input:focus { border-bottom-color: var(--brand); }
.sec-t-edit { min-height: 72px; font-size: 14px; line-height: 1.8; color: var(--text); outline: none; }
.sec-t-edit:focus { min-height: 72px; }
.sec-t-edit:empty::before { content: attr(data-ph); color: var(--text-3); }
.ed-add { width: 100%; border: 1px dashed var(--border, #e5e7eb); background: transparent; border-radius: 10px; padding: 10px; color: var(--text-3); font-size: 13px; cursor: pointer; }
.ed-add:hover { color: var(--brand); border-color: var(--brand); }
.modal.full .ed-sections { flex: 1; min-height: 0; }

/* 编辑器 · 插图显示 */
.sec-t-edit img, .frag-t img, .art-p img { max-width: 100%; border-radius: 8px; margin: 6px 0; }

/* ================= 编辑器 · 图片选中工具条与底色统一 ================= */
.ed-preview { background: #fff; }
.ed-grid .ed-preview .frag-sec { background: #fff; }
.modal { position: relative; }
.sec-t-edit img { cursor: pointer; }
.sec-t-edit img.img-selected { outline: 2px solid var(--brand); outline-offset: 2px; }
#img-tools { position: absolute; z-index: 30; display: none; align-items: center; background: #2c2c2a; border-radius: 8px; padding: 5px 7px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
#img-tools button { border: none; background: transparent; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
#img-tools button:hover { background: rgba(255, 255, 255, .18); }
#img-tools .sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .3); margin: 0 4px; }

/* 编辑器图片 · 手动宽度输入 + 编辑态图片块级显示（对齐生效前提） */
#img-w { width: 52px; background: #fff; color: #2c2c2a; border: none; border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.sec-t-edit img { display: block; }

/* ================= 编辑器 · 图片拖拽缩放手柄与拖动 ================= */
#img-resize-overlay { position: absolute; z-index: 29; pointer-events: none; }
.img-handle { position: absolute; width: 12px; height: 12px; background: var(--brand); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); pointer-events: auto; }
.img-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.img-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.img-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.img-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.frag-t img, .art-p img, .sec-t-edit img { display: block; max-width: 100%; border-radius: 8px; margin: 6px 0; }
