:root {
  --bg: #f7f7f4;
  --surface: #fff;
  --ink: #171916;
  --muted: #73776f;
  --line: #e7e8e2;
  --green: #1f8f68;
  --green-soft: #eaf6f1;
  --coral: #f7644f;
  --yellow: #f2b84b;
  --blue: #4985c7;
  --radius: 22px;
  --shadow: 0 18px 48px rgba(24, 31, 25, .06);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% 9%, rgba(247,100,79,.07) 0 4px, transparent 5px), radial-gradient(circle at 92% 12%, rgba(31,143,104,.07) 0 4px, transparent 5px), var(--bg); }
button, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(73,133,199,.25); outline-offset: 2px; }
.analytics-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 max(24px, calc((100vw - 1400px) / 2)); border-bottom: 1px solid rgba(222,224,217,.85); background: rgba(247,247,244,.88); backdrop-filter: blur(18px); }
.analytics-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.analytics-brand strong { display: block; font-size: 20px; letter-spacing: -.04em; }
.analytics-brand small { display: block; margin-top: 2px; color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.analytics-logo { position: relative; width: 38px; height: 38px; display: block; }
.analytics-logo i { position: absolute; width: 12px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; }
.analytics-logo i:nth-child(1) { left: 13px; top: 0; background: var(--coral); }
.analytics-logo i:nth-child(2) { left: 1px; top: 12px; background: var(--green); }
.analytics-logo i:nth-child(3) { right: 1px; top: 12px; background: var(--yellow); }
.analytics-logo i:nth-child(4) { left: 7px; bottom: 0; background: var(--blue); }
.analytics-logo i:nth-child(5) { right: 7px; bottom: 0; background: #e98ca7; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.header-links { display: flex; align-items: center; gap: 18px; }
.platform-entry-link { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: #fff0ed; color: #d94735; font-size: 11px; font-weight: 900; text-decoration: none; }
.analytics-main { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 48px; }
.analytics-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.analytics-hero h1 { max-width: 780px; margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1.12; letter-spacing: -.055em; }
.analytics-hero > div > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.analytics-controls { display: flex; align-items: flex-end; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.8); box-shadow: var(--shadow); }
.analytics-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.analytics-controls select { min-width: 132px; height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); font-size: 12px; font-weight: 700; }
.analytics-controls button, .analytics-state button { height: 40px; padding: 0 17px; border: 0; border-radius: 11px; background: var(--ink); color: white; font-size: 12px; font-weight: 800; cursor: pointer; }
.analytics-state { display: grid; place-items: center; min-height: 360px; text-align: center; }
.analytics-state strong { margin-top: 16px; font-size: 18px; }
.analytics-state p { margin: 7px 0 18px; color: var(--muted); font-size: 13px; }
.loader { width: 30px; height: 30px; border: 3px solid #dfe6e1; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.error-state > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff0ed; color: var(--coral); font-size: 20px; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card { min-height: 166px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.kpi-card > div { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 800; }
.kpi-card em { padding: 5px 7px; border-radius: 7px; background: #f1f2ee; color: var(--muted); font-size: 9px; font-style: normal; letter-spacing: .1em; }
.kpi-card > strong { display: block; margin-top: 24px; font-size: 42px; line-height: 1; letter-spacing: -.06em; }
.kpi-card p { margin: 11px 0 0; color: var(--muted); font-size: 11px; }
.kpi-card p.is-up { color: var(--green); }
.kpi-card p.is-down { color: var(--coral); }
.kpi-card--dark { border-color: var(--ink); background: var(--ink); color: white; }
.kpi-card--dark > div, .kpi-card--dark p { color: #b9beb6; }
.kpi-card--dark em { background: rgba(255,255,255,.1); color: #e8ebe6; }
.insight-section { margin-top: 36px; }
.section-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.section-heading > span, .panel-heading > span { color: var(--muted); font-size: 11px; }
.insight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.insight-card { min-height: 126px; padding: 18px; border-radius: 18px; background: var(--green-soft); }
.insight-card:nth-child(2) { background: #fff3df; }
.insight-card:nth-child(3) { background: #eef3fa; }
.insight-card:nth-child(4) { background: #fff0ed; }
.insight-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.insight-card strong { display: block; margin-top: 12px; font-size: 18px; line-height: 1.35; }
.insight-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.panel { margin-top: 16px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.panel-heading p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.chart-legend { display: flex; gap: 15px; color: var(--muted); font-size: 11px; font-weight: 700; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 17px; height: 3px; border-radius: 999px; }
.legend-pv { background: var(--green); }
.legend-uv { background: var(--coral); }
.trend-chart { width: 100%; min-height: 280px; margin-top: 22px; overflow: hidden; }
.trend-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #eceee9; stroke-width: 1; }
.chart-axis-label { fill: #8b8f87; font-size: 10px; }
.chart-pv-area { fill: url(#pvGradient); }
.chart-pv-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-uv-line { fill: none; stroke: var(--coral); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 6; }
.analysis-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 16px; }
.analysis-grid .panel { min-width: 0; }
.panel-heading.compact { align-items: center; }
.hour-chart { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 4px; height: 190px; margin-top: 22px; padding-top: 15px; border-bottom: 1px solid var(--line); }
.hour-column { position: relative; height: 100%; display: flex; align-items: flex-end; }
.hour-column i { width: 100%; min-height: 2px; border-radius: 5px 5px 0 0; background: #d8eee5; transition: .2s; }
.hour-column:hover i, .hour-column.is-peak i { background: var(--green); }
.hour-column span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 8px; }
.rank-list { display: grid; gap: 16px; margin-top: 24px; }
.rank-row { display: grid; grid-template-columns: minmax(72px, 1fr) 2.2fr auto; align-items: center; gap: 10px; }
.rank-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 7px; overflow: hidden; border-radius: 99px; background: #eceee9; }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.rank-row:nth-child(2n) .rank-track i { background: var(--blue); }
.rank-row span { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-heading { padding: 24px 24px 18px; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 24px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #fafaf8; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .05em; }
td { font-size: 12px; }
td strong { font-size: 12px; }
td small { display: block; max-width: 420px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
.empty-cell { height: 120px; color: var(--muted); text-align: center; }
.ip-pill { display: inline-flex; padding: 6px 9px; border-radius: 8px; background: #f0f2ee; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 700; }
.analytics-footnote { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 18px; padding: 22px 4px; color: var(--muted); }
.analytics-footnote strong { color: var(--ink); font-size: 11px; }
.analytics-footnote p { margin: 5px 0 0; font-size: 10px; line-height: 1.7; }
@media (max-width: 1100px) { .kpi-grid, .insight-grid { grid-template-columns: repeat(2, 1fr); } .analysis-grid { grid-template-columns: 1fr 1fr; } .hour-panel { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .analytics-topbar { min-height: 62px; padding: 0 16px; }
  .analytics-brand strong { font-size: 17px; }
  .analytics-main { width: min(100% - 28px, 1400px); padding-top: 34px; padding-bottom: 100px; }
  .analytics-hero { display: grid; gap: 24px; }
  .analytics-controls { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .analytics-controls select { width: 100%; min-width: 0; }
  .analytics-controls button { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 142px; padding: 17px; }
  .kpi-card > strong { margin-top: 20px; font-size: 34px; }
  .insight-grid, .analysis-grid, .analytics-footnote { grid-template-columns: 1fr; }
  .hour-panel { grid-column: auto; }
  .panel { padding: 18px; }
  .table-panel { padding: 0; }
  th, td { padding: 13px 16px; }
  .back-link { font-size: 0; }
  .back-link span { font-size: 18px; }
  .trend-chart { min-height: 210px; }
}
@media (max-width: 430px) { .kpi-grid { grid-template-columns: 1fr; } .kpi-card { min-height: 132px; } .insight-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; } }
