:root {
  --ink: #1f2937;
  --muted: #71808c;
  --line: #e2e8f0;
  --paper: #f5f5f7;
  --panel: #fff;
  --accent: #0a84ff;
  --blue: #0a84ff;
  --shadow: 0 12px 30px rgba(31, 49, 66, .07);
  --font-text: "LXGW WenKai Screen", ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.page-shell {
  width: min(860px, calc(100% - 24px));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 14px 0 12px;
  display: flex;
  flex-direction: column;
}

.site-header {
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.header-note {
  color: var(--muted);
  font-size: 12px;
}

main {
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding-top: 10px;
}

.store-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.region-card {
  min-width: 0;
  height: 78px;
  padding: 7px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 3px 10px rgba(31, 49, 66, .035);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.region-card:hover,
.region-card:focus-visible {
  border-color: var(--blue);
  background: #fbfdfe;
  box-shadow: 0 8px 16px rgba(31, 49, 66, .08);
  transform: translateY(-2px);
}

.region-icon {
  width: 42px;
  height: 29px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: transparent;
}

.region-icon .fi {
  width: 39px;
  height: 27px;
  background-size: cover;
}

.region-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.minor-grid {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  gap: 6px;
}

.minor-chip {
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.minor-chip:hover,
.minor-chip:focus-visible {
  border-color: var(--blue);
  background: #f7fafc;
  color: var(--ink);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(111, 141, 171, .35);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .page-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .site-header {
    flex-basis: 36px;
  }

  main {
    padding-top: 8px;
  }

  .store-list {
    gap: 8px;
  }

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

  .region-card {
    height: 72px;
    gap: 4px;
    border-radius: 9px;
  }

  .region-icon {
    width: 39px;
    height: 27px;
  }

  .region-icon .fi {
    width: 36px;
    height: 25px;
  }

  .minor-grid {
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 4px;
  }

  .minor-chip {
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
  }
}

@media (max-height: 560px) {
  .page-shell {
    padding-top: 5px;
    padding-bottom: 4px;
  }

  .site-header {
    flex-basis: 28px;
  }

  main {
    padding-top: 3px;
  }

  .store-list {
    gap: 4px;
  }

  .popular-grid,
  .minor-grid {
    gap: 4px;
  }

  .region-card {
    height: 50px;
    padding: 3px;
    gap: 2px;
  }

  .region-icon {
    width: 32px;
    height: 20px;
  }

  .region-icon .fi {
    width: 30px;
    height: 18px;
  }

  .region-name {
    font-size: 10px;
  }

  .minor-chip {
    height: 20px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
