/* 彩单通 SlipPass — 运动型编辑风。设计令牌 + 响应式，动效仅用 transform/opacity。 */
:root {
  --ink: oklch(22% 0.03 260);
  --ink-soft: oklch(45% 0.02 260);
  --surface: oklch(98.5% 0.004 250);
  --card: oklch(100% 0 0);
  --line: oklch(90% 0.01 260);
  --accent: oklch(58% 0.20 28);          /* 运动红橙 */
  --accent-press: oklch(50% 0.20 28);
  --win: oklch(60% 0.16 150);
  --gold: oklch(72% 0.15 85);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 1px 2px oklch(0% 0 0 / 0.05), 0 8px 24px oklch(0% 0 0 / 0.06);
  --shadow-pop: 0 12px 40px oklch(0% 0 0 / 0.18);

  --text-hero: clamp(1.4rem, 1rem + 1.5vw, 2rem);
  --space-col: clamp(1rem, 0.5rem + 2vw, 2.5rem);
  --dur: 180ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 100% 0, oklch(96% 0.03 28 / 0.5), transparent 60%),
    var(--surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.75rem var(--space-col);
  background: var(--ink); color: oklch(97% 0 0);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--accent); color: white; font-weight: 800; font-size: 1.2rem;
  border-radius: 10px; box-shadow: 0 4px 14px oklch(58% 0.2 28 / 0.5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.15rem; letter-spacing: 0.5px; }
.brand-text small { color: oklch(80% 0.02 260); font-size: 0.72rem; }

.lottery-tabs { display: flex; gap: 0.25rem; margin-left: auto; }
.tab {
  background: transparent; color: oklch(82% 0.02 260); border: none;
  padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.95rem; cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tab:hover { color: white; }
.tab.is-active { background: oklch(100% 0 0 / 0.12); color: white; font-weight: 600; }

.auth-area { display: flex; gap: 0.5rem; }

/* ---- Buttons ---- */
.btn-solid, .btn-ghost {
  font-family: inherit; font-size: 0.9rem; cursor: pointer;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn-solid { background: var(--accent); color: white; font-weight: 600; }
.btn-solid:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px oklch(58% 0.2 28 / 0.4); }
.btn-solid:active:not(:disabled) { background: var(--accent-press); transform: translateY(0); }
.btn-solid:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: oklch(100% 0 0 / 0.08); color: inherit; border-color: var(--line); }
.topbar .btn-ghost { color: oklch(92% 0.02 260); border-color: oklch(100% 0 0 / 0.18); }
.btn-ghost:hover { background: oklch(60% 0.02 260 / 0.12); }

/* ---- Layout ---- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-col); align-items: start;
  padding: var(--space-col); max-width: 1240px; margin: 0 auto;
}
.col-title { font-size: var(--text-hero); margin: 0 0 0.25rem; letter-spacing: 0.5px; }
.data-note { color: var(--accent); font-size: 0.8rem; margin: 0 0 1rem; font-weight: 600; }

/* ---- Match cards ---- */
.day-group { margin-bottom: 1.5rem; }
.day-label {
  font-size: 0.82rem; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 1px; margin: 0 0 0.6rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.6rem;
}
.match-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 0.9rem 1rem; margin-bottom: 0.75rem;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.match-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.match-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.match-no {
  font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent);
  font-size: 0.95rem;
}
.match-league { font-size: 0.78rem; color: var(--ink-soft); }
.single-flag {
  font-size: 0.68rem; background: oklch(72% 0.15 85 / 0.2); color: oklch(45% 0.1 85);
  padding: 0.1rem 0.4rem; border-radius: 5px; font-weight: 700;
}
.match-time { margin-left: auto; font-size: 0.75rem; color: var(--ink-soft); }
.teams { display: flex; align-items: center; gap: 0.5rem; margin: 0.45rem 0 0.7rem; }
.team { font-size: 1.05rem; font-weight: 700; }
.team .rank { font-size: 0.72rem; color: var(--ink-soft); font-weight: 500; margin-left: 0.2rem; }
.vs { color: var(--ink-soft); font-size: 0.8rem; }

.market-row { margin-top: 0.5rem; }
.market-name { font-size: 0.74rem; color: var(--ink-soft); margin-bottom: 0.3rem; font-weight: 600; }
.odds-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.odd-btn {
  flex: 1 1 0; min-width: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.4rem 0.3rem; cursor: pointer; font-family: inherit;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.odd-btn .pick { font-size: 0.82rem; font-weight: 700; }
.odd-btn .odd { font-size: 0.78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.odd-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.odd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.odd-btn.is-selected {
  background: var(--accent); border-color: var(--accent); color: white;
}
.odd-btn.is-selected .odd { color: oklch(100% 0 0 / 0.85); }
.more-toggle {
  margin-top: 0.5rem; background: none; border: none; color: var(--accent);
  font-size: 0.8rem; cursor: pointer; font-weight: 600; padding: 0;
}
.market-extra[hidden] { display: none; }

/* ---- Bet slip ---- */
.slip-col { position: sticky; top: 76px; }
.slip-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 1rem;
}
.slip-title { font-size: 1.1rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.pill {
  background: var(--accent); color: white; border-radius: 999px;
  font-size: 0.75rem; padding: 0.05rem 0.55rem; font-variant-numeric: tabular-nums;
}
.slip-legs { display: flex; flex-direction: column; gap: 0.4rem; max-height: 38vh; overflow-y: auto; }
.empty-hint { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.5; }
.leg-item {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.83rem;
  padding: 0.45rem 0.55rem; background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.leg-item .leg-main { flex: 1; min-width: 0; }
.leg-item .leg-picks { color: var(--accent); font-weight: 600; }
.leg-banker {
  font-size: 0.66rem; padding: 0.05rem 0.3rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
}
.leg-banker.on { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.leg-x { border: none; background: none; color: var(--ink-soft); cursor: pointer; font-size: 1rem; }

.slip-controls { display: flex; gap: 0.6rem; margin: 0.8rem 0; }
.slip-controls label { flex: 1; font-size: 0.74rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: 0.2rem; }
.slip-controls select, .slip-controls input {
  font-family: inherit; padding: 0.4rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); font-size: 0.85rem;
}
.slip-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.5rem 0; }
.slip-figures > div { background: var(--surface); border-radius: var(--radius-sm); padding: 0.45rem 0.6rem; }
.slip-figures .wide { grid-column: 1 / -1; }
.slip-figures dt { font-size: 0.7rem; color: var(--ink-soft); }
.slip-figures dd { margin: 0.1rem 0 0; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#payoutRange { color: var(--accent); }
.slip-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.slip-actions .btn-solid { flex: 1; }
.micro-note { font-size: 0.7rem; color: var(--ink-soft); margin: 0.6rem 0 0; line-height: 1.5; }

/* ---- Account / ledger ---- */
.account { max-width: 1240px; margin: 0 auto; padding: 0 var(--space-col) var(--space-col); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--shadow-card); }
.stat-card .label { font-size: 0.75rem; color: var(--ink-soft); }
.stat-card .value { font-size: 1.5rem; font-weight: 800; margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.value.profit-pos { color: var(--win); }
.value.profit-neg { color: var(--accent); }
.scheme-list { display: flex; flex-direction: column; gap: 0.6rem; }
.scheme-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.7rem 1rem; box-shadow: var(--shadow-card);
}
.scheme-row .badge { font-size: 0.7rem; padding: 0.1rem 0.5rem; border-radius: 5px; font-weight: 700; }
.badge.open { background: oklch(90% 0.02 260); color: var(--ink-soft); }
.badge.win { background: oklch(60% 0.16 150 / 0.18); color: oklch(42% 0.14 150); }
.badge.lose { background: oklch(58% 0.2 28 / 0.14); color: var(--accent-press); }
.scheme-row .grow { flex: 1; }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: oklch(82% 0.02 260); padding: 1.5rem var(--space-col); margin-top: 2rem; text-align: center; }
.footer-disclaimers { font-size: 0.85rem; color: var(--gold); font-weight: 600; margin: 0 0 0.4rem; }
.footer-fine { font-size: 0.72rem; margin: 0; color: oklch(65% 0.02 260); }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; background: oklch(20% 0.03 260 / 0.55); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.5rem; max-width: 480px; width: 100%; box-shadow: var(--shadow-pop); position: relative; }
.modal-card h3 { margin: 0 0 0.75rem; }
.slip-pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem; font-family: ui-monospace, "SF Mono", monospace; font-size: 0.82rem; white-space: pre-wrap; line-height: 1.6; max-height: 50vh; overflow-y: auto; }
.modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; }
.qr-stub { opacity: 0.5; }
.auth-card { max-width: 360px; }
.auth-switch { display: flex; gap: 0.25rem; margin-bottom: 1rem; background: var(--surface); padding: 0.25rem; border-radius: 999px; }
.auth-tab { flex: 1; border: none; background: none; padding: 0.45rem; border-radius: 999px; cursor: pointer; font-family: inherit; color: var(--ink-soft); }
.auth-tab.is-active { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-card); }
.auth-form { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--ink-soft); }
.auth-form input { padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.95rem; }
.auth-error { color: var(--accent); font-size: 0.8rem; margin: 0; }
.modal-close { position: absolute; top: 0.6rem; right: 0.9rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink-soft); }

/* ---- 可访问性：跳转链接 + 全局焦点环 ---- */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 100;
  background: var(--ink); color: white; padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm); text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 0.5rem; }

/* 键盘可见焦点环（鼠标点击不触发，故不打扰指针用户） */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .slip-col { position: static; }
  .lottery-tabs { order: 3; width: 100%; margin-left: 0; }
  .topbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, .skip-link { transition: none !important; }
}
