/* ============================================================
   乐透小助手 · 前端样式
   移动端优先（彩民扫店内二维码进入）
   ⚠️ 视觉调性铁律：不能让人产生「这是博彩 App」的联想
      → 用清爽的信息工具感，不用红金赌场配色，不用筹码/骰子/金币图标
   ============================================================ */

:root {
  --brand: #1f6feb;          /* 由 /api/station 的 theme_color 覆盖 */
  --brand-ink: #0b3d91;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1f27;
  --muted: #6b7480;
  --line: #e3e8ef;
  --ok: #0f9d58;
  --warn: #b7791f;
  --danger: #d93025;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .07), 0 6px 18px rgba(20, 30, 50, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── 布局 ─────────────────────────────────────────────── */
.wrap { max-width: 560px; margin: 0 auto; padding: 0 0 84px; }

header.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, var(--brand), var(--brand-ink));
  color: #fff;
  padding: 14px 16px 16px;
  box-shadow: 0 2px 10px rgba(20, 30, 50, .12);
}
.topbar .row { display: flex; align-items: center; gap: 10px; }
.topbar .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center; font-size: 19px; flex: 0 0 auto;
  overflow: hidden;
}
.topbar .logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: .3px; }
.topbar .sub { font-size: 12px; opacity: .82; margin-top: 1px; }

/* ── 卡片 ─────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  margin: 12px 12px 0; padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 15px; margin: 0 0 12px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.card h2 .ico { font-size: 16px; }
.card .hint { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; }

/* ── Tab 栏 ───────────────────────────────────────────── */
nav.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 560px; margin: 0 auto;
}
nav.tabs button {
  flex: 1; border: 0; background: none; padding: 9px 2px 7px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: inherit; transition: color .15s;
}
nav.tabs button .ti { font-size: 19px; line-height: 1.1; }
nav.tabs button.on { color: var(--brand); font-weight: 600; }
nav.tabs button.on .ti { transform: translateY(-1px); }

.page { display: none; }
.page.on { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 按钮 ─────────────────────────────────────────────── */
button.btn {
  border: 0; border-radius: 11px; padding: 13px 18px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .08s, opacity .15s;
  background: var(--brand); color: #fff; width: 100%;
}
button.btn:active { transform: scale(.975); }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
button.btn.ghost {
  background: #fff; color: var(--brand);
  border: 1.5px solid var(--brand);
}
button.btn.plain {
  background: #eef2f7; color: var(--text); font-weight: 500;
}
button.btn.sm { padding: 9px 13px; font-size: 13.5px; width: auto; border-radius: 9px; }
button.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid #f5c6c2; }
.btnrow { display: flex; gap: 9px; }
.btnrow > * { flex: 1; }

/* ── 号码球 ───────────────────────────────────────────── */
.balls { display: flex; flex-wrap: wrap; gap: 6px; }
.ball {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #eef2f7; color: var(--text);
  border: 1.5px solid transparent;
  transition: all .12s;
  user-select: none;
}
.ball.sm { width: 30px; height: 30px; font-size: 12.5px; }
.ball.pick { background: var(--brand); color: #fff; }
.ball.hit { background: var(--ok); color: #fff; box-shadow: 0 0 0 3px rgba(15,157,88,.16); }
.ball.miss { opacity: .34; }
.ball.hitpartial { background: #fdf0d5; color: #8a5a00; border-color: #f0c36d; }
.ball.disabled { opacity: .28; cursor: not-allowed; }

.picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.picker .ball { width: 100%; height: 0; padding-bottom: 100%; position: relative; border-radius: 50%; }
.picker .ball span {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px;
}

/* ── 列表 ─────────────────────────────────────────────── */
.item {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 12px; margin-bottom: 9px; background: #fff;
}
.item .head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 9px;
}
.item .title { font-size: 14px; font-weight: 600; }
.item .meta { font-size: 12px; color: var(--muted); }

/* ── 状态徽章 ─────────────────────────────────────────── */
.badge {
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  font-weight: 600; white-space: nowrap;
  background: #eef2f7; color: var(--muted);
}
.badge.ok { background: #e6f4ea; color: #0b6b3a; }
.badge.wait { background: #fff4e0; color: #8a5a00; }
.badge.done { background: #e8eef9; color: #1a4b9c; }
.badge.bad { background: #fdecea; color: #a5271c; }

/* ── 表单 ─────────────────────────────────────────────── */
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 500; }
input.inp, select.inp {
  width: 100%; padding: 12px 13px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); font-family: inherit;
}
input.inp:focus, select.inp:focus { outline: 0; border-color: var(--brand); }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.switch small { color: var(--muted); font-size: 12px; display: block; }
.switch input { width: 46px; height: 27px; appearance: none; background: #cfd8e3; border-radius: 20px; position: relative; transition: .2s; cursor: pointer; flex: 0 0 auto; }
.switch input:checked { background: var(--brand); }
.switch input::after { content: ""; position: absolute; width: 21px; height: 21px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; }
.switch input:checked::after { left: 22px; }

/* ── 提示条 ───────────────────────────────────────────── */
.notice {
  font-size: 12.5px; line-height: 1.55; border-radius: 10px;
  padding: 10px 12px; margin: 10px 0 0;
  background: #f0f4fa; color: #46536a; border-left: 3px solid var(--brand);
}
.notice.warn { background: #fff8e8; color: #7a5500; border-left-color: #e0a800; }
.notice.ok { background: #eaf7ef; color: #0b6b3a; border-left-color: var(--ok); }
.notice.bad { background: #fdeeec; color: #8f2318; border-left-color: var(--danger); }

.disclaim {
  font-size: 11.5px; color: var(--muted); line-height: 1.6;
  padding: 14px 18px 8px; text-align: center;
}

/* ── 统计 ─────────────────────────────────────────────── */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 9px; }
.stat { background: #f7f9fc; border-radius: 10px; padding: 11px 10px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.stat .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.heat { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.heat .cell {
  aspect-ratio: 1; border-radius: 7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.bar .lbl { width: 52px; color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.bar .track { flex: 1; height: 17px; background: #f0f3f8; border-radius: 5px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-ink)); border-radius: 5px; transition: width .4s ease; }
.bar .val { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ── 弹层 ─────────────────────────────────────────────── */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(15,22,35,.42); z-index: 60;
  display: none; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.sheet-mask.on { display: flex; animation: fade .18s; }
.sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  animation: up .24s cubic-bezier(.2,.8,.3,1);
}
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.sheet h3 { margin: 0 0 14px; font-size: 16px; }
.sheet .grab { width: 36px; height: 4px; background: #d8dfe8; border-radius: 3px; margin: -8px auto 12px; }

/* ── 金额展示（预约确认，参考金额） ─────────────────────── */
.amountbox {
  background: #f7f9fc; border-radius: 11px; padding: 13px; text-align: center;
  border: 1px dashed #c9d4e3;
}
.amountbox .amt { font-size: 25px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.amountbox .lbl { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ── 空状态 & 加载 ─────────────────────────────────────── */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .e { font-size: 34px; opacity: .45; display: block; margin-bottom: 9px; }
.empty p { margin: 5px 0; font-size: 13.5px; }

.spin {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: sp .7s linear infinite; display: inline-block; vertical-align: -3px;
}
@keyframes sp { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  background: rgba(22,29,40,.94); color: #fff; padding: 11px 19px;
  border-radius: 11px; font-size: 14px; z-index: 90; opacity: 0;
  transition: all .22s; pointer-events: none; max-width: 86vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

/* ── 时间轴（预约状态） ────────────────────────────────── */
.steps { display: flex; align-items: flex-start; margin: 12px 0 4px; }
.steps .st { flex: 1; text-align: center; position: relative; font-size: 11px; color: var(--muted); }
.steps .st .dot {
  width: 21px; height: 21px; border-radius: 50%; margin: 0 auto 5px;
  background: #e6ebf2; color: #93a0b1; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; position: relative; z-index: 1;
}
.steps .st.done .dot { background: var(--ok); color: #fff; }
.steps .st.now .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(31,111,235,.15); }
.steps .st::before {
  content: ""; position: absolute; top: 10px; left: -50%; width: 100%;
  height: 2px; background: #e6ebf2; z-index: 0;
}
.steps .st:first-child::before { display: none; }
.steps .st.done::before, .steps .st.now::before { background: var(--ok); }

@media (min-width: 561px) {
  .wrap { padding-bottom: 92px; }
  nav.tabs { border-radius: 0; }
}
