/* =============================================================================
 * 网站统计分析系统 · 管理后台样式
 * 视觉风格参考百度统计：深蓝顶部导航 + 左侧垂直菜单 + 浅灰背景 + 白色卡片
 * 零依赖，纯原生 CSS
 * ========================================================================== */

:root {
  --brand-1: #1a4b8c;
  --brand-2: #2b6cb0;
  --brand-3: #4299e1;
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e5eaf1;
  --line-soft: #eef2f7;
  --text: #2d3748;
  --text-sub: #5b6b7f;
  --text-muted: #90a0b3;
  --green: #2f9e44;
  --red: #e03131;
  --orange: #ed8936;
  --purple: #805ad5;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(26, 75, 140, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 28px rgba(20, 45, 80, 0.18);
  --topbar-h: 56px;
  --sidebar-w: 186px;
}

* { box-sizing: border-box; }

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

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.mono { font-family: Consolas, "Courier New", monospace; }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb12 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ============================================================ 顶部导航栏 */

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand-logo {
  width: 24px; height: 24px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topbar-main::-webkit-scrollbar { display: none; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  white-space: nowrap;
}
.topbar-user .user-name { opacity: 0.95; }
.topbar-user .user-role {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
}

.site-select,
.date-input {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.site-select { max-width: 190px; }
.site-select option { color: #333; background: #fff; }
.date-input { width: 128px; }
.date-input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.8; cursor: pointer; }

.preset-list { display: flex; gap: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; padding: 2px; }
.preset-btn {
  border: 0;
  background: transparent;
  color: #e8f0fb;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.preset-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.preset-btn.active { background: #fff; color: var(--brand-2); font-weight: 600; }

.tb-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.25); flex: 0 0 auto; }

/* ============================================================ 主体布局 */

.layout { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 8px 0 24px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d8e0ea; border-radius: 3px; }

.menu-group { margin-bottom: 4px; }
.menu-group-title {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 16px 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 16px;
  color: var(--text-sub);
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13px;
  user-select: none;
}
.menu-item:hover { background: #f4f8fd; color: var(--brand-2); }
.menu-item.active {
  background: #eef5fd;
  color: var(--brand-2);
  border-left-color: var(--brand-2);
  font-weight: 600;
}
.menu-item .menu-badge {
  font-size: 10px; color: #fff; background: var(--red);
  border-radius: 8px; padding: 0 6px; line-height: 15px;
}

.content { flex: 1; min-width: 0; overflow-y: auto; padding: 14px 16px 40px; }
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #d8e0ea; border-radius: 4px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.page-desc { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ============================================================ 卡片 */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.card-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--brand-2); display: inline-block;
}
.card-extra { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.card-body { padding: 14px; }
.card-body.nopad { padding: 0; }
.card-body.pad8 { padding: 8px 6px; }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .cols-3, .cols-4, .cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-4, .cols-6 { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================ 指标卡片 */

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1280px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px 10px;
  position: relative;
  transition: box-shadow .15s, transform .15s;
}
.metric-card:hover { box-shadow: 0 3px 10px rgba(26, 75, 140, 0.12); transform: translateY(-1px); }
.metric-label { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.metric-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.35; margin-top: 2px; letter-spacing: -0.5px; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.metric-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.delta-good { color: var(--green); }
.delta-bad { color: var(--red); }
.delta-flat { color: var(--text-muted); }
.metric-spark { width: 74px; height: 30px; flex: 0 0 74px; }
.metric-sub { color: var(--text-muted); font-size: 11px; }

/* ============================================================ 按钮与表单 */

.btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--brand-3); color: var(--brand-2); background: #f7fbff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-primary:hover { background: #245c99; border-color: #245c99; color: #fff; }
.btn-danger { color: var(--red); border-color: #f3c9c9; }
.btn-danger:hover { background: #fff5f5; border-color: var(--red); color: var(--red); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 12px; }
.btn-link { border: 0; background: transparent; color: var(--brand-2); padding: 0 4px; height: auto; cursor: pointer; font-family: inherit; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.form-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.form-row > .form-col { flex: 1; min-width: 0; }
.form-label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.form-label .req { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--brand-3); box-shadow: 0 0 0 2px rgba(66, 153, 225, .15); }
.form-textarea { min-height: 62px; resize: vertical; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 6px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-sub); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-2); }

/* ============================================================ 过滤条件标签 */

.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #eef5fd; border: 1px solid #d3e4f7; border-radius: var(--radius);
  padding: 7px 12px; margin-bottom: 12px; font-size: 12px;
}
.filter-bar .filter-label { color: var(--brand-2); font-weight: 600; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #cfe0f5; color: var(--brand-2);
  border-radius: 12px; padding: 1px 6px 1px 10px;
}
.filter-tag .tag-close {
  cursor: pointer; color: #90a0b3; font-size: 14px; line-height: 1; border: 0; background: none; padding: 0 2px;
}
.filter-tag .tag-close:hover { color: var(--red); }

/* ============================================================ 表格 */

.table-wrap { width: 100%; overflow-x: auto; }
table.tj-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tj-table th, table.tj-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
table.tj-table thead th {
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
table.tj-table thead th.sortable { cursor: pointer; user-select: none; }
table.tj-table thead th.sortable:hover { color: var(--brand-2); }
table.tj-table thead th .sort-mark { color: var(--brand-3); margin-left: 3px; font-size: 10px; }
table.tj-table tbody tr { transition: background .12s; }
table.tj-table tbody tr:hover { background: #f7fbff; }
table.tj-table tbody tr.drillable { cursor: pointer; }
table.tj-table td.num, table.tj-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tj-table td.center, table.tj-table th.center { text-align: center; }
table.tj-table td.dim-link { color: var(--brand-2); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tj-table tbody tr.row-active { background: #eef5fd; }
table.tj-table tfoot td { background: #f8fafc; font-weight: 600; border-top: 1px solid var(--line); }
.cell-bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--brand-3); vertical-align: middle; margin-right: 6px; opacity: .55; }

.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-muted);
  flex-wrap: wrap;
}
.pager { display: flex; align-items: center; gap: 6px; }
.empty-state { padding: 34px 14px; text-align: center; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 26px; display: block; margin-bottom: 6px; opacity: .6; }

.badge { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; line-height: 17px; }
.badge-green { background: #e6f7ec; color: var(--green); }
.badge-gray { background: #eef1f5; color: var(--text-muted); }
.badge-red { background: #fdeaea; color: var(--red); }
.badge-blue { background: #e8f2fd; color: var(--brand-2); }
.badge-orange { background: #fdf1e3; color: #c05621; }

/* ============================================================ 选项卡 */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; cursor: pointer; color: var(--text-sub); font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tab:hover { color: var(--brand-2); }
.tab.active { color: var(--brand-2); font-weight: 600; border-bottom-color: var(--brand-2); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button {
  border: 0; background: #fff; color: var(--text-sub); padding: 4px 11px; cursor: pointer;
  font-size: 12px; font-family: inherit; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--brand-2); color: #fff; }

/* ============================================================ 加载 / 错误 / 提示 */

.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 12px; margin-bottom: 9px; }
.sk-card { height: 88px; margin-bottom: 12px; }
.sk-chart { height: 260px; margin-bottom: 12px; }
.sk-row { height: 34px; margin-bottom: 6px; }

.loading-box { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px; color: var(--text-muted); }
.spinner {
  width: 15px; height: 15px; border: 2px solid #dbe6f2; border-top-color: var(--brand-2);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff5f5; border: 1px solid #f7c8c8; color: #9b2c2c;
  border-radius: var(--radius); padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px;
}
.error-bar .err-icon { font-size: 14px; }
.error-bar .err-retry { margin-left: auto; }

.toast-host { position: fixed; top: 68px; right: 18px; z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 180px; max-width: 380px; padding: 9px 14px; border-radius: var(--radius);
  background: #2d3748; color: #fff; font-size: 12.5px; box-shadow: var(--shadow-lg);
  animation: slideIn .18s ease; word-break: break-word;
}
.toast-success { background: #2f9e44; }
.toast-error { background: #c92a2a; }
.toast-warn { background: #d9822b; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ============================================================ 弹窗 */

.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 35, 60, 0.42);
  display: flex; align-items: flex-start; justify-content: center; z-index: 800; padding: 60px 16px;
  overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; animation: pop .16s ease;
}
.modal.modal-wide { max-width: 820px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }
.modal-head { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-close { border: 0; background: none; font-size: 18px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 16px; max-height: 64vh; overflow-y: auto; }
.modal-foot { padding: 11px 16px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }

/* ============================================================ 登录页 */

.login-layer {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #123a6b 0%, var(--brand-2) 55%, #4c8fd0 100%);
}
.login-card {
  width: 366px; max-width: 92vw; background: #fff; border-radius: 10px;
  box-shadow: 0 18px 50px rgba(8, 25, 50, 0.35); padding: 30px 28px 24px;
}
.login-logo { text-align: center; margin-bottom: 6px; font-size: 30px; }
.login-title { text-align: center; font-size: 19px; font-weight: 700; color: var(--brand-1); margin: 0 0 4px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 12px; margin-bottom: 20px; }
.login-field { margin-bottom: 14px; }
.login-field .form-input { height: 38px; font-size: 13px; }
.login-btn {
  width: 100%; height: 38px; border: 0; border-radius: 4px; color: #fff; font-size: 14px; cursor: pointer;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); font-family: inherit; margin-top: 4px;
}
.login-btn:hover { filter: brightness(1.08); }
.login-btn:disabled { opacity: .7; cursor: not-allowed; }
.login-tip { margin-top: 14px; font-size: 11.5px; color: var(--text-muted); text-align: center; line-height: 1.7; }

/* ============================================================ 图表容器 */

.tj-chart { position: relative; width: 100%; min-height: 40px; }
.tj-chart .tj-svg { display: block; width: 100%; overflow: visible; }
.tj-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; color: var(--text-muted); gap: 4px; }
.tj-empty-icon { font-size: 22px; opacity: .5; }
.tj-empty-text { font-size: 12px; }

.tj-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 2px 2px; font-size: 12px; align-items: center; }
.tj-legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-sub); min-width: 0; }
.tj-legend-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
/* 图例文案可能是很长的页面 URL，超长要截断，否则会把图例挤成好几行 */
.tj-legend-label {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tj-legend-value { color: var(--text); font-weight: 600; }
.tj-legend-note { color: var(--text-muted); font-size: 11px; margin-left: auto; }

.tj-tip {
  position: absolute; z-index: 20; pointer-events: none;
  background: rgba(26, 40, 60, 0.94); color: #fff; border-radius: 5px;
  padding: 7px 10px; font-size: 12px; line-height: 1.6; box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
  min-width: 120px;
}
.tj-tip-title { font-weight: 600; margin-bottom: 3px; color: #cfe3fb; }
.tj-tip-row { display: flex; align-items: center; gap: 6px; }
.tj-tip-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tj-tip-name { color: #d6e2f0; }
.tj-tip-row b { margin-left: auto; }

.tj-pie-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tj-pie-legend { flex: 1; min-width: 200px; max-width: 480px; display: flex; flex-direction: column; gap: 4px; }
.tj-pie-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.tj-pie-legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-sub); }
.tj-pie-legend-value { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tj-pie-legend-ratio { width: 52px; text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ============================================================ 实时访客 */
/* 版式对齐百度统计：左侧「当前在线」大数字 + 右侧「最近30分钟访问情况」折线图，
   下方是带整排筛选条件的「访问明细」表格。 */

.rt-top {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 8px;
  background: #fff; border-radius: var(--radius); padding: 20px 24px 12px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.rt-left { padding-top: 6px; }
.rt-caption { display: flex; align-items: baseline; gap: 10px; }
.rt-caption-title { font-size: 15px; font-weight: 600; color: var(--text); }
.rt-countdown { font-size: 12.5px; color: #e8710a; }
.rt-clock { margin-top: 14px; font-size: 13.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.rt-big {
  font-size: 54px; font-weight: 700; line-height: 1.1; color: var(--text);
  letter-spacing: -1.5px; font-variant-numeric: tabular-nums; margin-top: 2px;
}
.rt-biglabel { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.rt-chart-side { min-width: 0; }
.rt-chart-title { text-align: center; font-size: 13.5px; color: var(--text); margin: 4px 0 2px; }
.rt-chart-box { min-height: 300px; }

/* ---- 筛选区 ---- */
.rt-filter-area { padding: 14px 18px 4px; }
.rt-filter-area.collapsed { display: none; }
.rt-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rt-filter-label { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.rt-select {
  height: 28px; min-width: 116px; max-width: 190px; padding: 0 24px 0 8px;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b98a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.rt-select:focus { outline: none; border-color: #4f92d9; }
.rt-pills { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.rt-pill {
  padding: 0 14px; height: 28px; line-height: 26px; border: 0; background: #fff;
  font-size: 12.5px; color: var(--text-sub); cursor: pointer; border-right: 1px solid var(--border);
}
.rt-pill:last-child { border-right: 0; }
.rt-pill:hover { color: #2b6cb0; }
.rt-pill.active { background: #2b6cb0; color: #fff; }

.rt-collapse-row { padding: 0 18px 8px; text-align: right; }
.rt-collapse {
  border: 0; background: none; color: #2b6cb0; font-size: 12.5px; cursor: pointer; padding: 2px 4px;
}
.rt-collapse::after { content: ' ⌃'; }
.rt-filter-area.collapsed ~ .rt-collapse-row .rt-collapse::after { content: ' ⌄'; }

.rt-metric-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-top: 1px solid var(--border-weak, #eef2f7);
}
.rt-metric-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border: 1px solid var(--border); border-radius: 3px;
  background: #fff; font-size: 12.5px; color: var(--text); cursor: pointer;
}
.rt-metric-btn:hover { border-color: #4f92d9; color: #2b6cb0; }
.rt-metric-icon { font-size: 13px; color: #2b6cb0; }
.rt-metric-hint { font-size: 12.5px; color: var(--text-muted); }
.rt-metric-hint b { color: #2b6cb0; font-weight: 600; }

.rt-search-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 18px; border-top: 1px solid var(--border-weak, #eef2f7);
}
.rt-search-item { display: flex; align-items: center; gap: 7px; }
.rt-search-label { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.rt-input {
  height: 28px; width: 132px; padding: 0 9px; border: 1px solid var(--border);
  border-radius: 3px; font-size: 12.5px; color: var(--text);
}
.rt-input:focus { outline: none; border-color: #4f92d9; }
.rt-search-btn {
  height: 28px; padding: 0 20px; border: 1px solid #2b6cb0; border-radius: 3px;
  background: #fff; color: #2b6cb0; font-size: 12.5px; cursor: pointer;
}
.rt-search-btn:hover { background: #2b6cb0; color: #fff; }

/* ---- 明细表 ---- */
.rt-table-wrap { overflow-x: auto; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rt-table thead th {
  background: #f7f9fc; color: var(--text-sub); font-weight: 500; text-align: left;
  padding: 9px 10px; border-top: 1px solid var(--border-weak, #eef2f7);
  border-bottom: 1px solid var(--border-weak, #eef2f7); white-space: nowrap;
}
.rt-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border-weak, #eef2f7);
  color: var(--text); vertical-align: middle;
}
.rt-table tbody tr.rt-row:hover { background: #f9fbfe; }
.rt-col-expand { width: 34px; text-align: center; }
.rt-col-seq-h { width: 34px; }
.rt-col-seq { width: 34px; color: var(--text-sub); }
.rt-col-time { white-space: nowrap; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.rt-col-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt-col-ip, .rt-col-vid { white-space: nowrap; color: var(--text-sub); }
.rt-col-vid { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.rt-col-page { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-col-kw { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-sub); }
.rt-expand {
  width: 18px; height: 18px; line-height: 15px; padding: 0; border: 1px solid var(--border);
  border-radius: 2px; background: #fff; color: var(--text-sub); font-size: 13px; cursor: pointer;
}
.rt-expand:hover { border-color: #4f92d9; color: #2b6cb0; }
.rt-expand.open { background: #eef4ff; border-color: #4f92d9; color: #2b6cb0; }
.rt-link { color: #2b6cb0; text-decoration: none; }
.rt-link:hover { text-decoration: underline; }

.rt-detail-row td { background: #fbfcfe; padding: 0; }
.rt-trail { padding: 12px 18px 14px 44px; }
.rt-trail-title { font-size: 12.5px; color: var(--text-sub); margin-bottom: 8px; }
.rt-trail-item {
  display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px;
}
.rt-trail-idx {
  width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%;
  background: #eef4ff; color: #2b6cb0; font-size: 11px; flex: none;
}
.rt-trail-page { color: #2b6cb0; }
.rt-trail-title2 { color: var(--text-sub); }
.rt-trail-time { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rt-trail-meta { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.rt-table-foot { padding: 10px 18px 14px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .rt-top { grid-template-columns: 1fr; }
  .rt-chart-box { min-height: 240px; }
}

/* 旧版实时页样式（已不再使用，保留以免影响其它引用） */
.rt-hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: linear-gradient(120deg, #1a4b8c, #2b6cb0 62%, #3f86c9);
  color: #fff; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(26, 75, 140, .22);
}
.rt-main { display: flex; align-items: center; gap: 14px; }
.rt-pulse { width: 10px; height: 10px; border-radius: 50%; background: #48e07a; box-shadow: 0 0 0 0 rgba(72, 224, 122, .8); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(72, 224, 122, .7); }
  70% { box-shadow: 0 0 0 12px rgba(72, 224, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(72, 224, 122, 0); }
}
.rt-number { font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.rt-label { font-size: 13px; opacity: .88; }
.rt-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-left: auto; }
.rt-stat { text-align: center; min-width: 64px; }
.rt-stat b { display: block; font-size: 20px; font-weight: 700; }
.rt-stat span { font-size: 12px; opacity: .85; }

.kv-list { display: flex; flex-direction: column; gap: 7px; }
.kv-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.kv-item .kv-label { color: var(--text-sub); }
.kv-item .kv-value { font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }

.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 17px; height: 17px; border-radius: 3px; background: #eef2f7; color: var(--text-muted); font-size: 11px; display: flex; align-items: center; justify-content: center; flex: 0 0 17px; }
.rank-row:nth-child(1) .rank-no { background: #fdeaea; color: var(--red); }
.rank-row:nth-child(2) .rank-no { background: #fdf1e3; color: #c05621; }
.rank-row:nth-child(3) .rank-no { background: #fdf6dd; color: #a17c00; }
.rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* 页面上下游 */
.flow-wrap { display: flex; align-items: stretch; gap: 14px; }
.flow-col { flex: 1; min-width: 0; }
.flow-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; }
.flow-node {
  background: #eef5fd; border: 1px solid #cfe0f5; color: var(--brand-2);
  padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: 600; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flow-arrow { color: var(--text-muted); font-size: 16px; }
.flow-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.flow-row .flow-page { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand-2); cursor: pointer; }
.flow-row .flow-track { width: 90px; height: 7px; border-radius: 4px; background: #f2f6fb; overflow: hidden; flex: 0 0 90px; }
.flow-row .flow-track i { display: block; height: 100%; background: var(--brand-3); }
.flow-row .flow-ratio { width: 52px; text-align: right; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* 代码块 */
.code-block { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f8fafc; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--text-sub);
}
.code-box {
  background: #fbfdff; margin: 0; padding: 10px 12px; font-size: 12px; line-height: 1.65;
  font-family: Consolas, "Courier New", monospace; color: #24405e; white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow: auto;
}

/* 漏斗步骤编辑 */
.step-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.step-no { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: #eef2f7; color: var(--text-sub); display: flex; align-items: center; justify-content: center; font-size: 11px; }
.step-row .form-select { width: 100px; flex: 0 0 100px; }
.step-row .form-input { flex: 1; }
.step-row .form-select.match { width: 96px; flex: 0 0 96px; }

/* 系统信息 */
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
@media (max-width: 900px) { .info-grid { grid-template-columns: minmax(0, 1fr); } }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
.info-row .info-key { color: var(--text-sub); }
.info-row .info-val { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }

.section-note { background: #f7fbff; border: 1px dashed #cfe0f5; border-radius: var(--radius); padding: 9px 12px; font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.report-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; max-height: 520px; overflow: auto; }

/* =============================================================================
 * 网站概览（版式对齐百度统计）
 * ========================================================================== */

/* ---- 日期标签页 ---- */
.ov-tabs {
  display: flex; gap: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin: 12px 0;
}
.ov-tab {
  flex: 0 0 auto; padding: 9px 22px; border: none; background: #fff; cursor: pointer;
  font-size: 13px; color: var(--text-sub); border-right: 1px solid var(--line-soft);
  font-family: inherit; transition: background .15s, color .15s;
}
.ov-tab:last-child { border-right: none; }
.ov-tab:hover { background: #f4f8fd; color: var(--brand-2); }
.ov-tab.active { background: var(--brand-2); color: #fff; font-weight: 600; }

/* ---- 今日流量三行表 ---- */
.ov-traffic-card .card-body { padding: 0 0 4px; }
.ov-traffic { position: relative; }
.ov-traffic.collapsed tbody { display: none; }
.ov-traffic-toggle {
  display: block; margin: 0 auto 4px; width: 46px; height: 18px; line-height: 16px;
  border: 1px solid var(--line); border-bottom: none; border-radius: 10px 10px 0 0;
  background: #f7f9fc; color: var(--text-muted); cursor: pointer; font-size: 11px; font-family: inherit;
}
.ov-traffic-toggle:hover { color: var(--brand-2); background: #eef5fd; }
.ov-online { font-size: 12px; color: var(--text-sub); }
.ov-online b { color: var(--brand-2); font-size: 15px; margin: 0 2px; }

/* ---- 通用小表格（今日流量 / 新老访客） ---- */
.ov-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ov-table .ov-th {
  padding: 9px 12px; text-align: right; font-weight: 500; color: var(--text-sub);
  background: #f7f9fc; border-bottom: 1px solid var(--line);
}
.ov-table .ov-th-row {
  padding: 9px 16px; text-align: left; font-weight: 500; color: var(--text-sub);
  background: #f7f9fc; border-bottom: 1px solid var(--line); width: 130px; white-space: nowrap;
}
.ov-table .ov-td {
  padding: 10px 12px; text-align: right; color: var(--text); border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.ov-table tbody tr:hover .ov-td,
.ov-table tbody tr:hover .ov-th-row { background: #f9fbfe; }
.ov-table .ov-tr-est .ov-td,
.ov-table .ov-tr-est .ov-th-row { color: var(--text-muted); }

/* ---- 新老访客 ---- */
.ov-nv-body { padding: 14px 16px 6px; }
.ov-nv-top { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.ov-nv-icon { flex: 0 0 auto; line-height: 0; }
.ov-nv-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1; }
.ov-nv-label { font-size: 12.5px; color: var(--text-sub); margin-bottom: 2px; }
.ov-nv-value { font-size: 24px; font-weight: 700; color: #3fa86a; line-height: 1.2; }
.ov-nv-cell:last-child .ov-nv-value { color: var(--brand-2); }
.ov-nv-table { margin-top: 4px; }
.ov-nv-table .ov-th-row { width: 120px; }

/* ---- 两列栅格 ---- */
.ov-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.ov-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .ov-cols-2 { grid-template-columns: minmax(0, 1fr); } }
.ov-grid .card { margin-bottom: 0; }

/* ---- TOP10 卡片：表格高度一致，空状态居中 ---- */
.ov-topcard .table-wrap { min-height: 268px; }
.ov-topcard .empty-state { padding: 84px 16px; }

/* ---- 趋势图卡片 ---- */
.ov-chart-tools {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 0 0 10px; border-bottom: 1px solid var(--line-soft);
  margin-bottom: 10px;
}
.ov-chart-tabs { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ov-chart-tab {
  padding: 6px 16px; border: none; background: #fff; cursor: pointer; font-size: 12.5px;
  color: var(--text-sub); font-family: inherit; border-right: 1px solid var(--line-soft);
}
.ov-chart-tab:hover { background: #f4f8fd; color: var(--brand-2); }
.ov-chart-tab.active { background: var(--brand-2); color: #fff; font-weight: 600; }
.ov-chart-select {
  padding: 6px 10px; border: none; background: #fff; font-size: 12.5px; font-family: inherit;
  color: var(--text-sub); cursor: pointer; outline: none;
}
.ov-chart-select.active { background: var(--brand-2); color: #fff; font-weight: 600; }
.ov-chart-compare { display: flex; align-items: center; gap: 14px; }
.ov-compare-label { font-size: 12.5px; color: var(--text-sub); }
.ov-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-sub); cursor: pointer; }
.ov-check input { margin: 0; cursor: pointer; }
.ov-chart-box { min-height: 296px; }

/* ---- 卡片标题右侧的 ? ---- */
.card-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--text-muted); font-size: 10px; cursor: help; margin-left: 6px;
  vertical-align: middle; font-weight: 600;
}
.card-help:hover { border-color: var(--brand-2); color: var(--brand-2); }

/* ---- 地域分布地图 ---- */
.ov-map-card .card-body { padding: 6px 16px 14px; }
.ov-map-box { position: relative; }
.tj-map-prov {
  stroke: #fff; stroke-width: 1; transition: opacity .12s;
}
.tj-map-prov.has-data { cursor: pointer; }
.tj-map-prov.has-data:hover { opacity: .82; }
.tj-map-prov.decorative { stroke: #8fbdec; stroke-width: 1.4; }
.tj-map-legend {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin-top: 6px; font-size: 11.5px; color: var(--text-sub);
}
.tj-map-legend-bar { display: inline-block; width: 96px; height: 9px; border-radius: 2px; }
.tj-map-legend-ticks { display: inline-flex; gap: 42px; color: var(--text-muted); }
.tj-map-unmatched { text-align: center; font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
/* 地图尺寸：居中并限制最大宽度，避免在宽卡片里显得过小 */
.ov-map-box .tj-svg { display: block; margin: 0 auto; max-width: 100%; }
.ov-map-box { max-width: 980px; margin: 0 auto; }

/* ============================================================ 报表页（对齐百度统计） */

/* ---- 筛选条 ---- */
.rp-filters {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 18px; margin-bottom: 12px;
}
.rp-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-filter-row + .rp-filter-row { margin-top: 10px; }
.rp-flabel { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; margin-left: 6px; }
.rp-filter-row > .rp-flabel:first-child { margin-left: 0; }
.rp-pills { display: inline-flex; border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.rp-pill {
  padding: 0 14px; height: 28px; line-height: 26px; border: 0; background: #fff;
  font-size: 12.5px; color: var(--text-sub); cursor: pointer; border-right: 1px solid var(--border);
  white-space: nowrap;
}
.rp-pill:last-child { border-right: 0; }
.rp-pill:hover { color: #2b6cb0; }
.rp-pill.active { background: #2b6cb0; color: #fff; }
.rp-date {
  height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 3px;
  font-size: 12.5px; color: var(--text); background: #fff;
}
.rp-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-sub); cursor: pointer; }
.rp-collapse {
  margin-left: auto; border: 0; background: none; color: #2b6cb0; font-size: 12.5px; cursor: pointer; padding: 2px 4px;
}

/* ---- 提示条 ---- */
.rp-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fffdf0; border: 1px solid #f6e6b4; border-left: 3px solid #e8b83a;
  border-radius: 3px; padding: 10px 14px; margin-bottom: 12px;
}
.rp-banner-text { flex: 1; font-size: 12.5px; line-height: 1.7; color: #7a6430; }
.rp-banner-close {
  border: 0; background: none; color: #b9a06a; font-size: 14px; cursor: pointer; line-height: 1; padding: 2px 4px;
}
.rp-banner-close:hover { color: #7a6430; }

/* ---- 报表主体 ---- */
.rp-body { padding: 0; }
.rp-body .tabs { margin: 0 0 0; padding: 0 18px; }

.rp-summary {
  display: flex; flex-wrap: wrap; gap: 8px 0;
  padding: 16px 24px 14px; border-bottom: 1px solid var(--border-weak, #eef2f7);
}
/* 5 个指标等宽均分，和百度统计一致。
   早先用 min-width + 固定 gap，宽度由内容撑开，
   结果「浏览量(PV)」最宽、后面越来越挤，间距很不均匀。 */
.rp-sum-cell { flex: 1 1 0; min-width: 118px; padding-right: 16px; }
.rp-sum-head { display: flex; align-items: center; gap: 4px; }
.rp-sum-label { font-size: 12.5px; color: var(--text-sub); }
.rp-sum-value {
  margin-top: 6px; font-size: 28px; font-weight: 400; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.15;
}
.rp-sum-cell .metric-delta { margin-top: 4px; display: block; font-size: 12px; }

/* ---- 图表区 ---- */
.rp-chart-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px 6px;
}
.rp-select {
  height: 28px; min-width: 132px; max-width: 220px; padding: 0 24px 0 8px;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  font-size: 12.5px; color: var(--text); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b98a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.rp-select.small { min-width: 76px; }
.rp-select:focus { outline: none; border-color: #4f92d9; }
.rp-chart-row { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 12px; padding: 0 12px; }
.rp-donut, .rp-trend, .rp-map { min-width: 0; }
.rp-maplist { padding: 8px 8px 0; }
.rp-maplist-head, .rp-maplist-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 104px 72px;
  align-items: center; gap: 6px; font-size: 12.5px;
}
.rp-maplist-head {
  color: var(--text-sub); border-bottom: 1px solid var(--border-weak, #eef2f7);
  padding-bottom: 6px; white-space: nowrap;
}
.rp-maplist-row { padding: 5px 0; }
.rp-maplist-idx { color: var(--text-muted); text-align: center; }
.rp-maplist-name { color: #2b6cb0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-maplist-name:hover { text-decoration: underline; }
.rp-maplist-val { text-align: right; font-variant-numeric: tabular-nums; }
.rp-maplist-ratio { text-align: right; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.rp-metric-bar { padding: 10px 18px 14px; }
.rp-metric-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 3px; background: #fff;
  font-size: 12.5px; color: var(--text); cursor: pointer;
}
.rp-metric-btn:hover { border-color: #4f92d9; color: #2b6cb0; }
.rp-metric-icon { color: #2b6cb0; font-size: 13px; }

/* ---- 表格 ---- */
.rp-table-wrap { overflow-x: auto; border-top: 1px solid var(--border-weak, #eef2f7); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rp-table thead th {
  background: #f7f9fc; color: var(--text-sub); font-weight: 400; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--border-weak, #eef2f7); white-space: nowrap;
}
.rp-th-dim { min-width: 260px; vertical-align: middle; }
.rp-th-group { text-align: center !important; border-left: 1px solid #e6ebf2; }
.rp-col-row .rp-th-metric { text-align: right; cursor: pointer; user-select: none; border-left: 1px solid #eef2f7; }
.rp-col-row .rp-th-metric:hover { color: #2b6cb0; }
.rp-th-inner { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.rp-sort { font-size: 10px; color: #2b6cb0; }
.rp-sort.muted { color: #c3ccd8; }

.rp-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border-weak, #eef2f7); vertical-align: middle;
}
.rp-row:hover { background: #fafcff; }
.rp-td-dim { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.rp-idx { color: var(--text-muted); min-width: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.rp-dim-link { color: #2b6cb0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.rp-dim-link:hover { text-decoration: underline; }
.rp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-delta { margin-left: 6px; font-size: 11px; }
.rp-delta.good { color: #2f9e44; }
.rp-delta.bad { color: #d64545; }
.rp-expand {
  width: 18px; height: 18px; line-height: 15px; padding: 0; border: 1px solid var(--border);
  border-radius: 2px; background: #fff; color: var(--text-sub); font-size: 13px; cursor: pointer; flex: none;
}
.rp-expand:hover { border-color: #4f92d9; color: #2b6cb0; }
.rp-expand-row td { background: #fbfcfe; padding: 0; }
.rp-expand-body { padding: 10px 18px 14px 46px; }
.rp-expand-item { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; }
.rp-expand-url { color: #2b6cb0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.rp-expand-val { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rp-expand-error { font-size: 12.5px; color: var(--text-muted); }
.rp-total-row td { background: #fcfdfe; font-weight: 600; border-top: 1px solid #e6ebf2; }
.rp-total-row .rp-td-dim { color: var(--text); }

/* ---- 分页 ---- */
.rp-pager {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px 6px; font-size: 12.5px;
}
.rp-pager-left { display: flex; align-items: center; gap: 8px; }
.rp-pager-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.rp-page {
  min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid transparent; border-radius: 3px;
  background: none; color: #2b6cb0; font-size: 12.5px; cursor: pointer;
}
.rp-page:hover:not(:disabled) { background: #eef4ff; }
.rp-page.active { background: #2b6cb0; color: #fff; cursor: default; }
.rp-page:disabled { color: #c3ccd8; cursor: not-allowed; }
.rp-page-gap { color: var(--text-muted); padding: 0 2px; }
.rp-jump {
  width: 44px; height: 28px; text-align: center; border: 1px solid var(--border);
  border-radius: 3px; font-size: 12.5px;
}
.rp-page-btn {
  height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: 3px;
  background: #fff; font-size: 12.5px; color: var(--text-sub); cursor: pointer;
}
.rp-page-btn:hover { border-color: #4f92d9; color: #2b6cb0; }
.rp-pager-hint { padding: 0 18px 14px; font-size: 12px; color: var(--text-muted); width: 100%; }

/* ---- 小贴士 ---- */
.rp-tip { padding: 4px 18px 18px; }
.rp-tip-title { font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
.rp-tip-body { font-size: 12px; line-height: 1.8; color: var(--text-muted); }

/* ---- 自定义指标弹窗 ---- */
.rp-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.rp-picker-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }

@media (max-width: 1180px) {
  .rp-chart-row { grid-template-columns: 1fr; }
  .rp-summary { gap: 14px 28px; }
}

/* ============================================================ 主页（多站点一览） */

/* 主页模式下顶栏只留品牌和用户区：主页是跨站点的总览，
   没有「当前站点」也没有「日期区间」，这些控件留着只会误导。 */
.topbar.home-mode .topbar-main { display: none !important; }
.topbar.home-mode #range-label { display: none !important; }

/* flat 菜单组：不显示分组标题，条目当一级入口用（目前只有「主页」） */
.menu-group-flat { margin-top: 8px; }
.menu-group-flat .menu-item { font-weight: 600; }

/* ---- 工具条 ---- */
.hm-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 16px; margin-bottom: 12px;
}
.hm-label { font-size: 12.5px; color: var(--text-sub); }
.hm-search { display: flex; align-items: center; margin-left: auto; }
/* 搜索维度下拉（按域名 / 按站点名称），和输入框拼成一组 */
.hm-search-by {
  height: 30px; padding: 0 24px 0 10px; font-size: 12.5px; color: var(--text-sub);
  border: 1px solid var(--border); border-right: 0; border-radius: 3px 0 0 3px;
  background-color: #f7f9fc; cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b98a8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.hm-search-by:focus { border-color: #4f92d9; }
.hm-input {
  height: 30px; width: 220px; padding: 0 30px 0 10px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 0 3px 3px 0; outline: none;
}
.hm-input:focus { border-color: #4f92d9; }
.hm-search-icon {
  margin-left: -26px; font-size: 12px; color: var(--text-muted); pointer-events: none;
}

/* ---- 表格 ---- */
.hm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hm-table thead th {
  background: #f7f9fc; color: var(--text-sub); font-weight: 400; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--border-weak, #eef2f7); white-space: nowrap;
}
.hm-th-name { min-width: 240px; }
.hm-th-fav { width: 56px; }
.hm-th-label { width: 92px; }
.hm-th-num { text-align: right; cursor: pointer; user-select: none; }
.hm-th-num:hover { color: #2b6cb0; }
.hm-th-inner { display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; }
.hm-sort { font-size: 10px; color: #2b6cb0; }
.hm-sort.muted { color: #c3ccd8; }
.hm-th-act { width: 96px; text-align: center; }

.hm-row td { padding: 8px 12px; border-bottom: 1px solid #f2f5f9; vertical-align: middle; }
/* 每个站点的第一行加上分隔，三行视觉上归成一组 */
.hm-row.first td { border-top: 1px solid var(--border-weak, #eef2f7); }
.hm-row:hover td { background: #fafcff; }
/* 预计今日那一行：数值本身用正常颜色（和百度的观感一致），
   只有不能外推的比率指标显示为灰色的 -- */
.hm-dash { color: var(--text-muted); }

.hm-td-name { vertical-align: top; padding-top: 12px !important; }
.hm-site-link {
  color: #2b6cb0; font-size: 13.5px; text-decoration: none;
  display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hm-site-link:hover { text-decoration: underline; }
.hm-site-sub { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }

.hm-td-fav { text-align: center; vertical-align: top; padding-top: 12px !important; }
.hm-heart {
  border: 0; background: none; font-size: 17px; line-height: 1; cursor: pointer;
  color: #c3ccd8; padding: 2px;
}
.hm-heart:hover { color: #e05252; }
.hm-heart.on { color: #e05252; }

.hm-td-label { color: var(--text-sub); width: 92px; }
.hm-td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-up { color: #d64545; font-size: 11px; }
.hm-td-act { text-align: center; }

@media (max-width: 900px) {
  .hm-search { margin-left: 0; width: 100%; }
  .hm-input { flex: 1; width: auto; }
  .hm-th-name, .hm-site-link { min-width: 0; max-width: 180px; }
}
