/* Shared customer interface. Web and App render the same content without a backend. */
:root {
  color-scheme: light;
  --blue: #0875ff;
  --blue-dark: #075ac4;
  --blue-soft: #eaf3ff;
  --ink: #12233e;
  --muted: #718198;
  --faint: #9aa7b9;
  --line: #e5ebf3;
  --bg: #f3f6fb;
  --surface: #fff;
  --green: #168858;
  --green-soft: #e7f6ee;
  --orange: #af6511;
  --orange-soft: #fff3df;
  --red: #d64848;
  --radius: 16px;
  --shadow: 0 6px 24px rgb(24 54 95 / 4%);
  --sidebar-width: 216px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled, .btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: none; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
input, select, textarea { min-width: 0; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.35; }
h2 { font-size: 21px; letter-spacing: -.035em; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin-bottom: 14px; }
button, a, input, select, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #64a6ff; }
::selection { color: #03449b; background: #d9eaff; }
[hidden] { display: none !important; }

/* Application frame */
.site-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 35;
  width: var(--sidebar-width);
  padding: 30px 18px 20px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; margin-bottom: 42px; font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.brand img { width: 39px; height: 39px; object-fit: contain; }
.brand > svg, .brand-mark { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; padding: 7px; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; line-height: 1.6; margin-top: 2px; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-radius: 10px; color: #708096; font-weight: 500; transition: background .18s, color .18s; }
.sidebar nav a svg { width: 20px; height: 20px; }
.sidebar nav a:hover { color: var(--blue); background: #f4f8ff; }
.sidebar nav a.active { color: var(--blue); background: #eaf3ff; font-weight: 700; }
.sidebar nav .nav-label { padding: 20px 15px 6px; font-size: 11px; letter-spacing: .08em; color: #99a4b4; }
.sidebar-footer { margin-top: auto; padding: 25px 10px 0; color: var(--muted); font-size: 12px; }
.sidebar-footer .divider { margin: 0 0 20px; }
.sidebar-footer > a { display: flex; align-items: center; gap: 9px; margin: 10px 0; }
.workspace { margin-left: var(--sidebar-width); min-height: 100dvh; }
.topbar { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 40px; background: rgb(255 255 255 / 96%); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; }
.breadcrumb { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 11px; }
.breadcrumb span, .breadcrumb .muted { color: var(--muted); font-weight: 400; }
.breadcrumb svg { width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.top-actions .profile, .top-actions .user { display: flex; align-items: center; gap: 9px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #e2efff; color: #216bcd; font-weight: 700; object-fit: cover; }
main#view { max-width: 1500px; margin: auto; padding: 35px 40px 64px; animation: page-appear .22s ease-out; }
.bottom-nav { display: none; }
.demo-strip { border: 1px solid #d9e8fa; background: #edf5ff; border-radius: 8px; padding: 8px 13px; color: #587494; font-size: 12px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-strip a { color: var(--blue); white-space: nowrap; }
.app-switch { position: fixed; right: 22px; bottom: 22px; z-index: 45; padding: 10px 15px; display: flex; align-items: center; gap: 8px; border: 1px solid #d5e4f7; border-radius: 999px; background: #fff; color: #2463ad; box-shadow: 0 5px 22px rgb(18 48 89 / 12%); font-size: 12px; }
.app-switch svg { width: 16px; height: 16px; }

/* Shared components */
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.page-heading h1 { font-size: 40px; font-weight: 750; letter-spacing: -.055em; margin: 0 0 7px; }
.page-heading p { color: var(--muted); margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; font-weight: 600; line-height: 1.4; white-space: nowrap; transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn.primary, button.primary, a.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 5px 15px rgb(8 117 255 / 15%); }
.btn.secondary { background: #fff; color: #276bc2; border-color: #cbdcf2; }
.btn.secondary:hover { background: #eff6ff; border-color: #9ac2f7; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: #edf5ff; }
.btn.danger { color: var(--red); border-color: #f4cece; background: #fff7f7; }
.btn.small { min-height: 34px; padding: 7px 12px; font-size: 12px; border-radius: 7px; }
.btn.full { width: 100%; }
.icon-button { width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; color: #75859c; border: 1px solid var(--line); background: #fff; position: relative; }
.icon-button:hover { color: var(--blue); background: var(--blue-soft); }
.icon-button svg { width: 19px; height: 19px; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 8px; font-size: 11px; font-weight: 600; border-radius: 5px; line-height: 1.7; white-space: nowrap; vertical-align: middle; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.blue { color: #126bd2; background: var(--blue-soft); }
.badge.orange { color: var(--orange); background: var(--orange-soft); }
.badge.gray { color: #6e7f94; background: #edf1f6; }
.badge.red { color: #cc414b; background: #fff0f1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.panel-heading h2, .panel-heading h3 { margin: 0; }
.panel-heading p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.grid { display: grid; gap: 18px; min-width: 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .panel + .panel { margin-top: 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px 22px; min-width: 0; }
.stat-card label, .stat-card > span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 29px; line-height: 1.4; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
.stat-card small { color: var(--muted); font-size: 12px; }
.tabs { display: flex; align-items: center; gap: 25px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border-bottom: 3px solid transparent; padding: 12px 2px 13px; color: var(--muted); font-weight: 500; flex: 0 0 auto; white-space: nowrap; }
.tabs button.active, .tabs a.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.tabs button:hover, .tabs a:hover { color: var(--blue); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: #526278; }
.field input, .field select, .field textarea, input.search-input { width: 100%; min-height: 44px; padding: 10px 12px; background: #fff; border: 1px solid #dce4ef; border-radius: 8px; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
.field input:focus, .field select:focus, .field textarea:focus, input.search-input:focus { border-color: #6cabff; box-shadow: 0 0 0 3px rgb(8 117 255 / 8%); }
input::placeholder, textarea::placeholder { color: #98a5b6; }
.field textarea { min-height: 100px; resize: vertical; }
.field small { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; white-space: nowrap; }
th { padding: 13px 16px; font-weight: 500; color: #7b8a9e; background: #f7f9fc; }
td { padding: 16px; border-top: 1px solid #edf1f6; vertical-align: middle; color: #5e7088; }
td strong, td b { color: var(--ink); font-weight: 600; }
tbody tr:hover { background: #fafdff; }
td .btn + .btn { margin-left: 4px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); border: 1px dashed #cfdced; border-radius: 12px; background: #fbfdff; }
.empty svg { width: 40px; height: 40px; color: #94b6e2; margin-bottom: 12px; }
.empty h3 { color: #526a86; margin-bottom: 8px; }
.notice { display: flex; align-items: flex-start; gap: 9px; padding: 13px 15px; background: #edf5ff; border: 1px solid #d9e9fc; border-radius: 9px; color: #426c9e; font-size: 13px; margin: 16px 0; }
.notice svg { width: 17px; height: 17px; margin-top: 2px; }
.notice p { margin: 0; }
.notice.warning { color: #8e662c; border-color: #f4e6c9; background: #fff9ec; }
.amount { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--blue); letter-spacing: -.025em; }
.amount.positive { color: var(--green); }
.amount.negative { color: var(--red); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > .panel + .panel { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips button, .chips a, .chips > span { display: inline-flex; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px 11px; color: var(--muted); font-size: 12px; }
.chips .active { border-color: #9fc7fb; background: var(--blue-soft); color: var(--blue); }
.link { color: var(--blue); font-weight: 500; cursor: pointer; }
.link:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 4px; }
.divider { border: 0; height: 1px; background: var(--line); margin: 22px 0; }
.kv { display: grid; gap: 14px; }
.kv > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }

/* Competition lobby */
.hero-banner { min-height: 260px; border-radius: 18px; overflow: hidden; padding: 31px 34px; background-color: #0b5baa; background-image: linear-gradient(90deg,rgb(4 43 88 / 95%) 0%,rgb(5 67 127 / 68%) 48%,rgb(4 51 100 / 3%) 80%),var(--hero-image,none); background-size: cover; background-position: center,right center; position: relative; isolation: isolate; color: #fff; margin-bottom: 24px; display: flex; align-items: center; }
.hero-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-banner:has(> img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,rgb(4 43 88 / 93%),rgb(5 55 110 / 48%) 60%,transparent); z-index: -1; }
.hero-content { position: relative; z-index: 1; max-width: 65%; }
.hero-content h1, .hero-content h2 { color: #fff; font-size: 33px; letter-spacing: -.04em; line-height: 1.3; margin: 10px 0 13px; }
.hero-content > p { color: #daeaff; font-size: 14px; margin-bottom: 20px; }
.hero-content .btn.primary { background: #fff; color: #075fc5; border-color: #fff; }
.hero-content .badge { background: rgb(255 255 255 / 17%); color: #fff; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-size: 12px; color: #d1e6ff; margin: 15px 0; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta svg { width: 14px; height: 14px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 24px; }
.content-grid > main, .content-grid > div, .content-grid > aside { min-width: 0; }
.race-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.race-card { border: 1px solid var(--line); background: #fff; border-radius: 14px; overflow: hidden; min-width: 0; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.race-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgb(30 69 120 / 9%); }
.race-card img.cover { width: 100%; aspect-ratio: 1.9; object-fit: cover; background: #dceafb; }
.race-card .race-body { padding: 18px 18px 15px; }
.race-body h3 { font-size: 18px; margin: 10px 0 9px; }
.race-body .row h3 { margin: 0; }
.race-body p { color: var(--muted); margin: 0 0 9px; font-size: 13px; }
.race-body .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; color: var(--muted); font-size: 12px; }
.race-body .meta span { display: inline-flex; gap: 5px; align-items: center; }
.race-body .meta svg { width: 14px; height: 14px; }
.race-card footer { border-top: 1px solid #eef2f7; padding: 13px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.race-card footer .amount { font-size: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; margin: 22px 0; }
.quick-grid a { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 17px 15px; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 600; transition: border-color .16s; }
.quick-grid a:hover { border-color: #a5cafa; color: var(--blue); }
.quick-grid a > svg, .quick-icon { color: var(--blue); width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--blue-soft); }
.quick-grid small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 11px; }
.pool-ticker { padding: 21px 23px; background: #eaf3ff; border: 1px solid #d3e6ff; border-radius: 12px; color: #356393; margin-bottom: 20px; }
.pool-ticker strong { color: var(--blue); display: block; margin-top: 8px; font-size: 30px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pool-ticker small { color: #7990ad; }
.sidebar-card { border-radius: 14px; border: 1px solid var(--line); padding: 21px; background: #fff; margin-bottom: 20px; }
.sidebar-card h3 { font-size: 16px; margin-bottom: 15px; }
.sidebar-card .btn { width: 100%; }
.news-list { margin: 0; padding: 0; list-style: none; }
.news-list > li, .news-list > a, .news-list > div { display: block; padding: 13px 0; border-bottom: 1px solid #edf1f5; }
.news-list > :last-child { border-bottom: 0; padding-bottom: 0; }
.news-list strong, .news-list b { display: block; font-size: 13px; font-weight: 600; line-height: 1.7; }
.news-list time, .news-list small { color: var(--muted); display: block; font-size: 11px; margin-top: 4px; }

/* Detail, rules and pigeon records */
.detail-hero { position: relative; min-height: 300px; padding: 30px; border-radius: 17px; overflow: hidden; background: #0e5ba4; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; margin-bottom: 22px; }
.detail-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg,rgb(4 28 61 / 88%),rgb(4 28 61 / 10%) 90%); z-index: -1; }
.detail-hero h1, .detail-hero h2 { color: #fff; font-size: 32px; margin: 10px 0; letter-spacing: -.035em; }
.detail-hero p { margin-bottom: 0; color: #d6e5f7; }
.detail-hero .hero-meta { margin-bottom: 0; }
.detail-facts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; padding: 22px 0; }
.detail-facts > div { border-right: 1px solid var(--line); padding-left: 4px; }
.detail-facts > div:last-child { border-right: 0; }
.detail-facts span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.detail-facts strong { font-size: 17px; font-weight: 650; }
.timeline { position: relative; display: grid; gap: 13px; }
.timeline .stage { position: relative; display: flex; align-items: center; gap: 15px; padding: 17px 18px; border: 1px solid var(--line); background: #fafbfd; border-radius: 10px; }
.stage-dot { width: 11px; height: 11px; background: #b7c5d7; border: 3px solid #e8edf4; border-radius: 50%; flex: 0 0 11px; box-sizing: content-box; }
.stage h3, .stage h4 { margin: 0 0 5px; font-size: 15px; }
.stage p, .stage small { color: var(--muted); margin: 0; font-size: 12px; }
.stage > .badge, .stage > .status { margin-left: auto; }
.timeline .stage.active { border-color: #b2d3fd; background: #f2f8ff; }
.stage.active .stage-dot { background: var(--blue); border-color: #d8eaff; }
.stage.done .stage-dot { background: #28a572; border-color: #dcf3e7; }
.entry-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.entry-option { border: 1px solid var(--line); border-radius: 11px; padding: 17px; background: #fff; display: block; cursor: pointer; position: relative; }
.entry-option h3, .entry-option h4 { font-size: 15px; margin: 0 0 8px; }
.entry-option p { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.entry-option:has(input:checked), .entry-option.selected { border-color: #62a6ff; background: #f4f9ff; box-shadow: 0 0 0 1px #62a6ff; }
.entry-option input { accent-color: var(--blue); }
.entry-option > input { position: absolute; top: 18px; right: 14px; }
.entry-option .amount { font-size: 20px; }
.pigeon-row { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.pigeon-row:last-child { border-bottom: 0; }
.pigeon-row img { width: 76px; height: 76px; flex: 0 0 76px; object-fit: cover; border-radius: 10px; background: #eaf1f9; }
.pigeon-row h3, .pigeon-row h4 { margin: 0 0 5px; font-size: 15px; }
.pigeon-row p, .pigeon-row small { margin: 0; font-size: 12px; color: var(--muted); }
.pigeon-row > .btn, .pigeon-row > .badge { margin-left: auto; }
.rank-table tbody tr:nth-child(-n+3) td:first-child { font-weight: 800; color: #b17a21; }
.mode-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.mode-card h3 { margin-bottom: 10px; }
.mode-card p, .mode-card li { color: #74859b; font-size: 13px; }
.mode-card ul { padding-left: 20px; margin: 12px 0; }
.rule-example { background: #f5f9ff; border-left: 3px solid #70adfd; padding: 16px 18px; border-radius: 0 9px 9px 0; color: #5d7697; font-size: 13px; margin: 17px 0; }
.rule-example strong { color: #215b9c; }

/* Authentication */
.auth-layout { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 570px; max-width: 970px; margin: 20px auto; border-radius: 20px; background: #fff; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 14px 45px rgb(25 68 121 / 7%); }
.auth-art { position: relative; padding: 50px 38px; color: #fff; background-color: #0879d8; background-image: linear-gradient(180deg,rgb(4 57 119 / 20%),rgb(3 56 113 / 32%)),var(--auth-image,none); background-position: center; background-size: cover; overflow: hidden; isolation: isolate; }
.auth-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.auth-art:has(> img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgb(4 57 119 / 45%),transparent 70%); z-index: -1; }
.auth-art h1 { font-size: 39px; color: #fff; letter-spacing: .08em; margin-bottom: 12px; }
.auth-art p { color: #e0f1ff; font-size: 14px; max-width: 250px; }
.auth-form { padding: 48px 42px; align-self: center; min-width: 0; }
.auth-form h2 { font-size: 25px; margin-bottom: 8px; }
.auth-form > p { font-size: 13px; color: var(--muted); }
.auth-form form { display: grid; gap: 18px; }
.auth-form .field { margin-bottom: 17px; }
.auth-form form .field { margin-bottom: 0; }
.auth-form .btn.primary { width: 100%; }
.auth-tabs { display: flex; gap: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-tabs button { padding: 12px 2px; border-bottom: 2px solid transparent; color: var(--muted); }
.auth-tabs button.active { color: var(--blue); border-color: var(--blue); font-weight: 700; }
.social-row { display: flex; justify-content: center; gap: 15px; margin-top: 24px; }
.social-row button { border: 1px solid var(--line); border-radius: 9px; padding: 10px 18px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.social-row button:hover { background: #f8fbff; }
.checkbox-line { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.8; margin: 18px 0; }
.checkbox-line input { flex: 0 0 auto; margin-top: 4px; accent-color: var(--blue); }
.checkbox-line a { color: var(--blue); }

/* Registration, payment and settlement */
.checkout-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 24px; align-items: start; }
.checkout-summary { background: #fff; border: 1px solid var(--line); padding: 24px; border-radius: 15px; position: sticky; top: 105px; }
.checkout-summary h3 { margin-bottom: 20px; }
.checkout-summary .btn { width: 100%; }
.pay-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 15px; margin: 10px 0; cursor: pointer; transition: border-color .16s, background .16s; }
.pay-option:has(input:checked) { border-color: #6cafff; background: #f3f8ff; }
.pay-option input { margin-left: auto; accent-color: var(--blue); width: 16px; height: 16px; }
.pay-option > div:not(.pay-icon) { flex: 1; }
.pay-option strong { display: block; font-size: 14px; }
.pay-option small { display: block; font-size: 12px; color: var(--muted); }
.pay-icon { display: inline-grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 16px; font-weight: 700; }
.pay-icon.wechat { background: #e3f8eb; color: #15a259; }
.pay-icon.alipay { background: #e8f3ff; color: #1681e7; }
.pay-icon.card { background: #fff0ef; color: #df625c; }
.payment-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin: 22px 0; padding-top: 21px; }
.payment-total .amount, .payment-total strong { font-size: 30px; color: var(--red); letter-spacing: -.04em; }
.bottom-action { display: flex; align-items: center; justify-content: flex-end; gap: 12px; background: #fff; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; margin-top: 22px; }
.bottom-action > .amount, .bottom-action > div:first-child { margin-right: auto; }
.result-banner { background: linear-gradient(125deg,#0875ff,#0759c8); color: #fff; padding: 34px; border-radius: 16px; text-align: center; overflow: hidden; position: relative; margin-bottom: 22px; }
.result-banner h1, .result-banner h2, .result-banner h3 { color: #fff; margin: 12px 0 8px; }
.result-banner p { color: #d0e5ff; margin-bottom: 5px; }
.result-symbol { width: 44px; height: 44px; margin: auto; border: 1px solid rgb(255 255 255 / 38%); background: rgb(255 255 255 / 14%); border-radius: 50%; display: grid; place-items: center; font-size: 23px; }
.result-amount { font-size: 42px; font-weight: 750; letter-spacing: -.04em; line-height: 1.4; margin: 9px 0; font-variant-numeric: tabular-nums; }
.result-meta { display: flex; justify-content: center; gap: 13px; color: #c8e2ff; font-size: 12px; }
.receipt { max-width: 760px; margin: 0 auto; }
.receipt > .panel { margin-bottom: 20px; }
.stepper { display: flex; align-items: center; gap: 16px; margin: 0 0 24px; color: #91a0b3; font-size: 12px; }
.stepper > span, .stepper > div { display: flex; align-items: center; gap: 7px; }
.stepper .current { color: var(--blue); font-weight: 700; }
.stepper b { border: 1px solid #d9e2ee; border-radius: 50%; width: 23px; height: 23px; display: inline-grid; place-items: center; font-size: 11px; }
.stepper .current b { color: #fff; border-color: var(--blue); background: var(--blue); }

/* Wallet and live race */
.chart-bars { height: 200px; display: flex; gap: 12px; align-items: flex-end; padding: 15px 4px 0; border-bottom: 1px solid #dce6f1; background: repeating-linear-gradient(to top,transparent 0,transparent 49px,#f0f3f8 49px,#f0f3f8 50px); }
.chart-bars .bar { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; position: relative; }
.bar-fill { width: 100%; min-height: 3px; background: #87baff; border-radius: 5px 5px 0 0; }
.bar:nth-last-child(1) .bar-fill, .bar.active .bar-fill { background: var(--blue); }
.chart-axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.chart-axis > span { flex: 1; text-align: center; }
.wallet-card { background: linear-gradient(120deg,#0b6ce5,#0854b9); border-radius: 16px; padding: 27px 30px; color: #fff; margin-bottom: 23px; }
.wallet-card p, .wallet-card label { color: #c4dcfa; margin-bottom: 8px; }
.wallet-card strong, .wallet-card .amount { color: #fff; display: block; font-size: 38px; font-weight: 750; letter-spacing: -.04em; margin-bottom: 18px; }
.wallet-card .btn { background: rgb(255 255 255 / 15%); border-color: rgb(255 255 255 / 35%); color: #fff; }
.ledger-list { list-style: none; padding: 0; margin: 0; }
.ledger-list > li, .ledger-list > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.ledger-list > :last-child { border-bottom: 0; }
.ledger-list strong { font-weight: 600; }
.ledger-list small, .ledger-list time { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.video-stage { position: relative; min-height: 330px; border-radius: 14px; overflow: hidden; background: #142b46; display: grid; place-items: center; color: #fff; margin-bottom: 18px; }
.video-stage img, .video-stage video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.video-stage > :not(img):not(video) { position: relative; z-index: 1; }
.video-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0; }
.progress-track { height: 6px; background: #e4edf8; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue); }

/* Dialog and feedback */
dialog#dialog { border: 1px solid #e0e8f3; border-radius: 18px; padding: 0; width: min(520px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); color: var(--ink); box-shadow: 0 30px 90px rgb(5 31 66 / 25%); }
dialog::backdrop { background: rgb(12 31 59 / 46%); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head > button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 7px; font-size: 22px; }
.dialog-head > button:hover { background: #f1f5fa; }
#dialog-body { padding: 24px; }
#dialog-body > :last-child { margin-bottom: 0; }
.toast { position: fixed; z-index: 100; top: 98px; left: calc(50% + 108px); transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 12px 20px; border: 1px solid #dce7f4; border-radius: 10px; background: #fff; box-shadow: 0 8px 30px rgb(14 42 81 / 15%); color: #285071; font-size: 13px; animation: toast-appear .2s ease-out; }
@keyframes page-appear { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes toast-appear { from { opacity: 0; margin-top: -8px; } to { opacity: 1; margin-top: 0; } }

/* Intermediate desktop widths keep navigation compact and content readable. */
@media (max-width: 1250px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  main#view { padding-left: 28px; padding-right: 28px; }
  .content-grid { grid-template-columns: minmax(0,1fr) 250px; gap: 18px; }
  .race-grid { gap: 15px; }
  .race-body h3 { font-size: 16px; }
  .race-card .race-body, .race-card footer { padding-left: 15px; padding-right: 15px; }
  .quick-grid { gap: 10px; }
  .quick-grid a { padding: 13px 11px; gap: 7px; }
  .checkout-layout { grid-template-columns: minmax(0,1fr) 285px; gap: 18px; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  :root { --sidebar-width: 190px; }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .brand { padding-left: 7px; font-size: 19px; }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid > aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .content-grid > aside .sidebar-card { margin: 0; }
  .content-grid > aside .pool-ticker { margin: 0; }
  .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-heading h1 { font-size: 34px; }
  .auth-art { padding: 35px 24px; }
  .auth-form { padding: 32px 25px; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-summary { position: static; }
  .toast { left: calc(50% + 95px); }
}

/* App preview is a real scrolling page, not a clipped screenshot frame. */
body[data-mode="app"] { background: #e8eef7; }
body[data-mode="app"] .site-shell { max-width: 430px; min-height: 820px; margin: 24px auto; background: var(--bg); border: 1px solid #d7e1ee; border-radius: 25px; box-shadow: 0 22px 70px rgb(18 46 86 / 12%); overflow: clip; }
body[data-mode="app"] .sidebar { display: none; }
body[data-mode="app"] .workspace { margin-left: 0; min-height: 820px; padding-bottom: 76px; }
body[data-mode="app"] .topbar { height: 62px; padding: 0 18px; position: sticky; }
body[data-mode="app"] .breadcrumb { font-size: 15px; }
body[data-mode="app"] .top-actions { gap: 8px; }
body[data-mode="app"] .top-actions .user-name { display: none; }
body[data-mode="app"] main#view { padding: 20px 16px 28px; }
body[data-mode="app"] .bottom-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(428px,100%); min-height: 68px; padding: 7px 7px max(7px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 98%); z-index: 40; box-shadow: 0 -4px 18px rgb(28 60 104 / 3%); }
body[data-mode="app"] .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8996a9; font-size: 11px; line-height: 1.3; padding: 4px; }
body[data-mode="app"] .bottom-nav svg { width: 21px; height: 21px; }
body[data-mode="app"] .bottom-nav a.active { color: var(--blue); font-weight: 700; }
body[data-mode="app"] .app-switch { top: 30px; bottom: auto; right: calc(50% - 385px); }
body[data-mode="app"] .demo-strip { font-size: 11px; margin-bottom: 19px; padding: 7px 10px; }
body[data-mode="app"] .page-heading { align-items: flex-start; gap: 13px; margin-bottom: 20px; flex-wrap: wrap; }
body[data-mode="app"] .page-heading h1 { font-size: 24px; letter-spacing: -.035em; }
body[data-mode="app"] .page-heading p { font-size: 12px; }
body[data-mode="app"] .page-heading .actions { gap: 7px; }
body[data-mode="app"] .page-heading .actions .btn { min-height: 35px; font-size: 12px; padding: 7px 11px; }
body[data-mode="app"] .grid.two, body[data-mode="app"] .grid.three, body[data-mode="app"] .content-grid, body[data-mode="app"] .checkout-layout { grid-template-columns: 1fr; gap: 16px; }
body[data-mode="app"] .grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
body[data-mode="app"] .stat-card { padding: 15px; }
body[data-mode="app"] .stat-card strong { font-size: 25px; }
body[data-mode="app"] .panel { padding: 18px; border-radius: 13px; }
body[data-mode="app"] .panel-heading { margin-bottom: 16px; }
body[data-mode="app"] .panel-heading h2 { font-size: 18px; }
body[data-mode="app"] .tabs { gap: 22px; margin-bottom: 18px; }
body[data-mode="app"] .tabs button, body[data-mode="app"] .tabs a { font-size: 13px; padding-top: 10px; }
body[data-mode="app"] .hero-banner { min-height: 225px; padding: 24px 21px; border-radius: 14px; margin-bottom: 18px; }
body[data-mode="app"] .hero-content { max-width: 88%; }
body[data-mode="app"] .hero-content h1, body[data-mode="app"] .hero-content h2 { font-size: 26px; }
body[data-mode="app"] .hero-content > p { font-size: 12px; }
body[data-mode="app"] .hero-meta { gap: 9px; font-size: 11px; }
body[data-mode="app"] .race-grid { grid-template-columns: 1fr; gap: 14px; }
body[data-mode="app"] .race-card img.cover { aspect-ratio: 2.1; }
body[data-mode="app"] .race-body h3 { font-size: 18px; }
body[data-mode="app"] .race-card .race-body { padding: 15px; }
body[data-mode="app"] .quick-grid { gap: 8px; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 18px 0; }
body[data-mode="app"] .quick-grid a { flex-direction: column; justify-content: center; text-align: center; padding: 12px 5px; gap: 7px; font-size: 11px; }
body[data-mode="app"] .quick-grid small { display: none; }
body[data-mode="app"] .quick-grid a > svg { width: 33px; height: 33px; }
body[data-mode="app"] .sidebar-card { margin-bottom: 15px; }
body[data-mode="app"] .pool-ticker strong { font-size: 28px; }
body[data-mode="app"] .detail-hero { min-height: 235px; padding: 22px; margin-bottom: 17px; }
body[data-mode="app"] .detail-hero h1, body[data-mode="app"] .detail-hero h2 { font-size: 25px; }
body[data-mode="app"] .detail-hero p { font-size: 12px; }
body[data-mode="app"] .detail-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 14px; padding: 17px 0; }
body[data-mode="app"] .detail-facts > div:nth-child(2) { border: 0; }
body[data-mode="app"] .detail-facts strong { font-size: 15px; }
body[data-mode="app"] .timeline .stage { padding: 14px 12px; gap: 10px; }
body[data-mode="app"] .stage small, body[data-mode="app"] .stage p { font-size: 11px; }
body[data-mode="app"] .entry-grid { gap: 9px; }
body[data-mode="app"] .entry-option { padding: 13px; }
body[data-mode="app"] .entry-option h3 { font-size: 14px; }
body[data-mode="app"] .entry-option .amount { font-size: 18px; }
body[data-mode="app"] .pigeon-row { gap: 11px; }
body[data-mode="app"] .pigeon-row img { width: 58px; height: 64px; flex-basis: 58px; }
body[data-mode="app"] .pigeon-row small { overflow-wrap: anywhere; font-size: 11px; }
body[data-mode="app"] .pigeon-row .btn { padding: 7px 9px; font-size: 11px; }
body[data-mode="app"] .auth-layout { display: flex; flex-direction: column; min-height: 0; margin: 0; border-radius: 15px; }
body[data-mode="app"] .auth-art { min-height: 250px; padding: 28px 23px; }
body[data-mode="app"] .auth-art h1 { font-size: 32px; }
body[data-mode="app"] .auth-form { padding: 24px 22px 30px; width: 100%; }
body[data-mode="app"] .form-grid { grid-template-columns: 1fr; gap: 16px; }
body[data-mode="app"] .checkout-summary { position: static; padding: 20px; }
body[data-mode="app"] .stepper { gap: 9px; font-size: 11px; flex-wrap: wrap; }
body[data-mode="app"] .stepper b { width: 21px; height: 21px; }
body[data-mode="app"] .bottom-action { padding: 14px; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
body[data-mode="app"] .bottom-action > .btn { flex: 1; }
body[data-mode="app"] .result-banner { padding: 27px 20px; }
body[data-mode="app"] .result-amount { font-size: 34px; }
body[data-mode="app"] .result-meta { font-size: 11px; gap: 9px; }
body[data-mode="app"] .kv { gap: 13px; font-size: 13px; }
body[data-mode="app"] .kv > div { gap: 12px; }
body[data-mode="app"] .wallet-card { padding: 22px; }
body[data-mode="app"] .wallet-card strong, body[data-mode="app"] .wallet-card .amount { font-size: 32px; }
body[data-mode="app"] .video-stage { min-height: 220px; }
body[data-mode="app"] .chart-bars { gap: 8px; height: 170px; }
body[data-mode="app"] .toast { left: 50%; top: 85px; width: max-content; max-width: min(390px,calc(100vw - 32px)); }

/* Mobile web mirrors the app navigation, while keeping the browser a normal page. */
@media (max-width: 760px) {
  html { scroll-padding-top: 80px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .topbar { height: 62px; padding: 0 18px; }
  .breadcrumb { font-size: 14px; }
  .top-actions { gap: 8px; }
  .top-actions .user-name { display: none; }
  main#view { padding: 23px 18px 30px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); position: fixed; bottom: 0; left: 0; right: 0; min-height: 68px; padding: 7px 9px max(7px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 98%); z-index: 40; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8996a9; font-size: 11px; line-height: 1.3; padding: 4px; }
  .bottom-nav svg { width: 21px; height: 21px; }
  .bottom-nav a.active { color: var(--blue); font-weight: 700; }
  .app-switch { display: none; }
  .demo-strip { margin-bottom: 19px; font-size: 11px; padding: 8px 10px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 13px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; letter-spacing: -.035em; }
  .page-heading p { font-size: 12px; }
  .page-heading .actions .btn { min-height: 35px; font-size: 12px; padding: 7px 11px; }
  .grid.two, .grid.three, .content-grid, .checkout-layout { grid-template-columns: 1fr; gap: 16px; }
  .grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 26px; }
  .panel { padding: 19px; border-radius: 13px; }
  .panel-heading h2 { font-size: 18px; }
  .tabs { gap: 22px; margin-bottom: 18px; }
  .tabs button, .tabs a { font-size: 13px; }
  .hero-banner { min-height: 235px; padding: 26px 22px; border-radius: 14px; margin-bottom: 18px; }
  .hero-content { max-width: 85%; }
  .hero-content h1, .hero-content h2 { font-size: 28px; }
  .hero-content > p { font-size: 12px; }
  .hero-meta { gap: 10px; font-size: 11px; }
  .race-grid { grid-template-columns: 1fr; gap: 15px; }
  .race-card img.cover { aspect-ratio: 2.1; }
  .race-body h3 { font-size: 18px; }
  .quick-grid { gap: 9px; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 18px 0; }
  .quick-grid a { flex-direction: column; justify-content: center; text-align: center; padding: 13px 5px; gap: 8px; font-size: 11px; }
  .quick-grid small { display: none; }
  .quick-grid a > svg { width: 34px; height: 34px; }
  .sidebar-card { margin-bottom: 15px; }
  .detail-hero { min-height: 250px; padding: 23px; }
  .detail-hero h1, .detail-hero h2 { font-size: 26px; }
  .detail-hero p { font-size: 12px; }
  .detail-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .detail-facts > div:nth-child(2) { border: 0; }
  .timeline .stage { padding: 15px 13px; gap: 11px; }
  .stage small, .stage p { font-size: 11px; }
  .entry-grid { gap: 10px; }
  .entry-option { padding: 14px; }
  .entry-option .amount { font-size: 18px; }
  .pigeon-row { gap: 11px; }
  .pigeon-row img { width: 58px; height: 64px; flex-basis: 58px; }
  .pigeon-row small { overflow-wrap: anywhere; }
  .auth-layout { display: flex; flex-direction: column; min-height: 0; margin: 0; border-radius: 15px; }
  .auth-art { min-height: 260px; padding: 29px 24px; }
  .auth-art h1 { font-size: 33px; }
  .auth-form { padding: 27px 23px 32px; width: 100%; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .checkout-summary { position: static; padding: 20px; }
  .stepper { gap: 10px; font-size: 11px; flex-wrap: wrap; }
  .bottom-action { padding: 14px; gap: 9px; flex-wrap: wrap; }
  .bottom-action > .btn { flex: 1; }
  .result-banner { padding: 27px 20px; }
  .result-amount { font-size: 35px; }
  .result-meta { font-size: 11px; }
  .kv { gap: 13px; font-size: 13px; }
  .kv > div { gap: 13px; }
  .wallet-card { padding: 24px; }
  .wallet-card strong, .wallet-card .amount { font-size: 34px; }
  .video-stage { min-height: 225px; }
  .chart-bars { gap: 8px; height: 175px; }
  .dialog-head { padding: 18px 20px; }
  #dialog-body { padding: 20px; }
  .toast { top: 78px; left: 50%; width: max-content; max-width: calc(100vw - 32px); }
  body[data-mode="app"] .site-shell { border: 0; border-radius: 0; margin: 0 auto; min-height: 100dvh; box-shadow: none; max-width: none; }
  body[data-mode="app"] .workspace { min-height: 100dvh; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body[data-mode="app"] .bottom-nav { width: 100%; }
}
@media (max-width: 360px) {
  main#view, body[data-mode="app"] main#view { padding-left: 12px; padding-right: 12px; }
  .hero-content h1, .hero-content h2, body[data-mode="app"] .hero-content h1, body[data-mode="app"] .hero-content h2 { font-size: 24px; }
  .panel, body[data-mode="app"] .panel { padding: 15px; }
  .entry-grid, body[data-mode="app"] .entry-grid { grid-template-columns: 1fr; }
  .quick-grid, body[data-mode="app"] .quick-grid { gap: 6px; }
  .tabs, body[data-mode="app"] .tabs { gap: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
