/* ==========================================================================
   vue28 公共样式：10 个页面共用，全部为纯静态 CSS，不依赖任何外部 CDN
   ========================================================================== */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e8ecf2;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #ff9800;
  --brand-2: #ffb74d;
  --ok: #16a34a;
  --bad: #ef4444;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(17, 24, 39, .05);
  /* 彩色国旗字体（country-flag-emoji-polyfill 注入的同名字体），必须排在最前面 */
  --flag-font: "Twemoji Country Flags";
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  /* "Twemoji Country Flags" 放最前面：只覆盖国旗码点，其它字符自动回落到后面的字体。
     Windows / 远程桌面下 Chromium 本来会把 🇵🇹 画成 "PT"，加上这个字体后就是彩色国旗。 */
  font-family: var(--flag-font), "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* 所有会显示国旗的元素都优先用国旗字体（防止个别组件重置了 font-family） */
.seg button,
.page-title,
.draw,
.badge,
.stat,
.card-title,
table.tb,
.timer,
.footer,
.notice {
  font-family: var(--flag-font), inherit;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}
.wrap.narrow { max-width: 560px; }
.wrap.wide { max-width: 1280px; }

/* ---------------- 顶部 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.page-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.page-title small {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}

/* 彩种切换 */
.seg {
  display: inline-flex;
  background: #eef1f6;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.seg button.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 600;
}
.seg.mini button { padding: 5px 10px; font-size: 12px; }

/* 数据状态 */
.status {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(203, 213, 225, .25);
}
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.dot.warn { background: var(--brand); box-shadow: 0 0 0 3px rgba(255, 152, 0, .2); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card.tight { padding: 12px; }
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-title .tip { font-weight: 400; color: var(--muted); font-size: 11px; }

.grid { display: grid; gap: 10px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ---------------- 开奖卡片 ---------------- */
.period-chip {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.draw {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
}
.draw .num {
  min-width: 54px;
  height: 54px;
  line-height: 54px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  border-radius: 16px;
  background: #f1f5f9;
  color: var(--brand);
}
.draw .num.sum { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.draw .op { font-size: 20px; color: var(--muted); padding: 0 2px; }

.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.badge {
  background: #eef1f6;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: #374151;
}
.badge.hot { background: var(--brand); color: #fff; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.bad { background: #fee2e2; color: #b91c1c; }

/* 倒计时 */
.timer {
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  margin-bottom: 12px;
}
.timer .label { font-size: 11px; opacity: .95; }
.timer .value { font-size: 30px; font-weight: 800; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.timer.done { background: linear-gradient(135deg, #64748b, #94a3b8); }

/* ---------------- 指标格 ---------------- */
.stat {
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--line);
}
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.hot { background: #fff7ed; border-color: #fed7aa; }
.stat.hot .v { color: var(--brand); }
.stat small { display: block; font-size: 10px; color: var(--muted); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tb {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
table.tb th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 7px 8px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.tb td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.tb tbody tr:hover { background: #fffbf3; }
table.tb .nums { font-weight: 600; letter-spacing: 1px; }
.mark-cell { display: flex; gap: 4px; }
.mark {
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 6px;
  font-size: 11px;
  background: #f1f5f9;
  color: #cbd5e1;
}
.mark.on-big, .mark.on-odd { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.mark.on-small, .mark.on-even { background: #dbeafe; color: #1d4ed8; font-weight: 700; }
.scroll-y { max-height: 380px; overflow-y: auto; }

/* ---------------- 选项卡 ---------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button {
  border: 0;
  background: #eef1f6;
  color: #475569;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.tabs button.on { background: #1f2937; color: #fff; font-weight: 600; }

/* ---------------- 其它 ---------------- */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono { font-variant-numeric: tabular-nums; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn.ghost { background: #eef1f6; color: #334155; }
.btn.wide { width: 100%; }
.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
}
.notice.err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  padding: 6px 0 0;
}

/* 导航条（选页） */
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef1f6;
  color: #475569;
}
.nav a.on { background: #1f2937; color: #fff; }

/* 迷你条形图 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bars .bar i {
  display: block;
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand), #ffd8a8);
  min-height: 3px;
}
.bars .bar b { font-size: 12px; }
.bars .bar span { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* 三彩种同屏 */
.game-col { display: flex; flex-direction: column; gap: 10px; }
.game-col h4 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 6px; }

@media (max-width: 720px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.c3.three-games { grid-template-columns: 1fr; }
  .topbar { gap: 8px; }
  .page-title { font-size: 14px; }
  .seg button { padding: 6px 10px; font-size: 12px; }
  .draw .num { min-width: 44px; height: 44px; line-height: 44px; font-size: 20px; }
}
