/* ============================================================
   GEO 监测动态看板 · 设计系统
   浅蓝紫渐变 · 现代金融科技风
   ============================================================ */
:root {
  /* 背景与容器 */
  --bg: #F5F7FB;
  --card: #FFFFFF;
  --hair: #EDF1F8;
  --shadow: 0 4px 20px rgba(80, 110, 255, .10);
  --shadow-sm: 0 2px 10px rgba(80, 110, 255, .08);

  /* 品牌渐变 */
  --grad-a: #4E7CFF;
  --grad-b: #8B5CF6;
  --grad: linear-gradient(135deg, #4E7CFF 0%, #8B5CF6 100%);
  --grad-soft: linear-gradient(90deg, #EAF0FF 0%, #F4EEFF 100%);

  /* 文字 */
  --ink: #1A2140;
  --ink-2: #3D4770;
  --muted: #8A94B0;
  --muted-2: #A9B2C9;

  /* 语义色（固定映射，禁止挪用） */
  --ok: #10B981;        /* 命中 / 爬升 */
  --ok-bg: #E7F8F1;
  --danger: #EF4444;    /* 下滑 */
  --danger-bg: #FDECEC;
  --flat: #98A2B8;      /* 持平 */
  --flat-bg: #F1F3F8;
  --amber: #F59E0B;     /* 待处理 */
  --amber-bg: #FEF5E7;

  /* 图表共用系列色（蓝 / 紫 / 青 / 灰阶） */
  --c-blue: #4E7CFF;
  --c-purple: #8B5CF6;
  --c-cyan: #22D3EE;
  --c-gray: #98A2B8;
  --c-navy: #33407A;
  --grid: rgba(60, 90, 255, .08);
  --axis: #B9C2D8;

  --r-card: 16px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Source Han Sans SC", "Noto Sans SC",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* 极浅蓝紫渐变光斑（装饰层，不干扰阅读） */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  background:
    radial-gradient(760px 300px at 12% -6%, rgba(78, 124, 255, .13), transparent 62%),
    radial-gradient(620px 280px at 88% -10%, rgba(139, 92, 246, .12), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ================= 登录页 ================= */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-soft);
}
.login-card {
  width: 372px;
  background: var(--card);
  border-radius: 20px;
  padding: 38px 34px 26px;
  box-shadow: var(--shadow);
}
.login-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(78, 124, 255, .28);
}
.login-card h1 { font-size: 19px; font-weight: 700; text-align: center; color: var(--ink); }
.login-sub { color: var(--muted); font-size: 12px; text-align: center; margin: 6px 0 22px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.login-card input {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--hair); border-radius: 10px;
  font-size: 13px; outline: none; background: #FBFCFE;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus {
  border-color: var(--grad-a);
  box-shadow: 0 0 0 3px rgba(78, 124, 255, .12);
}
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-top: 8px; }
.login-foot { margin-top: 18px; font-size: 11px; color: var(--muted); text-align: center; }

/* ================= 按钮 ================= */
.btn {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--hair);
  background: #fff;
  color: var(--ink-2);
  transition: all .16s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--grad-a); color: var(--grad-a); }
.btn-grad {
  background: var(--grad);
  color: #fff;
  border: none;
  box-shadow: 0 3px 12px rgba(78, 124, 255, .26);
}
.btn-grad:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 5px 16px rgba(78, 124, 255, .32); }
.btn-ghost { background: #fff; border: 1px solid #D8DEF0; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--c-purple); color: var(--c-purple); }
/* 筛选栏内按钮同步放大 */
.filterbar .btn { padding: 8px 20px; font-size: 14px; border-radius: var(--r-pill); }

/* ================= 头部 ================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
  padding: 13px 28px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  box-shadow: 0 4px 12px rgba(78, 124, 255, .26);
  flex: none;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .2px; }
.brand-txt span { font-size: 11px; color: var(--muted); }
.top-meta { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }

/* 自动刷新开关 */
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 34px; height: 19px; border-radius: 999px;
  background: #DCE2F0; position: relative; transition: background .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* ================= 筛选栏 ================= */
.filter-shell {
  max-width: 1440px;
  margin: 20px auto 0;
  padding: 0 28px;
}
.filterbar {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 15px;
}
.frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flabel {
  font-size: 14px; color: var(--ink-2); font-weight: 600;
  min-width: 68px; flex: none;
}
/* 胶囊式控件 */
.filterbar select, .filterbar input[type="text"], .filterbar input[type="date"],
.filterbar input:not([type]) {
  padding: 8px 14px;
  border: 1px solid #E2E7F3;
  border-radius: var(--r-pill);
  font-size: 14px;
  background: #FBFCFE;
  color: var(--ink-2);
  outline: none;
  min-width: 118px;
  transition: all .15s;
}
.filterbar select:focus, .filterbar input:focus {
  border-color: var(--grad-a);
  box-shadow: 0 0 0 3px rgba(78, 124, 255, .10);
}
.filterbar input::placeholder { color: var(--muted-2); }
.fdash { color: var(--muted-2); font-size: 14px; }
.fchip {
  font-size: 13.5px; color: var(--muted);
  background: #F6F8FD; border-radius: var(--r-pill);
  padding: 7px 14px;
}
/* 快捷组合胶囊 */
.hot-row { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.hot-chips {
  padding: 7px 15px !important;
  border-radius: var(--r-pill) !important;
  font-size: 13.5px !important;
  color: var(--ink-2) !important;
  background: #F6F8FD !important;
  border: 1px solid #E6EAF5 !important;
  cursor: pointer;
  transition: all .16s;
}
.hot-chips:hover { border-color: var(--grad-a) !important; color: var(--grad-a) !important; }
.hot-chips small { color: var(--muted-2); font-size: 12px; margin-left: 5px; }
.hot-chips.on {
  background: var(--grad) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 10px rgba(78, 124, 255, .24);
}
.hot-chips.on small { color: rgba(255, 255, 255, .8); }

/* ================= 布局 ================= */
.wrap { max-width: 1440px; margin: 0 auto; padding: 24px 28px 60px; }

/* 章节横幅 */
.sec-head {
  display: flex; align-items: center; gap: 12px;
  margin: 30px 0 14px;
  padding-bottom: 12px;
}
.sec-head:first-of-type { margin-top: 8px; }
.sec-bar {
  width: 4px; height: 22px; border-radius: 3px;
  background: var(--grad); flex: none;
}
.sec-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sec-txt b { font-size: 16px; font-weight: 700; color: var(--ink); }
.sec-txt span { font-size: 12px; color: var(--muted); }
.sec-fold {
  font-size: 12px; color: var(--muted);
  background: #F6F8FD; border: 1px solid #E6EAF5;
  border-radius: var(--r-pill); padding: 5px 13px; cursor: pointer;
  transition: all .16s; flex: none;
}
.sec-fold:hover { color: var(--grad-a); border-color: var(--grad-a); }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.card h3 {
  font-size: 15px; font-weight: 700; color: var(--ink);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card .hint { color: var(--muted); font-size: 12px; margin-bottom: 10px; line-height: 1.6; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 20px; }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 380px; }
.chart.heat { height: 420px; }
.inline-select {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid #E2E7F3;
  border-radius: var(--r-pill);
  font-size: 12px;
  background: #FBFCFE;
  color: var(--ink-2);
  outline: none;
}

/* ================= KPI ================= */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.kpi {
  position: relative;
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  min-height: 124px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
/* 顶部极浅渐变细条 */
.kpi::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: .85;
}
.kpi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.kpi-ico {
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex: none;
  box-shadow: 0 3px 9px rgba(78, 124, 255, .22);
}
.kpi-ico.violet { background: linear-gradient(135deg, #8B5CF6, #C084FC); box-shadow: 0 3px 9px rgba(139, 92, 246, .22); }
.kpi-ico.cyan { background: linear-gradient(135deg, #22D3EE, #4E7CFF); box-shadow: 0 3px 9px rgba(34, 211, 238, .22); }
.kpi-label {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-val {
  font-size: 32px; font-weight: 700; color: var(--ink);
  line-height: 1.15; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.kpi-val small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 8px; line-height: 1.5; }
.kpi-delta { margin-top: 8px; }

/* 状态胶囊 */
.pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill.up { background: var(--ok-bg); color: var(--ok); }
.pill.down { background: var(--danger-bg); color: var(--danger); }
.pill.flat { background: var(--flat-bg); color: var(--flat); }
.pill.amber { background: var(--amber-bg); color: #B45309; }
.pill.brand { background: #EEF2FF; color: var(--grad-a); }
.pill.gray { background: var(--flat-bg); color: var(--muted); }

/* 趋势描述条 */
.trend-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.trend-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; line-height: 1.5;
}
.trend-chip.sm { padding: 3px 9px; font-size: 11.5px; font-weight: 600; }
.trend-chip.t-up { background: var(--ok-bg); color: var(--ok); }
.trend-chip.t-down { background: var(--danger-bg); color: var(--danger); }
.trend-chip.t-flat { background: var(--flat-bg); color: var(--flat); }
.trend-chip b { font-weight: 600; }

/* ================= 表格 ================= */
.tbl-scroll { max-height: 460px; overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  background: #EEF2FF;
  color: var(--ink);
  font-weight: 700; font-size: 12px;
  padding: 10px 12px;
  white-space: nowrap;
  border-bottom: 1px solid #E0E7FB;
}
table.tbl th:first-child { border-top-left-radius: 10px; }
table.tbl th:last-child { border-top-right-radius: 10px; }
table.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #F3F5FA;
  vertical-align: middle;
  color: var(--ink-2);
}
table.tbl tbody tr:hover td { background: rgba(80, 110, 255, .06); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl a { color: var(--grad-a); text-decoration: none; }
table.tbl a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 迷你渐变进度条 */
.mini-bar {
  position: relative; height: 5px; border-radius: 3px;
  background: #EDF1FA; overflow: hidden; margin-top: 3px; min-width: 46px;
}
.mini-bar i {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 3px; background: var(--grad);
  display: block;
}
.cell-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

/* 标签 */
.tag {
  display: inline-block;
  background: #EEF2FF; color: var(--grad-a);
  border-radius: 6px; font-size: 11px;
  padding: 2px 7px; margin: 1px 3px 1px 0;
  white-space: nowrap;
}
.tag.macro {
  background: #F5F0FF; color: #7C3AED;
  border: 1px dashed #C4A5F5;
}
.badge {
  display: inline-block;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; white-space: nowrap; font-weight: 600;
}
.badge.anchor { background: var(--ok-bg); color: var(--ok); }
.badge.dead { background: var(--danger-bg); color: var(--danger); }
.badge.alive { background: var(--ok-bg); color: var(--ok); }
.badge.dim { background: var(--flat-bg); color: var(--flat); font-weight: 500; }
.badge.hit { background: var(--ok-bg); color: var(--ok); }
.badge.pending { background: var(--amber-bg); color: #B45309; }
.badge.miss { background: var(--flat-bg); color: var(--flat); }

/* 说明条 */
.note-banner {
  background: linear-gradient(90deg, #EEF3FF, #F6F1FF);
  color: var(--ink-2);
  border-left: 3px solid var(--grad-a);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px; line-height: 1.7;
  margin-bottom: 12px;
}
.empty-note {
  background: var(--amber-bg);
  color: #92400E;
  border: 1px dashed #F2C987;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px; line-height: 1.7;
  margin-bottom: 12px;
}
.err-box {
  background: var(--danger-bg); color: var(--danger);
  border-radius: 10px; padding: 11px 15px;
  margin: 12px 0; display: none; font-size: 12.5px;
}

/* ================= 投放建议卡 ================= */
.sug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.sug {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  position: relative; overflow: hidden;
  border-left: 4px solid var(--grad-a);
}
.sug.rule { border-left-color: var(--danger); }
.sug.warn { border-left-color: var(--amber); }
.sug.ok { border-left-color: var(--ok); }
.sug.info { border-left-color: var(--grad-a); }
.sug-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.s-tag {
  font-size: 11px; padding: 3px 10px; border-radius: var(--r-pill);
  font-weight: 600; color: #fff; white-space: nowrap;
}
.sug.rule .s-tag { background: var(--danger); }
.sug.warn .s-tag { background: var(--amber); }
.sug.ok .s-tag { background: var(--ok); }
.sug.info .s-tag { background: var(--grad); }
.s-title { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.5; }
/* 三段式 */
.s-sec { display: flex; gap: 8px; margin-top: 8px; }
.s-key {
  flex: none; font-size: 11px; font-weight: 700; color: var(--muted);
  padding-top: 1px; min-width: 52px;
}
.s-sec.evi .s-key { color: var(--grad-a); }
.s-sec.act .s-key { color: var(--c-purple); }
.s-val { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.s-sec.act .s-val { color: var(--ink); font-weight: 500; }
.s-body { font-size: 12px; color: var(--ink-2); line-height: 1.6; }

/* ================= 页脚 ================= */
.footer {
  margin-top: 36px; padding: 16px 20px;
  background: var(--card); border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  color: var(--muted); font-size: 11.5px; line-height: 1.8;
}
.footer code {
  background: #F1F4FB; color: var(--grad-a);
  padding: 1px 5px; border-radius: 4px; font-size: 11px;
}

/* ================= 响应式 ================= */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .frow { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 12px 16px; }
  .wrap, .filter-shell { padding-left: 16px; padding-right: 16px; }
  .tbl-scroll { overflow-x: auto; }
  table.tbl { min-width: 720px; }
  /* 宽表格 sticky 首列 */
  table.tbl th:first-child,
  table.tbl td:first-child {
    position: sticky; left: 0; z-index: 3;
    background: #fff;
  }
  table.tbl th:first-child { background: #EEF2FF; z-index: 4; }
  table.tbl tbody tr:hover td:first-child { background: #F5F8FF; }
}
