:root {
  color-scheme: light;
  --paper: #f4f5ee;
  --white: #fff;
  --ink: #152a24;
  --muted: #52645a;
  --line: #dce2d7;
  --green: #2e5547;
  --deep: #112b25;
  --lime: #d8fa61;
  --red: #ad3426;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4 { margin: 0; }
:focus-visible { outline: 2px solid #557b26; outline-offset: 4px; }
html { scroll-behavior: smooth; }
section, aside { scroll-margin-top: 24px; }
.frame { max-width: 1336px; width: calc(100% - 100px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.masthead { background: var(--deep); color: #fff; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand img { width: 39px; height: 39px; }
.brand strong { display: flex; align-items: center; gap: 11px; font-size: 26px; line-height: 1; font-weight: 850; letter-spacing: -.055em; }
.brand span { border-left: 1px solid #5b7567; padding-left: 11px; font-size: 13px; color: #d8e1d7; letter-spacing: .05em; font-weight: 500; line-height: 1.3; }
.topbar nav { display: flex; gap: clamp(26px, 4vw, 62px); font-size: 14px; white-space: nowrap; }
.topbar nav a { color: #dee6de; padding: 10px 0; }
.topbar nav a:hover, .official:hover { color: var(--lime); }
.official { font-size: 13px; color: #e3ede1; border: 1px solid #486358; padding: 9px 13px; border-radius: 6px; white-space: nowrap; }
.official span { padding-left: 5px; }
.utility { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.utility b { color: var(--ink); font-size: 13px; }
.utility p span { margin-left: 13px; border-left: 1px solid #bfcabd; padding-left: 13px; }
.sync { display: flex; align-items: center; gap: 9px; }
.refresh { display: inline-grid; place-items: center; padding: 0; width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; border-radius: 6px; font-size: 18px; }
.refresh[hidden] { display: none; }
.refresh:hover { background: #e9eddd; }
.refresh:disabled { opacity: .55; cursor: wait; }
.calendar-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 13px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.calendar-bar label { font-size: 13px; font-weight: 800; white-space: nowrap; }
.calendar-bar select { width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.calendar-detail { min-height: 35px; padding: 5px 9px; color: var(--green); border: 1px solid var(--line); border-radius: 6px; background: #f4f6ec; white-space: nowrap; font-size: 12px; font-weight: 750; }
.calendar-detail:hover:not(:disabled) { background: #e9eddd; }
.calendar-detail:disabled { opacity: .55; cursor: default; }

.hero { border-radius: 13px; min-height: 390px; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; background: #132f27; color: #fff; }
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.hero::before { left: 29%; background: url("./assets/hero.jpg") center 23% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, #102b24 0%, #102b24 28%, #102b24f7 35%, #102b245e 57%, #0b21191f 84%, #0b211953 100%), linear-gradient(0deg, #0b1f19a0, transparent 40%); }
.hero-content { position: relative; padding: 42px 5%; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: #e4f6b9; font-size: 12px; font-weight: 760; letter-spacing: .14em; }
.eyebrow span { width: 25px; height: 2px; background: var(--lime); }
.hero h1 { font-size: clamp(46px, 5.4vw, 79px); font-weight: 900; letter-spacing: -.055em; line-height: 1.08; margin: 17px 0 20px; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero-meta { font-size: 15px; color: #edf3e7; font-weight: 650; }
.primary { display: inline-flex; align-items: center; gap: 22px; background: var(--lime); color: #1d2c15; font-weight: 780; border-radius: 6px; padding: 12px 15px; margin-top: 24px; font-size: 14px; }
.primary:hover { background: #e9ffa5; }
.primary span { font-size: 17px; line-height: 1; }
.credit { position: absolute; right: 17px; bottom: 13px; color: #fff; background: #111a15b0; border-radius: 4px; padding: 4px 7px; font-size: 10px; }

.dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, .95fr); gap: 24px; margin-block: 36px 50px; align-items: start; }
.main-column { display: grid; gap: 29px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 15px; }
.kicker { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--green); letter-spacing: .17em; font-weight: 800; }
.kicker > span { display: inline-block; width: 12px; height: 2px; background: #6a8750; }
h2 { font-size: clamp(23px, 2.3vw, 34px); line-height: 1.3; letter-spacing: -.04em; font-weight: 850; margin-top: 4px; }
.text-link { background: transparent; border: 0; border-bottom: 1px solid #a9b5a4; padding: 4px 0; white-space: nowrap; color: var(--green); font-weight: 740; font-size: 13px; }
.text-link:hover { border-color: var(--ink); color: var(--ink); }
.text-link span { margin-left: 3px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.event-feature { display: grid; grid-template-columns: minmax(145px, 30%) minmax(0, 1fr); min-height: 142px; }
.event-image { display: block; position: relative; background: #223a2e; }
.event-image img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center 37%; }
.event-copy { padding: 16px 19px; align-self: center; }
.event-copy h3 { font-size: clamp(17px, 1.65vw, 24px); line-height: 1.3; letter-spacing: -.035em; margin: 8px 0 5px; }
.event-copy h3 a:hover { color: #48642c; }
.event-copy h3 span { color: var(--green); font-size: .67em; white-space: nowrap; }
.event-copy p { color: var(--muted); font-size: 12px; }
.event-copy .event-match { margin-top: 5px; color: var(--ink); font-weight: 700; }
.event-state { display: flex; align-items: center; gap: 7px; color: var(--red); font-size: 11px; font-weight: 780; }
.event-state span, .live-note span { width: 7px; height: 7px; border-radius: 50%; background: #bc4633; flex: 0 0 7px; }
.event-state b { color: var(--muted); border-left: 1px solid var(--line); margin-left: 3px; padding-left: 9px; }
.event-detail { display: inline-block; color: var(--green); font-size: 12px; margin-top: 9px; font-weight: 760; }
.event-detail:hover { text-decoration: underline; }
.live-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.live-note span { background: #8e9f8d; }
.live-matches { margin-top: 12px; }
.live-matches > h3 { margin: 13px 16px; color: var(--red); font-size: 14px; }

.timezone { color: var(--muted); font-size: 12px; white-space: nowrap; padding-bottom: 3px; }
.timezone b { font-weight: 800; color: var(--green); margin-left: 4px; }
.schedule-zone { padding: 8px 15px 0; }
.schedule-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 7px; background: #eef1e8; }
.switch button { border: 0; border-radius: 5px; background: transparent; min-height: 34px; padding: 5px 11px; color: var(--muted); font-weight: 700; font-size: 12px; white-space: nowrap; }
.switch button:hover { color: var(--ink); }
.switch [aria-pressed="true"] { color: #fff; background: #274c3c; }
select { max-width: 100%; background: white; border: 1px solid var(--line); border-radius: 6px; padding: 7px; font-size: 12px; min-height: 35px; }
.dates { display: flex; overflow-x: auto; gap: 5px; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.dates:empty { display: none; }
.dates button { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 5px 8px; font-weight: 700; color: var(--muted); font-size: 12px; white-space: nowrap; }
.dates button:hover, .dates [aria-pressed="true"] { color: var(--ink); background: #eff4df; border-color: #e0eacb; }
.match-row { display: grid; grid-template-columns: minmax(59px, .6fr) minmax(130px, 2fr) minmax(70px, 1fr) 14px; gap: 12px; align-items: center; min-height: 73px; border-bottom: 1px solid var(--line); padding: 10px 15px; }
.match-row.followed { background: #f7f9ee; box-shadow: inset 3px 0 0 #a7c84e; }
.match-row:hover, .china-match:hover { background: #eff4e1; }
.match-row strong, .china-match strong { font-variant-numeric: tabular-nums; }
.match-time strong, .match-time small, .china-match small { display: block; }
.match-time strong { font-size: 14px; }
.match-time small, .china-match small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.match-teams, .china-match-teams { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.match-teams > span { display: grid; grid-template-columns: minmax(0, 1fr) 31px max-content; align-items: center; gap: 7px; }
.match-teams i { background: #edf0eb; color: #456052; border-radius: 3px; font-size: 9px; font-style: normal; text-align: center; font-weight: 850; padding: 2px; }
.match-teams .is-china i { color: var(--red); background: #f6e9df; }
.country-label { display: inline-flex; align-items: center; gap: .35em; vertical-align: baseline; }
.country-flag { width: 20px; height: 14px; flex: 0 0 20px; object-fit: contain; }
.hero h1 .hero-flag { width: 32px; height: 22px; margin-right: .13em; vertical-align: .16em; }
.match-venue, .chevron { color: var(--muted); font-size: 12px; }
.chevron { justify-self: end; }
.panel-link { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 12px 15px; color: var(--green); font-size: 12px; font-weight: 760; }
.panel-link:hover { background: #edf1e5; }
.empty { padding: 22px 15px; color: var(--muted); font-size: 13px; }

.china-header { display: flex; gap: 12px; align-items: center; padding: 16px; background: #203d32; color: #fff; }
.china-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: #a92d23; color: #fff2cb; border-radius: 7px; font-size: 12px; font-weight: 820; letter-spacing: .06em; }
.china-header h3 { font-size: 20px; }
.china-header p { color: #d6e3d8; font-size: 12px; margin-top: 2px; }
.team-switch { margin: 13px 15px 0; display: flex; }
.team-switch button { flex: 1; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 15px 13px; }
.facts:empty { display: none; }
.facts div { display: grid; gap: 4px; background: #f1f4e9; border-radius: 6px; padding: 9px 10px; }
.facts strong { font-size: 16px; }
.facts small { color: var(--muted); font-size: 11px; }
.china-panel h4 { font-size: 12px; padding: 7px 15px 5px; font-weight: 770; color: var(--green); }
.china-match { display: grid; grid-template-columns: 66px minmax(0, 1fr) 12px; gap: 10px; padding: 10px 15px; border-bottom: 1px solid var(--line); align-items: center; }
.china-match strong { font-size: 12px; }
.china-match-teams > span { display: flex; justify-content: space-between; gap: 6px; }
.china-history { border-bottom: 1px solid var(--line); }
.china-history summary { cursor: pointer; padding: 10px 15px; color: var(--green); font-size: 12px; font-weight: 750; }
.china-history .china-match:last-child { border-bottom: 0; }
.is-china { color: var(--red); font-weight: 800; }
.china-panel .panel-link { margin-top: 3px; }

footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-content { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.footer-content a { font-weight: 750; color: var(--green); }
.footer-content a:hover { text-decoration: underline; }
dialog { border: 1px solid var(--line); border-radius: 12px; width: min(660px, calc(100% - 32px)); padding: 20px; color: var(--ink); max-height: 83vh; }
dialog::backdrop { background: #10221ad6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

#detail { width: min(730px, calc(100% - 32px)); }
#detail .refresh { flex: 0 0 30px; }
.detail-status { margin: 8px 0 14px; font-size: 12px; color: var(--muted); }
.detail-competition { font-size: 13px; color: var(--green); margin-bottom: 9px; }
.detail-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; text-align: center; background: #edf3e3; padding: 17px 12px; border-radius: 7px; }
.detail-score > span { display: grid; gap: 3px; }
.detail-score small { color: var(--muted); font-size: 11px; }
.detail-score strong { font-size: clamp(23px, 5vw, 38px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-facts { display: grid; gap: 6px; font-size: 13px; margin-block: 14px; }
.detail-facts > div { display: grid; grid-template-columns: 90px 1fr; gap: 6px; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; font-weight: 650; }
#detail-body h3 { font-size: 15px; margin: 14px 0 6px; }
#detail-body h3 small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.detail-table { overflow-x: auto; }
.detail-table table { border-collapse: collapse; width: 100%; text-align: center; font-size: 13px; }
.detail-table th, .detail-table td { white-space: nowrap; padding: 7px; border-bottom: 1px solid var(--line); }
.detail-table thead { background: #edf3e3; }
.final-result { margin-top: 15px; }
.result-section { border: 1px solid var(--line); border-radius: 7px; padding: 0 10px 5px; margin-top: 8px; }
.result-section summary { cursor: pointer; padding: 9px 0 4px; font-size: 14px; font-weight: 800; }
.result-section .detail-table { margin-block: 6px; }
.result-section th[scope="row"] { text-align: left; }
.player-table th:first-child { position: sticky; left: 0; z-index: 1; background: white; }
.player-table thead th:first-child { background: #edf3e3; }
.player-table small { color: var(--muted); }
.period-picker { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 8px; }
.action-table { max-height: 360px; }
.action-table thead { position: sticky; top: 0; }
.action-table td:nth-child(2) { text-align: left; white-space: normal; }
.action-table td strong { display: block; }
.result-note { color: var(--muted); font-size: 12px; margin-top: 12px; }
.detail-matches { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.detail-match > span { display: block; padding: 6px 12px 0; font-size: 11px; color: var(--muted); }
.detail-pairing { padding: 9px 12px; display: flex; gap: 10px; font-size: 13px; }
.detail-pairing + .detail-pairing { border-top: 1px solid var(--line); }
.detail-pairing span { color: var(--muted); }
.detail-footer { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 12px; }
.qualifier-controls { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px; background: #eef2e7; border-radius: 7px; }
.qualifier-controls label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.qualifier-group + .qualifier-group { border-top: 2px solid var(--line); margin-top: 17px; padding-top: 4px; }
.standings-table th[scope="row"] { text-align: left; }
.standings-table small { color: var(--muted); font-size: 10px; font-weight: 500; }
.standings-table tr.is-china { background: #fbf4e8; }
.qualification { padding: 11px 15px 10px; border-bottom: 1px solid var(--line); }
.china-panel .qualification h4 { padding: 0; font-size: 14px; }
.qualification p { margin-top: 7px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.qualification .qualification-position { color: var(--green); font-weight: 800; }
.qualification .qualification-label { font-weight: 770; color: var(--ink); }
.qualification-analysis { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.qualification-analysis h5 { margin: 0; color: var(--ink); font-size: 13px; }
.qualification-analysis .qualification-fixtures { margin: 7px 0 9px; padding-left: 17px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.qualification-analysis .analysis-table { margin-block: 8px; }
.qualification-analysis .analysis-table table { font-size: 11px; }
.qualification-analysis .analysis-table th, .qualification-analysis .analysis-table td { padding: 6px 4px; white-space: normal; }
.qualification .text-link { display: inline-block; font-size: 11px; margin: 7px 7px 0 0; }
.qualification-rules { margin-top: 10px; font-size: 12px; line-height: 1.55; }
.qualification-rules summary { cursor: pointer; font-weight: 770; }
.qualification-rules ul { color: var(--muted); margin: 7px 0; padding-left: 17px; }
.qualification-rules li + li { margin-top: 6px; }

@media (max-width: 1050px) {
  .frame { width: calc(100% - 54px); }
  .dashboard { gap: 17px; }
  .hero { min-height: 340px; }
}

@media (max-width: 775px) {
  .frame { width: calc(100% - 32px); }
  .topbar { height: auto; min-height: 64px; column-gap: 8px; row-gap: 0; flex-wrap: wrap; padding-top: 9px; }
  .brand img { width: 33px; height: 33px; }
  .brand strong { font-size: 22px; }
  .brand span { font-size: 11px; }
  .topbar nav { gap: 30px; order: 3; flex-basis: 100%; font-size: 12px; }
  .official { font-size: 11px; padding: 6px 8px; }
  .utility { min-height: 50px; font-size: 10px; }
  .utility b { font-size: 11px; }
  .utility p span { display: none; }
  .hero { min-height: 315px; }
  .hero::before { left: 12%; background-position: 50% 38%; }
  .hero::after { background: linear-gradient(90deg, #102b24 0%, #102b24e8 24%, #102b2479 60%, #102b2436 100%); }
  .hero-content { padding: 35px 6%; }
  .hero h1 { font-size: clamp(38px, 7vw, 57px); }
  .hero-meta { font-size: 13px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-block: 25px 35px; }
  .main-column { display: contents; }
  #live { grid-row: 1; }
  #china { grid-row: 2; }
  #schedule { grid-row: 3; }
}

@media (max-width: 460px) {
  .calendar-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 8px; }
  .calendar-bar label { grid-column: 1 / -1; }
  .eyebrow { font-size: 9px; gap: 6px; }
  .eyebrow span { width: 13px; }
  .hero::before { left: 0; background-position: 51% 39%; }
  .hero::after { background: linear-gradient(90deg, #102b24f2 2%, #102b24b5 43%, #102b243e 100%); }
  .event-feature { grid-template-columns: minmax(85px, 30%) minmax(0, 1fr); }
  .event-copy { padding: 12px; }
  .event-copy p { font-size: 11px; }
  .match-row { grid-template-columns: minmax(51px, .5fr) minmax(115px, 2fr) minmax(48px, .7fr) 10px; gap: 6px; padding-inline: 10px; }
  .match-venue { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
