/* =========================================================
   GeoPilot 智见 — 设计系统
   视觉基线：浅灰底 + 白色卡片 + 靛蓝主色，紧凑型 B 端控制台
   ========================================================= */

:root {
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef0fe;
  --brand-softer: #f5f6ff;

  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;

  --text: #1f2329;
  --text-2: #5f6672;
  --text-3: #9aa1ac;
  --text-4: #c3c8d0;

  --line: #edeff3;
  --line-2: #e5e7eb;

  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;

  --radius: 8px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.12);

  --sidebar-w: 232px;
  --topbar-h: 60px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: #ddd9ff; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.logo {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.logo-mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--brand);
}
.logo-text { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.logo-text em { font-style: normal; color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 4px; }

.nav { padding: 12px 10px 24px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 6px; }
.nav-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  border-radius: 6px; user-select: none;
}
.nav-group-head:hover { background: var(--panel-2); }
.nav-group-head .chev { margin-left: auto; color: var(--text-4); transition: transform .16s; }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 12px 0 14px;
  border-radius: 6px; color: var(--text-2);
  font-size: 13px; cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item svg { flex: 0 0 auto; opacity: .85; }
.nav-item.active svg { opacity: 1; }
.nav-item .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
}
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who b { display: block; font-size: 12.5px; font-weight: 600; }
.sidebar-foot .who span { display: block; font-size: 11.5px; color: var(--text-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: .2px; }
.topbar .breadcrumb { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.topbar .spacer { flex: 1; }

.filters { display: flex; align-items: center; gap: 10px; }

.view { padding: 22px 24px 48px; }

/* ---------------- 控件 ---------------- */
.ctrl {
  height: 32px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ctrl:hover { border-color: #d6d9e0; }
.ctrl svg { color: var(--text-3); }
select.ctrl { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ac' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; }

.btn {
  height: 32px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font-size: 12.5px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #d6d9e0; background: var(--panel-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px;
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-head .sub { color: var(--text-3); font-size: 12px; }
.card-head .spacer { flex: 1; }

.section { margin-bottom: 18px; }
.section-title { font-size: 14px; font-weight: 650; margin: 0 0 4px; }
.section-desc { color: var(--text-3); font-size: 12px; margin: 0 0 12px; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kpi {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  min-height: 108px;
  box-shadow: var(--shadow);
}
.kpi .label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.kpi .label .hint { color: var(--text-4); cursor: help; }
.kpi .value { font-size: 27px; font-weight: 700; letter-spacing: -.5px; margin: 10px 0 8px; line-height: 1.1; }
.kpi .value small { font-size: 15px; font-weight: 600; margin-left: 1px; }
.kpi .delta { font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.kpi .delta .up { color: var(--ok); }
.kpi .delta .down { color: var(--danger); }
.kpi .delta .flat { color: var(--text-3); }
.kpi .corner { position: absolute; top: 14px; right: 14px; color: var(--text-4); }

.kpi.primary {
  background: linear-gradient(135deg, #5b6cff 0%, #4f46e5 55%, #4b3fe0 100%);
  border-color: transparent;
  color: #fff;
}
.kpi.primary .label { color: rgba(255,255,255,.82); }
.kpi.primary .corner { color: rgba(255,255,255,.7); }
.kpi.primary .delta { color: rgba(255,255,255,.9); }
.kpi.primary .delta .up, .kpi.primary .delta .down { color: #fff; }
.kpi.primary .value { color: #fff; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
tbl, .tbl { font-size: 12.5px; }
.tbl thead th {
  text-align: left; font-weight: 500; color: var(--text-3);
  background: #f7f8fa; padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tbl thead th:first-child { border-top-left-radius: 6px; }
.tbl thead th:last-child { border-top-right-radius: 6px; }
.tbl tbody td {
  padding: 12px 14px; border-bottom: 1px solid #f1f2f5;
  color: var(--text); vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl tbody tr.is-self { background: #f7f8ff; }
.tbl tbody tr.is-self:hover { background: #f2f3ff; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--text-3); }
.tbl .center { text-align: center; }
.tbl .right { text-align: right; }

.rank {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.rank.r1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); }
.rank.r2 { background: linear-gradient(135deg,#cbd5e1,#94a3b8); }
.rank.r3 { background: linear-gradient(135deg,#fdba74,#f97316); }
.rank.rn { background: #f1f2f5; color: var(--text-2); font-weight: 600; }

.brand-cell { display: flex; align-items: center; gap: 9px; }
.brand-logo {
  width: 24px; height: 24px; border-radius: 5px;
  background: #f1f2f5; color: var(--text-2);
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-track { width: 56px; height: 4px; border-radius: 3px; background: #eceefe; overflow: hidden; flex: 0 0 auto; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--brand); }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 600; }

.delta-inline { font-size: 11px; margin-left: 6px; }
.delta-inline.up { color: var(--ok); }
.delta-inline.down { color: var(--danger); }

/* ---------------- 标签 / 状态 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 11.5px; background: #f3f4f6; color: var(--text-2);
  white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.outline { background: #fff; border: 1px solid var(--line-2); }

.dot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.dot-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.dot-status.on i { background: var(--ok); }
.dot-status.off i { background: var(--text-4); }

/* ---------------- 分段控件 / Tabs ---------------- */
.segmented {
  display: inline-flex; align-items: center; gap: 2px;
  background: #f4f5f7; border-radius: 7px; padding: 3px;
}
.segmented button {
  height: 26px; padding: 0 12px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer;
}
.segmented button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button {
  position: relative; background: none; border: 0; padding: 0 0 10px;
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.tabs button.active { color: var(--brand); font-weight: 600; }
.tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--brand); border-radius: 2px;
}

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; padding: 14px 16px; color: var(--text-2); font-size: 12px; }
.pager .spacer { flex: 1; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button {
  min-width: 26px; height: 26px; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer;
}
.pager .pages button:hover { background: var(--panel-2); }
.pager .pages button.active { border-color: var(--brand); color: var(--brand); background: #fff; font-weight: 600; }
.pager .pages button:disabled { color: var(--text-4); cursor: default; }

/* ---------------- 图表 ---------------- */
.chart-box { padding: 6px 20px 16px; }
.chart-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--text-2); padding: 0 4px 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid-line { stroke: #f1f2f5; stroke-width: 1; }
svg.chart .axis-label { fill: #9aa1ac; font-size: 10px; }
svg.chart .series { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .area { fill: url(#gradArea); opacity: .5; }
svg.chart .point { fill: #fff; stroke: var(--brand); stroke-width: 2; }
svg.chart .point:hover { r: 4.5; }

/* 横向占比条 */
.split-bar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; }
.split-bar div { display: grid; place-items: center; font-size: 11.5px; color: #fff; font-weight: 600; }

/* ---------------- 弹窗 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .38);
  display: grid; place-items: center; z-index: 100; padding: 24px;
  animation: fade .14s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-pop);
  width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.modal-head .spacer { flex: 1; }
.modal-head .close { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- 提示 ---------------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1f2329; color: #fff; padding: 9px 16px; border-radius: 7px;
  font-size: 12.5px; box-shadow: var(--shadow-pop); animation: pop .16s ease-out;
}

/* ---------------- 空状态 ---------------- */
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty .ico { font-size: 26px; margin-bottom: 8px; opacity: .5; }

/* ---------------- 工具类 ---------------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.clickable { cursor: pointer; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* 进度条 */
.progress { height: 6px; background: #f1f2f5; border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 4px; }

/* 描述列表 */
.dl { display: grid; grid-template-columns: 108px 1fr; row-gap: 10px; column-gap: 12px; font-size: 12.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); }

/* 问答快照 */
.qa-card { display: flex; gap: 18px; padding: 20px; }
.qa-side { width: 128px; flex: 0 0 128px; text-align: center; }
.qa-platform { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.plat-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 700; }
.qa-side .meta { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.qa-side .ops { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.qa-main { flex: 1; min-width: 0; }
.qa-quote { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.kw-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.kw { font-size: 11.5px; color: var(--text-2); background: #f6f7f9; border-radius: 4px; padding: 3px 8px; }
.qa-block { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.qa-block h4 { margin: 0 0 6px; font-size: 13.5px; }
.qa-block p { margin: 0 0 8px; color: var(--text-2); font-size: 12.5px; line-height: 1.75; }
.qa-block ul { margin: 4px 0 10px; padding-left: 18px; color: var(--text-2); font-size: 12.5px; line-height: 1.8; }
.qa-block .pros li::marker { color: var(--ok); }
.qa-block .cons li::marker { color: var(--danger); }

/* 引用内容条目 */
.cite-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f2f5; }
.cite-item:last-child { border-bottom: 0; }
.cite-idx { width: 22px; flex: 0 0 22px; color: var(--text-3); font-size: 12px; text-align: center; }
.cite-main { min-width: 0; flex: 1; }
.cite-title { font-size: 12.8px; margin-bottom: 4px; }
.cite-meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 11.5px; flex-wrap: wrap; }
.cite-count { color: var(--brand); font-weight: 700; font-size: 12.5px; }

/* 平台小图标 */
.pchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.pchip i { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 8px; font-weight: 700; }

/* 文件列表 */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f2f5; }
.doc-row:last-child { border-bottom: 0; }
.doc-ico { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #fff; flex: 0 0 auto; }
.doc-ico.pdf { background: #ef4444; }
.doc-ico.docx { background: #2563eb; }
.doc-ico.pptx { background: #ea580c; }
.doc-ico.xlsx { background: #16a34a; }
.doc-ico.md { background: #64748b; }
.doc-name { font-size: 12.8px; }
.doc-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 10px; margin-top: 2px; }

/* 智能体卡片 */
.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.agent-card { padding: 18px 18px 16px; border-radius: 10px; background: linear-gradient(180deg,#fbfbff,#f7f8ff); border: 1px solid #eceefb; }
.agent-card .top { display: flex; align-items: flex-start; gap: 10px; }
.agent-card h4 { margin: 0; font-size: 13.5px; font-weight: 650; }
.agent-card .en { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.agent-card .ico { margin-left: auto; color: #b7bcf0; }
.agent-card p { color: var(--text-2); font-size: 12px; line-height: 1.7; margin: 10px 0; min-height: 40px; }
.agent-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* 登录页 */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1000px 500px at 15% 0%, #eef0ff 0%, #f5f6f8 55%, #f5f6f8 100%);
  padding: 24px;
}
.login-card { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(16,24,40,.08); padding: 30px 28px 24px; }
.login-card .brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card .sub { color: var(--text-3); font-size: 12.5px; margin: 0 0 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2);
  border-radius: 7px; font-size: 13px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.login-btn { width: 100%; height: 40px; border-radius: 7px; border: 0; background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.login-btn:hover { background: #4338ca; }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; margin: 8px 0 0; }
.demo-accounts { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.demo-accounts .t { font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; }
.demo-accounts .chips { display: flex; gap: 8px; }
.demo-accounts .chip {
  flex: 1; border: 1px solid var(--line-2); border-radius: 7px; padding: 8px 6px;
  text-align: center; cursor: pointer; font-size: 11.5px; color: var(--text-2); background: #fff;
}
.demo-accounts .chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-softer); }
.demo-accounts .chip b { display: block; font-size: 12px; color: var(--text); margin-bottom: 1px; }

/* 角色切换徽标 */
.role-badge { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 响应式 */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar { position: fixed; left: -240px; transition: left .2s; z-index: 50; width: 232px; }
  .sidebar.open { left: 0; }
  .kpi-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
}

/* ---------------- 开关 / 单选 ---------------- */
.switch {
  display: inline-block; width: 36px; height: 20px; border-radius: 10px;
  background: #d1d5db; position: relative; cursor: pointer;
  transition: background .15s; flex: 0 0 auto; vertical-align: middle;
}
.switch.on { background: var(--brand); }
.switch i {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: left .15s;
}
.switch.on i { left: 18px; }

.radio {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid #cbd0d8; background: #fff; position: relative; flex: 0 0 auto;
}
.radio.on { border-color: var(--brand); }
.radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }

/* ---------------- 悬浮提示 ---------------- */
.hint {
  position: relative; display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--text-4); color: var(--text-3);
  font-size: 10px; cursor: help; line-height: 1; margin-left: 3px;
  font-style: normal; vertical-align: middle;
}
.hint::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 9px);
  transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 280px;
  background: #1f2329; color: #fff; font-size: 11.5px; line-height: 1.65;
  padding: 8px 11px; border-radius: 6px; white-space: normal;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 400;
  text-align: left; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.hint::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 4px);
  transform: translateX(-50%); border: 5px solid transparent;
  border-top-color: #1f2329; opacity: 0; transition: opacity .15s; z-index: 400;
}
.hint:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.hint:hover::before { opacity: 1; }

/* 登录页演示账号选中态 */
.demo-accounts .chip { transition: all .15s; }
.demo-accounts .chip.active {
  border-color: var(--brand); background: var(--brand-softer); color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79,70,229,.10);
}
.demo-accounts .chip.active b { color: var(--brand); }
.demo-accounts .chip.active::after {
  content: "✓"; position: absolute; top: 4px; right: 6px; font-size: 10px; color: var(--brand);
}
.demo-accounts .chip { position: relative; }

/* 问号提示：更轻的样式 */
.hint {
  border: 0; background: rgba(31,35,41,.07); color: var(--text-2);
  width: 15px; height: 15px; font-size: 10px; font-weight: 600;
}
.kpi.primary .hint { background: rgba(255,255,255,.22); color: #fff; }
.kpi .label { white-space: nowrap; }

/* 问号：圆内绝对居中 */
.hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; line-height: 1; padding: 0; margin: 0 0 0 4px;
  font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 10.5px;
  border-radius: 50%; background: rgba(31,35,41,.08); color: var(--text-3);
  vertical-align: middle; transform: translateY(-1px);
}
.kpi.primary .hint { background: rgba(255,255,255,.24); color: #fff; }
.hint:hover { background: rgba(31,35,41,.16); color: var(--text-2); }
.kpi.primary .hint:hover { background: rgba(255,255,255,.34); color: #fff; }

/* =========================================================
   主题：橄榄绿 + 侧边栏层级
   ========================================================= */
:root {
  --brand: #6B7C3A;
  --brand-2: #7F9150;
  --brand-soft: #EEF1E1;
  --brand-softer: #F7F9EE;
  --brand-ink: #55632C;
}
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: #5A682F; border-color: #5A682F; }
.login-btn { background: var(--brand); }
.login-btn:hover { background: #5A682F; }
.kpi.primary { background: linear-gradient(135deg, #8A9A52 0%, #6B7C3A 55%, #5A682F 100%); }
.avatar { background: linear-gradient(135deg, #8A9A52, #6B7C3A); }
.tbl tbody tr.is-self { background: #F7F9EE; }
.tbl tbody tr.is-self:hover { background: #F1F4E4; }
.agent-card { background: linear-gradient(180deg, #FCFDF7, #F7F9EE); border-color: #E7EBD8; }
.login-page { background: radial-gradient(1000px 500px at 15% 0%, #F1F3E4 0%, #F5F6F8 55%, #F5F6F8 100%); }

/* 主目录（分组）与子目录（页面）拉开层级 */
.nav-group-head {
  font-size: 11.5px; color: var(--text-3); font-weight: 600;
  letter-spacing: .5px; padding: 13px 10px 6px;
}
.nav-group-head:hover { background: transparent; color: var(--text-2); }
.nav-group-head svg { opacity: .5; }
.nav-items { gap: 1px; }
.nav-item { font-size: 13.5px; color: #3C4149; height: 36px; }
.nav-item:hover { background: var(--brand-softer); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav-item.active svg { opacity: 1; color: var(--brand); }

/* 提示层级修复：悬停的卡片抬到 topbar 之上，避免 tooltip 被裁切 */
.kpi { position: relative; }
.kpi:hover { z-index: 40; }
.card:hover { z-index: 35; }
.hint {
  transform: none; margin-top: -1px;   /* 去掉 transform，避免生成新的层叠上下文 */
}
.hint::after { z-index: 900; }
.hint::before { z-index: 900; }
/* 最右侧卡片的提示向左收，避免超出视口 */
.kpi:last-child .hint::after { left: auto; right: -8px; transform: translateY(4px); }
.kpi:last-child .hint:hover::after { transform: translateY(0); }
.kpi:last-child .hint::before { left: auto; right: 6px; transform: none; }

.card { position: relative; }

/* 主目录再加强：更大更粗更深 */
.nav-group-head { font-size: 13.5px; font-weight: 700; color: #3C4149; letter-spacing: .2px; }
.nav-item { font-size: 13px; color: #5F6672; }
.nav-item.active { color: var(--brand-ink); font-weight: 650; }

/* 日期区间控件 */
.range { position: relative; }
.range-panel {
  display: none; position: absolute; right: 0; top: 38px; width: 330px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 14px 36px rgba(16,24,40,.14); padding: 12px; z-index: 120;
}
.range.open .range-panel { display: block; }
.range .ctrl { cursor: pointer; }

/* ===== 主题：苍青 #2E5B4C ===== */
:root {
  --brand: #2E5B4C;
  --brand-2: #3F7263;
  --brand-soft: #E6EFEA;
  --brand-softer: #F2F7F4;
  --brand-ink: #23463B;
}
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: #23463B; border-color: #23463B; }
.login-btn { background: var(--brand); } .login-btn:hover { background: #23463B; }
.kpi.primary { background: linear-gradient(135deg, #3F7263 0%, #2E5B4C 55%, #23463B 100%); }
.avatar { background: linear-gradient(135deg, #3F7263, #2E5B4C); }
.tbl tbody tr.is-self { background: #F2F7F4; } .tbl tbody tr.is-self:hover { background: #EAF2ED; }
.agent-card { background: linear-gradient(180deg, #FBFDFC, #F2F7F4); border-color: #DCE8E2; }
.login-page { background: radial-gradient(1000px 500px at 15% 0%, #EAF2ED 0%, #F5F6F8 55%, #F5F6F8 100%); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-item:hover { background: var(--brand-softer); }
