:root {
  --ink: #152028;
  --text: #152028;
  --muted: #64717b;
  --line: #dbe4e7;
  --border: #dbe4e7;
  --soft: #eef4f4;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-2: #2563eb;
  --primary: #0f766e;
  --bg: #eef4f4;
  --danger: #c2410c;
  --shadow: 0 16px 44px rgba(18, 32, 39, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15,118,110,.05) 1px, transparent 1px),
    linear-gradient(rgba(15,118,110,.045) 1px, transparent 1px),
    #f6f8f7;
  background-size: 24px 24px;
  font-family: "DIN Alternate", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hidden { display: none !important; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(920px, 100%);
  min-height: 420px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  padding: 38px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-panel h1 {
  margin: 34px 0 10px;
  font-size: 42px;
  letter-spacing: 0;
}

.login-panel p, .side-brand span, .metric em, .panel-head span, .form-error {
  color: var(--muted);
}

.login-form {
  align-self: center;
  display: grid;
  gap: 16px;
}

label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
input, select, button {
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input, select { padding: 0 12px; }
select { min-width: 128px; }
button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}
.login-form button, .primary-btn {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.ghost-btn {
  background: transparent;
  color: var(--muted);
}
.form-error { min-height: 20px; color: var(--danger); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #111b20;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.side-brand { display: flex; gap: 12px; align-items: center; }
.side-brand span { display: block; margin-top: 3px; font-size: 12px; }
.side-brand .brand-mark { background: #e6fffb; color: #0f3f3a; }
.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #b8c5ca;
  border-color: transparent;
}
.nav-item.active, .nav-item:hover {
  background: #1e3036;
  color: #fff;
}
.sidebar .ghost-btn {
  margin-top: auto;
  color: #c7d3d7;
  border-color: #2c444b;
}

.workspace {
  min-width: 0;
  padding: 22px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.topbar h2 { margin: 0 0 4px; font-size: 28px; }
#subTitle { color: var(--muted); }
.filters, .inline-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.view { display: none; }
.view.active { display: grid; gap: 18px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(128px, 1fr));
  gap: 12px;
}
.compact-metrics { grid-template-columns: repeat(4, minmax(128px, 1fr)); }
.user-metrics { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.metric {
  min-height: 112px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: space-between;
}
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 30px; letter-spacing: 0; }
.metric.warn strong { color: var(--danger); }

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}
.layout-two .wide { min-width: 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(18,32,39,.045);
  padding: 16px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.panel h3 { margin: 0; font-size: 17px; }
#chartHint { text-align: right; }
canvas { width: 100%; display: block; }
.chart-canvas-wrap {
  width: 100%;
  height: 260px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.chart-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
}
.user-trend-wrap { height: 220px; }
.register-trend-wrap { height: 220px; }
.inline-metrics { margin-bottom: 14px; }

.bar-list { display: grid; gap: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 54px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bar-track {
  height: 10px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.bar-fill.secondary {
  background: #94a3b8;
}
.compact .bar-row { grid-template-columns: 64px 1fr 54px; }
.platform-compare-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft);
}
.platform-compare-name { font-weight: 800; }
.platform-compare-bars { display: grid; gap: 6px; min-width: 0; }
.platform-bar-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.muted-line { color: var(--muted); }
.platform-split { color: var(--muted); font-size: 12px; white-space: nowrap; }

.feed-list { display: grid; gap: 8px; max-height: 316px; overflow: auto; }
.feed-item {
  display: grid;
  grid-template-columns: 88px 92px 1fr 52px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--soft);
  font-size: 13px;
}
.health-feed {
  grid-template-columns: 72px 72px minmax(120px, .7fr) 1fr;
}
.path-cell, .ua-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 520px;
}
.customer-cell {
  min-width: 120px;
  max-width: 220px;
}
.customer-chip {
  display: inline-grid;
  max-width: 100%;
  height: 24px;
  align-items: center;
  margin: 0 4px 4px 0;
  padding: 0 8px;
  border-radius: 6px;
  background: #eef7f6;
  color: #0f5f59;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ip-list {
  min-width: 180px;
}
.ip-chip {
  display: inline-grid;
  height: 24px;
  align-items: center;
  margin: 0 4px 4px 0;
  padding: 0 8px;
  border-radius: 6px;
  background: #eef2f4;
  color: #33434c;
  font-weight: 700;
  white-space: nowrap;
}
.status {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 24px;
  border-radius: 6px;
  background: #e7f7f3;
  color: #047857;
  font-weight: 700;
}
.status.ok { background: #e7f7f3; color: #047857; }
.status.warn { background: #fff8db; color: #a16207; }
.status.bad { background: #fff0e8; color: var(--danger); }
.status.unknown { background: #eef2f4; color: var(--muted); }

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}
.users-table { min-width: 1040px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  background: #f3f7f7;
}
th, td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--soft);
  vertical-align: middle;
}
td { max-width: 360px; }

.search-input { width: 260px; }
.status-input { width: 96px; }
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
}
.config-list {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  margin: 0;
}
.config-list dt { color: var(--muted); }
.config-list dd { margin: 0; overflow-wrap: anywhere; }

.tab-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.tab-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
}
.tab-btn.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.source-metrics {
  margin-bottom: 14px;
}
.section-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--soft);
}
.compact-head {
  margin-top: 0;
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow: auto;
    gap: 12px;
  }
  .nav-list { display: flex; }
  .nav-item { white-space: nowrap; }
  .sidebar .ghost-btn { margin-top: 0; margin-left: auto; }
  .metric-grid, .compact-metrics, .user-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-two { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { padding-bottom: 64px; }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 20;
    height: auto;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    background: #0c1222;
    border-top: 1px solid #1e3036;
    box-shadow: 0 -4px 12px rgba(0,0,0,.2);
  }
  .side-brand .brand-mark { width: 32px; height: 32px; font-size: 14px; }
  .side-brand div:last-child { display: none; }
  .nav-list { flex-wrap: nowrap; gap: 4px; overflow-x: auto; }
  .nav-item { font-size: 12px; padding: 0 8px; height: 32px; min-width: auto; }
  .sidebar .ghost-btn { margin-top: 0; }
  .workspace { padding: 12px 12px 72px; }
  .login-panel { grid-template-columns: 1fr; padding: 24px; }
  .login-panel h1 { font-size: 32px; }
  .topbar { align-items: stretch; flex-direction: column; }
  .filters > * { flex: 1; min-width: 130px; }
  .metric-grid, .compact-metrics, .user-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 92px; padding: 12px; }
  .metric strong { font-size: 24px; }
  .panel { padding: 12px; }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  #chartHint { text-align: left; }
  .inline-tools, .search-input, .status-input { width: 100%; }
  .inline-tools input { flex: 1 1 140px; }
  .feed-item {
    grid-template-columns: 64px 82px minmax(120px, 1fr) 48px;
    gap: 8px;
  }
  .path-cell, .ua-cell { max-width: 240px; }
  .customer-cell { min-width: 104px; }
  .ip-list { min-width: 150px; }
  .chart-canvas-wrap { height: 210px; }
  .user-trend-wrap { height: 190px; }
  .tab-btn { flex: 1 1 auto; padding: 0 10px; }
  .platform-compare-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .platform-split { white-space: normal; }
  .funnel-step {
    grid-template-columns: minmax(180px, 1fr) 92px 120px 54px;
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .metric-grid, .compact-metrics, .user-metrics { grid-template-columns: 1fr 1fr; }
  .topbar h2 { font-size: 24px; }
  .filters { gap: 8px; }
  .filters > * { min-width: 118px; }
  .customer-chip { max-width: 118px; }
}

.funnel-chart { display: grid; gap: 6px; padding: 8px 0; }
.funnel-step {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) 100px 80px 60px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--soft);
  font-size: 13px;
}
.funnel-step .funnel-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.funnel-step .funnel-uv { color: var(--primary); font-weight: 800; font-size: 18px; }
.funnel-step .funnel-req { color: var(--muted); font-size: 12px; }
.funnel-step .funnel-conv { font-weight: 700; }
.funnel-conv.high { color: #059669; }
.funnel-conv.mid { color: #d97706; }
.funnel-conv.low { color: #dc2626; }
.funnel-bar { height: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; margin-top: 4px; }

.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.habit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.habit-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.habit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.habit-head strong { font-size: 15px; }
.habit-share {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}
.habit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  align-items: baseline;
}
.habit-stats span { white-space: nowrap; }
.habit-uv { font-size: 20px; font-weight: 800; color: var(--primary); }
.habit-req { font-size: 12px; color: var(--muted); }
.habit-path { font-size: 12px; color: var(--muted); }
.habit-platforms { margin-bottom: 8px; }
.habit-paths { display: flex; flex-wrap: wrap; gap: 4px; }
.top-mod-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.compare-hint { font-size: 12px; font-style: normal; }
.compare-hint.up { color: #059669; }
.compare-hint.down { color: #dc2626; }

[data-theme="dark"] {
  --ink: #e2e8f0;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #1e293b;
  --border: #1e293b;
  --soft: #1e293b;
  --panel: #0f172a;
  --brand: #2dd4bf;
  --brand-2: #60a5fa;
  --primary: #2dd4bf;
  --bg: #1e293b;
  --danger: #fb923c;
  --shadow: 0 16px 44px rgba(0, 0, 0, .3);
}
[data-theme="dark"] body {
  background:
    linear-gradient(90deg, rgba(45,212,191,.03) 1px, transparent 1px),
    linear-gradient(rgba(45,212,191,.025) 1px, transparent 1px),
    #020617;
}
[data-theme="dark"] .sidebar { background: #0c1222; }
[data-theme="dark"] .nav-item.active, [data-theme="dark"] .nav-item:hover { background: #1e293b; }
[data-theme="dark"] input, [data-theme="dark"] select {
  background: #1e293b;
  border-color: #334155;
  color: var(--ink);
}
[data-theme="dark"] th { background: #1e293b; color: var(--muted); }
[data-theme="dark"] td { border-bottom-color: #1e293b; }
[data-theme="dark"] .customer-chip { background: #134e4a; color: #5eead4; }
[data-theme="dark"] .ip-chip { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .status.ok { background: #052e16; color: #4ade80; }
[data-theme="dark"] .status.warn { background: #422006; color: #fbbf24; }
[data-theme="dark"] .status.bad { background: #450a0a; color: #f87171; }
[data-theme="dark"] .status.unknown { background: #1e293b; color: var(--muted); }
[data-theme="dark"] .bar-track { background: #1e293b; }
[data-theme="dark"] .feed-item { border-bottom-color: #1e293b; }
[data-theme="dark"] .login-panel { background: rgba(15,23,42,.95); border-color: #1e293b; }
[data-theme="dark"] .habit-card { background: #1e293b; }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 600;
}
.tag-server {
  background: #fef3c7;
  color: #92400e;
}
.tag-service {
  background: #dbeafe;
  color: #1e40af;
}
[data-theme="dark"] .tag-server { background: #78350f; color: #fef3c7; }
[data-theme="dark"] .tag-service { background: #1e3a5f; color: #93c5fd; }

.user-stat-grid { display: none; }
.stat-huge { display: none; }

.ov-stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(18,32,39,.055);
  transition: box-shadow .2s, transform .15s;
}
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(18,32,39,.075);
}
.stat-hero {
  background: linear-gradient(135deg, var(--primary), #0d5f57);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15,118,110,.16);
}
.stat-hero:hover {
  box-shadow: 0 12px 28px rgba(15,118,110,.22);
}
.stat-sub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-hero .stat-label { color: rgba(255,255,255,.75); }
.stat-hero-num { font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: 0; }
.stat-hero-sub { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 6px; }
.stat-hero-sub span { font-weight: 700; }
.stat-big { font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: 0; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

.neu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(18,32,39,.055);
  padding: 16px 18px;
}
.neu-panel:hover {
  box-shadow: 0 10px 24px rgba(18,32,39,.075);
}

.ov-chart-full {
  min-height: 200px;
}
.ov-chart-full canvas { display: block; }

.chart-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.traffic-tabs { display: flex; gap: 3px; }
.traffic-tab {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  height: 28px;
  line-height: 22px;
}
.traffic-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(15,118,110,.2);
}

.top-toggle { display: flex; gap: 3px; }
.top-btn {
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  height: 26px;
  line-height: 22px;
}
.top-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(15,118,110,.2);
}

.hint { font-size: 11px; color: var(--muted); font-weight: 400; }

.ov-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.top-mod-list { display: flex; flex-direction: column; gap: 8px; }
.top-mod-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  transition: background .15s;
  border-radius: 6px;
}
.top-mod-row:hover { background: var(--soft); padding-left: 4px; padding-right: 4px; }
.top-mod-rank {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: inset 2px 2px 4px rgba(255,255,255,.5), inset -1px -1px 3px rgba(18,32,39,.06);
}
.top-mod-row:nth-child(1) .top-mod-rank { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 6px rgba(15,118,110,.25); }
.top-mod-row:nth-child(2) .top-mod-rank { background: #64748b; color: #fff; border-color: #64748b; }
.top-mod-row:nth-child(3) .top-mod-rank { background: #94a3b8; color: #fff; border-color: #94a3b8; }
.top-mod-body { flex: 1; min-width: 0; }
.top-mod-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.top-mod-bar-wrap { height: 5px; background: var(--soft); border-radius: 3px; overflow: hidden; box-shadow: inset 1px 1px 2px rgba(18,32,39,.06); }
.top-mod-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--brand-2)); border-radius: 3px; transition: width .3s; }
.top-mod-count { font-size: 12px; font-weight: 600; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.top-mod-uv { font-size: 18px; font-weight: 800; color: var(--primary); }
.top-mod-req { font-size: 11px; color: var(--muted); }

.ip-source-req { font-size: 18px; font-weight: 800; color: var(--primary); }

@media (max-width: 1080px) {
  .ov-stat-row { grid-template-columns: repeat(2, 1fr); }
  .ov-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .ov-stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 14px; border-radius: 8px; }
  .stat-hero-num { font-size: 32px; }
  .stat-big { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .ov-chart-full .chart-canvas-wrap { height: 190px; }
  .chart-controls { gap: 4px; }
  .traffic-tab { font-size: 11px; padding: 2px 8px; height: 26px; line-height: 22px; }
  .top-btn { font-size: 10px; padding: 2px 6px; }
  .neu-panel { padding: 12px; border-radius: 8px; }
  .top-mod-uv { font-size: 15px; }
  .sidebar .ghost-btn {
    white-space: nowrap;
    min-width: auto;
    font-size: 12px;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 420px) {
  .ov-stat-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-hero-num { font-size: 28px; }
  .stat-big { font-size: 18px; }
  .ov-chart-full .chart-canvas-wrap { height: 170px; }
  .traffic-tabs { gap: 2px; }
  .top-toggle { gap: 2px; }
  .sidebar .ghost-btn { font-size: 11px; padding: 0 8px; height: 30px; }
}

[data-theme="dark"] .stat-card {
  box-shadow: 0 8px 20px rgba(0,0,0,.24);
  border-color: #1e293b;
}
[data-theme="dark"] .stat-card:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
}
[data-theme="dark"] .stat-hero {
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
}
[data-theme="dark"] .neu-panel {
  box-shadow: 0 8px 20px rgba(0,0,0,.24);
  border-color: #1e293b;
}
[data-theme="dark"] .top-mod-rank {
  box-shadow: inset 1px 1px 3px rgba(0,0,0,.3), inset -1px -1px 2px rgba(30,41,59,.4);
}
[data-theme="dark"] .top-mod-bar-wrap {
  box-shadow: inset 1px 1px 2px rgba(0,0,0,.3);
}
