:root,
html[data-theme="dark"] {
  --bg: #0f172a;
  --bg-deep: #080c1b;
  --panel: #111827;
  --panel-2: #1e293b;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-dim: rgba(99, 102, 241, 0.18);
  --live: #ef4444;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --focus: #a5b4fc;
  --touch: 44px;
  --topbar: 56px;
  --sidebar: 224px;
  --hero: 241px;
  --row: 95px;
  --crest: 32px;
  --crest-lg: 56px;
  --rail: 93px;
  --bolt: 36px;
  --font: Inter, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Segoe UI", system-ui, sans-serif;
  --num: "SF Mono", "Menlo", ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #eef2f7;
  --bg-deep: #ffffff;
  --panel: #ffffff;
  --panel-2: #e2e8f0;
  --line: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-dim: rgba(79, 70, 229, 0.12);
  --live: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --focus: #6366f1;
}

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

html,
body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.visually-hidden,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 40;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}

.app-shell {
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: var(--touch) minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  height: calc(var(--topbar) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0 6px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-hit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.icon-hit svg {
  width: 22px;
  height: 22px;
}

.sync-chip {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.top-badge,
.nav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--live);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.nav-badge {
  position: static;
  margin-left: auto;
}

.live-alerts {
  min-width: 0;
}

.live-alerts:empty {
  display: none;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: clip;
  padding-bottom: 24px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
}

.nav-backdrop[hidden] {
  display: none !important;
}

.side-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 21;
  width: min(86vw, 320px);
  max-width: 100%;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 16px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  transform: translateX(-105%);
  transition: transform 0.18s ease;
  overflow-y: auto;
}

.side-nav[hidden] {
  display: none !important;
}

body.nav-open .side-nav {
  transform: translateX(0);
}

.side-brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-2);
  color: #fff;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 15px;
}

.brand-text span {
  color: var(--muted);
  font-size: 11px;
}

.side-collapse {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.side-label {
  margin: 14px 8px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--text);
}

.side-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted);
}

.side-link[aria-current="page"] {
  background: var(--accent-dim);
}

.side-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-foot-btn {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}

.state-strip {
  position: sticky;
  top: calc(var(--topbar) + env(safe-area-inset-top, 0px));
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 44px;
  gap: 0;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.state-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 2px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
}

.state-tab .n {
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.state-tab .l {
  font-size: 11px;
}

.state-tab[aria-selected="true"] {
  border-bottom-color: #818cf8;
  color: var(--text);
}

.state-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.state-tools .icon-hit {
  width: 40px;
  height: 22px;
}

.search-row {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.search-row[hidden] {
  display: none !important;
}

.search-row .search {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.date-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.league-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.league-head .date-side {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  align-items: stretch;
  min-height: var(--row);
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-width: 0;
  overflow: hidden;
}

.match-row .teams-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 16px;
  color: inherit;
}

.team-score-row {
  display: grid;
  grid-template-columns: var(--crest) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  height: 32px;
}

.mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--crest);
  height: var(--crest);
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}

.team-name.is-winner {
  color: var(--ok);
}

.score-num {
  font-family: var(--num);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 1.25rem;
}

.match-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px var(--bolt);
  gap: 8px;
  align-items: center;
  padding: 8px 10px 8px 0;
  min-width: 0;
}

.rail-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.rail-status .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-status.is-live {
  color: var(--live);
}

.rail-status .data-status {
  font-size: 10px;
  color: var(--danger);
}

.rail-line {
  width: 1px;
  height: 36px;
  background: var(--line);
}

.bolt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bolt);
  height: var(--bolt);
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgb(57, 66, 94);
  background: transparent;
  color: rgb(100, 116, 139);
  box-shadow: none;
}

.bolt-btn.is-coach {
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.28);
}

.bolt-btn.is-on,
.bolt-btn[aria-pressed="true"],
.bolt-btn[data-followed="1"] {
  border-color: rgba(139, 92, 246, 0.7);
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  box-shadow: none;
}

.bolt-btn.is-finished {
  border-color: rgb(57, 66, 94);
  color: rgb(100, 116, 139);
  opacity: 0.85;
}

.bolt-btn svg {
  width: 16px;
  height: 16px;
}

.card-star {
  display: contents;
}

.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 16px;
}

.match-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: #121826;
  overflow: hidden;
  min-width: 0;
}

.match-card .card-body {
  display: block;
  padding: 12px 14px 8px;
  color: inherit;
  min-width: 0;
}

.match-card .card-league {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.match-card .card-live {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.match-card .card-live.is-live,
.match-card .card-live.live {
  color: var(--live);
}

.match-card .teams-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-card .card-status {
  margin: 8px 0 0;
  color: var(--live);
  font-size: 12px;
}

.match-card .card-star {
  display: block;
  padding: 0 12px 12px;
}

.follow-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a3348, #1a2233);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}

.follow-bar.is-on {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.scoreboard {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 18px 14px 0;
  height: var(--hero);
  min-height: var(--hero);
  border: 0;
  border-radius: 0;
  color: #eef2ff;
  background-color: #2a1b55;
  overflow: hidden;
  min-width: 0;
}

.scoreboard::before {
  content: "";
  position: absolute;
  inset: 0;
  /* 公开装饰球场图；浏览器可解码，无需 base64 内嵌 */
  background: url("/static/stadium.png") center / cover no-repeat;
  opacity: 0.25;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.scoreboard > * {
  position: relative;
  z-index: 1;
}

.scoreboard .back-fab {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 0;
}

.scoreboard .scoreboard-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding-bottom: 8px;
}

.scoreboard .live-pill {
  display: flex;
  justify-content: center;
  margin: 0 0 10px;
}

.scoreboard .live-pill span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fecaca;
  font-size: 12px;
  font-weight: 700;
}

.scoreboard .boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 8px;
}

.scoreboard .side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.scoreboard .side .mono {
  width: var(--crest-lg);
  height: var(--crest-lg);
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.scoreboard .side .name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #eef2ff;
}

.scoreboard .big-score {
  font-family: var(--font);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: #fff;
  text-align: center;
  line-height: 1;
}

.scoreboard .ht {
  margin-top: 4px;
  color: rgba(238, 242, 255, 0.72);
  font-size: 12px;
  text-align: center;
}

.scoreboard .foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(238, 242, 255, 0.85);
  font-size: 12px;
  flex: 0 0 auto;
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 28px 16px 20px;
}

.detail-empty .empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.detail-empty .empty-ico svg {
  width: 28px;
  height: 28px;
}

.detail-empty h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
}

.detail-empty p {
  margin: 0;
  max-width: 16rem;
  color: var(--muted);
  font-size: 13px;
}

.follow-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: min(100%, 280px);
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: #3b82f6;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}

.follow-cta svg {
  width: 18px;
  height: 18px;
}

.follow-cta.is-on {
  background: rgba(139, 92, 246, 0.25);
  color: #c4b5fd;
}

.accordion {
  border-bottom: 1px solid var(--line);
}

.accordion-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.accordion-head .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
}

.accordion-head .chev {
  margin-left: auto;
  color: var(--muted);
}

.accordion-body {
  padding: 12px 14px 16px;
  background: var(--bg-deep);
}

.accordion-body[hidden],
.search-row[hidden],
.nav-backdrop[hidden],
[hidden] {
  display: none !important;
}

.event-cat + .event-cat {
  margin-top: 10px;
}

.event-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 650;
}

.event-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.event-row .minute {
  color: var(--accent);
  font-weight: 700;
}

.event-row.is-away .minute {
  color: var(--danger);
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.stat-home {
  text-align: left;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.stat-away {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.stat-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

/* 实测 05-stats：主队紫、客队灰半幅，非主蓝客红 */
.stat-bar .h {
  justify-self: end;
  height: 100%;
  background: var(--accent-2);
}

.stat-bar .a {
  height: 100%;
  background: #475569;
}

.stat-bar .a.is-zero,
.stat-bar .h.is-zero {
  background: transparent;
}

.native-list,
.card-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  min-width: 0;
}

.native-row,
.fact,
.notice,
.prediction {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.native-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.native-row .label {
  flex: 1 1 auto;
  min-width: 0;
}

.fact-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: #c7d2fe;
  font-size: 10px;
  font-weight: 700;
}

.fact-tag.pred {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.empty,
.loading,
.error {
  margin: 24px 16px;
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}

.hint,
.meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.primary {
  min-height: var(--touch);
  margin-top: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
}

.ghost {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.switch .track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #334155;
  flex: 0 0 auto;
}

.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
}

.switch[aria-checked="true"] .track {
  background: #22c55e;
}

.switch[aria-checked="true"] .knob {
  transform: translateX(18px);
}

.switch[disabled] {
  opacity: 0.45;
}

.chip-row,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
}

.chip[aria-pressed="true"] {
  background: #fff;
  color: #0f172a;
  border-color: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
}

.source-sync {
  display: none;
}

.how-dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  max-width: 360px;
}

.how-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  body {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }

  .nav-backdrop,
  .topbar [data-open-nav],
  .side-collapse {
    display: none !important;
  }

  .side-nav,
  .side-nav[hidden] {
    display: block !important;
    position: sticky;
    transform: none;
    width: var(--sidebar);
    height: 100dvh;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .app-shell {
    min-width: 0;
  }

  .scoreboard {
    margin: 12px;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    overflow: hidden;
  }

  /* 手机卡片视图为纵向单列；宽屏仍保持单列堆叠，不改为多列网格 */
}

/* Runtime-verified empty notification panel and right-aligned preferences. */
.primary, .ghost { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
#inbox-title { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.notification-empty { margin:0; padding:36px 20px 32px; min-height:256px; background:var(--bg); border-bottom:1px solid var(--line); }
.notification-empty > svg { width:36px; height:36px; color:var(--muted); margin-bottom:12px; }
.notification-empty > p:first-of-type { color:var(--text); margin:0 0 4px; }
.notification-empty .primary { background:#fff; color:#111827; border-radius:6px; min-height:36px; margin-top:16px; font-size:13px; }
.native-row > [data-pref-sound], .native-row > [data-alert-global], .native-row > [data-alert-match] { width:100%; flex-direction:row-reverse; justify-content:space-between; }

.signal-empty { margin:16px 0 10px; padding:44px 22px 36px; border:1px solid var(--line); border-radius:20px; background:var(--panel-2); min-height:310px; }
.signal-mark { display:inline-flex; align-items:center; justify-content:center; width:64px; height:64px; border-radius:50%; color:#6ee7b7; background:rgba(52,211,153,.08); box-shadow:0 0 0 8px rgba(52,211,153,.03); }
.signal-mark svg { width:30px; height:30px; }
.signal-empty h3 { color:var(--text); font-size:18px; margin:22px 0 10px; }
.signal-empty .hint { font-size:14px; line-height:1.6; }
.signal-empty .ghost { margin-top:22px; }
