*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 子元素上的 display:flex 等会盖过 HTML hidden 的默认样式，导致「已登录仍显示登录/注册」等 */
[hidden] {
  display: none !important;
}

:root {
  --bg: #e8e8e8;
  --text: #1a1a1a;
  --muted: #5f6368;
  --card: #ffffff;
  --wait: #1e3a5f;
  --go-bright: #1e6b34;
  --fail: #8b1c1c;
  --radius: 12px;
  --chart-surface: #f7f8fb;
  --chart-line: #2563eb;
  --line: #dadce0;
  --hb-wait: #c0392b;
  --hb-go: #1f8f3a;
  --hb-intro: #3d7dca;
  --hb-done: #5c5c5c;
  --hb-arena-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  --hb-arena-radius: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(165deg, #dfe4ec 0%, #e8eaee 32%, #eceef2 100%);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.topnav,
.hb-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.hb-top {
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.brand,
.hb-brand {
  color: #2c2c2c;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.hb-top-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem 1.25rem;
}

.hb-top-nav a {
  color: #5f6368;
  text-decoration: none;
  font-size: 0.9rem;
}

.hb-top-nav a:hover {
  color: #1a1a1a;
}

.hb-top-nav a[aria-current="page"] {
  color: #1a1a1a;
  font-weight: 600;
}

.hb-top-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hb-username {
  color: #333;
  font-size: 0.88rem;
  margin-right: 0.2rem;
}

.hb-link-btn {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #333;
  cursor: pointer;
}

a.hb-link-btn {
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
}

.hb-link-btn:hover {
  background: #f5f5f5;
}

.hb-link-btn.primary {
  background: #1a56db;
  border-color: #1a56db;
  color: #fff;
}

.hb-link-btn.primary:hover {
  background: #1543ad;
  border-color: #1543ad;
}

.brand:hover {
  color: var(--hb-go);
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-guest {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn.sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.app,
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-narrow {
  max-width: 640px;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.warn {
  text-align: center;
  color: #fbbf24;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.panel {
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.panel:focus-visible {
  outline: 2px solid var(--go-bright);
  outline-offset: 3px;
}

.panel:active {
  transform: scale(0.99);
}

.panel[data-state="intro"] {
  background: var(--card);
  border-color: #2a3442;
}

.panel[data-state="waiting"] {
  background: var(--wait);
  border-color: var(--wait-border);
}

.panel[data-state="ready"] {
  background: var(--go);
  border-color: var(--go-bright);
}

.panel[data-state="fail"] {
  background: var(--fail);
  border-color: #a83248;
}

.panel[data-state="done"] {
  background: var(--card);
  border-color: #2a3442;
  cursor: default;
}

.panel-inner {
  text-align: center;
  padding: 1.5rem;
}

.panel-hint {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.panel-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.panel[data-state="ready"] .panel-hint,
.panel[data-state="ready"] .panel-sub {
  color: #fff;
}

.panel[data-state="ready"] .panel-sub {
  opacity: 0.95;
}

.controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  border: 1px solid #3d4a5c;
  background: #252d38;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: #2c3644;
  border-color: #556070;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn.ghost {
  background: transparent;
}

.stats {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid #2a3442;
}

.stats h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: #2a3442;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}

.times {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.times li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid #2a3442;
  font-variant-numeric: tabular-nums;
  animation: rowin 0.2s ease;
}

@keyframes rowin {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.times li:last-child {
  border-bottom: none;
}

.times .ms {
  font-weight: 600;
  color: var(--go-bright);
}

.run-avg {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.average {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--go-bright);
  font-variant-numeric: tabular-nums;
}

.saved {
  font-size: 0.9rem;
  color: #86b79a;
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.4rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}

.modal-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: #1a1a1a;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.modal-err {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.filter-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-row input[type="date"] {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.pill:hover {
  color: var(--text);
  border-color: #bbb;
}

.pill[aria-pressed="true"] {
  background: #e8f0fe;
  color: #1a56db;
  border-color: #1a56db;
}

.chart-wrap {
  background: var(--chart-surface);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #e2e6ee;
}

.chart-wrap h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #334155;
  font-weight: 600;
}

.chart-canvas {
  max-height: 360px;
}

.data-block {
  margin-top: 2rem;
}

.data-block h2 {
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #ececec;
  font-variant-numeric: tabular-nums;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  background: #f8f9fa;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.err {
  color: #f87171;
}

.footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Human Benchmark 式主测试区：大色块、红等绿、蓝开始 */
.hb-body {
  background: var(--bg);
}

.hb-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem max(1rem, env(safe-area-inset-left)) max(2rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-right));
  text-align: center;
}

.hb-page-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0.5rem 0 0.4rem;
  color: #141823;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hb-lead {
  margin: 0 0 1.5rem;
  color: #4a4f5a;
  font-size: 0.95rem;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.reaction-arena {
  max-width: 100%;
  margin: 0 auto 0.75rem;
  border-radius: var(--hb-arena-radius);
  overflow: hidden;
  box-shadow: var(--hb-arena-shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.hb-screen {
  border-radius: 0;
  min-height: min(64vh, 480px);
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.12s ease, color 0.12s ease;
  border: none;
}

.hb-screen:focus-visible {
  outline: 3px solid #1a56db;
  outline-offset: 3px;
}

.hb-screen:active {
  filter: brightness(0.98);
}

.hb-screen[data-state="intro"] {
  background: var(--hb-intro);
  color: #fff;
  border-color: #2a6cb8;
}

.hb-screen[data-state="between"] {
  background: var(--hb-intro);
  color: #fff;
  border-color: #2a6cb8;
  cursor: pointer;
}

.hb-screen[data-state="waiting"] {
  background: var(--hb-wait);
  color: #fff;
  border-color: #a12e22;
}

.hb-screen[data-state="ready"] {
  background: var(--hb-go);
  color: #fff;
  border-color: #1a6b2e;
}

/* 当次结果（Human Benchmark 式：整屏主色 + 中央大字 ms，再点继续） */
.hb-screen[data-state="result"] {
  background: linear-gradient(160deg, #2f6ed8 0%, #2563c9 50%, #1e4faf 100%);
  color: #fff;
  cursor: pointer;
}

.hb-screen.is-trial-result .hb-screen-live {
  display: none;
}

.hb-screen-hint.hb-hero-metric {
  font-size: clamp(2.75rem, 14vw, 4.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 0.25rem 0 0.5rem;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.12);
}

.hb-screen-sub.is-continue {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 0.5rem;
  opacity: 0.95;
}

.hb-screen[data-state="result"] .hb-screen-kicker {
  opacity: 0.95;
  font-size: 0.78rem;
}

.hb-screen[data-state="done"] .hb-screen-hint.hb-hero-metric,
.hb-screen.is-summary-hero .hb-screen-hint.hb-hero-metric {
  font-size: clamp(2.5rem, 12vw, 3.8rem);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.hb-screen[data-state="fail"] {
  background: #7b241c;
  color: #fff;
}

.hb-screen[data-state="done"] {
  background: var(--hb-done);
  color: #fff;
  border-color: #4a4a4a;
  cursor: default;
}

.hb-screen-inner {
  padding: 1.5rem 1.25rem;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hb-screen-kicker {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
  opacity: 0.9;
  color: inherit;
}

.hb-screen-hint {
  font-size: clamp(1.6rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: inherit;
}

.hb-screen[data-state="ready"] .hb-screen-hint {
  font-size: clamp(2rem, 7vw, 3.2rem);
}

.hb-screen-sub {
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
  opacity: 0.9;
  color: inherit;
}

.hb-screen-live {
  margin-top: 1.1rem;
  width: 100%;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0.25rem;
}

.hb-screen-live-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 0.55rem;
  opacity: 0.8;
  color: inherit;
}

.hb-screen-live-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.4rem;
}

.hb-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem 0.25rem;
  padding: 0.4rem 0.7rem 0.4rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: inherit;
  font-size: 0.85rem;
}

.hb-screen[data-state="done"] .hb-live-chip,
.hb-screen[data-state="intro"] .hb-live-chip {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.32);
}

.hb-live-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  margin-right: 0.1rem;
}

.hb-screen[data-state="ready"] .hb-live-n {
  background: rgba(0, 0, 0, 0.12);
}

.hb-live-ms {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-left: 0.1rem;
}

.hb-live-unit {
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.8;
  margin-left: 0.02rem;
  text-transform: lowercase;
}

.hb-hint {
  font-size: 0.9rem;
  color: #5f6368;
  margin: 0.75rem 0 0;
}

.hb-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.hb-btn {
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: #333;
  cursor: pointer;
  width: 100%;
}

.hb-btn:hover {
  background: #f5f5f5;
}

.hb-btn.full {
  background: #1a56db;
  border-color: #1a56db;
  color: #fff;
  font-weight: 500;
}

.hb-btn.full:hover {
  background: #1543ad;
}

/* 次操作：与 full 成对出现，保持为「按钮」感，易辨认 */
.hb-btn.outline {
  background: #fff;
  color: #1a56db;
  border: 2px solid #1a56db;
  font-weight: 600;
  width: 100%;
}

.hb-btn.outline:hover {
  background: #eef3ff;
  color: #1543ad;
  border-color: #1543ad;
}

.hb-btn.sub {
  width: auto;
  background: transparent;
  color: #5f6368;
  font-size: 0.9rem;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hb-btn.sub:hover {
  color: #1a1a1a;
  background: transparent;
}

.hb-stats {
  text-align: left;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.15rem 1.3rem 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.hb-stats-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f6368;
  font-weight: 600;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.round-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1a56db;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.hb-times {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
}

.hb-times li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #ececec;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.hb-times li:last-of-type {
  border-bottom: none;
}

.hb-times .val {
  font-weight: 600;
  color: #1a56db;
}

.hb-run-avg {
  font-size: 0.9rem;
  color: #5f6368;
  margin: 0 0 0.4rem;
}

.hb-avg {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.35rem;
  font-variant-numeric: tabular-nums;
}

.hb-saved {
  font-size: 0.9rem;
  color: #137333;
  margin: 0;
  line-height: 1.4;
}

.hb-tier {
  margin: 0.9rem 0 0.25rem;
  padding: 0.9rem 0.85rem;
  border-radius: 8px;
  background: #f1f3f4;
  border: 1px solid #e0e3e6;
  text-align: left;
}

.hb-tier-label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #80868b;
  font-weight: 600;
}

.hb-tier-name {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.35;
}

.hb-tier-quote {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #3c4043;
  padding-left: 0.5rem;
  border-left: 3px solid #1a56db;
}

.modal-lead {
  color: #5f6368;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.45;
}

/* 排行榜：见文件末尾 `body.site-cursor`（与全站主题一致） */

/* 宽表横向滚动（手机端） */
.table-x-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.5rem 0 0;
}

.table-x-scroll .data-table {
  min-width: 480px;
}

/* -------------------------------------------------------------------------
   移动端与小平板
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .app,
  .page {
    padding: 1.25rem max(0.75rem, env(safe-area-inset-left)) 2.5rem
      max(0.75rem, env(safe-area-inset-right));
  }

  .title {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .hb-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hb-top-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.9rem;
    width: 100%;
  }

  .hb-top-user {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav-guest {
    justify-content: center;
  }

  .hb-link-btn,
  a.hb-link-btn,
  .hb-top-nav a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hb-top-nav a {
    padding: 0.35rem 0.5rem;
  }

  .hb-page-title {
    font-size: 1.35rem;
  }

  .hb-lead {
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 1.1rem;
  }

  .hb-screen {
    min-height: max(45vh, 220px);
    max-height: none;
  }

  .hb-screen-inner {
    padding: 1.1rem 0.9rem;
  }

  .hb-screen-live {
    max-width: 100%;
    margin-top: 0.75rem;
  }

  .hb-screen-live-title {
    font-size: 0.62rem;
    margin-bottom: 0.45rem;
  }

  .hb-live-ms {
    font-size: 1rem;
  }

  .hb-live-chip {
    padding: 0.32rem 0.55rem;
  }

  .hb-hint,
  .hb-saved,
  .hb-run-avg {
    font-size: 0.85rem;
  }

  .hb-actions {
    max-width: 100%;
    padding: 0 max(0.5rem, env(safe-area-inset-left)) 0 max(0.5rem, env(safe-area-inset-right));
  }

  .hb-btn {
    min-height: 48px;
    font-size: 1rem;
  }

  .hb-stats {
    max-width: 100%;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
  }

  .hb-tier-quote {
    font-size: 0.85rem;
  }

  .modal-backdrop {
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
      max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    align-items: center;
  }

  .modal {
    max-width: 100%;
    max-height: min(90dvh, 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .field input {
    font-size: 16px;
  }

  .modal-actions {
    flex-direction: column;
    width: 100%;
  }

  .modal-actions .btn {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row label,
  .filter-row > div {
    width: 100%;
  }

  .filter-row input[type="date"] {
    width: 100%;
    min-height: 44px;
  }

  .filter-row .btn.primary#btnLoad,
  .filter-row #btnLoad {
    width: 100%;
    min-height: 48px;
  }

  .chart-wrap {
    padding: 1rem 0.75rem 1.25rem;
  }

  .chart-canvas {
    max-height: 55vh;
    min-height: 200px;
  }

  .pills {
    justify-content: flex-start;
  }

  .pill {
    min-height: 40px;
    padding: 0.4rem 0.75rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.45rem;
  }

  .table-x-scroll .data-table {
    min-width: 420px;
  }
}

/* -------------------------------------------------------------------------
   全站：参考 cursor.com 的深色、细边框、弱对比装饰（少渐变、少重阴影）
   页面 body 加 class="site-cursor"（与 hb-body 并用）
   ------------------------------------------------------------------------- */
body.site-cursor {
  --cs-bg: #050505;
  --cs-surface: #0a0a0a;
  --cs-raise: #141414;
  --cs-line: rgba(255, 255, 255, 0.08);
  --cs-line2: rgba(255, 255, 255, 0.12);
  --cs-text: #fafafa;
  --cs-mute: #a1a1aa;
  --cs-mute2: #71717a;
  background: var(--cs-bg);
  color: var(--cs-text);
}

body.site-cursor::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 120, 120, 0.06), transparent 50%);
  z-index: 0;
}

body.site-cursor .hb-top,
body.site-cursor .topnav {
  position: relative;
  z-index: 1;
  max-width: 960px;
  background: rgba(5, 5, 5, 0.72);
  border-bottom: 1px solid var(--cs-line);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body.site-cursor .hb-brand,
body.site-cursor .brand {
  color: var(--cs-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.site-cursor .hb-top-nav a {
  color: var(--cs-mute);
  font-size: 0.875rem;
}

body.site-cursor .hb-top-nav a:hover {
  color: var(--cs-text);
}

body.site-cursor .hb-top-nav a[aria-current="page"] {
  color: var(--cs-text);
  font-weight: 500;
}

body.site-cursor .hb-username {
  color: var(--cs-mute);
}

body.site-cursor .hb-link-btn {
  background: transparent;
  border: 1px solid var(--cs-line2);
  color: var(--cs-text);
}

body.site-cursor .hb-link-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.site-cursor .hb-link-btn.primary {
  background: var(--cs-text);
  color: #0a0a0a;
  border-color: var(--cs-text);
}

body.site-cursor .hb-link-btn.primary:hover {
  filter: brightness(0.95);
}

body.site-cursor .hb-page-title {
  color: var(--cs-text);
  text-shadow: none;
}

body.site-cursor .hb-lead {
  color: var(--cs-mute);
}

body.site-cursor .hb-hint,
body.site-cursor .hb-saved,
body.site-cursor .hb-run-avg,
body.site-cursor .hb-avg {
  color: var(--cs-mute);
}

body.site-cursor .hb-main {
  position: relative;
  z-index: 1;
}

body.site-cursor .reaction-arena {
  box-shadow: none;
  border: 1px solid var(--cs-line);
}

body.site-cursor .hb-btn {
  background: var(--cs-raise);
  border: 1px solid var(--cs-line2);
  color: var(--cs-text);
}

body.site-cursor .hb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.site-cursor .hb-btn.full {
  background: #e4e4e7;
  border-color: #e4e4e7;
  color: #0a0a0a;
  font-weight: 600;
}

body.site-cursor .hb-btn.full:hover {
  background: #fafafa;
  border-color: #fafafa;
}

body.site-cursor .hb-btn.outline {
  background: transparent;
  color: #a1a1aa;
  border: 1px solid var(--cs-line2);
  font-weight: 500;
}

body.site-cursor .hb-btn.outline:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--cs-text);
  border-color: rgba(255, 255, 255, 0.2);
}

body.site-cursor .hb-btn.sub {
  color: var(--cs-mute);
}

body.site-cursor .hb-btn.sub:hover {
  color: var(--cs-text);
}

body.site-cursor .hb-stats,
body.site-cursor .hb-tier {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  color: var(--cs-text);
  box-shadow: none;
}

body.site-cursor .hb-tier-quote {
  border-left-color: var(--cs-mute2);
  color: var(--cs-mute);
}

body.site-cursor .page .header .title,
body.site-cursor .title {
  color: var(--cs-text);
}

body.site-cursor .page .header .subtitle,
body.site-cursor .subtitle {
  color: var(--cs-mute);
}

body.site-cursor .muted {
  color: var(--cs-mute);
}

body.site-cursor .err {
  color: #f87171;
}

body.site-cursor .chart-wrap {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  box-shadow: none;
  color: var(--cs-text);
}

body.site-cursor .chart-wrap h2,
body.site-cursor .data-block h2 {
  color: var(--cs-mute);
}

body.site-cursor .filter-row .btn,
body.site-cursor .filter-row input[type="date"] {
  border-color: var(--cs-line2);
  background: var(--cs-raise);
  color: var(--cs-text);
}

body.site-cursor .pill {
  background: var(--cs-raise);
  border: 1px solid var(--cs-line);
  color: var(--cs-mute);
}

body.site-cursor .pill[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cs-text);
  border-color: var(--cs-line2);
}

body.site-cursor .data-table {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  color: var(--cs-text);
}

body.site-cursor .data-table th {
  background: var(--cs-raise);
  color: var(--cs-mute2);
  border-bottom-color: var(--cs-line);
}

body.site-cursor .data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.site-cursor .modal {
  background: #121212;
  border: 1px solid var(--cs-line2);
  color: var(--cs-text);
}

body.site-cursor .modal h2,
body.site-cursor .field label {
  color: var(--cs-mute);
}

body.site-cursor .field input {
  background: var(--cs-raise);
  border: 1px solid var(--cs-line2);
  color: var(--cs-text);
}

/* 排行榜页 */
body.site-cursor .page-lb {
  position: relative;
  z-index: 1;
  max-width: 48rem;
}

body.site-cursor .lb-hero {
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.25rem;
  text-align: left;
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-radius: 10px;
  box-shadow: none;
}

body.site-cursor .lb-hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cs-mute2);
}

body.site-cursor .lb-hero-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--cs-text);
}

body.site-cursor .lb-hero-title.title {
  font-size: 1.75rem;
}

body.site-cursor .lb-hero-sub {
  max-width: none;
  margin: 0;
  line-height: 1.65;
  font-size: 0.9rem;
  color: var(--cs-mute);
  text-align: left;
}

body.site-cursor .lb-hero strong {
  color: #e4e4e7;
  font-weight: 600;
}

body.site-cursor .lb-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  padding: 0.25rem;
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}

body.site-cursor .lb-tab {
  cursor: pointer;
  font: inherit;
  border: none;
  background: transparent;
  color: var(--cs-mute);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.12s ease, background 0.12s ease;
  box-shadow: none;
}

body.site-cursor .lb-tab:hover {
  color: var(--cs-text);
  background: rgba(255, 255, 255, 0.04);
}

body.site-cursor .lb-tab[aria-selected="true"],
body.site-cursor .lb-tab.lb-tab--on {
  background: rgba(255, 255, 255, 0.1);
  color: var(--cs-text);
  box-shadow: none;
}

body.site-cursor .lb-period-line {
  text-align: left;
  font-size: 0.8125rem;
  margin: 0 0 0.9rem;
  line-height: 1.5;
  color: var(--cs-mute2);
}

body.site-cursor .lb-hint {
  text-align: left;
  color: var(--cs-mute);
  font-size: 0.875rem;
}

body.site-cursor .lb-me-card {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.25rem;
  border-radius: 10px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-line2);
  color: var(--cs-text);
  box-shadow: none;
}

body.site-cursor .lb-me-card--soft {
  background: var(--cs-surface);
  color: var(--cs-mute);
  border: 1px solid var(--cs-line);
}

body.site-cursor .lb-me-line {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--cs-mute);
}

body.site-cursor .lb-me-label {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cs-mute2);
}

body.site-cursor .lb-me-period {
  text-align: left;
  font-size: 0.8rem;
  color: var(--cs-mute2);
}

body.site-cursor .lb-me-stat-v {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--cs-text);
}

body.site-cursor .lb-me-stat--rank .lb-me-stat-v {
  color: var(--cs-text);
  text-shadow: none;
}

body.site-cursor .lb-me-stat-k {
  font-size: 0.75rem;
  color: var(--cs-mute2);
  letter-spacing: 0.02em;
}

body.site-cursor .lb-me-foot {
  text-align: left;
  font-size: 0.8rem;
  color: var(--cs-mute);
}

body.site-cursor .lb-me-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cs-line2);
  color: var(--cs-mute);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

body.site-cursor .lb-me-badge--on {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

body.site-cursor .lb-me-card--soft .lb-me-foot {
  display: none;
}

body.site-cursor .lb-table {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
}

body.site-cursor .lb-table th {
  background: var(--cs-raise);
  color: var(--cs-mute2);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--cs-line);
}

body.site-cursor .lb-table th,
body.site-cursor .lb-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.site-cursor .lb-col-user {
  font-weight: 500;
  color: #e4e4e7;
}

body.site-cursor .lb-col-ms {
  font-weight: 500;
  color: #d4d4d8;
  font-feature-settings: "tnum" 1;
}

body.site-cursor .lb-col-rank {
  width: 4.25rem;
  text-align: left;
  padding-left: 0.85rem;
}

body.site-cursor .lb-rank-num {
  font-weight: 500;
  color: var(--cs-mute2);
}

body.site-cursor .lb-rank-pill {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  box-shadow: none;
  background: #27272a;
  color: #e4e4e7;
  border: 1px solid var(--cs-line2);
}

body.site-cursor .lb-rank-pill[data-rank="1"] {
  background: #f4f4f5;
  color: #18181b;
  border-color: #e4e4e7;
}

body.site-cursor .lb-rank-pill[data-rank="2"] {
  background: #3f3f46;
  color: #e4e4e7;
  border-color: #52525b;
}

body.site-cursor .lb-rank-pill[data-rank="3"] {
  background: #3f3f46;
  color: #d4d4d8;
  border-color: #52525b;
  opacity: 0.95;
}

body.site-cursor .lb-table tbody tr {
  background: transparent;
  transition: background 0.1s ease;
}

body.site-cursor .lb-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.site-cursor .lb-table .lb-row-top1,
body.site-cursor .lb-table .lb-row-top2,
body.site-cursor .lb-table .lb-row-top3 {
  background: rgba(255, 255, 255, 0.02);
}

body.site-cursor .lb-table tr.lb-row--self {
  background: rgba(99, 102, 241, 0.06);
  box-shadow: inset 2px 0 0 0 rgba(99, 102, 241, 0.6);
}

body.site-cursor .lb-table tr.lb-row--self .lb-col-user {
  color: #fafafa;
}

@media (max-width: 640px) {
  body.site-cursor .lb-hero {
    padding: 1.1rem 1rem;
  }

  body.site-cursor .lb-hero-title,
  body.site-cursor .lb-hero-title.title {
    font-size: 1.4rem;
  }

  body.site-cursor .lb-tabs {
    width: 100%;
  }

  body.site-cursor .lb-tab {
    flex: 1 1 40%;
    min-height: 44px;
  }

  body.site-cursor .lb-me-stat-v {
    font-size: 1.65rem;
  }

  body.site-cursor .lb-rank-pill {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.7rem;
  }
}
