:root {
  --ink: #18231f;
  --muted: #66736e;
  --paper: #f5f6f2;
  --card: #ffffff;
  --green: #145f47;
  --green-2: #1f8061;
  --lime: #d9f055;
  --line: #dfe4df;
  --red: #b54c42;
  --shadow: 0 16px 40px rgba(24, 35, 31, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
.hero { background: var(--green); color: white; padding: 54px 24px 76px; border-bottom: 5px solid var(--lime); }
.hero-inner, main { width: min(1180px, 100%); margin: auto; }
.hero-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; letter-spacing: .18em; font-weight: 800; color: var(--lime); }
h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 6vw, 68px); line-height: 1; letter-spacing: -.04em; }
.subtitle { margin: 18px 0 0; color: #d8e7e1; font-size: 16px; }
.health { display: flex; align-items: center; gap: 9px; white-space: nowrap; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 10px 14px; font-size: 13px; }
.pulse { width: 9px; height: 9px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 5px rgba(217,240,85,.14); }
.health.error .pulse { background: #ff8175; box-shadow: 0 0 0 5px rgba(255,129,117,.14); }
main { padding: 0 24px 64px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: -34px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.summary div { padding: 24px 28px; border-right: 1px solid var(--line); }
.summary div:last-child { border: 0; }
.summary strong, .summary span { display: block; }
.summary strong { font-size: 28px; }
.summary span { color: var(--muted); font-size: 12px; margin-top: 5px; }
.toolbar { display: grid; grid-template-columns: 1.7fr 1fr auto; align-items: end; gap: 14px; margin: 34px 0 22px; }
.toolbar label > span, .history-toolbar label > span { display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, button { font: inherit; }
input, select { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 14px; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(31,128,97,.12); }
button { border: 0; cursor: pointer; }
#refresh, #loadHistory, #downloadHistory { height: 46px; padding: 0 20px; border-radius: 10px; color: white; background: var(--green); font-weight: 750; }
#refresh:hover, #loadHistory:hover { background: var(--green-2); }
.view-tabs { display: flex; gap: 7px; margin-top: 28px; padding: 5px; width: max-content; border: 1px solid var(--line); border-radius: 12px; background: white; }
.view-tab { padding: 10px 19px; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; }
.view-tab.active { color: white; background: var(--green); }
.history-toolbar { display: grid; grid-template-columns: 1fr .8fr auto auto; align-items: end; gap: 14px; margin: 24px 0 8px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.download-button { color: var(--green) !important; background: var(--lime) !important; }
.download-button:hover { filter: brightness(.96); }
.export-hint { margin: 0 4px 20px; color: var(--muted); font-size: 12px; }
.notice, .empty { padding: 24px; text-align: center; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 12px; }
.match-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.match-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.match-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.match-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.league { color: var(--green); font-weight: 800; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 24px 18px 20px; text-align: center; }
.team { font-size: 17px; font-weight: 800; }
.versus span { display: block; font-size: 11px; color: var(--muted); }
.versus strong { font-family: Georgia, serif; font-size: 25px; }
.markets { padding: 0 18px 18px; }
.market { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.market-title { display: flex; justify-content: space-between; padding: 8px 11px; background: #f7f8f5; font-size: 11px; font-weight: 800; color: var(--muted); }
.odds-row { display: grid; grid-template-columns: 68px repeat(3, 1fr); align-items: center; min-height: 36px; font-size: 12px; text-align: center; }
.odds-row + .odds-row { border-top: 1px solid var(--line); }
.odds-row .label { color: var(--muted); }
.odds-row strong { font-size: 13px; }
.movement { color: var(--red); }
.card-action { width: 100%; padding: 13px; border-top: 1px solid var(--line); background: white; color: var(--green); font-size: 13px; font-weight: 800; }
.card-action:hover { background: #f0f6f3; }
dialog { width: min(880px, calc(100% - 28px)); max-height: 86vh; border: 0; border-radius: 16px; padding: 0; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(12,27,22,.66); backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px; color: white; background: var(--green); }
.dialog-head h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; }
.close { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); color: white; font-size: 25px; }
.history-content { padding: 22px 24px 28px; }
.history-section { margin-bottom: 24px; }
.history-section h3 { margin: 0 0 10px; font-size: 16px; }
.feature-section { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #f9faf7; }
.feature-teams, .feature-row { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: center; text-align: center; }
.feature-teams { padding: 4px 8px 12px; color: var(--green); }
.feature-teams span { color: var(--muted); font-size: 11px; }
.feature-row { padding: 10px 8px; border-top: 1px solid var(--line); font-size: 13px; }
.feature-row b { color: var(--muted); font-size: 12px; }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table th, .history-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.history-table th { color: var(--muted); font-weight: 700; }
.odds-detail { max-width: 520px; overflow-wrap: anywhere; color: var(--muted); }
.odds-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.odds-chips span { display: inline-flex; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 7px; background: #eef3ef; color: var(--ink); white-space: nowrap; }
.odds-chips b { color: var(--green); font-size: 11px; }
.settlement-list { display: grid; gap: 18px; }
.settlement-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 8px 28px rgba(24,35,31,.05); }
.settlement-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; }
.settlement-head h2 { margin: 4px 0 0; font-size: 20px; }
.settlement-head h2 strong { display: inline-block; margin: 0 10px; color: var(--green); font-family: Georgia, serif; font-size: 27px; }
.match-id { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.status-badge { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-badge.settled { color: #17664d; background: #dff4e9; }
.status-badge.pending { color: #846315; background: #fff1bf; }
.status-badge.invalid { color: #8b4038; background: #fde2df; }
.score-strip { display: flex; gap: 26px; padding: 11px 22px; border-block: 1px solid var(--line); background: #f7f8f5; color: var(--muted); font-size: 12px; }
.score-strip b { margin-left: 5px; color: var(--ink); }
.settlement-markets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.settlement-market { min-width: 0; padding: 16px; border-right: 1px solid var(--line); }
.settlement-market:last-child { border: 0; }
.settlement-name { display: flex; justify-content: space-between; gap: 6px; padding-bottom: 10px; }
.settlement-name strong { color: var(--green); font-size: 12px; }
.settlement-name span { font-size: 12px; font-weight: 800; }
.settlement-quote { display: grid; grid-template-columns: 34px 1fr; align-items: baseline; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
.settlement-quote span { color: var(--muted); font-size: 10px; }
.settlement-quote b { text-align: right; font-size: 15px; }
.settlement-quote em { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-style: normal; text-align: right; }
.settlement-quote.closing b, .settlement-quote.closing em { color: var(--red); }
.settlement-card.compact .settlement-head { padding-bottom: 12px; }
.pending-copy { padding: 0 22px 20px; color: var(--muted); font-size: 13px; }
footer { padding: 25px; text-align: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .hero { padding-top: 38px; }
  .hero-inner { display: block; }
  .health { width: max-content; margin-top: 24px; }
  .summary { grid-template-columns: 1fr; }
  .summary div { border-right: 0; border-bottom: 1px solid var(--line); padding: 17px 20px; }
  .toolbar, .history-toolbar { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  .teams { gap: 7px; }
  .view-tabs { width: 100%; }
  .view-tab { flex: 1; }
  .score-strip { flex-wrap: wrap; gap: 8px 18px; }
  .settlement-markets { grid-template-columns: 1fr; }
  .settlement-market { border-right: 0; border-bottom: 1px solid var(--line); }
  .settlement-head h2 { font-size: 16px; }
}
