:root {
  color-scheme: light;
  --canvas: oklch(0.965 0.005 255);
  --surface: oklch(0.995 0.002 255);
  --surface-hover: oklch(0.978 0.008 25);
  --ink: oklch(0.19 0.014 255);
  --ink-soft: oklch(0.43 0.014 255);
  --line: oklch(0.885 0.008 255);
  --hero: oklch(0.165 0.014 255);
  --brand: #f04438;
  --brand-strong: color-mix(in oklch, var(--brand) 78%, var(--ink));
  --brand-soft: color-mix(in oklch, var(--brand) 8%, var(--surface));
  --danger: oklch(0.5 0.19 28);
  --white: oklch(0.995 0 0);
  --shadow-shell: 0 1.5rem 4rem oklch(0.17 0.012 255 / 0.16);
  --radius-panel: 1rem;
  --radius-control: 0.75rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 30rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  background: var(--canvas);
}

.hero {
  position: relative;
  min-height: 13.75rem;
  padding: 1.75rem 1.125rem 3.5rem;
  overflow: hidden;
  color: var(--white);
  background: var(--hero);
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 0.2rem;
  content: "";
  background: var(--brand);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 8.5rem;
  flex-direction: column;
  justify-content: space-between;
  animation: hero-settle 420ms var(--ease-out) both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: color-mix(in oklch, var(--white) 88%, var(--brand));
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.brand-rule {
  width: 1.75rem;
  height: 0.1875rem;
  background: var(--brand);
  border-radius: 999px;
}

.hero-copy {
  display: grid;
  gap: 0.85rem;
  max-width: 23rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 9.5vw, 3.35rem);
  font-weight: 750;
  letter-spacing: -0.028em;
  line-height: 1.12;
  text-wrap: balance;
}

.page-description {
  max-width: 25em;
  margin: 0;
  color: color-mix(in oklch, var(--white) 82%, var(--brand));
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.7;
  text-wrap: pretty;
}

.bank-picker {
  position: relative;
  z-index: 2;
  margin-top: -1.5rem;
  padding: 0 0.875rem 1.75rem;
}

.page-status {
  margin: 0;
  padding: 1rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  text-align: center;
}

.bank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: list-settle 420ms 70ms var(--ease-out) both;
}

.bank-item {
  min-width: 0;
}

.bank-link {
  display: flex;
  min-height: 4.75rem;
  padding: 0.875rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  text-decoration: none;
  transition:
    color 180ms var(--ease-out),
    background-color 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    transform 140ms var(--ease-out);
}

.bank-link:hover {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: color-mix(in oklch, var(--brand) 34%, var(--line));
}

.bank-link:active,
.bank-link.is-navigating {
  transform: translateY(1px) scale(0.992);
}

.bank-link:focus-visible,
.retry-button:focus-visible {
  outline: 3px solid var(--brand-strong);
  outline-offset: 2px;
}

.bank-name {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.92rem, 4.1vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-arrow {
  display: grid;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  color: var(--ink-soft);
  transition:
    color 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.bank-arrow svg {
  width: 1.125rem;
  height: 1.125rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.bank-link:hover .bank-arrow,
.bank-link:focus-visible .bank-arrow,
.bank-link.is-navigating .bank-arrow {
  color: var(--brand-strong);
  transform: translateX(0.2rem);
}

.skeleton {
  min-height: 4.75rem;
  background: linear-gradient(
    90deg,
    var(--surface) 0%,
    var(--brand-soft) 48%,
    var(--surface) 100%
  );
  background-size: 220% 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  animation: shimmer 1.1s linear infinite;
}

.state-message {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 2.5rem 1.25rem;
  color: var(--ink-soft);
  background: var(--surface);
  border-radius: var(--radius-control);
  font-size: 0.9375rem;
  text-align: center;
}

.state-message strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
}

.state-message--error {
  color: color-mix(in oklch, var(--danger) 76%, var(--ink));
}

.retry-button {
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: var(--white);
  background: var(--brand-strong);
  border: 0;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color 180ms var(--ease-out),
    transform 140ms var(--ease-out);
}

.retry-button:hover {
  background: var(--brand);
}

.retry-button:active {
  transform: translateY(1px) scale(0.985);
}

.noscript-message {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 30;
  margin: 0;
  padding: 0.875rem 1rem;
  color: var(--white);
  background: var(--danger);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
}

[hidden] {
  display: none !important;
}

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

@keyframes hero-settle {
  from {
    transform: translateY(0.35rem);
  }
}

@keyframes list-settle {
  from {
    transform: translateY(0.45rem);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 22rem) {
  .hero {
    padding-inline: 1rem;
  }

  .bank-picker {
    padding-inline: 0.75rem;
  }

  .bank-list {
    gap: 0.5rem;
  }

  .bank-link {
    padding-inline: 0.625rem;
  }

  .bank-name {
    font-size: 0.875rem;
  }
}

@media (min-width: 48rem) {
  body {
    display: grid;
    min-height: 100vh;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    place-items: center;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(28rem, 1.12fr);
    width: min(100%, 68rem);
    min-height: min(40rem, calc(100vh - 3rem));
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-shell);
  }

  .hero {
    display: flex;
    min-height: 40rem;
    padding: 3.25rem 2.75rem;
    align-items: stretch;
  }

  .hero-content {
    min-height: 100%;
  }

  .hero-copy {
    margin-block: auto;
  }

  h1 {
    font-size: clamp(3rem, 4.2vw, 4.35rem);
  }

  .page-description {
    font-size: 0.9375rem;
  }

  .bank-picker {
    display: flex;
    margin-top: 0;
    padding: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    background: var(--surface);
  }

  .bank-list {
    width: 100%;
    gap: 0.75rem;
  }

  .bank-link,
  .skeleton {
    min-height: 4.25rem;
  }

  .bank-link {
    padding-inline: 1rem;
  }

  .bank-name {
    font-size: 1rem;
  }

  .state-message {
    width: 100%;
  }
}

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