:root {
  --bg: #f4f8ff;
  --surface: #ffffff;
  --ink: #111114;
  --muted: #6e6e73;
  --soft: #e8f1ff;
  --blue: #0071e3;
  --blue-soft: #edf6ff;
  --green: #16a957;
  --gold: #ffd23f;
  --shadow: 0 18px 50px rgba(0, 72, 160, .12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -16px -16px 14px;
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(244, 248, 255, .88);
  backdrop-filter: blur(22px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 72, 160, .16);
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: 850;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
}

.top-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  color: #07285f;
  background: var(--gold);
  font-size: 11px;
  line-height: 15px;
  font-weight: 900;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  border-radius: 26px;
  background: #071b43;
  box-shadow: var(--shadow);
}

.hero-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .78;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.72)), linear-gradient(90deg, rgba(0,0,0,.76), rgba(0,0,0,.05));
}

.hero-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
}

.hero-copy em {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  margin-bottom: 8px;
  padding: 0 11px;
  border-radius: 999px;
  color: #07285f;
  background: var(--gold);
  font-size: 13px;
  line-height: 18px;
  font-style: normal;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(255, 210, 63, .22);
}

.hero-copy strong {
  display: block;
  font-size: 28px;
  line-height: 34px;
  font-weight: 900;
}

.hero-copy span {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 20px;
  font-weight: 650;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 14px 0;
}

.stat-card,
.card {
  border: 1px solid rgba(0, 0, 0, .055);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .055);
}

.stat-card {
  min-width: 0;
  padding: 12px 10px;
}

.stat-card strong {
  display: block;
  font-size: 20px;
  line-height: 24px;
  font-weight: 900;
}

.stat-card span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
}

.ad-card {
  display: block;
  padding: 15px 16px;
  border: 1px solid rgba(0, 102, 204, .12);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f4f9ff);
  box-shadow: 0 10px 28px rgba(0, 102, 204, .06);
  cursor: pointer;
}

.ad-card.top-ad {
  margin: 0 0 14px;
}

.ad-card.feed-ad {
  min-height: 116px;
}

.ad-label {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  line-height: 14px;
  font-weight: 900;
}

.ad-card strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 880;
}

.ad-card span:not(.ad-label) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
}

.ad-card em {
  display: block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 12px;
  line-height: 16px;
  font-style: normal;
  font-weight: 850;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, .055);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: #8e8e93;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.scroller {
  overflow-x: auto;
  margin: 14px -16px 0;
  padding: 0 16px;
  scrollbar-width: none;
}

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

.chip-row,
.team-strip {
  display: flex;
  gap: 10px;
  width: max-content;
  padding-right: 16px;
}

.chip,
.segmented button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #3a3a3c;
  background: #e9e9ee;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chip.active,
.segmented button.active {
  color: #fff;
  background: var(--blue);
}

.match-list,
.city-list,
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.match-card {
  padding: 16px;
}

.match-top,
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-no {
  color: #8e8e93;
  font-size: 12px;
  line-height: 16px;
  font-weight: 900;
}

.match-time {
  display: grid;
  justify-items: end;
  color: #3a3a3c;
  font-size: 12px;
  line-height: 16px;
  font-weight: 760;
  text-align: right;
}

.time-row {
  display: block;
  white-space: nowrap;
}

.time-row.user {
  margin-top: 2px;
  color: var(--blue);
}

.teams-line {
  display: grid;
  grid-template-columns: 1fr 46px 1fr;
  align-items: center;
  gap: 8px;
  margin: 16px 0 14px;
}

.team-side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.team-side.away {
  justify-content: flex-end;
  text-align: right;
}

.flag {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #f2f2f7;
}

.team-name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 23px;
  font-weight: 860;
}

.team-en {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
}

.vs {
  color: #a1a1a6;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.meta-row {
  color: #77777c;
  font-size: 12px;
  line-height: 17px;
  font-weight: 700;
}

.weather-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.weather-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 16px;
  font-weight: 800;
}

.status-chip {
  color: var(--green);
  background: #ecf9f1;
}

.section-head {
  margin: 8px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 900;
}

.section-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  font-weight: 650;
}

.city-card,
.news-card,
.team-card {
  padding: 16px;
}

.city-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.city-name {
  display: block;
  font-size: 20px;
  line-height: 25px;
  font-weight: 880;
}

.city-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  font-weight: 700;
}

.current-weather {
  min-width: 82px;
  text-align: right;
}

.current-weather strong {
  display: block;
  font-size: 28px;
  line-height: 30px;
  font-weight: 900;
}

.current-weather span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stadium-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.stadium-list span {
  padding: 7px 9px;
  border-radius: 999px;
  color: #55555b;
  background: #f1f1f4;
  font-size: 11px;
  font-weight: 750;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.team-pill {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 88px;
  padding: 10px 8px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid rgba(0,0,0,.055);
  font-size: 12px;
  font-weight: 800;
}

.team-pill img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.team-pill small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.news-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 13px;
  min-height: 112px;
}

.news-card img {
  width: 112px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--soft);
}

.news-type {
  display: block;
  color: var(--blue);
  font-size: 11px;
  line-height: 15px;
  font-weight: 900;
}

.news-title {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 850;
}

.news-summary {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
  font-weight: 650;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.settings-card strong {
  display: block;
  font-size: 18px;
  line-height: 24px;
  font-weight: 880;
}

.settings-card span {
  display: block;
  max-width: 560px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
  font-weight: 650;
}

.select-wrap {
  position: relative;
  flex: 0 0 auto;
}

.select-wrap select {
  min-width: 188px;
  height: 42px;
  padding: 0 34px 0 14px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-card img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.team-card strong {
  display: block;
  font-size: 16px;
  line-height: 21px;
  font-weight: 850;
}

.team-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
}

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 66px;
  padding: 7px;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 18px 50px rgba(0,0,0,.15);
  backdrop-filter: blur(22px);
}

.tabbar button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 18px;
  color: #7a7a80;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.tabbar button.active {
  color: #06336f;
  background: #e6f3ff;
}

.tabbar svg {
  width: 21px;
  height: 21px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, .24);
  backdrop-filter: blur(5px);
}

.detail-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  max-height: 84vh;
  overflow: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, .2);
  transform: translateY(105%);
  transition: transform .24s ease;
}

.detail-drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: #c7c7cc;
}

.drawer-title {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 900;
}

.drawer-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
  font-weight: 650;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #3a3a3c;
  background: #e8e8ed;
  font-size: 20px;
  line-height: 36px;
}

.drawer-section {
  margin-top: 14px;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 850;
}

.empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

@media (min-width: 760px) {
  .app-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }

  .topbar {
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-panel {
    min-height: 260px;
  }

  .match-list,
  .city-list,
  .news-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tabbar {
    left: 50%;
    right: auto;
    width: 600px;
    transform: translateX(-50%);
  }

  .settings-card {
    max-width: 760px;
  }

  .detail-drawer {
    left: 50%;
    right: auto;
    width: min(560px, calc(100vw - 32px));
    border-radius: 28px;
    bottom: 18px;
  }
}
