:root {
  --ink: #102629;
  --muted: #5e7476;
  --paper: #f2f0e9;
  --surface: #fbfaf6;
  --line: #d6d9d1;
  --night: #0d2528;
  --night-2: #16363a;
  --cyan: #34d5c5;
  --coral: #ef745f;
  --gold: #e4b95f;
  --violet: #8b82df;
  --shadow: 0 18px 60px rgba(13, 37, 40, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 6%, rgba(52, 213, 197, .11), transparent 22rem),
    var(--paper);
  font-family: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.wrap { width: min(1440px, calc(100% - 64px)); margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 74px; padding: 0 32px;
  display: flex; align-items: center; gap: 44px;
  color: #edf8f6; background: rgba(13, 37, 40, .94);
  border-bottom: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--night); background: var(--cyan); font-weight: 900; border-radius: 8px 2px 8px 2px; }
.brand strong { display: block; font-size: 14px; letter-spacing: .06em; }
.brand small { display: block; margin-top: 2px; color: #94b0b1; font-size: 9px; letter-spacing: .18em; }
.topbar nav { display: flex; gap: 30px; }
.topbar nav a { color: #b9cece; text-decoration: none; font-size: 13px; }
.topbar nav a:hover { color: white; }
.health { display: flex; align-items: center; gap: 8px; min-width: 84px; color: #aac1c1; font-size: 12px; }
.health i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(228,185,95,.15); }
.health.ok i { background: var(--cyan); box-shadow: 0 0 0 4px rgba(52,213,197,.15); }
.health.error i { background: var(--coral); }

.hero { min-height: 480px; display: grid; grid-template-columns: 1fr 380px; align-items: center; gap: 84px; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { display: block; color: #39877f; font: 800 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 16px 0 22px; max-width: 900px; font-family: Georgia, "Songti SC", serif; font-size: clamp(44px, 6vw, 82px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.hero h1 em { color: var(--coral); font-style: normal; }
.hero-copy p { max-width: 720px; color: var(--muted); font-size: 17px; line-height: 1.9; }
.hero-meta { position: relative; padding: 30px; color: #dbe8e7; background: var(--night); border-radius: 2px 26px 2px 26px; box-shadow: var(--shadow); overflow: hidden; }
.hero-meta::after { content: ""; position: absolute; right: -45px; top: -45px; width: 130px; height: 130px; border: 26px solid rgba(52,213,197,.14); border-radius: 50%; }
.hero-meta > span { color: var(--cyan); font: 700 10px/1 ui-monospace, monospace; letter-spacing: .18em; }
.hero-meta > strong { display: block; margin: 14px 0 30px; word-break: break-all; font: 600 16px/1.5 ui-monospace, monospace; }
.hero-meta div { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.hero-meta div span { color: #87a3a4; }

.kpi-strip { padding: 28px 0; color: white; background: var(--night); }
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); }
.kpi { min-width: 0; padding: 12px 24px; border-left: 1px solid rgba(255,255,255,.12); }
.kpi:first-child { border-left: 0; }
.kpi span { display: block; color: #8eaaab; font-size: 11px; }
.kpi strong { display: block; margin: 9px 0 5px; font: 500 clamp(22px, 2.5vw, 38px)/1 Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: #b9cccc; font-size: 10px; }

.section { padding-top: 92px; padding-bottom: 110px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 34px; }
.section-head > div { display: flex; align-items: baseline; gap: 18px; }
.section-index { color: var(--coral); font: 800 11px/1 ui-monospace, monospace; }
.section-head h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 38px; font-weight: 500; }
.section-head p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.section-head.inverse { color: white; }
.section-head.inverse p { color: #9bb3b4; }
.chart-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 18px; }
.panel { min-width: 0; padding: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(13,37,40,.045); }
.panel-wide { grid-row: span 2; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.bar-list { display: grid; gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(170px, 1fr) 2.2fr 52px; align-items: center; gap: 16px; font-size: 12px; }
.bar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar-track { height: 9px; background: #e5e4dd; overflow: hidden; }
.bar-fill { height: 100%; min-width: 2px; background: linear-gradient(90deg, #2ab4a7, var(--cyan)); transform-origin: left; animation: grow .6s ease-out both; }
.bar-value { text-align: right; font: 700 12px ui-monospace, monospace; }
@keyframes grow { from { transform: scaleX(0); } }
.donut-layout { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 28px; }
.donut { width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan) 0 50%, var(--coral) 50% 70%, var(--gold) 70% 90%, var(--violet) 90%); }
.donut::after { content: ""; grid-area: 1/1; width: 82px; height: 82px; border-radius: 50%; background: var(--surface); }
.donut span { z-index: 1; grid-area: 1/1; font: 600 20px Georgia, serif; }
.legend { display: grid; gap: 9px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 11px; }
.legend-row i { width: 8px; height: 8px; }
.legend-row span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: rank; }
.rank-list li { counter-increment: rank; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #e6e5df; font-size: 11px; }
.rank-list li::before { content: counter(rank, decimal-leading-zero); color: var(--coral); font: 700 10px ui-monospace, monospace; }
.rank-list span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-list b { font: 700 11px ui-monospace, monospace; }
.round-confidence { display: grid; gap: 12px; }
.confidence-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; align-items: center; gap: 12px; font-size: 11px; }
.confidence-row span { color: var(--muted); }
.confidence-track { height: 8px; overflow: hidden; background: #e5e4dd; }
.confidence-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--gold)); }
.confidence-row b { font: 700 11px ui-monospace, monospace; }
.snapshot-note { grid-column: 1 / -1; padding: 14px 16px; color: #456062; background: #e9f4f1; border-left: 3px solid #2ab4a7; font-size: 11px; line-height: 1.7; }

.browser-section { padding: 92px 0 110px; color: white; background: var(--night); }
.filter-card { padding: 22px; display: grid; grid-template-columns: 1.8fr repeat(6, minmax(110px, .7fr)); gap: 12px; color: var(--ink); background: #f8f7f2; }
.filter-card label { min-width: 0; }
.filter-card label > span { display: block; margin-bottom: 7px; color: #647678; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.filter-card input, .filter-card select, .event-filter input, .event-filter select {
  width: 100%; height: 42px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #d3d8d3; border-radius: 0; outline: none;
}
.filter-card input:focus, .filter-card select:focus, .event-filter input:focus, .event-filter select:focus { border-color: #289f94; box-shadow: 0 0 0 3px rgba(52,213,197,.13); }
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.filter-actions .check { display: flex; align-items: center; gap: 8px; margin-right: auto; color: var(--muted); font-size: 12px; }
.filter-actions .check span { margin: 0; color: inherit; font-size: inherit; text-transform: none; letter-spacing: 0; }
.button { min-height: 38px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-size: 12px; }
.button.primary { color: var(--night); background: var(--cyan); font-weight: 700; }
.button.subtle { color: #516567; background: transparent; border-color: #ccd3ce; }
.result-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; color: #9eb4b5; font-size: 12px; }
.page-size select { padding: 5px 8px; color: #dce9e7; background: #163438; border: 1px solid #36575a; }
.table-shell { position: relative; min-height: 360px; overflow-x: auto; background: #102c2f; border: 1px solid #29484b; }
table { width: 100%; border-collapse: collapse; min-width: 1050px; }
th { padding: 13px 16px; color: #789798; background: #0b2124; border-bottom: 1px solid #2b4a4d; text-align: left; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
td { padding: 15px 16px; border-bottom: 1px solid #254347; color: #c4d5d4; vertical-align: top; font-size: 12px; }
tbody tr { transition: background .18s ease; }
tbody tr:hover { background: #17383c; }
.trace-main { max-width: 390px; }
.trace-main strong { display: block; color: #eef7f6; font-size: 13px; }
.trace-main code { display: block; margin-top: 5px; color: #789899; font: 10px/1.45 ui-monospace, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-muted { color: #8ea5a6; }
.number { font: 700 12px ui-monospace, monospace; }
.status-pill { display: inline-flex; padding: 4px 8px; border: 1px solid #496367; color: #b7c9c9; font-size: 9px; text-transform: uppercase; }
.status-pill.completed { color: var(--cyan); border-color: rgba(52,213,197,.45); background: rgba(52,213,197,.07); }
.source-pill { display: inline-flex; padding: 4px 8px; color: #c5baf5; border: 1px solid rgba(139,130,223,.5); font-size: 9px; text-transform: uppercase; }
.source-pill.gateway { color: var(--gold); border-color: rgba(228,185,95,.5); }
.row-button { padding: 6px 10px; color: var(--cyan); background: transparent; border: 1px solid #3a6667; cursor: pointer; white-space: nowrap; }
.loading-state, .empty-state { padding: 80px 20px; color: #89a4a5; text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; color: #9eb5b5; font-size: 11px; }
.pagination button { padding: 8px 13px; color: #c7d7d6; background: #17373b; border: 1px solid #36565a; cursor: pointer; }
.pagination button:disabled { opacity: .35; cursor: default; }

.detail-dialog { width: min(1180px, calc(100% - 40px)); max-width: none; height: min(860px, calc(100% - 36px)); padding: 0; border: 0; background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.detail-dialog::backdrop { background: rgba(5,21,23,.72); backdrop-filter: blur(5px); }
.detail-shell { height: 100%; display: grid; grid-template-rows: auto auto 1fr; }
.detail-head { padding: 25px 28px 22px; display: flex; justify-content: space-between; gap: 30px; color: white; background: var(--night); }
.detail-head h2 { margin: 8px 0 6px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.detail-head p { max-width: 900px; margin: 0; color: #91aaab; font: 10px/1.5 ui-monospace, monospace; word-break: break-all; }
.close-button { align-self: flex-start; width: 38px; height: 38px; color: #b8cdcd; background: transparent; border: 1px solid #446165; cursor: pointer; font-size: 26px; }
.detail-tabs { padding: 0 28px; display: flex; border-bottom: 1px solid var(--line); background: #f0efe9; }
.detail-tabs button { padding: 14px 22px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: 12px; }
.detail-tabs button.active { color: var(--ink); border-bottom-color: var(--coral); font-weight: 700; }
.detail-content { min-height: 0; overflow: auto; padding: 26px 28px 36px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.metric-card { padding: 16px; background: white; border: 1px solid var(--line); }
.metric-card span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin-top: 9px; font: 500 21px Georgia, serif; }
.detail-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-panel { padding: 18px; background: white; border: 1px solid var(--line); min-width: 0; }
.detail-panel h3 { margin: 0 0 15px; font-size: 13px; }
.key-values { display: grid; grid-template-columns: 120px 1fr; gap: 9px 16px; font-size: 11px; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 5px 8px; color: #3f6664; background: #e5f3f0; font-size: 10px; }
.reference-list { margin: 0; padding-left: 18px; color: var(--muted); font: 10px/1.7 ui-monospace, monospace; overflow-wrap: anywhere; }
.event-filter { display: grid; grid-template-columns: 1fr 240px auto; gap: 10px; margin-bottom: 18px; }
.event-list, .round-list { display: grid; gap: 10px; }
.event-card, .round-card { padding: 15px 17px; background: white; border: 1px solid var(--line); }
.event-meta, .round-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font: 9px ui-monospace, monospace; }
.event-meta b, .round-meta b { color: #287c75; }
.event-card h4, .round-card h4 { margin: 10px 0 7px; font-size: 12px; }
.event-card pre { max-height: 220px; overflow: auto; margin: 8px 0 0; padding: 12px; color: #294244; background: #f1f2ed; white-space: pre-wrap; overflow-wrap: anywhere; font: 10px/1.6 ui-monospace, monospace; }
.round-card p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.pagination.compact { color: var(--muted); }
.pagination.compact button { color: var(--ink); background: white; border-color: var(--line); }

.footer { padding: 30px 0 42px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.footer strong, .footer span { display: block; }
.footer span { margin-top: 5px; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr 300px; gap: 40px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .kpi:nth-child(4) { border-left: 0; }
  .filter-card { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, 1440px); }
  .topbar { height: 64px; padding: 0 14px; }
  .topbar nav { display: none; }
  .health { min-width: 0; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding-top: 54px; gap: 30px; }
  .hero h1 { font-size: 46px; }
  .hero-meta { max-width: none; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi, .kpi:nth-child(4) { border-left: 1px solid rgba(255,255,255,.12); }
  .kpi:nth-child(odd) { border-left: 0; }
  .section { padding: 68px 0; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .chart-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-row: auto; }
  .bar-row { grid-template-columns: minmax(100px,1fr) 1.4fr 38px; gap: 8px; }
  .donut-layout { grid-template-columns: 110px 1fr; }
  .donut { width: 105px; height: 105px; }
  .donut::after { width: 65px; height: 65px; }
  .filter-card { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .check { flex-basis: 100%; }
  .detail-dialog { width: calc(100% - 16px); height: calc(100% - 16px); }
  .detail-head, .detail-content { padding-left: 16px; padding-right: 16px; }
  .detail-tabs { padding: 0 8px; }
  .metric-grid, .detail-grid { grid-template-columns: 1fr 1fr; }
  .event-filter { grid-template-columns: 1fr; }
}
