/* ============================================================
   开奖中心样式 - 大圣.ws 蓝色主题复刻
   ============================================================ */

/* CSS Variables - 蓝色主题 */
:root {
  --bg: #eaf1ff;
  --page-bg: #eaf1ff;
  --panel: rgba(255, 255, 255, 0.76);
  --card: rgba(255, 255, 255, 0.72);
  --primary: #2f7bff;
  --primary-strong: #1f6bff;
  --accent: #62b7ff;
  --text: #0f1e3a;
  --muted: #4b6288;
  --line: rgba(47, 123, 255, 0.16);
  --success: #16a37a;
  --warning: #d97706;
  --danger: #e34b64;
  --shadow: 0 14px 32px rgba(37, 79, 152, 0.14);
  --soft-shadow: 0 8px 20px rgba(37, 79, 152, 0.09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  
  /* Ball Colors */
  --ball-a: #3269e6;
  --ball-b: #138b63;
  --ball-c: #d87a19;
  --ball-sum: #dc4363;
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(900px 520px at -12% -10%, rgba(56, 189, 248, 0.22), transparent 62%),
    radial-gradient(820px 460px at 112% 4%, rgba(37, 99, 235, 0.2), transparent 62%),
    linear-gradient(160deg, var(--page-bg), #edf3ff 58%, #e7f0ff);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   Brand Header
   ============================================================ */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.1), rgba(98, 183, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ============================================================
   Navigation
   ============================================================ */
.site-header {
  margin-bottom: 12px;
}

.ng-page-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 20px 10px;
}

.lottery-navigation {
  padding: 0;
}

.lottery-category-shell {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.lottery-category-shell::-webkit-scrollbar { display: none; }

.lottery-category-track {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
}

.lottery-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.lottery-category-item:hover {
  background: rgba(47, 123, 255, 0.08);
  color: var(--primary);
}

.lottery-category-item.active {
  color: #fff;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(47, 123, 255, 0.22);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Status Bar
   ============================================================ */
.data-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  margin: 0 0 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.08);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
}

.source-badge.ok {
  background: rgba(22, 163, 122, 0.08);
  color: var(--success);
}

.source-badge.stale {
  background: rgba(227, 75, 100, 0.08);
  color: var(--danger);
}

.source-badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.lottery-status__note {
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================
   App Main
   ============================================================ */
.app-main {
  padding: 0 12px;
  outline: none;
}

/* ============================================================
   Skeleton Loading
   ============================================================ */
.skeleton-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(47, 123, 255, 0.06) 25%, rgba(47, 123, 255, 0.12) 50%, rgba(47, 123, 255, 0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton.title { height: 24px; width: 50%; margin-bottom: 14px; }
.skeleton.hero { height: 100px; margin-bottom: 14px; }
.skeleton.line { height: 16px; width: 70%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Toast Notification
   ============================================================ */
.toast {
  position: fixed;
  right: 20px;
  bottom: max(90px, calc(20px + env(safe-area-inset-bottom, 0px)));
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Bottom Navigation (matches homepage style)
   ============================================================ */
.ng-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.96));
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-top: 1px solid rgba(47, 123, 255, 0.12);
  box-shadow: 0 -8px 24px rgba(37, 79, 152, 0.08);
}

.ng-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: color 0.2s ease;
  text-decoration: none;
}

.ng-bottom-nav__item.active {
  color: var(--primary);
}

.ng-bottom-nav__icon {
  width: 28px;
  height: 28px;
}

.ng-nav-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ============================================================
   Draw Card
   ============================================================ */
.draw-card {
  overflow: hidden;
  padding: 18px 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), rgba(247, 251, 255, 0.68));
  box-shadow: inset 0 1px rgba(255,255,255,.84), var(--shadow);
}

.draw-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.draw-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.draw-actions {
  display: flex;
  gap: 8px;
}

.draw-actions .button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255,255,255,.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.draw-actions .button:hover {
  background: rgba(47, 123, 255, 0.08);
  color: var(--primary);
}

.draw-actions .button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  box-shadow: 0 8px 18px rgba(47, 123, 255, 0.2);
}

.draw-issue {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 14px;
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(22, 163, 122, 0.12);
  border-radius: 999px;
  background: rgba(22, 163, 122, 0.09);
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
}

.draw-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
  gap: 22px;
  padding-top: 18px;
}

/* ============================================================
   Scratch Zone
   ============================================================ */
.draw-scratch-zone {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.06), rgba(98, 183, 255, 0.04));
  border: 1px solid var(--line);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.draw-scratch-zone.scratched .number-expression {
  opacity: 1;
  filter: none;
}

/* 号码由涂层 canvas 遮挡，不需要模糊处理，刮开即可见 */
.draw-scratch-zone:not(.scratched) .number-expression {
  opacity: 1;
  filter: none;
}

/* 删除"点击咪牌揭开"提示，不再显示 */
.draw-scratch-zone::after {
  display: none;
}

/* ============================================================
   Number Expression & Balls
   ============================================================ */
.number-expression {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  --draw-ball-size: 58px;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.operator {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}

.draw-ball, .sum-ball {
  position: relative;
  display: grid;
  width: var(--draw-ball-size);
  height: var(--draw-ball-size);
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.18),
    inset 0 4px 8px rgba(255, 255, 255, 0.22),
    0 6px 16px rgba(0, 0, 0, 0.12);
}

.draw-ball::before, .sum-ball::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 18%;
  width: 40%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.55), transparent 70%);
}

.draw-ball::after, .sum-ball::after {
  content: "";
  position: absolute;
  bottom: 10%;
  right: 14%;
  width: 22%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.25), transparent 70%);
}

.draw-ball.ball-a, .ball-a {
  background: linear-gradient(145deg, var(--ball-a), #183f9d);
}

.draw-ball.ball-b, .ball-b {
  background: linear-gradient(145deg, var(--ball-b), #06543c);
}

.draw-ball.ball-c, .ball-c {
  background: linear-gradient(145deg, var(--ball-c), #91400b);
}

.sum-ball, .ball-sum {
  background: linear-gradient(145deg, var(--ball-sum), #951936);
}

/* Result Strip */
.result-strip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin-top: 3px;
}

.result-main {
  padding: 5px 16px;
  border-radius: 12px;
  background: rgba(22, 163, 122, 0.11);
  color: #138467;
  font-size: 25px;
  font-weight: 950;
}

.countdown {
  font-size: 18px;
  font-weight: 950;
}

.countdown strong {
  font-variant-numeric: tabular-nums;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

/* Keno Trace */
.keno-trace {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(47, 123, 255, 0.04);
}

.keno-trace span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.keno-number-list {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.keno-number-list i {
  display: grid;
  min-height: 25px;
  place-items: center;
  border: 1px solid rgba(47,123,255,.1);
  border-radius: 8px;
  background: rgba(47,123,255,.08);
  color: var(--primary-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

/* Meta Grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-box {
  min-width: 0;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.6);
}

.meta-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.meta-box strong {
  overflow: hidden;
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

/* Engine Panel */
.engine-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.engine-panel article {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.engine-panel span,
.engine-panel small {
  color: var(--muted);
  font-size: 10px;
}

.engine-panel strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Summary Cards
   ============================================================ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), rgba(247, 251, 255, 0.68));
  box-shadow: inset 0 1px rgba(255,255,255,.84), var(--shadow);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  font-size: 23px;
  font-weight: 800;
  color: var(--primary);
}

.stat-card small {
  color: var(--muted);
  font-size: 11px;
}

/* Recent Draw Panel */
.recent-draw-panel {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), rgba(247, 251, 255, 0.68));
  box-shadow: inset 0 1px rgba(255,255,255,.84), var(--shadow);
}

.panel-head {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(47, 123, 255, 0.1);
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: rgba(47,123,255,.04);
}

.table-wrap td {
  font-size: 13px;
  color: var(--text);
}

.table-wrap tbody tr:hover {
  background: rgba(47,123,255,.04);
}

.mini-balls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-ball {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(31, 107, 255, 0.16);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(31, 107, 255, 0.07), rgba(31, 107, 255, 0.14));
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 750;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px rgb(255 255 255 / .3);
}

.mini-balls b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.result-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(47,123,255,.08);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
}

/* ============================================================
   Panel (generic)
   ============================================================ */
.panel {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), rgba(247, 251, 255, 0.68));
  box-shadow: inset 0 1px rgba(255,255,255,.84), var(--shadow);
}

.panel-body {
  padding: 14px 16px;
}

/* ============================================================
   Button (base)
   ============================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px rgba(255,255,255,.6);
  white-space: nowrap;
}

.button:hover {
  background: rgba(47, 123, 255, 0.08);
  color: var(--primary);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.button.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  box-shadow: 0 8px 18px rgba(47, 123, 255, 0.2);
}

.button.primary:hover {
  box-shadow: 0 10px 22px rgba(47, 123, 255, 0.28);
}

.button.primary:disabled {
  opacity: 0.45;
}

/* ============================================================
   Page Head / Lottery Page Heading
   ============================================================ */
.page-head,
.lottery-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.07), rgba(98, 183, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.lottery-page-heading__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.lottery-page-heading__description {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.head-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   Empty State & Error Banner
   ============================================================ */
.empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: rgba(227, 75, 100, 0.08);
  border: 1px solid rgba(227, 75, 100, 0.18);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   Filters
   ============================================================ */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.1);
}

.history-more-filters {
  margin-top: 12px;
}

.history-more-filters summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}

.history-more-filters summary::-webkit-details-marker {
  display: none;
}

.history-more-filters summary::before {
  content: "\25B6";
  font-size: 10px;
  transition: transform 0.2s ease;
}

.history-more-filters[open] summary::before {
  transform: rotate(90deg);
}

.history-more-filters summary span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(47, 123, 255, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

/* ============================================================
   Pagination (generic)
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   Segmented Control
   ============================================================ */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
}

.segmented button {
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented button:hover {
  background: rgba(47, 123, 255, 0.08);
}

.segmented button.active {
  color: #fff;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  box-shadow: 0 6px 14px rgba(47, 123, 255, 0.2);
}

/* ============================================================
   Period Buttons (Trend)
   ============================================================ */
.period-button {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-button:hover {
  background: rgba(47, 123, 255, 0.08);
  color: var(--primary);
}

.period-button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  box-shadow: 0 6px 14px rgba(47, 123, 255, 0.2);
}

/* ============================================================
   Chart Shell (Trend Canvas)
   ============================================================ */
.chart-shell {
  padding: 14px 16px;
}

.chart-shell canvas {
  display: block;
  width: 100%;
  height: 330px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Distribution Grid & Bar Charts
   ============================================================ */
.distribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  align-items: center;
  gap: 10px;
}

.bar-row strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.bar-track {
  position: relative;
  height: 18px;
  border-radius: 9px;
  background: rgba(47, 123, 255, 0.08);
  overflow: hidden;
}

.bar-track i {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--bar-width, 0%);
  border-radius: 9px;
  background: linear-gradient(90deg, var(--primary-strong), var(--accent));
  transition: width 0.4s ease;
}

.bar-row b {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Omission Grid
   ============================================================ */
.omission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.omission-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  transition: all 0.2s ease;
}

.omission-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.omission-item strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.omission-item strong small {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.omission-item.hot {
  border-color: rgba(227, 75, 100, 0.25);
  background: rgba(227, 75, 100, 0.06);
}

.omission-item.hot strong {
  color: var(--danger);
}

.ball-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============================================================
   Dragon Sequence
   ============================================================ */
.sequence {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
}

.sequence i {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(47, 123, 255, 0.12);
  border-radius: 6px;
  background: rgba(47, 123, 255, 0.06);
  color: var(--primary-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

/* ============================================================
   Scratch Canvas
   ============================================================ */
.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-md) - 4px);
  cursor: pointer;
  touch-action: none;
  z-index: 2;
}

.scratch-canvas.is-cleared {
  opacity: 0;
  transition: opacity 0.26s ease;
  pointer-events: none;
}

/* ============================================================
   Robot Prediction
   ============================================================ */
.robot-prediction-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.robot-lab-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.06), rgba(98, 183, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.robot-lab-head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.robot-lab-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.robot-lab-title strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.robot-lab-title .hot-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.robot-lab-head-left p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.verify-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.verify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.robot-lab-stats {
  display: flex;
  gap: 12px;
}

.robot-lab-stats .stat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  min-width: 0;
}

.robot-lab-stats .stat-box b {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.robot-lab-stats .stat-box span {
  font-size: 11px;
  color: var(--muted);
}

/* 分类标签栏 - 横向排列 */
.robot-category-bar {
  display: flex;
  gap: 10px;
  padding: 4px;
}

.robot-cat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.robot-cat-btn:hover {
  background: rgba(47, 123, 255, 0.08);
  border-color: rgba(47, 123, 255, 0.2);
}

.robot-cat-btn.active {
  background: linear-gradient(135deg, #6c5ce7, #7c5cfc);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

.robot-cat-btn strong {
  font-size: 14px;
  font-weight: 700;
}

.robot-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.robot-section-head div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.robot-section-head strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.robot-section-head .page-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(108, 92, 231, 0.1);
  color: #6c5ce7;
}

.robot-section-head span {
  font-size: 12px;
  color: var(--muted);
}

.robot-section-head small {
  font-size: 11px;
  color: var(--muted);
}

.robot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.robot-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "avatar identity" "pick pick" "record record";
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: inherit;
  font: inherit;
}

.robot-card:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(47, 123, 255, 0.25);
  box-shadow: var(--soft-shadow);
}

.robot-avatar {
  grid-area: avatar;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  position: relative;
  background: linear-gradient(145deg, hsl(var(--robot-hue, 220) 76% 68%), hsl(var(--robot-hue, 220) 70% 48%));
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
}

.robot-avatar i {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #fff;
}

.robot-identity {
  grid-area: identity;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.robot-identity > strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.robot-identity > span {
  font-size: 11px;
  color: var(--muted);
}

.robot-identity span b {
  color: var(--primary);
  font-weight: 700;
}

.robot-pick {
  grid-area: pick;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(47, 123, 255, 0.06);
}

.robot-pick span {
  font-size: 11px;
  color: var(--muted);
}

.robot-pick strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-strong);
}

.robot-record {
  grid-area: record;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

.robot-record b {
  color: var(--text);
  font-weight: 700;
}

.robot-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0;
}

.robot-pagination span {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.robot-category-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 13px;
  background: rgba(255,255,255,.5);
  border: 1px solid var(--line);
}

.robot-category-tab {
  padding: 7px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.robot-category-tab:hover {
  background: rgba(47,123,255,.08);
}

.robot-category-tab.active {
  color: #fff;
  background: linear-gradient(110deg, var(--primary-strong), var(--accent));
  box-shadow: 0 8px 18px rgba(47,123,255,0.22);
}

.robot_grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

/* ============================================================
   Robot Modal
   ============================================================ */
.robot-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.robot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 58, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 0;
  cursor: pointer;
}

.robot-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff, #f5f8ff);
  box-shadow: 0 24px 64px rgba(37, 79, 152, 0.22);
  animation: fadeIn 0.25s ease;
}

.robot-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.robot-modal-head > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.robot-modal-head strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.robot-modal-head span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.robot-modal-head small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.robot-modal-close {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.robot-modal-close:hover {
  background: rgba(227, 75, 100, 0.08);
  color: var(--danger);
  border-color: rgba(227, 75, 100, 0.2);
}

.robot-modal-body {
  padding: 20px 22px;
}

.robot-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.robot-modal-stats > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(47, 123, 255, 0.04);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.robot-modal-stats strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.robot-rule-note {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.06);
  border: 1px solid rgba(217, 119, 6, 0.15);
  font-size: 12px;
  color: var(--warning);
  line-height: 1.6;
}

.robot-rule-note strong {
  font-weight: 700;
}

.robot-history-table > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.robot-history-table strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.robot-history-table > div:first-child > span {
  font-size: 11px;
  color: var(--muted);
}

.robot-draw-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.robot-draw-result small {
  font-size: 11px;
  color: var(--muted);
}

.robot-miss {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .draw-main {
    grid-template-columns: 1fr;
  }
  
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .engine-panel {
    grid-template-columns: 1fr;
  }
  
  .distribution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .draw-card {
    padding: 14px 16px;
  }
  
  .draw-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .draw-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .result-strip {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .number-expression {
    --draw-ball-size: 50px;
  }
  
  .page-head,
  .lottery-page-heading,
  .robot-lab-head {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
  }
  
  .robot-lab-stats {
    flex-wrap: wrap;
  }
  
  .robot-lab-stats .stat-box {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
  
  .robot-main-layout {
    flex-direction: column;
    gap: 10px;
  }
  
  .robot-sidebar {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .robot-sidebar::-webkit-scrollbar {
    display: none;
  }
  
  .robot-side-tab {
    flex-shrink: 0;
    width: auto;
    min-width: 64px;
    padding: 10px 14px;
  }
  
  .robot-head-controls {
    width: 100%;
  }
  
  .robot-modal-layer {
    padding: 10px;
    align-items: flex-end;
  }
  
  .robot-modal {
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  
  .robot-modal-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .robot-modal-stats > span {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .robot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  
  .robot-card {
    grid-template-columns: 38px minmax(0,1fr);
    grid-template-areas: "avatar identity" "pick pick" "record record";
    padding: 9px;
  }
  
  .robot-avatar {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  
  .robot-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 9px;
    background: rgba(47,123,255,.06);
  }
  
  .robot-pick strong {
    font-size: 16px;
  }
  
  .robot-record {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-card strong {
    font-size: 20px;
  }
  
  .keno-number-list {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .number-expression {
    --draw-ball-size: 44px;
  }
  
  .filters {
    grid-template-columns: 1fr;
  }
  
  .omission-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  }
  
  .robot-modal-head {
    padding: 16px;
    gap: 10px;
  }
  
  .robot-modal-body {
    padding: 16px;
  }
  
  .robot-modal-stats > span {
    font-size: 11px;
  }
  
  .robot-modal-stats strong {
    font-size: 16px;
  }
  
  .bar-row {
    grid-template-columns: 50px 1fr 32px;
    gap: 8px;
  }
  
  .bar-row strong {
    font-size: 12px;
  }

  .robot-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
    Animations
    ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Lottery Navigation Tabs - 开奖中心内部导航
   ============================================================ */

.lottery-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 0 8px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.lottery-nav-tabs::-webkit-scrollbar {
  display: none;
}

.lottery-nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.lottery-nav-tab:hover {
  background: rgba(47, 123, 255, 0.08);
  color: var(--primary);
}

.lottery-nav-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(47, 123, 255, 0.25);
}

.lottery-nav-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lottery-nav-tab span {
  font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .lottery-nav-tabs {
    gap: 6px;
    padding: 10px 12px;
  }
  
  .lottery-nav-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .lottery-nav-tab svg {
    width: 16px;
    height: 16px;
  }
  
  .lottery-nav-tab span {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .lottery-nav-tab {
    padding: 6px 10px;
  }
  
  .lottery-nav-tab span {
    font-size: 11px;
  }
}
