@font-face {
  font-family: "DIN Condensed";
  src: url("../../shared-assets/Typography/DIN Condensed Bold(1).ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "xianglifang-Regular";
  src: url("../../shared-assets/Typography/xianglifang-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "DouyinSansBold";
  src: url("../../shared-assets/Typography/DouyinSansBold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --banana-gray: #f1f1f1;
  --banana-red: #fd270f;
  --banana-yellow: #ffda2a;
  --betax-orange: #ff6a0f;
  --surface-0: #f1f1f1;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #e6e6e3;
  --ink: #17130f;
  --ink-muted: #67615a;
  --line: rgba(23, 19, 15, 0.13);
  --green: #3cba7a;
  --font-title-primary: "xianglifang-Regular", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-title-secondary: "DouyinSansBold", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-title-tertiary: "DouyinSansBold", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-numeric: "DIN Condensed", sans-serif;
  --gradient-warm: linear-gradient(
    90deg,
    #ff901e 0%,
    #ff901e 10%,
    #ffaf23 17%,
    #ffc726 34%,
    #ffd529 50%,
    #ffda2a 64%,
    #ffda2a 100%
  );
  --gradient-green: linear-gradient(
    90deg,
    #1bb573 0%,
    #3cba7a 18%,
    #62c182 43%,
    #7dc689 65%,
    #8ec88c 85%,
    #94ca8e 100%
  );
  --gradient-blue: linear-gradient(
    90deg,
    #0d57a7 0%,
    #2f73ba 29%,
    #5b96d2 69%,
    #6ca4dc 90%,
    #6ca4dc 100%
  );
  --gradient-pink: linear-gradient(
    90deg,
    #ff7f84 0%,
    #ff7f84 10%,
    #ff9b99 16%,
    #ffb2aa 33%,
    #ffc0b5 50%,
    #ffc5b9 64%,
    #ffc5b9 100%
  );
  --gradient-purple: linear-gradient(
    90deg,
    #a68cd2 0%,
    #a68cd2 8%,
    #bda1d2 27%,
    #dabbd3 55%,
    #e5c5d4 71%,
    #e5c5d4 100%
  );
  color: var(--ink);
  background: var(--surface-0);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

.typo-title-primary {
  font-family: var(--font-title-primary);
}

.typo-title-secondary {
  font-family: var(--font-title-secondary);
}

.typo-title-tertiary {
  font-family: var(--font-title-tertiary);
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  min-width: 320px;
  background: var(--banana-gray);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--banana-gray);
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--banana-yellow);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #f1f1f1 0%, #f5f5f3 48%, #ececea 100%);
  box-shadow: 0 0 50px rgba(23, 19, 15, 0.1);
}

.app-shell::before {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 50%;
  width: 100%;
  aspect-ratio: 677.21 / 906.97;
  content: "";
  pointer-events: none;
  background-image: url("../../shared-assets/SVG/BgPattern.svg");
  background-position: center top;
  background-size: 100% auto;
  background-repeat: no-repeat;
  opacity: 0.5;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 100%);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  animation: screen-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.screen > * {
  animation: rise-in 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.screen > *:nth-child(2) { animation-delay: 50ms; }
.screen > *:nth-child(3) { animation-delay: 100ms; }
.screen > *:nth-child(4) { animation-delay: 150ms; }
.screen > *:nth-child(5) { animation-delay: 200ms; }
.screen > *:nth-child(6) { animation-delay: 250ms; }

@keyframes screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.race-logo {
  display: block;
  width: min(68vw, 260px);
  height: auto;
}

.partner-logo {
  display: block;
  width: 82px;
  height: auto;
  opacity: 0.72;
}

.host-logo {
  display: block;
  width: 92px;
  height: auto;
}

.login-screen {
  display: flex;
  min-height: 100svh;
  padding-top: max(24px, env(safe-area-inset-top));
  flex-direction: column;
  justify-content: center;
}

.login-hero {
  display: grid;
  min-height: 144px;
  margin-top: auto;
  padding: 8px 4px 16px;
  place-items: center;
  top: -44px;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--betax-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-name,
.section-title,
.rules-page h2,
.section-kicker {
  font-family: var(--font-title-primary);
}

.backbar h1 {
  font-family: var(--font-title-secondary);
}

.score-status,
.status-banner,
.entry-title,
.history-card strong,
.tab,
.rank-badge,
.my-rank-summary__standing > strong,
.active-group-note,
.toast-title,
.share-content h2 {
  font-family: var(--font-title-secondary);
}

.field-label,
.spectator-entry,
.profile-meta,
.update-time,
.section-note,
.switch-account,
.login-credit,
.score-stat > span,
.score-complete,
.primary-button,
.secondary-button,
.rules-button,
.history-card small,
.entry-meta,
.leaderboard-head,
.form-error {
  font-family: var(--font-title-tertiary);
}

.login-race-logo {
  display: block;
  width: min(67%, 243px);
  height: auto;
}

.login-panel {
  width: min(100%, 320px);
  margin: 0 auto;
  padding: 0;
}

.login-action {
  display: flex;
  width: 100%;
  margin-top: 16px;
  flex-direction: column;
  align-items: center;
}

.login-action .primary-button {
  width: min(280px, 100%);
  border-radius: 12px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-muted);
  font-size: 12px;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(23, 19, 15, 0.08);
  backdrop-filter: blur(12px);
  font-size: 16px;
  transition: border-color 160ms ease, background 160ms ease;
}

.field input:focus {
  border-color: var(--banana-red);
  background: #ffffff;
  outline: none;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 5px;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  background: var(--banana-yellow);
  color: var(--ink);
  box-shadow: 0 5px 12px rgba(255, 218, 42, 0.16);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: scale(0.98);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.38;
  box-shadow: none;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.login-help {
  display: grid;
  gap: 4px;
  margin: 8px 2px 0;
  color: var(--ink-muted);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}

.spectator-entry {
  align-self: center;
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: var(--betax-orange);
  font-size: 12px;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: rgba(255, 106, 15, 0.32);
  text-underline-offset: 4px;
}

.spectator-entry:hover,
.spectator-entry:focus-visible {
  background: rgba(255, 106, 15, 0.06);
}

.login-credits {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: auto;
  padding-top: 28px;
}

.login-credit {
  display: flex;
  width: auto;
  min-width: 0;
  min-height: 52px;
  padding: 8px 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 9px;
  white-space: nowrap;
}

.login-credit .host-logo {
  width: 66px;
}

.login-credit .partner-logo {
  width: 74px;
  opacity: 0.68;
}

.form-error {
  margin: -4px 0 14px;
  color: var(--banana-red);
  font-size: 12px;
  line-height: 1.5;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.topbar-logo {
  width: 101px;
  height: auto;
}

.rules-button {
  position: absolute;
  right: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 20px;
}

.profile-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 2px 18px;
}

.profile-name {
  margin: 0 0 5px;
  font-size: 25px;
  line-height: 1.1;
}

.profile-meta,
.update-time {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.update-time {
  text-align: right;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 8px;
  color: #21180c;
  background: var(--banana-yellow);
  font-size: 12px;
  font-weight: 800;
}

.status-banner.offline {
  color: white;
  background: var(--banana-red);
}

.status-banner.submitted {
  color: #ffffff;
  background: var(--gradient-green);
}

.status-banner.finished {
  color: #ffffff;
  background: var(--gradient-blue);
}

.score-panel {
  position: relative;
  overflow: hidden;
  min-height: 184px;
  padding: 28px 18px 20px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 42px rgba(23, 19, 15, 0.1);
}

.score-corner {
  position: absolute;
  z-index: 0;
  display: none;
  width: 72px;
  height: 38px;
  pointer-events: none;
}

.score-panel.is-active .score-corner {
  display: block;
}

.score-corner::before,
.score-corner::after {
  position: absolute;
  content: "";
}

.score-corner--top {
  top: 0;
  left: 0;
  background:
    linear-gradient(90deg, var(--betax-orange), var(--banana-yellow)) 11px 0 / 61px 3px no-repeat,
    linear-gradient(180deg, var(--betax-orange), var(--banana-yellow)) 0 11px / 3px 27px no-repeat;
}

.score-corner--top::before {
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-top: 3px solid var(--betax-orange);
  border-left: 3px solid var(--betax-orange);
  border-radius: 11px 0 0;
}

.score-corner--top::after {
  display: none;
}

.score-corner--bottom {
  right: 0;
  bottom: 0;
  background:
    linear-gradient(90deg, var(--banana-yellow), var(--betax-orange)) 0 35px / 61px 3px no-repeat,
    linear-gradient(180deg, var(--banana-yellow), var(--betax-orange)) 69px 0 / 3px 27px no-repeat;
}

.score-corner--bottom::before {
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-right: 3px solid var(--betax-orange);
  border-bottom: 3px solid var(--betax-orange);
  border-radius: 0 0 11px;
}

.score-corner--bottom::after {
  display: none;
}

.score-status,
.score-display {
  position: relative;
  z-index: 1;
}

.score-complete {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 14px;
  color: #8d8b87;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.score-display {
  display: grid;
  min-height: 100px;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 18px;
}

.score-stat {
  display: grid;
  min-width: 0;
  padding-top: 18px;
  grid-template-rows: 16px 52px;
  align-content: end;
  row-gap: 6px;
  border-top: 1px solid var(--line);
}

.score-stat span {
  display: flex;
  margin: 0;
  align-items: flex-end;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1;
}

.score-stat strong {
  display: block;
  min-height: 52px;
  font-family: var(--font-numeric);
  font-size: 52px;
  line-height: 1;
  color: var(--banana-red);
  white-space: nowrap;
}

.score-status {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.score-panel.is-waiting {
  background:
    linear-gradient(135deg, rgba(108, 164, 220, 0.12), rgba(241, 241, 241, 0.74)),
    #ffffff;
}

.score-panel.is-waiting .score-stat strong {
  color: #8d8b87;
}

.score-panel.is-waiting .score-complete {
  color: #8d8b87;
}

.score-panel.is-waiting .score-status {
  color: var(--ink);
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 12px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.section-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.active-group-note {
  width: fit-content;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 106, 15, 0.1);
  color: var(--banana-red);
  font-size: 11px;
  font-weight: 800;
}

.map-panel {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(23, 19, 15, 0.1);
}

.venue-map-base {
  position: relative;
  display: block;
  width: calc(100% - 4px);
  height: auto;
  margin: 8px 2px;
  opacity: 1;
  filter: none;
  transform-origin: top left;
}

.map-entrances {
  position: absolute;
  inset: 8px 2px;
}

.map-entrance {
  position: absolute;
  right: auto;
  bottom: auto;
  display: flex;
  overflow: hidden;
  min-width: 0;
  padding: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--banana-yellow);
  border-radius: 10px;
  background: rgba(255, 218, 42, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 5px 16px rgba(90, 62, 17, 0.12);
  color: #30200a;
  text-align: center;
  backdrop-filter: blur(1px);
  transition:
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.map-entrance::after {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--zone-progress);
  background: rgba(255, 175, 35, 0.34);
  content: "";
  pointer-events: none;
}

.map-entrance:hover,
.map-entrance:focus-visible {
  background: rgba(255, 218, 42, 0.3);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 7px 20px rgba(90, 62, 17, 0.16);
}

.map-entrance:active {
  transform: scale(0.98);
}

.map-entrance--a,
.map-entrance--b,
.map-entrance--c {
  align-items: baseline;
  flex-direction: row;
  gap: 8px;
}

.map-entrance.is-waiting {
  border-color: #aaa8a3;
  background: rgba(178, 176, 171, 0.2);
  color: #5f5d59;
}

.map-entrance.is-waiting::after {
  background: rgba(120, 118, 113, 0.2);
}

.map-entrance__name {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.map-entrance__progress {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-family: var(--font-numeric);
  font-size: 17px;
  line-height: 1;
  color: rgba(48, 32, 10, 0.82);
}

.map-entrance--a .map-entrance__progress,
.map-entrance--b .map-entrance__progress,
.map-entrance--c .map-entrance__progress {
  margin-top: 0;
}


.rank-list,
.history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
}

.rank-entry,
.history-entry {
  display: grid;
  width: 100%;
  min-height: 62px;
  padding: 12px 13px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.rank-entry {
  grid-template-columns: 1fr auto 18px;
  gap: 10px;
}

.rank-entry:last-child,
.history-entry:last-child {
  border-bottom: 0;
}

.entry-title {
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.entry-meta {
  display: block;
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
}

.rank-badge {
  min-width: 58px;
  padding: 6px 8px 5px;
  border-radius: 4px;
  background: var(--banana-yellow);
  color: #231a0d;
  font-size: 17px;
  text-align: center;
}

.chevron {
  color: var(--ink-muted);
  font-size: 20px;
}

.history-entry {
  grid-template-columns: 1fr 18px;
}

.history-section {
  display: grid;
  gap: 16px;
}

.history-section .section-head {
  align-items: center;
  margin-bottom: 0;
}

.history-share-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-muted);
  box-shadow: 0 8px 20px rgba(23, 19, 15, 0.05);
  backdrop-filter: blur(8px);
  transition: color 160ms ease, transform 160ms ease, background 160ms ease;
}

.history-share-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-share-button:hover,
.history-share-button:focus-visible {
  background: #ffffff;
  color: var(--betax-orange);
}

.history-share-button:active {
  transform: scale(0.96);
}

.history-cards {
  display: grid;
  gap: 8px;
}

.history-card {
  display: grid;
  width: 100%;
  min-height: 58px;
  padding: 11px 13px;
  grid-template-columns: 1fr 18px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(23, 19, 15, 0.05);
}

.history-card strong,
.history-card small {
  display: block;
}

.history-card strong {
  font-size: 13px;
}

.history-card small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 400;
}

.history-card:disabled {
  cursor: default;
  opacity: 0.48;
}

.history-unavailable {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(23, 19, 15, 0.05);
  color: #9b9892;
  font-size: 13px;
}

.page-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.page-actions .primary-button {
  width: min(280px, 100%);
  border-radius: 12px;
  background: var(--banana-yellow);
  color: #21180c;
  box-shadow: 0 5px 12px rgba(255, 218, 42, 0.16);
}

.switch-account {
  display: block;
  margin: 22px auto 0;
  padding: 8px 14px;
  background: transparent;
  color: var(--betax-orange);
  font-size: 12px;
  font-weight: 400;
}

.sponsor-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--ink-muted);
  font-size: 10px;
}

.sponsor-line img {
  width: 76px;
  height: auto;
  opacity: 0.68;
}

.credits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.credit-item {
  display: grid;
  min-height: 42px;
  place-items: center;
  gap: 5px;
  color: var(--ink-muted);
  font-size: 9px;
}

.credit-item + .credit-item {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.credit-item .host-logo {
  width: 76px;
}

.credit-item .partner-logo {
  width: 68px;
}

.page-footer {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 26px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}

.page-footer .login-credit {
  min-height: 44px;
  padding: 4px 0;
}

.page-footer .host-logo {
  width: 66px;
}

.page-footer .partner-logo {
  width: 74px;
  opacity: 0.68;
}

.backbar {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.backbar .history-share-button {
  justify-self: end;
}

.backbar .icon-button,
.backbar .history-share-button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: var(--ink);
}

.backbar .icon-button:hover,
.backbar .icon-button:focus-visible,
.backbar .history-share-button:hover,
.backbar .history-share-button:focus-visible {
  background: transparent;
  color: var(--ink);
}

.backbar h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.zone-summary .section-kicker {
  color: var(--ink);
}

.zone-summary .zone-overview-title {
  margin-bottom: 8px;
  font-family: var(--font-title-primary);
  font-size: 18px;
  line-height: 1.2;
}

.zone-time-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.zone-time-note strong {
  color: inherit;
  font-family: var(--font-numeric);
  font-size: 16px;
  font-weight: 400;
}

.zone-total {
  margin: 0;
  font-family: var(--font-numeric);
  font-size: 54px;
  line-height: 1;
  color: var(--banana-red);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-tile {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 3 / 4;
  padding: 16px 12px 12px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-items: end;
  gap: 8px;
  border: 2px solid #deddda;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 18px rgba(23, 19, 15, 0.04);
}

.route-tile.completed {
  border-color: var(--banana-yellow);
  background:
    linear-gradient(180deg, var(--banana-yellow) 0%, var(--banana-yellow) 84%, #f7d21f 100%);
  box-shadow: 0 8px 20px rgba(255, 218, 42, 0.16);
}

.route-tile.pending {
  border-color: rgba(222, 221, 218, 0.72);
  background: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.route-tile.pending .route-code,
.route-tile.pending .route-status {
  color: rgba(0, 0, 0, 0.42);
}

.route-code {
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  color: #000000;
  font-family: var(--font-numeric);
  font-size: 28px;
  font-weight: 700;
  line-height: 0.88;
  white-space: nowrap;
}

.route-status {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  color: #000000;
  font-family: var(--font-title-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}


.repeat-mark {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  min-width: 32px;
  padding: 5px 7px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--banana-yellow);
  font-family: var(--font-title-secondary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: lowercase;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 0 -16px 18px;
  padding: 0 16px 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 38px;
  padding: 0 13px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  border-color: var(--banana-yellow);
  background: var(--banana-yellow);
  color: var(--ink);
}

.my-rank-summary {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 218, 42, 0.9);
  border-radius: 10px;
  background: rgba(255, 218, 42, 0.3);
  box-shadow: 0 8px 20px rgba(255, 218, 42, 0.1);
  color: var(--ink);
  text-align: left;
}

.my-rank-summary__standing,
.my-rank-summary__details,
.my-rank-summary__metrics span {
  display: grid;
}

.my-rank-summary__standing {
  gap: 5px;
}

.my-rank-summary__standing > span,
.my-rank-summary__metrics small {
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 500;
}

.my-rank-summary__standing > strong {
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.my-rank-summary__details {
  min-width: 0;
  gap: 3px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.my-rank-summary__details strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-rank-summary__details span {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-rank-summary__metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-rank-summary__metrics span {
  gap: 2px;
  text-align: right;
}

.my-rank-summary__metrics strong {
  font-family: var(--font-numeric);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(90px, 1fr) 48px 58px;
  align-items: center;
  gap: 7px;
}

.leaderboard-head {
  padding: 0 10px 8px;
  color: var(--ink-muted);
  font-size: 10px;
}

.leaderboard-head span:nth-child(3),
.leaderboard-head span:nth-child(4) {
  width: 100%;
  text-align: right;
}

.leaderboard {
  max-height: 58svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
}

.leaderboard-row {
  scroll-margin-top: 16px;
  min-height: 56px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row.is-me {
  position: relative;
  background: linear-gradient(90deg, rgba(255, 218, 42, 0.34), rgba(255, 218, 42, 0.14));
}

.leaderboard-row.is-me::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--banana-yellow);
  content: "";
}

.leaderboard-row.is-located {
  animation: locate-row 1.4s ease;
}

@keyframes locate-row {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: inset 0 0 0 2px var(--banana-yellow); }
}

.rank-number {
  font-family: var(--font-numeric);
  font-size: 21px;
  color: #9a958f;
}

.rank-number.is-top-three {
  color: var(--banana-red);
  font-weight: 900;
}

.athlete-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athlete-group {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 400;
}

.rank-score,
.rank-time {
  display: block;
  width: 100%;
  font-family: var(--font-numeric);
  font-size: 17px;
  line-height: 1;
  text-align: right;
}

.rank-score {
  display: inline-flex;
  justify-content: flex-end;
}

.rank-score .is-complete {
  color: var(--banana-red);
  font-weight: 900;
}

.my-rank-summary__metrics .is-complete {
  color: var(--banana-red);
  font-weight: 900;
}

@media (max-width: 350px) {
  .my-rank-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .my-rank-summary__metrics {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 9px;
    border-top: 1px solid var(--line);
  }

  .my-rank-summary__metrics span {
    text-align: left;
  }
}

.toast-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(23, 19, 15, 0.32);
  backdrop-filter: blur(3px);
}

.copy-feedback {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(32px, calc(env(safe-area-inset-bottom) + 24px));
  min-width: 112px;
  padding: 8px 16px;
  border: 1px solid rgba(23, 19, 15, 0.08);
  border-radius: 999px;
  background: rgba(23, 19, 15, 0.88);
  box-shadow: 0 8px 24px rgba(23, 19, 15, 0.18);
  color: #ffffff;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
  animation: feedback-in 180ms ease both;
}

@keyframes feedback-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-card {
  position: relative;
  width: min(70vw, 314px);
  padding: 15px;
  border: 1px solid rgba(255, 218, 42, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 55px rgba(23, 19, 15, 0.2);
  text-align: center;
  animation: toast-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-title {
  margin: 0 0 10px;
  color: var(--banana-red);
  font-size: 14px;
}

.toast-copy,
.toast-list {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.65;
}

.toast-list {
  padding-left: 0;
  margin-bottom: 8px;
  list-style-position: inside;
}

.toast-action {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.toast-action button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--banana-yellow);
  color: #21180c;
  font-size: 12px;
  font-weight: 900;
}

.preview-tools {
  position: fixed;
  z-index: 40;
  left: max(10px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 6px;
}

.preview-tools__toggle {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(23, 19, 15, 0.16);
  border-radius: 5px;
  background: rgba(23, 19, 15, 0.76);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(23, 19, 15, 0.16);
}

.preview-tools__menu {
  display: none;
  width: 154px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(23, 19, 15, 0.18);
  backdrop-filter: blur(10px);
}

.preview-tools.is-open .preview-tools__menu {
  display: block;
}

.preview-tools__menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  text-align: left;
}

.preview-tools__menu button:last-child {
  border-bottom: 0;
}

.empty-state {
  display: grid;
  min-height: 350px;
  padding: 28px;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
}

.empty-symbol {
  font-family: var(--font-numeric);
  font-size: 70px;
  color: var(--betax-orange);
}

.empty-state h2 {
  margin: 10px 0 8px;
  font-family: var(--font-title-secondary);
  font-size: 20px;
}

.empty-state p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.65;
}

.modal-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(23, 19, 15, 0.48);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  box-shadow: 0 30px 70px rgba(23, 19, 15, 0.24);
}

.route-photo {
  display: grid;
  min-height: 210px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 218, 42, 0.16), transparent 45%),
    var(--gradient-blue);
  color: rgba(255, 255, 255, 0.84);
  font-family: var(--font-numeric);
  font-size: 56px;
}

.modal-body {
  padding: 18px;
}

.modal-body h2 {
  margin: 0 0 8px;
  font-family: var(--font-title-secondary);
}

.modal-body p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.6;
}

.share-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  padding: 24px;
  background: var(--banana-gray);
}

.share-current-time {
  margin-top: 5px !important;
  color: var(--ink-muted);
  font-size: 12px !important;
}

.share-rank-switch {
  display: grid;
  margin-bottom: 12px;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-rank-switch button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-0);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.share-rank-switch button.active {
  border-color: var(--banana-yellow);
  background: var(--banana-yellow);
  color: var(--ink);
}

.rules-page {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 36px rgba(23, 19, 15, 0.08);
}

.rules-page h2 {
  margin: 0 0 18px;
  font-size: 22px;
}

.rules-page ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.rules-page > p:last-child {
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.share-preview::before {
  position: absolute;
  inset: 0;
  background: url("../../shared-assets/SVG/BgPattern.svg") center / cover;
  opacity: 0.4;
  content: "";
}

.share-content {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
}

.share-content .race-logo {
  width: 76%;
}

.share-score {
  font-family: var(--font-numeric);
  font-size: 92px;
  line-height: 0.85;
  color: var(--betax-orange);
}

.share-score span {
  font-size: 34px;
  color: var(--ink-muted);
}

.share-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.qr-placeholder {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 6px solid white;
  background:
    repeating-linear-gradient(45deg, #17130f 0 4px, #fff 4px 8px);
  color: transparent;
}

@media (max-width: 359px) {
  .screen {
    padding-right: 12px;
    padding-left: 12px;
  }

  .score-number {
    font-size: 66px;
  }

  .map-entrance {
    padding: 5px;
    border-width: 1.5px;
  }

  .map-entrance__name {
    font-size: 16px;
  }

  .map-entrance__progress {
    font-size: 15px;
  }

  .route-grid {
    gap: 6px;
  }

  .route-tile {
    padding: 8px;
    gap: 4px;
  }

  .route-code {
    font-size: 24px;
  }

  .route-status {
    font-size: 11px;
  }

  .repeat-mark {
    top: 8px;
    right: 8px;
    min-width: 28px;
    padding: 4px 6px;
    font-size: 12px;
  }

  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: 30px minmax(76px, 1fr) 42px 52px;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 浮动手动刷新按钮 — 固定右下角 */
.bm-refresh-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--banana-yellow, #ffda2a);
  color: #1a1a1a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.bm-refresh-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.26); }
.bm-refresh-fab:active { transform: translateY(0); }
.bm-refresh-fab svg { transition: transform 0.4s ease; }
.bm-refresh-fab.is-spinning svg {
  animation: bm-spin 0.8s linear infinite;
}
@keyframes bm-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
