/* WHL 竞猜系统 — 移动优先样式 */
:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1a1d21; --sub: #6b7280;
  --brand: #1652f0; --brand-ink: #fff;
  --ok: #0f9960; --warn: #d97706; --bad: #dc2626; --line: #e5e7eb;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 12px 14px 80px; }
header.app {
  position: sticky; top: 0; z-index: 10; background: var(--brand); color: var(--brand-ink);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
header.app .title { font-weight: 700; font-size: 17px; flex: 1; }
header.app a, header.app button.link { color: #fff; font-size: 13px; text-decoration: none; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
header.app a:hover, header.app button.link:hover { background: rgba(255,255,255,.15); }

.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--sub); font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e7f6ee; color: var(--ok); }
.badge.orange { background: #fef3e2; color: var(--warn); }
.badge.blue { background: #e8efff; color: var(--brand); }
.badge.purple { background: #f1e9ff; color: #7c3aed; }
.badge.gray { background: #eceef1; color: var(--sub); }
.badge.red { background: #fde8e8; color: var(--bad); }

button {
  font: inherit; border: none; border-radius: 10px; padding: 10px 16px;
  background: var(--brand); color: #fff; cursor: pointer; font-weight: 600;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.small { padding: 6px 12px; font-size: 13px; font-weight: 500; }

input, select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #b8ccff; border-color: var(--brand); }
label.field { display: block; margin: 10px 0 0; }
label.field span { display: block; font-size: 13px; color: var(--sub); margin-bottom: 4px; }
input[type="number"] { width: 90px; }
input.score-in { width: 74px; text-align: center; font-size: 17px; font-weight: 700; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg label { flex: 1; text-align: center; padding: 9px 0; cursor: pointer; font-weight: 600; background: #fff; }
.seg label.on { background: var(--brand); color: #fff; }
.seg input { display: none; }

.match-head { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 2px; }
.item { border-top: 1px dashed var(--line); padding: 10px 0; }
.item .q { font-weight: 600; margin-bottom: 6px; }
.tier-hint { font-size: 12px; color: var(--sub); margin-bottom: 6px; }

.bigcode {
  font-size: 34px; font-weight: 800; letter-spacing: 6px; text-align: center;
  padding: 14px; background: #f0f4ff; border-radius: 10px; margin: 10px 0; color: var(--brand);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--sub); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.hit { color: var(--ok); font-weight: 700; }
.miss { color: var(--sub); }
.total-line { font-size: 17px; font-weight: 700; }

.banner { border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.banner.warn { background: #fef3e2; color: var(--warn); }
.banner.bad { background: #fde8e8; color: var(--bad); }
.banner.info { background: #e8efff; color: var(--brand); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #1a1d21; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; transition: all .25s; z-index: 99; max-width: 86%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); }

code.kbd { background: #eceef1; border-radius: 6px; padding: 1px 7px; font-size: 13px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.empty { text-align: center; color: var(--sub); padding: 40px 0; }
.subitem { margin-left: 14px; font-size: 13px; }
