:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #7b8698;
  --line: #e6eaf2;
  --brand: #f2a93b;
  --brand-dark: #d98d17;
  --blue: #3f8efc;
  --green: #22b07d;
  --red: #e2574c;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(31, 39, 51, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: #eef2f8;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(90deg, #23293a 0%, #2c3448 60%, #343d55 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.brand small {
  font-weight: 400;
  font-size: 11px;
  color: #9aa4bb;
  border: 1px solid #4a5470;
  border-radius: 20px;
  padding: 1px 8px;
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(242, 169, 59, .25);
}
.nav { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 4px; }
.nav a {
  color: #c7cede;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: background .18s, color .18s;
}
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.nav a.on { background: var(--brand); color: #241a05; font-weight: 600; }

/* ---------- 布局 ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.page-head { margin: 4px 0 20px; }
.page-head h1 { font-size: 24px; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 4px solid var(--brand);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-extra { font-weight: 400; font-size: 12px; color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.grid-2 > .card, .grid-3 > .card { margin-bottom: 20px; }

.chart { width: 100%; height: 360px; }
.chart-sm { height: 260px; }
.chart-error {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  background: #fdf1f0;
  border-radius: 8px;
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brand);
}
.kpi:nth-child(2n)::after { background: var(--blue); }
.kpi:nth-child(3n)::after { background: var(--green); }
.kpi-label { display: block; color: var(--muted); font-size: 12px; }
.kpi-value { display: inline-block; font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi i { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.table th { background: #f7f9fc; color: #566074; font-weight: 600; }
.table tbody tr:hover { background: #fbfcfe; }
.table td.empty { text-align: center; color: var(--muted); padding: 24px; }
.table td.path, .table td.review-text { white-space: normal; }
.table td.review-text { min-width: 320px; max-width: 640px; }

/* ---------- 搜索 / 按钮 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-bar input {
  flex: 1;
  min-width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fbfcfe;
}
.search-bar input:focus { border-color: var(--blue); background: #fff; }
button, .btn {
  border: none;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 9px 18px;
  transition: opacity .18s;
}
button:hover, .btn:hover { opacity: .88; text-decoration: none; }
button.ghost {
  background: #eef2f8;
  color: #4a5468;
}
a.btn { display: inline-block; background: var(--green); }

/* ---------- 说明 ---------- */
.note { color: #566074; font-size: 13px; }
.note ul { margin: 0; padding-left: 18px; }
.note li { margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 18px 20px 30px;
  border-top: 1px solid var(--line);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi-value { font-size: 22px; }
  .topbar-inner { padding: 6px 14px 8px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .container { padding: 16px 12px 30px; }
  .chart { height: 300px; }
}
