/* 乐彩之家 —— 方案乙：浅灰白底 + 青绿主色 + 各彩种点缀色 */
:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --ink: #22312d;
  --muted: #71847e;
  --line: #e2e9e6;
  --brand: #0f8a76;
  --brand-deep: #0b6b5c;
  --brand-soft: #e3f2ef;
  --danger: #d64550;
  --ok: #2e9e5b;
  --warn: #c98a00;
  --ssq: #e5484d;
  --dlt: #2f7bd9;
  --pl3: #f08c2e;
  --fc3d: #c99700;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(30, 60, 50, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none !important; }   /* 防 Vue 挂载前模板语法裸奔 */
html { font-size: 17px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ---- 登录 ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 32px 26px; text-align: center; }
.login-logo { font-size: 44px; }
.login-title { font-size: 26px; margin: 6px 0 2px; color: var(--brand-deep); }
.login-sub { color: var(--muted); margin-bottom: 22px; }
.login-footer { margin-top: 18px; color: var(--muted); font-size: .8rem; }

/* ---- 布局 ---- */
.shell { min-height: 100vh; padding-bottom: 86px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.topbar-inner { max-width: 860px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.topbar-title { font-size: 1.15rem; font-weight: 600; letter-spacing: 1px; }
.topbar-user { font-size: .85rem; opacity: .92; cursor: pointer; }
.page-container { max-width: 860px; margin: 0 auto; padding: 14px 14px 30px; }
.site-footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 8px 0 96px; }

/* ---- 底部标签栏 ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(30,60,50,.05);
}
.tabbar button {
  flex: 1; border: 0; background: none; padding: 8px 0 6px;
  font-size: .78rem; color: var(--muted); font-family: inherit;
}
.tabbar button i { display: block; font-size: 1.35rem; font-style: normal; margin-bottom: 1px; }
.tabbar button.active { color: var(--brand); font-weight: 600; }

/* ---- 卡片与通用 ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.card-title .sub { font-weight: 400; color: var(--muted); font-size: .82rem; }
.muted { color: #5f736d; font-size: .88rem; }
.small { font-size: .84rem; }

.btn { border: 0; border-radius: 12px; padding: 9px 16px; font-size: .92rem; font-family: inherit; cursor: pointer; background: var(--brand-soft); color: var(--brand-deep); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-danger { background: #fdecee; color: var(--danger); }
.btn-lg { padding: 13px 20px; font-size: 1.05rem; border-radius: 14px; }
.btn-regen { background: #fdecee; border: 1.5px solid #f2b8bf; color: var(--danger); }
.btn-regen:active { background: #f9d4d9; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--ink); }

.field { margin-bottom: 12px; text-align: left; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fbfdfc; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); }
.form-error { color: var(--danger); font-size: .85rem; margin-bottom: 8px; }

/* ---- 彩种切换 chips ---- */
.chips { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding: 2px; }
.chip {
  flex-shrink: 0; border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 16px; font-size: .9rem; font-family: inherit; color: var(--ink); cursor: pointer;
}
.chip.active { border-color: var(--chip-c, var(--brand)); color: var(--chip-c, var(--brand)); background: #fff; font-weight: 600; }

/* ---- 号码球（随屏幕自适应，手机一行放得下 7 球） ---- */
.balls { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.ball {
  width: clamp(30px, 9vw, 42px); height: clamp(30px, 9vw, 42px); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: clamp(.85rem, 3.4vw, 1.1rem); font-weight: 700; color: #fff;
  background: var(--ball-c, var(--brand));
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.15);
}
.ball.small { width: clamp(24px, 7vw, 30px); height: clamp(24px, 7vw, 30px); font-size: clamp(.7rem, 2.6vw, .85rem); }
.ball.back { background: var(--ball-back-c, #5a7d9a); }
.ball.plus { background: none; box-shadow: none; color: var(--muted); font-weight: 400; font-size: .95rem; width: auto; flex-shrink: 0; }
.digit-box {
  width: clamp(36px, 11vw, 46px); height: clamp(36px, 11vw, 46px); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: clamp(1rem, 4.2vw, 1.35rem); font-weight: 700; color: #fff;
  background: var(--ball-c, var(--brand)); box-shadow: inset 0 -2px 4px rgba(0,0,0,.15);
}
.hits-badge { font-size: .8rem; color: var(--warn); font-weight: 600; }
.prize-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: #e3f0fb; color: #1d6ac9;   /* 待开奖：蓝 */
}
.prize-badge.win { background: #e2f6e9; color: var(--ok); }   /* 中奖：绿 */
.prize-badge.none { background: #fdecec; color: var(--danger); }  /* 未中奖：红 */

/* ---- 开奖时间表 ---- */
.sched-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 699px) { .sched-grid { grid-template-columns: 1fr; } }
.sched-group { background: #f7fafa; border-radius: 12px; padding: 12px 14px; }
.sched-group h4 { font-size: .95rem; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sched-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sched-tag { font-size: .68rem; color: var(--muted); background: #eef2f0; border-radius: 999px; padding: 1px 8px; font-weight: 400; }
.sched-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 6px; font-size: .9rem; border-bottom: 1px dashed var(--line); border-radius: 8px; }
.sched-row:last-child { border-bottom: 0; }
.sched-row.click { cursor: pointer; }
.sched-row.click:active { background: var(--brand-soft); }
.sched-row.cur { background: var(--brand-soft); }
.sched-name { font-weight: 600; display: flex; align-items: center; gap: 5px; }
.sched-mine { font-size: .65rem; color: var(--brand-deep); background: var(--brand-soft); border-radius: 999px; padding: 0 6px; font-weight: 500; }
.sched-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sched-time { color: var(--muted); font-size: .82rem; }
.today-pill { font-size: .7rem; font-weight: 600; color: #fff; background: var(--warn); border-radius: 999px; padding: 1px 8px; }

/* ---- 投注方式大按钮 ---- */
.bet-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.bet-chips button {
  border: 1.5px solid var(--line); background: #fbfdfc; border-radius: 12px;
  padding: 9px 14px; font-size: .92rem; font-family: inherit; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 96px;
}
.bet-chips button i { font-style: normal; font-size: .75rem; color: var(--muted); }
.bet-chips button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.bet-chips button.active i { color: var(--brand); }
.bet-chips button:disabled { opacity: .5; cursor: not-allowed; background: #f0f3f2; }
.bet-chips button:disabled i { color: var(--danger); }

/* ---- 玩法与中奖规则 ---- */
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 699px) { .rules-grid { grid-template-columns: 1fr; } }
.rules-table { width: 100%; border-collapse: collapse; font-size: .82rem; background: #fff; border-radius: 10px; overflow: hidden; }
.rules-table th { background: #eef2f0; color: var(--muted); font-weight: 500; padding: 6px 8px; text-align: left; }
.rules-table td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.rules-grade { font-weight: 600; white-space: nowrap; }
.rules-amt { font-weight: 600; color: var(--ok); white-space: nowrap; }

/* ---- 预测卡片 ---- */
.countdown { font-size: 1.05rem; font-weight: 700; color: var(--chip-c, var(--brand)); margin: 2px 2px 10px; }
.pred-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; position: relative; }
.pred-card.ensemble { border-color: var(--chip-c, var(--brand)); background: linear-gradient(180deg, #fdfffe, #f4faf8); }

/* 最终推荐区 */
.rec-banner { border: 2px solid var(--chip-c, var(--brand)); background: linear-gradient(135deg, #fffdf7, #f8faf7); box-shadow: 0 4px 16px rgba(30,60,50,.08); }
.rec-banner .card-title span:first-child { font-size: 1.1rem; font-weight: 800; color: var(--chip-c, var(--brand)); }
.rec-item { margin-bottom: 14px; border-color: var(--chip-c, var(--brand)); background: #fff; }
.rec-item:last-child { margin-bottom: 0; }
.rec-tag { background: var(--chip-c, var(--brand)); border-color: transparent; font-weight: 600; }
/* 覆盖 .pred-tag 的彩色文字规则（同优先级下后定义者胜，必须用双类名提权） */
.pred-tag.rec-tag, .rec-tag { color: #fff !important; }

/* 参考策略折叠区 */
.ref-section { opacity: .88; }
.ref-section .pred-card { padding: 10px 12px; margin-bottom: 8px; }
.ref-section .pred-reason { font-size: .84rem; margin-top: 6px; }
.pred-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.pred-name { font-weight: 700; font-size: 1rem; }
.pred-tag { font-size: .72rem; color: var(--chip-c, var(--brand)); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; }
.pred-reason { color: #5f736d; font-size: .92rem; margin: 10px 2px 0; }
.pred-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.btn-buy { background: var(--warn); color: #fff; font-weight: 600; padding: 7px 14px; border-radius: 999px; }

/* ---- 机选/收藏条目：号码一行，按钮第二行 ---- */
.pick-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.pick-item:last-child { border-bottom: 0; }
.pick-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ---- 统计/账本 ---- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-cell { background: #f7fafa; border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat-num { font-size: 1.45rem; font-weight: 700; }
.stat-label { font-size: .78rem; color: var(--muted); }
.money-red { color: var(--danger); }
.money-green { color: var(--ok); }

.entry-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; border-bottom: 1px dashed var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-main { flex: 1; min-width: 0; }
.entry-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* 手机：账本流水改上下结构（号码一行、徽标+按钮一行） */
@media (max-width: 699px) {
  .entry-row { flex-direction: column; align-items: stretch; }
  .entry-side { flex-direction: row; justify-content: space-between; align-items: center; width: 100%; }
}

/* ---- 分段控件 ---- */
.seg { display: flex; background: #edf2f0; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 10px; font-size: .85rem; font-family: inherit; color: var(--muted); }
.seg button.active { background: #fff; color: var(--brand-deep); font-weight: 600; box-shadow: var(--shadow); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { color: var(--muted); font-weight: 500; font-size: .8rem; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* ---- 弹层 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(20, 40, 34, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0;
  padding: 18px 18px 26px; max-height: 86vh; overflow-y: auto;
}
@media (min-width: 700px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal h3 { margin-bottom: 12px; }

/* ---- toast ---- */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: #24413a; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: .9rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 86vw; text-align: center;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---- 号码选择盘 ---- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 7px; margin: 6px 0 12px; }
.pick-ball {
  aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line); background: #fbfdfc;
  font-size: .95rem; font-weight: 600; font-family: inherit; cursor: pointer; color: var(--ink);
}
.pick-ball.sel { background: var(--chip-c, var(--brand)); border-color: var(--chip-c, var(--brand)); color: #fff; }

/* ---- 图表容器 ---- */
/* ---- 图表容器（手机优先，上下堆叠） ---- */
.chart-box { width: 100%; height: 300px; }
.chart-box.small { height: 230px; }
.chart-caption { font-size: .85rem; color: var(--muted); margin: 2px 2px 8px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 26px 0; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 记账归期提示条（开奖日绿 / 非开奖日橙） ---- */
.entry-hint { margin: 12px 2px 2px; padding: 10px 13px; border-radius: 10px;
  font-size: .9rem; line-height: 1.45; }
.entry-hint.ok { background: #e7f5ec; color: #1d7c44; }
.entry-hint.warn { background: #fdf3e0; color: #96690a; }

@media (min-width: 700px) {
  html { font-size: 17.5px; }
}
