:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e3e6eb;
  --text: #1f2329;
  --muted: #8a9099;
  --primary: #2b6cb0;
  --primary-hover: #245a96;
  --hover: #f0f4f9;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

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

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; }
.topbar .subtitle { color: var(--muted); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-self: center; }

.container { max-width: 1280px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.section-head .hint { color: var(--muted); font-size: 12px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1; }
.field label { font-size: 12px; color: var(--muted); }
.field.actions { flex-direction: row; gap: 8px; }

input, select, .btn {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); }

.btn {
  cursor: pointer;
  background: #fff;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: #c0392b; border-color: #e6b3ab; }
.btn.danger:hover { background: #fdf3f1; border-color: #d98a7e; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }

.chart { width: 100%; height: 380px; }

/* 数据分析卡片 */
.field-record { flex: 2; min-width: 320px; }
.field-points { min-width: 170px; max-width: 200px; }
.region-info { margin-top: 10px; color: var(--muted); font-size: 13px; min-height: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.stat-box { background: #fafbfc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 16px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); position: sticky; top: 0; }
tbody tr:hover { background: var(--hover); }
td.col-check, th.col-check { width: 36px; text-align: center; }
td.photons { max-width: 360px; white-space: normal; cursor: pointer; color: var(--primary); }
.photons-full {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  background: #fafbfc;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}
.row-expand .photons-full { display: block; }
.photons-preview { white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.page-info { color: var(--muted); font-size: 13px; min-width: 120px; text-align: center; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2329;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 99;
}
.toast.show { opacity: 1; }
