:root {
  --ink: #142334;
  --ink-soft: #536274;
  --muted: #8591a0;
  --line: #e4e9ef;
  --line-strong: #d4dce5;
  --canvas: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --brand: #0c7c8c;
  --brand-deep: #075d6b;
  --brand-soft: #e8f5f6;
  --signal: #f39a3d;
  --signal-soft: #fff3e3;
  --success: #1f9d74;
  --success-soft: #e8f7f1;
  --danger: #d15c58;
  --danger-soft: #fceceb;
  --shadow-sm: 0 1px 2px rgba(20, 35, 52, 0.03), 0 8px 24px rgba(20, 35, 52, 0.035);
  --shadow-md: 0 14px 40px rgba(20, 35, 52, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }

/* Public site */
.public-topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(20px, 4vw, 64px);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand-lockup { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.04em;
  box-shadow: 0 6px 14px rgba(12,124,140,.18);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark img { position: absolute; inset: 0; opacity: 0; transition: opacity .16s ease; }
.brand-mark.is-loaded img { opacity: 1; }
.brand-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.brand-mark::after { content: ""; position: absolute; inset: -30%; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.78) 50%, transparent 65%); transform: translateX(-150%) rotate(16deg); pointer-events: none; }
.brand-lockup:hover .brand-mark::after, .brand-lockup:focus-visible .brand-mark::after, .brand-lockup:active .brand-mark::after, .admin-brand:hover .brand-mark::after { animation: logo-glint .75s ease-out both; }
@keyframes logo-glint { to { transform: translateX(150%) rotate(16deg); } }
@keyframes logo-glint-mobile { 0%, 82% { transform: translateX(-150%) rotate(16deg); } 94%, 100% { transform: translateX(150%) rotate(16deg); } }
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .brand-lockup .brand-mark::after { animation: logo-glint-mobile 6s ease-in-out infinite; }
}
.brand-copy { min-width: 0; }
.brand-name { display: block; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; font-weight: 760; letter-spacing: -.02em; }
.brand-domain { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.public-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.public-nav a { color: var(--ink-soft); padding: 9px 12px; border-radius: 8px; font-size: 13px; transition: .18s ease; }
.public-nav a:hover, .public-nav a.active { color: var(--brand-deep); background: var(--brand-soft); }
.public-actions { display: flex; align-items: center; gap: 10px; }

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: .18s ease;
  font-weight: 650;
}
.button-primary { color: white; background: var(--brand); box-shadow: 0 5px 12px rgba(12,124,140,.15); }
.button-primary:hover { background: var(--brand-deep); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--brand); color: var(--brand-deep); background: #fbffff; }
.button-quiet { color: var(--ink-soft); background: transparent; }
.button-quiet:hover { color: var(--brand-deep); background: var(--surface-soft); }
.button-danger { color: var(--danger); background: var(--danger-soft); border-color: #f4d3d1; }
.button-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }
.button-icon { width: 34px; height: 34px; padding: 0; }

.public-main { max-width: 1440px; margin: 0 auto; padding: 26px clamp(20px, 4vw, 64px) 56px; }
.public-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); gap: 28px; align-items: stretch; margin: 12px 0 22px; }
.hero-copy { padding: 25px 4px 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-deep); font-size: 11px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.hero-copy h1 { max-width: 700px; margin: 18px 0 14px; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.08; letter-spacing: -.065em; font-weight: 780; }
.hero-copy p { max-width: 565px; margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.8; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.meta-item { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; color: var(--ink-soft); background: rgba(255,255,255,.66); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.meta-item .icon { width: 14px; height: 14px; color: var(--brand); }

.draw-panel { position: relative; overflow: hidden; color: white; background: #173b49; border-radius: 16px; padding: 25px; min-height: 294px; box-shadow: var(--shadow-md); }
.draw-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(42,160,158,.35), transparent 42%, rgba(243,154,61,.18)); pointer-events: none; }
.draw-panel-content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
.draw-panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dark-kicker { color: #b9ced3; font-size: 12px; }
.draw-period { margin-top: 5px; font-size: 13px; font-weight: 700; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; color: #a4f0d0; background: rgba(28, 154, 113, .18); border: 1px solid rgba(133, 239, 200, .2); border-radius: 99px; padding: 6px 9px; font-size: 10px; font-weight: 780; letter-spacing: .07em; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #76e6b8; box-shadow: 0 0 0 4px rgba(118,230,184,.12); }
.draw-number { display: flex; align-items: center; gap: 10px; margin: auto 0 19px; }
.draw-ball { width: 58px; height: 58px; display: grid; place-items: center; color: var(--ink); background: #fff; border-radius: 50%; font-size: 23px; font-weight: 780; box-shadow: 0 8px 16px rgba(0,0,0,.12); }
.draw-plus { color: #a5bec4; font-size: 20px; }
.draw-result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.draw-sum-label { color: #b9ced3; font-size: 12px; }
.draw-sum { margin-top: 2px; font-size: 30px; line-height: 1; font-weight: 780; letter-spacing: -.04em; }
.result-tags { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.result-tag { padding: 6px 9px; border-radius: 6px; color: #d8f5f3; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); font-size: 11px; font-weight: 650; }

.ad-strip { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 15px 18px; margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); }
.ad-strip-label { color: var(--signal); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.ad-strip-title { margin-top: 4px; font-size: 14px; font-weight: 720; }
.ad-strip-note { margin-top: 3px; color: var(--muted); font-size: 12px; }
.ad-strip a { color: var(--brand-deep); font-weight: 700; font-size: 12px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 13px; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-link { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-deep); font-size: 12px; font-weight: 700; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.history-surface { overflow: hidden; }
.surface-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.surface-header h3 { margin: 0; font-size: 14px; }
.surface-header span { color: var(--muted); font-size: 12px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { padding: 12px 17px; color: var(--muted); background: var(--surface-soft); font-size: 11px; text-align: left; font-weight: 650; }
.history-table td { padding: 13px 17px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.history-table tr:hover td { background: #fcfefe; }
.period-cell { color: var(--ink); font-weight: 700; }
.period-cell small { display: block; color: var(--muted); font-weight: 500; margin-top: 3px; }
.mini-balls { display: flex; align-items: center; gap: 5px; }
.mini-ball { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: #eef2f4; font-size: 10px; font-weight: 760; }
.mini-ball.accent { color: #fff; background: var(--brand); }
.sum-value { font-weight: 780; font-size: 14px; }
.table-tag { display: inline-flex; align-items: center; padding: 5px 7px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.table-tag.large { color: #a36516; background: var(--signal-soft); }
.table-tag.small { color: #33717b; background: var(--brand-soft); }
.table-tag.odd { color: #9a5b21; background: #fff5e9; }
.table-tag.even { color: #366c78; background: #edf7f7; }

.side-stack { display: grid; gap: 16px; }
.side-panel { padding: 18px; }
.side-panel h3 { margin: 0; font-size: 14px; }
.side-panel-subtitle { margin: 5px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.countdown-box { padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; }
.countdown-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.countdown-time { margin: 9px 0 12px; font-size: 28px; line-height: 1; font-weight: 780; letter-spacing: -.05em; }
.progress-track { height: 6px; overflow: hidden; background: #e6ecef; border-radius: 99px; }
.progress-value { width: 72%; height: 100%; background: var(--signal); border-radius: inherit; }
.tg-panel { color: #fff; background: #17636e; border: 0; }
.tg-panel .side-panel-subtitle { color: #b9d9d9; }
.tg-link { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; font-size: 12px; }
.tg-link strong { font-size: 12px; }
.tg-link span { color: #b9d9d9; }
.notice-list { display: grid; gap: 12px; }
.notice-item { display: grid; grid-template-columns: 8px 1fr; gap: 9px; }
.notice-bullet { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--signal); }
.notice-item p { margin: 0; font-size: 12px; line-height: 1.55; }
.notice-item time { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.site-footer { display: flex; justify-content: space-between; gap: 18px; padding-top: 40px; color: var(--muted); font-size: 11px; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 232px minmax(0,1fr); min-height: 100vh; background: var(--canvas); }
.admin-login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--canvas); }
.admin-login-card { display: grid; gap: 15px; width: min(100%, 380px); padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.admin-login-card h1 { margin: 0; font-size: 24px; }
.admin-login-card p { margin: -7px 0 4px; color: var(--muted); font-size: 13px; }
.admin-login-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
.admin-login-card input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); }
.admin-login-card a { justify-self: center; color: var(--brand); font-size: 12px; }
.admin-login-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.tg-group-list { display: grid; gap: 7px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-soft); font-size: 12px; }
.tg-group-list label { display: flex; align-items: center; gap: 8px; }
.tg-group-list input { width: auto; height: auto; }
html[data-theme="dark"] .admin-login-card { background: #17232d; border-color: #2b3a47; }
html[data-theme="dark"] .admin-login-card input { background: #1d2b36; border-color: #344652; color: #edf5fb; }
.admin-sidebar { color: #d8e6eb; background: #132f3b; padding: 22px 14px 18px; display: flex; flex-direction: column; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 3px 10px 24px; }
.admin-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; box-shadow: none; background: #2a8e99; }
.admin-brand .brand-name { color: #fff; font-size: 13px; }
.admin-brand .brand-domain { color: #96b2bb; }
.admin-nav-label { padding: 18px 11px 7px; color: #7896a0; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 3px; }
.admin-nav button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 0; border-radius: 7px; color: #b7ccd1; background: transparent; text-align: left; font-size: 12px; transition: .18s ease; }
.admin-nav button:hover { color: #fff; background: rgba(255,255,255,.07); }
.admin-nav button.active { color: #fff; background: #225563; box-shadow: inset 3px 0 0 #74d5ce; }
.admin-nav button .icon { width: 15px; height: 15px; opacity: .84; }
.admin-sidebar-bottom { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.admin-sync { display: flex; align-items: center; gap: 8px; color: #a4c6c7; font-size: 11px; }
.admin-sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #7ce2b4; box-shadow: 0 0 0 4px rgba(124,226,180,.12); }
.admin-main { min-width: 0; }
.admin-topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(20px, 3vw, 42px); background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); }
.admin-topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.admin-topbar h1 { margin: 0; font-size: 18px; letter-spacing: -.04em; }
.admin-topbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.admin-topbar-actions { display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 33px; height: 33px; display: grid; place-items: center; color: var(--brand-deep); background: var(--brand-soft); border-radius: 50%; font-size: 12px; font-weight: 800; }
.admin-content { max-width: 1500px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 52px; }
.content-title-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.content-title-row h2 { margin: 0; font-size: 24px; letter-spacing: -.05em; }
.content-title-row p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.content-title-actions { display: flex; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 7px; }
.metric-value { overflow: hidden; margin-top: 14px; font-size: 25px; line-height: 1; font-weight: 780; letter-spacing: -.055em; text-overflow: ellipsis; white-space: nowrap; }
.metric-foot { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.trend-up { color: var(--success); font-weight: 700; }
.trend-neutral { color: var(--brand); font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(300px, .78fr); gap: 17px; margin-top: 17px; }
.admin-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-panel { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-sm); }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.admin-panel-header h3 { margin: 0; font-size: 13px; }
.admin-panel-header span { color: var(--muted); font-size: 11px; }
.chart-area { padding: 20px 18px 15px; }
.chart-grid { height: 188px; display: flex; align-items: end; gap: 10px; padding: 0 3px; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, transparent 24%, #edf1f4 25%, transparent 25%, transparent 49%, #edf1f4 50%, transparent 50%, transparent 74%, #edf1f4 75%, transparent 75%); }
.chart-column { height: 100%; flex: 1; display: flex; align-items: end; justify-content: center; gap: 3px; position: relative; }
.chart-bar { width: 12px; min-height: 10px; border-radius: 4px 4px 0 0; background: #9dd9d6; transition: height .3s ease; }
.chart-bar.highlight { background: var(--brand); }
.chart-bar.alt { background: #f5c37f; }
.chart-labels { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px 0; color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 17px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.legend-dot.alt { background: #f5c37f; }
.activity-list { padding: 6px 18px 12px; }
.activity-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--brand); }
.activity-dot.orange { background: var(--signal); }
.activity-dot.green { background: var(--success); }
.activity-text { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.45; }
.activity-text strong { font-weight: 720; }
.activity-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.health-list { padding: 11px 18px 15px; }
.health-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.health-row:last-child { border-bottom: 0; }
.health-name { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.health-status { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 11px; font-weight: 700; }
.health-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Admin content modules */
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.segmented button { border: 0; padding: 6px 10px; color: var(--muted); background: transparent; border-radius: 5px; font-size: 11px; }
.segmented button.active { color: var(--brand-deep); background: white; box-shadow: 0 1px 3px rgba(20,35,52,.09); font-weight: 700; }
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th { padding: 12px 17px; color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 700; text-align: left; letter-spacing: .03em; }
.admin-table td { padding: 14px 17px; border-top: 1px solid var(--line); font-size: 12px; }
.ad-identity { display: flex; align-items: center; gap: 10px; }
.ad-thumb { width: 55px; height: 33px; overflow: hidden; display: grid; place-items: center; color: #fff; background: #235d66; border-radius: 5px; font-size: 10px; font-weight: 700; }
.ad-thumb.orange { background: #eaa358; }
.ad-thumb.teal { background: #38979a; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-name { font-weight: 700; }
.ad-sub { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-on { color: var(--success); background: var(--success-soft); }
.status-off { color: var(--muted); background: #f0f2f4; }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.row-actions button { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.row-actions button:hover { color: var(--brand); background: var(--brand-soft); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); gap: 17px; }
.form-panel { padding: 20px; }
.form-panel h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.form-intro { margin: 6px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px 14px; }
.field { min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.field label span { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; padding: 10px 11px; font-size: 12px; transition: .15s ease; }
.field input, .field select { height: 39px; }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(12,124,140,.1); }
.tg-template-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tg-template-toolbar button { padding: 6px 9px; color: var(--ink-soft); background: #f3f7fa; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 700; }
.tg-template-toolbar button:hover { color: var(--brand); border-color: var(--brand); }
.tg-emoji-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tg-emoji-row input { min-width: 0; flex: 1; }
.tg-emoji-row button { flex: 0 0 auto; }
.tg-template-hint { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.tg-preview-content { margin-top: 15px; padding: 16px; color: #f2fbfb; background: #173b49; border-radius: 9px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.tg-preview-content blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid #79cbd1; }
.tg-preview-content code { padding: 2px 4px; background: #285362; border-radius: 3px; }
.tg-preview-emoji { display: inline-block; padding: 0 2px; border-bottom: 1px dotted #79cbd1; }
.form-actions { display: flex; gap: 8px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle-copy strong { display: block; font-size: 12px; }
.toggle-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: #cbd4da; border-radius: 99px; transition: .18s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .18s; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.preview-panel { padding: 20px; background: #edf5f5; border: 1px solid #d7e8e8; }
.preview-panel h3 { margin: 0; font-size: 13px; }
.preview-window { margin-top: 15px; overflow: hidden; background: white; border: 1px solid #dce8ea; border-radius: 9px; box-shadow: 0 7px 17px rgba(27,74,81,.08); }
.preview-window-top { display: flex; align-items: center; gap: 7px; padding: 8px 10px; background: #f8fbfb; border-bottom: 1px solid #e4eeee; }
.preview-dot { width: 6px; height: 6px; border-radius: 50%; background: #e8ae74; }
.preview-dot:nth-child(2) { background: #71b8af; }
.preview-dot:nth-child(3) { background: #c7d3d5; }
.preview-body { padding: 19px 16px 23px; text-align: center; }
.preview-logo { width: 43px; height: 43px; display: grid; place-items: center; margin: 0 auto 10px; overflow: hidden; color: white; background: var(--brand); border-radius: 12px; font-size: 12px; font-weight: 800; }
.preview-logo img { width: 100%; height: 100%; object-fit: cover; }
.preview-body h4 { max-width: 210px; margin: 0 auto 6px; font-size: 14px; }
.preview-body p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.domain-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; padding: 11px; color: #587378; background: rgba(255,255,255,.55); border: 1px solid #d7e8e8; border-radius: 7px; font-size: 10px; line-height: 1.6; }
.domain-note .icon { width: 14px; height: 14px; color: var(--brand); }
.analytics-summary { display: grid; grid-template-columns: 1.35fr .65fr; gap: 17px; }
.analytics-bars { height: 226px; display: flex; align-items: end; gap: 10px; padding: 22px 20px 0; border-bottom: 1px solid var(--line); }
.analytics-bar-col { flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; height: 100%; }
.analytics-bar { width: 100%; max-width: 27px; min-height: 12px; border-radius: 6px 6px 0 0; background: #b7dedd; }
.analytics-bar.current { background: var(--brand); }
.analytics-bar-col span { color: var(--muted); font-size: 10px; }
.source-list { padding: 12px 18px 15px; }
.source-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.source-item:last-child { border-bottom: 0; }
.source-name { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.source-rank { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border-radius: 5px; font-size: 10px; font-weight: 750; }
.source-value { text-align: right; font-size: 12px; font-weight: 720; }
.source-value span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; }
.device-card { padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.device-card-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.device-number { margin-top: 10px; font-size: 20px; font-weight: 780; letter-spacing: -.04em; }
.device-bar { height: 5px; margin-top: 10px; overflow: hidden; background: #e1e7ea; border-radius: 99px; }
.device-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.empty-state { padding: 42px 22px; text-align: center; color: var(--muted); }

/* Toast and responsive */
#toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: grid; gap: 9px; }
.toast { display: flex; align-items: center; gap: 9px; min-width: 250px; padding: 12px 14px; color: #fff; background: #1d3b46; border-radius: 8px; box-shadow: var(--shadow-md); font-size: 12px; animation: toast-in .22s ease both; }
.toast.success { background: #1f8067; }
.toast.error { background: #9d4544; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .public-hero { grid-template-columns: 1fr; }
  .draw-panel { min-height: 255px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .analytics-summary { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .public-topbar { height: 62px; padding: 0 18px; gap: 12px; }
  .brand-domain, .public-nav { display: none; }
  .public-actions .button-secondary { display: none; }
  .public-main { padding: 20px 18px 42px; }
  .hero-copy { padding-top: 8px; }
  .hero-copy h1 { font-size: 39px; }
  .overview-grid, .admin-grid, .admin-grid.equal, .editor-layout { grid-template-columns: 1fr; }
  .history-table { min-width: 660px; }
  .history-surface { overflow-x: auto; }
  .site-footer { flex-direction: column; padding-top: 28px; }
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { position: sticky; top: 0; z-index: 30; display: block; min-width: 0; max-width: 100vw; padding: 10px 14px; }
  .admin-brand { padding: 0 4px; }
  .admin-brand .brand-domain, .admin-nav-label, .admin-sidebar-bottom { display: none; }
  .admin-nav { display: flex; width: 100%; min-width: 0; overflow-x: auto; gap: 3px; margin-top: 9px; padding-bottom: 1px; }
  .admin-nav { scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav button { width: auto; flex: 0 0 auto; padding: 8px 10px; white-space: nowrap; }
  .admin-nav button.active { box-shadow: inset 0 -3px 0 #74d5ce; }
  .admin-topbar { height: 62px; padding: 0 18px; }
  .admin-content { padding: 23px 18px 42px; }
  .content-title-row { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .content-title-actions { width: 100%; }
  .content-title-actions .button { flex: 1; }
}

@media (max-width: 540px) {
  .draw-panel { padding: 20px; }
  .draw-ball { width: 49px; height: 49px; font-size: 19px; }
  .draw-number { gap: 7px; }
  .result-tags { justify-content: flex-start; }
  .draw-result-row { align-items: flex-end; flex-direction: column; }
  .ad-strip { grid-template-columns: 1fr; gap: 11px; }
  .ad-strip a { justify-self: start; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .device-grid { grid-template-columns: 1fr; }
  .admin-topbar-actions .button { display: none; }
  .toast { min-width: 0; max-width: calc(100vw - 36px); }
  #toast-region { right: 18px; bottom: 18px; }
}

/* Public data site alignment */
.public-shell {
  --public-primary: #2d72bd;
  --public-primary-soft: #eaf3ff;
  --public-border: #e1e7ee;
  --public-muted: #6f7b89;
  background: #f8fafc;
  font-size: 16px;
  line-height: 1.5;
}
.public-topbar {
  height: 64px;
  padding: 0 max(18px, calc((100vw - 1120px) / 2));
  background: rgba(255,255,255,.97);
  border-bottom-color: var(--public-border);
  box-shadow: 0 1px 6px rgba(28, 54, 78, .035);
}
.public-topbar .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #2e73bd;
  background: #edf5ff;
  border: 1px solid #d5e6fb;
  box-shadow: none;
  font-size: 12px;
}
.public-topbar .brand-name { color: #1c2d40; font-size: 16px; }
.public-topbar .brand-domain { color: #8a96a4; }
.public-nav { margin-left: 16px; gap: 2px; }
.public-nav a, .public-nav button { border: 0; color: #5e6c7b; background: transparent; padding: 8px 10px; font-size: 12px; font-weight: 560; }
.public-nav a:hover, .public-nav a.active, .public-nav button:hover { color: var(--public-primary); background: var(--public-primary-soft); }
.public-nav a, .public-nav button { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; }
.public-nav .icon { width: 13px; height: 13px; color: #738191; }
.public-nav .nav-chevron { color: #98a3ae; font-size: 13px; line-height: 1; }
.public-actions { gap: 7px; }
.public-search { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; color: #7d8997; background: #f8fafc; border: 1px solid var(--public-border); border-radius: 7px; font-size: 11px; }
.public-search .icon { width: 13px; height: 13px; }
.public-search kbd { padding: 2px 4px; color: #8995a3; background: white; border: 1px solid #e2e7ec; border-radius: 4px; font-size: 9px; }
.public-topbar .button-primary { background: var(--public-primary); box-shadow: 0 4px 10px rgba(45,114,189,.16); }
.public-topbar .button-primary:hover { background: #245f9f; }
.theme-button { border: 1px solid var(--public-border); }
.public-admin-link { display: none; }
.public-main { width: 100%; max-width: 1168px; padding: 12px clamp(12px, 2.1vw, 24px) 42px; }
.ad-banner-list { display: flex; flex-direction: column; gap: 8px; }
.ad-banner { display: block; width: 100%; overflow: hidden; border-radius: 12px; background: var(--surface); box-shadow: 0 3px 10px rgba(26, 46, 72, .12); }
.ad-banner img { display: block; width: 100%; height: auto; object-fit: contain; }
.ad-banner[href]:hover { filter: brightness(.97); }
.ad-preview-image { min-height: 96px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ad-preview-image img { display: block; width: 100%; height: auto; }
.draw-banner-panels { display: grid; grid-template-columns: minmax(208px, .72fr) minmax(0, 1.28fr); gap: 12px; align-items: stretch; margin-top: 12px; }
.countdown-wrapper, .draw-result-panel, .hist-panel, .public-info-card { background: #fff; border: 1px solid var(--public-border); border-radius: 12px; box-shadow: 0 2px 7px rgba(29, 53, 78, .035); }
.countdown-wrapper { min-height: 184px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 15px 16px; border-color: #bfd9f6; }
.countdown-heading, .countdown-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--public-muted); font-size: 12px; font-weight: 600; }
.countdown-heading span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.countdown-heading .icon { width: 14px; height: 14px; color: var(--public-primary); }
.countdown-face { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 54px; text-align: center; }
.countdown-face strong { color: #263548; font-size: 39px; line-height: 1; letter-spacing: -.07em; font-weight: 680; font-variant-numeric: tabular-nums; }
.countdown-face strong span { margin: 0 4px; color: #7f8a96; font-size: 14px; font-weight: 560; letter-spacing: 0; }
.countdown-meta { font-size: 11px; }
.countdown-bar { height: 6px; overflow: hidden; background: #edf1f5; border-radius: 99px; }
.countdown-bar span { display: block; width: 53%; height: 100%; background: var(--public-primary); border-radius: inherit; }
.draw-result-panel { min-width: 0; min-height: 184px; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 12px; }
.draw-result-header { min-height: 29px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; }
.draw-result-header h2 { min-width: 0; margin: 0; overflow: hidden; color: #273446; font-size: 16px; font-weight: 700; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.draw-result-header h2 { width: 100%; text-align: center; }
.draw-result-header h2 strong { margin-left: 4px; font-weight: 700; }
.draw-result-header h2 span { margin-left: 8px; color: var(--public-muted); font-size: 14px; line-height: 1.2; font-weight: 400; font-variant-numeric: tabular-nums; }
.draw-result-actions { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; }
.result-setting-button, .result-mipai-button { height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; color: #647180; background: #fff; border: 1px solid var(--public-border); border-radius: 7px; font-size: 11px; }
.result-setting-button:hover, .result-mipai-button:hover, .result-mipai-button.active { color: var(--public-primary); background: var(--public-primary-soft); border-color: #bdd8f4; }
.result-setting-button .icon, .result-mipai-button .icon { width: 13px; height: 13px; }
.draw-scratch-host { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 2px 0; container-type: inline-size; }
.scratch-surface { --result-tile: clamp(28px, 10.5cqw, 77px); --result-gap: clamp(2px, .5cqw, 4px); position: relative; display: flex; width: 100%; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 18px clamp(4px, 1cqw, 12px); border: 1px solid #dce5ed; border-radius: 12px; background: #f8fbfd; }
.draw-scratch-card { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; }
.draw-result-strip { display: flex; align-items: center; justify-content: center; min-width: 0; gap: var(--result-gap); }
.draw-result-op { width: clamp(8px, 2.5cqw, 24px); flex: 0 0 auto; display: inline-grid; place-items: center; color: #0f1b2d; font-size: clamp(12px, 2.7cqw, 19px); line-height: 1; font-weight: 700; }
.draw-result-op.draw-result-eq { margin-left: 3px; }
.draw-result-cell { width: var(--result-tile); height: var(--result-tile); flex: 0 0 auto; display: grid; place-items: center; position: relative; padding: 0; color: #29394c; background: #eef2f7; border: 1px solid #e1e8ee; border-radius: 18%; font-size: clamp(19px, 5.1cqw, 39px); font-weight: 750; line-height: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); transition: .18s ease; }
.draw-result-cell.draw-result-sum { color: #fff; background: #1565c0; border-color: #1565c0; box-shadow: 0 6px 12px rgba(21,101,192,.15); }
.draw-result-classification { display: flex; align-items: center; justify-content: center; gap: clamp(2px, .7cqw, 5px); }
.draw-result-classification:empty { display: none; }
.draw-result-type { width: var(--result-tile); height: var(--result-tile); padding: 0; display: inline-grid; place-items: center; flex: 0 0 auto; color: #fff; border-radius: 18%; font-size: clamp(18px, 4.8cqw, 36px); font-weight: 750; line-height: 1; }
.draw-result-type.type-red { background: #e53935; }
.draw-result-type.type-blue { background: #1e88e5; }
.draw-result-cell:hover { transform: translateY(-1px); border-color: #b9d2eb; }
.draw-result-cell.covered { color: #4e83b8; background: linear-gradient(135deg, #e8f2fc 25%, #f9fbfe 25%, #f9fbfe 50%, #e8f2fc 50%, #e8f2fc 75%, #f9fbfe 75%); background-size: 9px 9px; border-style: dashed; cursor: pointer; }
.draw-result-cell.covered .draw-result-glyph { transform: translateY(-5px); font-size: 21px; }
.scratch-label { position: absolute; bottom: 11px; color: #5484b4; font-size: 9px; font-weight: 620; }
.scratch-canvas { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; border-radius: inherit; cursor: crosshair; touch-action: none; }
.scratch-canvas.scratch-revealed { opacity: 0; transform: scale(1.03); transition: opacity .35s ease, transform .35s ease; }
.draw-result-traits { display: flex; flex: 0 0 100%; flex-wrap: wrap; justify-content: center; gap: 4px; }
.result-trait, .history-tag { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.trait-large, .history-tag.large { color: #c62828; background: #ffebee; }
.trait-small, .history-tag.small { color: #1565c0; background: #e3f2fd; }
.trait-odd, .history-tag.odd { color: #1565c0; background: #e3f2fd; }
.trait-even, .history-tag.even { color: #c62828; background: #ffebee; }
.trait-大单 { color: #b71c1c; background: #ffe5e7; }
.trait-大双 { color: #aa4e0a; background: #fff0dc; }
.trait-小单 { color: #1556a8; background: #e4efff; }
.trait-小双 { color: #24713e; background: #e2f5e9; }
.trait-杂六 { color: #2e7d32; background: #e8f5e9; }
.trait-对子 { color: #ef6c00; background: #fff3e0; }
.trait-顺子 { color: #8e24aa; background: #f3e5f5; }
.trait-豹子 { color: #c62828; background: #ffebee; }
.trait-龙 { color: #c62828; background: #ffebee; }
.trait-虎 { color: #1565c0; background: #e3f2fd; }
.trait-合 { color: #8e24aa; background: #f3e5f5; }
.trait-location, .trait-extreme, .trait-road { color: #607d8b; background: #eceff1; }
.draw-display-settings { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; color: #5f6f7d; background: #f7fafc; border: 1px solid var(--public-border); border-radius: 7px; font-size: 11px; }
.draw-display-settings label { display: inline-flex; align-items: center; gap: 4px; }
.draw-display-settings .draw-ad-setting { margin-left: auto; padding-left: 8px; border-left: 1px solid var(--public-border); font-weight: 700; }
.draw-result-footer { display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--public-muted); font-size: 12px; font-weight: 550; }
.draw-result-footer span { display: inline-flex; align-items: center; gap: 6px; }
.draw-result-footer span + span::before { content: "·"; color: #b3bdc6; }
.source-status { display: inline-flex; align-items: center; gap: 4px; }
.source-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.source-status.live { color: #2b9773; }
.source-status.maintenance { color: #9b611c; }
.source-status.stale { color: #c98222; }
.source-status.demo { color: #9aa5ae; }
.insight-panel { margin-top: 12px; padding: 17px; background: #fff; border: 1px solid var(--public-border); border-radius: 12px; box-shadow: 0 2px 7px rgba(29, 53, 78, .035); }
.insight-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.insight-heading h2 { margin: 0; color: #273446; font-size: 15px; font-weight: 680; }
.insight-heading p { margin: 5px 0 0; color: var(--public-muted); font-size: 11px; }
.insight-source { display: inline-flex; align-items: center; gap: 5px; color: #2b9773; font-size: 10px; }
.insight-source::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.insight-tabs, .omission-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--public-border); }
.insight-tabs button, .omission-tabs button { min-height: 28px; padding: 0 9px; color: #6c7987; background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 11px; font-weight: 620; }
.insight-tabs button:hover, .omission-tabs button:hover { background: #f3f7fb; }
.insight-tabs button.active, .omission-tabs button.active { color: #fff; background: var(--public-primary); box-shadow: 0 3px 7px rgba(45,114,189,.14); }
.insight-body { padding-top: 14px; }
.insight-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.insight-kpis > div { min-width: 0; padding: 11px 12px; background: #f8fafc; border: 1px solid #e8edf2; border-radius: 8px; }
.insight-kpis span, .insight-kpis small { display: block; color: #718294; font-size: 11px; }
.insight-kpis strong { display: block; margin: 6px 0 3px; color: #2f4052; font-size: 18px; font-weight: 720; }
.insight-kpis strong small { display: inline; margin-left: 2px; font-size: 10px; font-weight: 600; }
.insight-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 10px; margin-top: 10px; }
.insight-card { min-width: 0; padding: 13px; background: #fbfcfd; border: 1px solid #e8edf2; border-radius: 8px; }
.insight-card h3 { margin: 0 0 11px; color: #526172; font-size: 12px; font-weight: 700; }
.insight-card p, .insight-subnote { margin: 10px 0 0; color: #718294; font-size: 11px; line-height: 1.65; }
.trend-line { width: 100%; height: 103px; display: block; overflow: visible; background: linear-gradient(to bottom, transparent 49.5%, #e8edf2 50%, transparent 50.5%); }
.trend-line line { stroke: #dce5ed; stroke-width: .6; }
.trend-bars { height: 34px; display: flex; align-items: flex-end; gap: 2px; margin-top: 5px; }
.trend-bars span { min-width: 2px; flex: 1; border-radius: 2px 2px 0 0; opacity: .84; }
.trend-bars span.large { background: #e53935; }
.trend-bars span.small { background: #1e88e5; }
.distribution-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) 94px; align-items: center; gap: 7px; margin: 12px 0; color: #758392; font-size: 10px; }
.distribution-row > div { height: 7px; overflow: hidden; background: #e6edf3; border-radius: 99px; }
.distribution-row i { display: block; height: 100%; background: #e53935; border-radius: inherit; }
.distribution-row:nth-of-type(3) i { background: #1e88e5; }
.distribution-row b { color: #536274; font-size: 10px; font-weight: 650; }
.rank-grid { display: grid; gap: 8px; margin-bottom: 15px; }
.rank-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) 94px; align-items: center; gap: 7px; }
.rank-item > div { height: 6px; overflow: hidden; background: #e8edf2; border-radius: 99px; }
.rank-item i { display: block; height: 100%; background: #ef6c00; border-radius: inherit; }
.rank-item b { color: #778492; font-size: 9px; font-weight: 600; }
.combo-rank { display: flex; flex-wrap: wrap; gap: 6px; }
.combo-rank span:not(.result-trait) { padding: 5px 7px; color: #657382; background: #f1f5f8; border-radius: 5px; font-size: 10px; }
.combo-rank b { color: #33485c; font-weight: 700; }
.frequency-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 13px; }
.frequency-item { display: grid; grid-template-columns: 21px minmax(0, 1fr); align-items: center; gap: 6px; }
.frequency-item > b { color: #526172; font-size: 10px; }
.frequency-item > span { grid-column: 2; color: #8d99a5; font-size: 9px; }
.frequency-track { height: 6px; position: relative; overflow: visible; background: #e8edf2; border-radius: 99px; }
.frequency-track i { display: block; height: 100%; background: #347dbf; border-radius: inherit; }
.frequency-track em { width: 2px; height: 10px; position: absolute; top: -2px; background: #6d7b87; border-radius: 2px; }
.omission-tabs { margin-top: 0; padding-bottom: 10px; }
.omission-group { margin-top: 14px; }
.omission-group h3, .omission-positions h3 { margin: 0 0 8px; color: #657382; font-size: 11px; }
.omission-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.omission-cell { min-width: 0; padding: 8px 4px; color: #697786; background: #f2f6f8; border: 1px solid #e8edf2; border-radius: 6px; text-align: center; }
.omission-cell b, .omission-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omission-cell b { color: #425466; font-size: 11px; }
.omission-cell span { margin-top: 3px; color: #8d99a5; font-size: 9px; }
.omission-cell.hot { color: #2b9773; background: #e8f7f1; border-color: #cde9de; }
.omission-cell.cold { color: #b86b16; background: #fff4e6; border-color: #f4dfc5; }
.omission-positions { display: grid; gap: 15px; }
.cycle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 0; color: #6d7b87; border-top: 1px solid #edf0f3; font-size: 10px; }
.cycle-row:first-of-type { border-top: 0; }
.cycle-row b { color: #405468; }
.dragon-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dragon-card h3 { margin: 0; }
.dragon-card strong { color: #347dbf; font-size: 20px; }
.dragon-card span { color: #8794a0; font-size: 10px; }
.insight-note { margin-top: 13px; color: #718294; font-size: 11px; }
.hist-panel { margin-top: 12px; overflow: hidden; }
.hist-panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--public-border); }
.hist-panel-modes { display: inline-flex; align-items: center; gap: 4px; }
.hist-panel-modes button { min-height: 31px; padding: 0 11px; color: #697685; background: transparent; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 600; }
.hist-panel-modes button:hover { background: #f3f7fb; }
.hist-panel-modes button.active { color: #fff; background: var(--public-primary); box-shadow: 0 3px 7px rgba(45,114,189,.16); }
.history-toolbar-right { display: flex; align-items: center; gap: 6px; }
.history-search { width: 205px; height: 31px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; color: #8c98a4; background: #fff; border: 1px solid var(--public-border); border-radius: 7px; }
.history-search .icon { width: 13px; height: 13px; }
.history-search input { width: 100%; min-width: 0; padding: 0; color: #425163; background: transparent; border: 0; outline: 0; font-size: 11px; }
.history-search input::placeholder { color: #9aa5af; }
.history-color-toggle { height: 31px; flex: 0 0 auto; padding: 0 9px; color: #286aa3; background: #edf5ff; border: 1px solid #bdd8f4; border-radius: 7px; font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.history-color-toggle:hover, .history-color-toggle:focus-visible { color: #fff; background: #2d72bd; border-color: #2d72bd; }
.history-pager { height: 31px; padding: 0 8px; color: #596b7f; background: #fff; border: 1px solid var(--public-border); border-radius: 7px; font-size: 11px; }
.history-pager:hover:not(:disabled), .history-page-number:hover:not(:disabled), .history-page-jump button:hover { color: var(--public-primary); border-color: #bdd8f4; background: var(--public-primary-soft); }
.history-pager:disabled, .history-page-number:disabled { color: #a8b0b8; background: #f8fafc; cursor: not-allowed; }
.history-table-wrap { overflow-x: auto; }
.reference-table { width: 100%; min-width: 920px; border-collapse: collapse; font-size: 14px; }
.reference-table th { padding: 11px 14px; color: #5a6b82; background: #f1f5f9; border-bottom: 1px solid var(--public-border); font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; }
.reference-table td { padding: 10px 14px; color: #344357; border-top: 1px solid #e7ecf2; font-size: 14px; text-align: center; white-space: nowrap; }
.reference-table tbody tr:nth-child(odd) td { background: #fff; }
.reference-table tbody tr:nth-child(even) td { background: #f4f7fb; }
.reference-table tbody tr:hover td { background: #eaf3fc; }
.reference-table .period-cell { color: #253b56; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.history-equation-cell { text-align: center; }
.history-equation { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.history-equation-digit, .history-equation-sum { min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 3px; border-radius: 5px; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; }
.history-equation-digit.history-digit-big, .history-equation-digit.history-digit-even { color: #fff; background: #e53935; }
.history-equation-digit.history-digit-small, .history-equation-digit.history-digit-odd { color: #fff; background: #1e88e5; }
.history-equation .history-equation-sum { min-width: 29px; color: #fff; background: #2e9b57; font-size: 14px; }
.history-equation-op { color: #8592a0; font-size: 12px; font-weight: 650; }
.history-tag { display: inline-flex; padding: 4px 6px; border-radius: 5px; font-size: 10px; font-weight: 650; }
.reference-table .history-tag { min-width: 25px; height: 25px; justify-content: center; padding: 0 6px; font-size: 12px; font-weight: 700; }
.reference-table .result-trait { padding: 3px 9px; border-radius: 6px; font-size: 12px; line-height: 1.2; font-weight: 600; }
.reference-table td .history-tag + .history-tag { margin-left: 5px; }
.reference-table .history-soft-tag, .reference-table .history-chip, .reference-table .history-count-tag { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-variant-numeric: tabular-nums; }
.reference-table .history-soft-tag { min-width: 40px; padding: 3px 9px; font-size: 12px; line-height: 1.2; font-weight: 600; }
.history-pattern-pair { color: #ef6c00; background: rgba(239, 108, 0, .16); }
.history-pattern-mixed { color: #2e7d32; background: rgba(46, 125, 50, .16); }
.history-pattern-straight { color: #8e24aa; background: rgba(142, 36, 170, .16); }
.history-pattern-triple { color: #e53935; background: rgba(229, 57, 53, .16); }
.history-location-middle, .history-tag-neutral { color: #5a6b82; background: #eef2f7; }
.history-location-small, .history-extreme-small { color: #1e88e5; background: rgba(30, 136, 229, .16); }
.history-location-large, .history-extreme-large { color: #e53935; background: rgba(229, 57, 53, .16); }
.reference-table .history-chip { width: 25px; height: 25px; padding: 0; color: #fff; font-size: 12px; font-weight: 700; }
.history-dragon { background: #e53935; }
.history-tiger { background: #1e88e5; }
.history-tie { background: #8e24aa; }
.history-chip-neutral { color: #5a6b82; background: #eef2f7; }
.reference-table .history-count-tag { min-width: 25px; height: 25px; padding: 0 6px; font-size: 12px; font-weight: 750; }
.history-count-3n { color: #1565c0; background: #e3f2fd; }
.history-count-4n { color: #b45a08; background: #fff0dc; }
.history-count-5n { color: #7b1fa2; background: #f3e5f5; }
.history-muted-value { color: #5a6b82; }
.history-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border-top: 1px solid var(--public-border); color: #667587; font-size: 12px; }
.history-page-summary { white-space: nowrap; }
.history-page-list, .history-page-jump { display: flex; align-items: center; gap: 5px; }
.history-page-number, .history-page-jump button { min-width: 30px; height: 30px; padding: 0 7px; color: #526477; background: #fff; border: 1px solid var(--public-border); border-radius: 6px; font-size: 12px; font-weight: 600; }
.history-page-number.active { color: #fff; background: var(--public-primary); border-color: var(--public-primary); }
.history-page-jump { margin: 0; }
.history-page-jump input { width: 52px; height: 30px; padding: 0 6px; color: #344357; background: #fff; border: 1px solid var(--public-border); border-radius: 6px; font-size: 12px; text-align: center; }
.history-tag.large { color: #c62828; background: #ffebee; }
.history-tag.small { color: #1565c0; background: #e3f2fd; }
.history-tag.odd { color: #1565c0; background: #e3f2fd; }
.history-tag.even { color: #c62828; background: #ffebee; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; color: #2b9773; font-size: 10px; }
.status-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.keno-placeholder { color: #99a6b1; font-size: 10px; }
.keno-numbers { display: inline-flex; flex-wrap: wrap; gap: 3px; max-width: 440px; }
.keno-numbers i { min-width: 20px; padding: 3px 4px; color: #526172; background: #f0f4f7; border-radius: 4px; font-size: 10px; font-style: normal; text-align: center; }
.history-empty { padding: 28px !important; color: #9aa5ae !important; text-align: center; }
.public-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.public-info-card { min-height: 105px; padding: 16px; color: #596777; }
.public-info-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #2e4052; font-size: 13px; font-weight: 700; }
.public-info-heading .icon { width: 14px; height: 14px; color: var(--public-primary); }
.public-info-card p { margin: 10px 0 7px; color: #667483; font-size: 11px; line-height: 1.65; }
.public-info-card > span { color: #9aa5ae; font-size: 10px; }
.tg-info-card { color: inherit; transition: .18s ease; }
.tg-info-card:hover { border-color: #bcd7f3; background: #fbfdff; }
.site-footer { max-width: none; padding-top: 26px; color: #718294; font-size: 11px; }
.back-to-top { position: fixed; right: 20px; bottom: 24px; z-index: 45; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: #286aa3; background: #fff; border: 1px solid #cbd9e5; border-radius: 8px; box-shadow: 0 5px 16px rgba(24, 52, 76, .16); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease; }
.back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover, .back-to-top:focus-visible { color: #fff; background: var(--public-primary); border-color: var(--public-primary); }
.back-to-top .icon { width: 19px; height: 19px; }

html[data-theme="dark"] body { color: #d8e2eb; background: #101820; }
html[data-theme="dark"] .public-shell { --public-border: #263542; --public-muted: #94a5b4; background: #101820; }
html[data-theme="dark"] .public-topbar, html[data-theme="dark"] .countdown-wrapper, html[data-theme="dark"] .draw-result-panel, html[data-theme="dark"] .hist-panel, html[data-theme="dark"] .public-info-card { background: #17232d; border-color: #2b3a47; }
html[data-theme="dark"] .public-topbar .brand-name, html[data-theme="dark"] .draw-result-header h2, html[data-theme="dark"] .public-info-heading { color: #edf5fb; }
html[data-theme="dark"] .public-nav a, html[data-theme="dark"] .public-nav button, html[data-theme="dark"] .reference-table td { color: #b8c7d3; }
html[data-theme="dark"] .public-search, html[data-theme="dark"] .history-search, html[data-theme="dark"] .result-setting-button, html[data-theme="dark"] .result-mipai-button { color: #b8c7d3; background: #1d2b36; border-color: #344652; }
html[data-theme="dark"] .history-search input { color: #e5edf3; }
html[data-theme="dark"] .reference-table th { color: #93a5b4; background: #14202a; border-color: #2b3a47; }
html[data-theme="dark"] .reference-table td { border-color: #253440; }
html[data-theme="dark"] .reference-table tbody tr:nth-child(odd) td { background: #17232d; }
html[data-theme="dark"] .reference-table tbody tr:nth-child(even) td { background: #1c2b36; }
html[data-theme="dark"] .reference-table tbody tr:hover td { background: #263744; }
html[data-theme="dark"] .history-pager, html[data-theme="dark"] .history-page-number, html[data-theme="dark"] .history-page-jump input, html[data-theme="dark"] .history-page-jump button { color: #b8c7d3; background: #1d2b36; border-color: #344652; }
html[data-theme="dark"] .history-page-number.active { color: #fff; background: var(--public-primary); border-color: var(--public-primary); }
html[data-theme="dark"] .scratch-surface, html[data-theme="dark"] .draw-display-settings { background: #1c2b36; border-color: #344652; }
html[data-theme="dark"] .draw-result-cell.draw-result-ball { color: #e8f0f5; background: #263744; border-color: #3d5260; }
html[data-theme="dark"] .draw-result-footer, html[data-theme="dark"] .public-info-card p { color: #9fb0bd; }
html[data-theme="dark"] .insight-panel { background: #17232d; border-color: #2b3a47; }
html[data-theme="dark"] .insight-heading h2 { color: #edf5fb; }
html[data-theme="dark"] .insight-kpis > div, html[data-theme="dark"] .insight-card { background: #1c2b36; border-color: #344652; }
html[data-theme="dark"] .insight-kpis strong, html[data-theme="dark"] .insight-card h3, html[data-theme="dark"] .rank-item b, html[data-theme="dark"] .distribution-row b, html[data-theme="dark"] .omission-cell b { color: #dce8f0; }
html[data-theme="dark"] .omission-cell, html[data-theme="dark"] .combo-rank span:not(.result-trait) { background: #263744; border-color: #344652; color: #aebdca; }
html[data-theme="dark"] .frequency-track, html[data-theme="dark"] .rank-item > div, html[data-theme="dark"] .distribution-row > div { background: #334652; }
html[data-theme="dark"] .countdown-wrapper.is-drawing { background: linear-gradient(105deg, #17232d 0%, #2d2527 48%, #17232d 100%); background-size: 220% 100%; }
html[data-theme="dark"] .countdown-face strong { color: #e6f0f7; }
html[data-theme="dark"] .countdown-face strong span { color: #aabac6; }
html[data-theme="dark"] .draw-result-op { color: #e7f0f5; }
html[data-theme="dark"] .draw-result-header h2 span, html[data-theme="dark"] .draw-result-footer, html[data-theme="dark"] .site-footer { color: #aebdca; }
html[data-theme="dark"] .draw-display-settings { color: #bdcad4; }
html[data-theme="dark"] .draw-display-settings .draw-ad-setting { border-color: #405360; }
html[data-theme="dark"] .history-equation-op { color: #a8bac9; }
html[data-theme="dark"] .history-equation .history-equation-sum { color: #fff; }
html[data-theme="dark"] .reference-table .period-cell { color: #d8e5ef; }
html[data-theme="dark"] .history-color-toggle { color: #c3e2ff; background: #25425e; border-color: #3d668b; }
html[data-theme="dark"] .history-color-toggle:hover, html[data-theme="dark"] .history-color-toggle:focus-visible { color: #fff; background: #2d72bd; }
html[data-theme="dark"] .reference-table .history-location-middle, html[data-theme="dark"] .reference-table .history-tag-neutral, html[data-theme="dark"] .reference-table .history-chip-neutral { color: #b8c7d3; background: #263744; }
html[data-theme="dark"] .history-muted-value { color: #b8c7d3; }
html[data-theme="dark"] .hist-panel-modes button:not(.active), html[data-theme="dark"] .history-search input::placeholder { color: #b7c6d2; }
html[data-theme="dark"] .history-pager:disabled, html[data-theme="dark"] .history-page-number:disabled { color: #8fa2b1; background: #1a2934; }
html[data-theme="dark"] .keno-numbers i { color: #d8e5ef; background: #263744; }
html[data-theme="dark"] .history-pagination, html[data-theme="dark"] .history-page-jump label { color: #b8c7d3; }
html[data-theme="dark"] .insight-heading p, html[data-theme="dark"] .insight-card p, html[data-theme="dark"] .insight-subnote, html[data-theme="dark"] .insight-note, html[data-theme="dark"] .insight-kpis span, html[data-theme="dark"] .insight-kpis small, html[data-theme="dark"] .cycle-row, html[data-theme="dark"] .dragon-card span { color: #aebdca; }
html[data-theme="dark"] .insight-tabs button, html[data-theme="dark"] .omission-tabs button, html[data-theme="dark"] .distribution-row, html[data-theme="dark"] .frequency-item > span { color: #b7c5cf; }
html[data-theme="dark"] .trend-line line { stroke: #536674; }
html[data-theme="dark"] .countdown-bar { background: #344652; }
html[data-theme="dark"] .public-info-card > span { color: #aebdca; }
html[data-theme="dark"] .mobile-bottom-nav { background: rgba(23, 35, 45, .97); border-color: #2b3a47; }
html[data-theme="dark"] .mobile-bottom-nav button { color: #9eafbb; }
html[data-theme="dark"] .mobile-bottom-nav button.active { color: #7ab8ff; }
html[data-theme="dark"] .back-to-top { color: #c3e2ff; background: #25425e; border-color: #3d668b; }
html[data-theme="dark"] .back-to-top:hover, html[data-theme="dark"] .back-to-top:focus-visible { color: #fff; background: var(--public-primary); }
html[data-theme="dark"] .public-topbar .public-nav .mobile-tool-nav, html[data-theme="dark"] .public-topbar .public-nav .mobile-api-nav { color: #d8e5ef; background: #1d2b36; border-color: #344652; }
html[data-theme="dark"] .theme-button { color: #d8e5ef; background: #1d2b36; border-color: #344652; }
html[data-theme="dark"] .insight-tabs button:hover, html[data-theme="dark"] .omission-tabs button:hover, html[data-theme="dark"] .hist-panel-modes button:hover { background: #263744; }
html[data-theme="dark"] .insight-tabs button.active, html[data-theme="dark"] .omission-tabs button.active, html[data-theme="dark"] .hist-panel-modes button.active { color: #fff; background: var(--public-primary); }
html[data-theme="dark"] .combo-rank b, html[data-theme="dark"] .frequency-item > b, html[data-theme="dark"] .omission-group h3, html[data-theme="dark"] .omission-positions h3, html[data-theme="dark"] .cycle-row b { color: #e2ebf2; }
html[data-theme="dark"] .omission-cell span { color: #b2c0cb; }

html[data-theme="dark"] .admin-shell { --canvas: #101820; --surface: #17232d; --surface-soft: #1c2b36; --ink: #e7f0f5; --ink-soft: #b8c7d3; --muted: #94a5b4; --line: #2b3a47; --line-strong: #405360; background: #101820; color: #e7f0f5; }
html[data-theme="dark"] .admin-topbar, html[data-theme="dark"] .metric-card, html[data-theme="dark"] .admin-panel { background: #17232d; border-color: #2b3a47; }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea { color: #e7f0f5; background: #1c2b36; border-color: #405360; }
html[data-theme="dark"] .admin-table th, html[data-theme="dark"] .segmented, html[data-theme="dark"] .device-card { background: #1c2b36; border-color: #344652; }
html[data-theme="dark"] .admin-table td { border-color: #2b3a47; }
html[data-theme="dark"] .preview-panel { background: #1c3034; border-color: #385257; }

@media (max-width: 820px) {
  .public-main { padding: 10px 12px 35px; }
  .public-nav { display: none; }
  .public-topbar { padding: 0 12px; }
  .public-search { display: none; }
  .public-login { display: none; }
  .public-actions .public-admin-link { display: inline-flex; }
  .draw-banner-panels { grid-template-columns: 1fr; }
  .countdown-wrapper, .draw-result-panel { min-height: 185px; }
  .countdown-face strong { font-size: 34px; }
  .hist-panel-toolbar { align-items: flex-start; flex-direction: column; }
  .history-toolbar-right { width: 100%; }
  .history-search { flex: 1; width: auto; }
  .public-bottom-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .frequency-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omission-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .public-main { width: 100%; max-width: 100%; }
  .admin-content { width: 100%; }
}
@media (max-width: 540px) {
  .brand-copy .brand-domain { display: none; }
  .public-topbar .brand-name { max-width: 150px; font-size: 14px; }
  .draw-result-panel { padding: 12px 10px; }
  .draw-result-header h2 { font-size: 14px; }
  .draw-result-header h2 span { display: none; }
  .draw-result-actions { gap: 4px; }
  .result-setting-button { width: 30px; padding: 0; justify-content: center; font-size: 0; }
  .result-setting-button .icon { width: 14px; height: 14px; }
  .result-mipai-button { padding: 0 7px; font-size: 10px; }
  .scratch-label { bottom: 7px; font-size: 8px; }
  .draw-result-footer { font-size: 10px; }
  .site-footer { gap: 5px; }
  .insight-panel { padding: 12px; }
  .insight-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omission-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .draw-result-actions .result-setting-button[data-action="toggle-voice"] { width: 30px; padding: 0; justify-content: center; font-size: 0; }
}

.mobile-result-history { display: none; }
.mobile-bottom-nav { display: none; }
.draw-result-cell { border-radius: 18%; }
.draw-result-cell.draw-result-sum { border-radius: 18%; }
.draw-pattern-cell { font-size: clamp(18px, 4.2cqw, 32px); }
.draw-pattern-cell.trait-对子 { color: #fff; background: #ef6c00; }
.draw-pattern-cell.trait-杂六 { color: #fff; background: #2e7d32; }
.draw-pattern-cell.trait-顺子 { color: #fff; background: #8e24aa; }
.draw-pattern-cell.trait-豹子 { color: #fff; background: #e53935; }
.reference-table .history-tag.large, .reference-table .history-tag.even { color: #fff; background: #e53935; }
.reference-table .history-tag.small, .reference-table .history-tag.odd { color: #fff; background: #1e88e5; }
.history-covered-cell { padding: 0 12px !important; color: #f4f5f6 !important; background: #4a4a4a !important; font-size: 12px !important; font-weight: 650; text-align: center; }
.countdown-wrapper.is-expiring { border-color: #e5a3a3; box-shadow: 0 2px 8px rgba(204, 74, 74, .09); }
.countdown-wrapper.is-expiring .countdown-heading, .countdown-wrapper.is-expiring .countdown-face strong { color: #c75252; }
.countdown-wrapper.is-expiring .countdown-heading .icon { color: #c75252; }
.countdown-wrapper.is-drawing { border-color: #e5a3a3; background: linear-gradient(105deg, #fff 0%, #fff6f3 48%, #fff 100%); background-size: 220% 100%; animation: drawing-sheen 2.4s ease-in-out infinite; }
.countdown-wrapper.is-drawing .countdown-face strong { color: #ce4d42; animation: drawing-pulse 1.1s ease-in-out infinite; }
.countdown-wrapper.is-drawing .countdown-bar span { background: #ce4d42; animation: drawing-pulse 1.1s ease-in-out infinite; }
.countdown-wrapper.is-maintenance { border-color: #e9c879; background: #fff8e9; box-shadow: 0 2px 8px rgba(164, 105, 31, .12); }
.countdown-wrapper.is-maintenance .countdown-heading, .countdown-wrapper.is-maintenance .countdown-heading .icon { color: #9b611c; }
.countdown-wrapper.is-maintenance .countdown-face strong { color: #b45d12; animation: none; }
.countdown-wrapper.is-maintenance .countdown-face strong span, .countdown-wrapper.is-maintenance .countdown-meta { color: #986934; }
.countdown-wrapper.is-maintenance .countdown-meta { gap: 5px; flex-wrap: wrap; }
.countdown-wrapper.is-maintenance .countdown-bar { background: #f0e2c8; }
.countdown-wrapper.is-maintenance .countdown-bar span { background: #2d72bd; animation: none; }
html[data-theme="dark"] .countdown-wrapper.is-maintenance { border-color: #8a622e; background: #30291f; }
html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-heading, html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-heading .icon, html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-face strong { color: #f4b866; }
html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-face strong span, html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-meta { color: #dec499; }
html[data-theme="dark"] .countdown-wrapper.is-maintenance .countdown-bar { background: #554632; }
html[data-theme="dark"] .source-status.maintenance { color: #f1bb73; }
html[data-theme="dark"] .insight-source-maintenance { color: #f4c27b; background: #4a3524; }
.draw-result-panel.is-fresh .scratch-surface { animation: result-arrive .9s ease-out both; }
@keyframes drawing-sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes drawing-pulse { 50% { opacity: .58; } }
@keyframes result-arrive { from { opacity: .55; box-shadow: 0 0 0 0 rgba(45, 114, 189, .22); } 55% { box-shadow: 0 0 0 6px rgba(45, 114, 189, .09); } to { opacity: 1; box-shadow: 0 0 0 0 rgba(45, 114, 189, 0); } }

@media (max-width: 600px) {
  body { background: #f5f7fa; }
  .public-topbar { height: 60px; padding: 0 10px; gap: 5px; }
  .public-topbar .brand-lockup { gap: 6px; }
  .public-topbar .brand-mark { width: 32px; height: 32px; }
  .public-topbar .brand-name { max-width: calc(100vw - 112px); font-size: 13px; }
  .public-topbar .public-nav { display: none; }
  .public-topbar .public-nav > * { display: none; }
  .public-topbar .public-nav .mobile-tool-nav, .public-topbar .public-nav .mobile-api-nav { display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 5px; background: #fff; border: 1px solid var(--public-border); border-radius: 7px; color: #536779; font-size: 10px; white-space: nowrap; }
  .public-topbar .public-nav .icon { width: 12px; height: 12px; }
  .public-actions { gap: 0; }
  .public-actions .theme-button { width: 34px; height: 34px; }
  .public-actions .public-admin-link { display: none; }
  .public-main { width: 100%; padding: 10px 12px calc(82px + env(safe-area-inset-bottom)); }
  .ad-banner-list { gap: 7px; }
  .draw-banner-panels { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .countdown-wrapper { width: 100%; min-height: 100px; align-self: stretch; padding: 11px 12px 9px; gap: 5px; border-radius: 12px; }
  .countdown-face { justify-content: center; }
  .countdown-face strong { font-size: 31px; }
  .countdown-meta { font-size: 10px; }
  .draw-result-panel { min-height: 0; padding: 11px; gap: 6px; border-radius: 12px; }
  .draw-result-header { flex-direction: row; align-items: center; justify-content: space-between; min-height: 34px; gap: 4px; }
  .draw-result-header h2 { width: auto; flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 3px; padding-top: 0; font-size: 12px; }
  .draw-result-header h2 strong { margin-left: 0; }
  .draw-result-header h2 span { display: none; }
  .draw-result-actions { flex: 0 0 auto; gap: 4px; }
  .draw-result-actions .result-setting-button, .draw-result-actions .result-mipai-button { height: 34px; }
  .draw-result-actions .result-setting-button { width: 34px; padding: 0; justify-content: center; font-size: 0; }
  .draw-result-actions .result-mipai-button { width: 34px; padding: 0; justify-content: center; font-size: 0; }
  .draw-result-actions .icon { width: 14px; height: 14px; }
  .draw-scratch-host { padding: 3px 0 0; }
  .scratch-surface { --result-tile: min(62px, 11.5cqw); --result-gap: clamp(1px, .4cqw, 3px); width: 100%; min-width: 0; min-height: 0; flex-wrap: nowrap; padding: 15px 4px; border-radius: 11px; gap: clamp(2px, .7cqw, 4px); }
  .draw-result-strip, .draw-result-classification { flex: 0 0 auto; }
  .draw-result-strip { flex-wrap: nowrap; }
  .draw-result-cell { font-size: clamp(17px, 7.3cqw, 34px); }
  .draw-result-type { font-size: clamp(17px, 7cqw, 32px); }
  .draw-pattern-cell { font-size: clamp(16px, 6.7cqw, 29px); }
  .draw-result-op { width: clamp(7px, 2.8cqw, 18px); font-size: clamp(12px, 4.2cqw, 21px); }
  .draw-result-op.draw-result-eq { margin-left: 0; }
  .draw-result-type { border-radius: 18%; }
  .draw-result-traits { gap: 3px; }
  .result-trait { padding: 3px 5px; font-size: 9px; }
  .draw-result-footer { flex-wrap: wrap; gap: 4px 8px; font-size: 10px; }
  .draw-result-header h2 { font-weight: 750; }
  .draw-result-header h2 strong { font-size: 13px; }
  .hist-panel { margin-top: 10px; border-radius: 12px; }
  .hist-panel-toolbar { flex-direction: column; align-items: stretch; padding: 10px 9px; gap: 6px; }
  .hist-panel-modes { width: auto; gap: 3px; }
  .hist-panel-modes button { flex: 0 0 auto; min-height: 32px; padding: 0 8px; font-size: 11px; }
  .history-toolbar-right { width: 100%; min-width: 0; gap: 4px; }
  .history-search { flex: 1; width: auto; min-width: 0; height: 32px; }
  .history-color-toggle { height: 32px; padding: 0 6px; font-size: 10px; }
  .history-pager { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 32px; padding: 0; font-size: 0; }
  .history-pager[data-history-page-step="-1"]::before { content: "‹"; font-size: 18px; }
  .history-pager[data-history-page-step="1"]::before { content: "›"; font-size: 18px; }
  .history-pagination { justify-content: center; padding: 10px 8px 12px; font-size: 11px; }
  .history-page-summary { width: 100%; text-align: center; }
  .history-page-jump { width: 100%; justify-content: center; }
  .desktop-result-history { display: none; }
  .mobile-result-history { display: block; overflow: hidden; }
  .mobile-result-history .reference-table { width: 100%; min-width: 0 !important; table-layout: fixed; }
  .mobile-result-history .reference-table th, .mobile-result-history .reference-table td { padding: 9px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-result-history .reference-table th { font-size: 10px; }
  .mobile-result-history .reference-table td { font-size: 11px; }
  .mobile-result-history .reference-table th:nth-child(1), .mobile-result-history .reference-table td:nth-child(1) { width: 19%; }
  .mobile-result-history .reference-table th:nth-child(2), .mobile-result-history .reference-table td:nth-child(2) { width: 15%; }
  .mobile-result-history .reference-table th:nth-child(3), .mobile-result-history .reference-table td:nth-child(3) { width: 33%; }
  .mobile-result-history .reference-table th:nth-child(4), .mobile-result-history .reference-table td:nth-child(4) { width: 19%; }
  .mobile-result-history .reference-table th:nth-child(5), .mobile-result-history .reference-table td:nth-child(5) { width: 14%; overflow: visible; }
  .mobile-result-history .period-cell { font-size: 10px; }
  .mobile-result-history .reference-table td:nth-child(2) { font-size: 9px; }
  .mobile-result-history .history-equation { gap: 1px; }
  .mobile-result-history .history-equation-digit { min-width: 16px; height: 20px; padding: 0 1px; font-size: 10px; }
  .mobile-result-history .history-equation .history-equation-sum { min-width: 19px; height: 20px; padding: 0 1px; font-size: 10px; }
  .mobile-result-history .history-equation-op { font-size: 9px; }
  .mobile-result-history .history-combination { overflow: visible; }
  .mobile-result-history .history-tag { padding: 4px 5px; font-size: 10px; }
  .mobile-result-history .history-combination .history-tag + .history-tag { margin-left: 2px; }
  .mobile-result-history .history-soft-tag { min-width: 0; padding: 4px 5px; font-size: 10px; }
  .mobile-result-history .result-trait { padding: 4px 5px; font-size: 10px; }
  .mobile-result-history .history-covered-cell { padding: 0 7px !important; font-size: 11px !important; }
.insight-panel, .public-bottom-grid, .site-footer { margin-bottom: 0; }
}

/* Operations console */
.admin-shell {
  grid-template-columns: 250px minmax(0, 1fr);
  --canvas: #f2f5fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fe;
  --ink: #17233c;
  --ink-soft: #425370;
  --muted: #71809a;
  --line: #e2e8f2;
  --line-strong: #cbd5e5;
  --brand: #4f46e5;
  --brand-deep: #3730a3;
  --brand-soft: #eef0ff;
  --success: #0c8a70;
  --success-soft: #e7f7f2;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
}
.admin-sidebar { background: #111c36; color: #eef2ff; padding: 30px 17px 22px; }
.admin-brand { padding: 1px 10px 14px; gap: 12px; }
.admin-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #6157ea; }
.admin-brand .brand-name { color: #f7f8ff; font-size: 16px; letter-spacing: -.025em; }
.admin-brand .brand-domain { margin-top: 4px; color: #9eafd2; font-size: 9px; letter-spacing: .12em; }
.admin-sidebar-caption { margin: 1px 10px 24px; color: #9eafd2; font-size: 11px; }
.admin-nav-label { padding: 14px 12px 9px; color: #7890bc; font-size: 10px; letter-spacing: .13em; }
.admin-nav { gap: 4px; margin-bottom: 14px; }
.admin-nav button { gap: 13px; padding: 12px 13px; border-radius: 10px; color: #b5c2de; font-size: 13px; font-weight: 600; }
.admin-nav button .icon { width: 18px; height: 18px; }
.admin-nav button:hover { background: #233252; color: #fff; }
.admin-nav button.active { background: #5148d8; color: #fff; box-shadow: 0 8px 22px rgba(45, 38, 163, .22); }
.admin-sidebar-bottom { border-top-color: #2a3a5b; padding-top: 19px; }
.admin-side-health { display: flex; align-items: flex-start; gap: 12px; padding: 0 4px 18px; color: #9eafd2; font-size: 10px; line-height: 1.55; }
.admin-side-health strong { color: #f1f4ff; font-size: 12px; font-weight: 650; }
.admin-logout { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 5px; border: 0; color: #b5c2de; background: transparent; font-size: 12px; text-align: left; }
.admin-logout:hover { color: #fff; }
.admin-logout .icon { width: 17px; height: 17px; }
.admin-main { background: radial-gradient(circle at 88% 2%, #e6ebff 0, transparent 26%), var(--canvas); }
.admin-topbar { height: 86px; padding: 0 clamp(20px,3.2vw,50px); background: #fff; border-color: var(--line); }
.admin-topbar-kicker, .admin-section-kicker { display: block; margin-bottom: 5px; color: #5148d8; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.admin-topbar h1 { font-size: 21px; font-weight: 780; letter-spacing: -.035em; }
.admin-topbar p { margin-top: 3px; font-size: 11px; }
.admin-topbar-actions { gap: 13px; }
.admin-live-pill { padding: 7px 10px; border-radius: 99px; color: #815c16; background: #fff4da; font-size: 10px; font-weight: 750; white-space: nowrap; }
.admin-live-pill.is-live { color: #087861; background: #e6f7f1; }
.admin-live-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.admin-avatar { width: 36px; height: 36px; color: #fff; background: #344a87; font-size: 11px; }
.admin-content { padding: 32px clamp(20px,3.2vw,50px) 58px; }
.content-title-row h2 { color: var(--ink); font-size: 26px; font-weight: 780; }
.content-title-row p { color: var(--muted); font-size: 12px; }
.admin-panel, .metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 35px rgba(27,42,80,.045); }
.admin-panel-header { padding: 19px 21px; }
.admin-panel-header h3 { color: var(--ink); font-size: 14px; font-weight: 760; }
.metric-card { min-height: 139px; padding: 20px; }
.metric-head { color: #687996; font-size: 12px; font-weight: 650; }
.metric-icon { width: 33px; height: 33px; color: #5048d7; background: #eef0ff; border-radius: 10px; }
.metric-value { margin-top: 16px; color: var(--ink); font-size: 29px; font-weight: 800; }
.metric-foot { color: #8190a8; }
.trend-neutral { color: #5148d8; }
.admin-table th { color: #64748f; background: #f6f8fd; font-size: 11px; }
.admin-table td { color: var(--ink-soft); border-color: var(--line); }
.admin-table tbody tr:hover { background: #f9faff; }
.segmented { background: #edf1f9; border-color: #dbe3f1; }
.segmented button.active { color: #3730a3; background: #fff; }
.field input, .field select, .field textarea { color: var(--ink); background: #fff; }
.preview-panel { background: #f1f3ff; border-color: #dce2fc; }
.analytics-channel-list { display: grid; gap: 12px; padding: 23px; }
.analytics-channel-list > div { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); font-size: 12px; }
.analytics-channel-list strong { color: var(--brand); font-size: 13px; }
.analytics-chart-empty { display: grid; place-items: center; min-height: 226px; color: var(--muted); font-size: 12px; }
.analytics-detail-panel { margin-top: 18px; }
.analytics-detail-table { min-width: 1030px; }
.analytics-detail-table td { padding-top: 13px; padding-bottom: 13px; white-space: nowrap; }
.analytics-ip { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11px !important; font-weight: 700; }
.analytics-pv { display: inline-flex; padding: 5px 9px; color: var(--brand-deep); background: var(--brand-soft); border-radius: 6px; font-weight: 750; }
.analytics-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.analytics-pagination > div { display: flex; gap: 8px; }
.analytics-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.admin-login-page { background: radial-gradient(circle at 20% 16%, #304a8f, transparent 35%), radial-gradient(circle at 90% 92%, #3d368e, transparent 35%), #101a33; }
.admin-login-card { width: min(100%, 430px); padding: 39px; border: 1px solid rgba(255,255,255,.14); border-radius: 20px; color: #f6f8ff; background: #192747; box-shadow: 0 30px 80px rgba(9,17,40,.28); }
.admin-login-brand { margin-bottom: 16px; font-size: 13px; }
.admin-login-kicker { color: #aaa8ff; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.admin-login-card h1 { color: #fff; font-size: 28px; }
.admin-login-card p { color: #bac8e4; font-size: 12px; }
.admin-login-card label { color: #e2e9f9; font-size: 11px; }
.admin-login-card input { height: 46px; border-color: #53678e; color: #fff; background: #26375c; }
.admin-login-card a { color: #b7c5ee; }
.admin-login-card .button-primary { height: 45px; margin-top: 6px; color: #fff; background: #5148d8; border-color: #5148d8; }
html[data-theme="dark"] .admin-shell { --canvas: #0e1729; --surface: #18243b; --surface-soft: #20304b; --ink: #f1f5ff; --ink-soft: #c9d5e9; --muted: #9fb0cc; --line: #2c3d59; --line-strong: #405474; --brand: #948dff; --brand-deep: #b4aeff; --brand-soft: #2b315e; background: var(--canvas); color: var(--ink); }
html[data-theme="dark"] .admin-main { background: #0e1729; }
html[data-theme="dark"] .admin-topbar, html[data-theme="dark"] .admin-panel, html[data-theme="dark"] .metric-card { background: #18243b; border-color: #2c3d59; }
html[data-theme="dark"] .admin-table th, html[data-theme="dark"] .analytics-channel-list > div { background: #20304b; border-color: #2c3d59; color: #d0dcf0; }
html[data-theme="dark"] .admin-table td, html[data-theme="dark"] .metric-value, html[data-theme="dark"] .admin-panel-header h3, html[data-theme="dark"] .content-title-row h2 { color: #f1f5ff; }
html[data-theme="dark"] .admin-table tbody tr:hover { background: #20304b; }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea { background: #20304b; color: #f1f5ff; border-color: #405474; }
html[data-theme="dark"] .preview-panel { background: #202a4c; border-color: #394671; }
.admin-shell .button-primary { color: #fff; background: #5148d8; border-color: #5148d8; box-shadow: 0 6px 15px rgba(71, 61, 201, .16); }
.admin-shell .button-primary:hover { background: #4036b8; }
.admin-shell .button-secondary { color: var(--ink-soft); background: var(--surface); border-color: var(--line-strong); }
.admin-shell .button-secondary:hover { color: var(--brand); background: var(--brand-soft); }
.admin-shell .tg-preview-content { background: #1a2a4e; color: #f4f6ff; }
.admin-shell .tg-preview-content blockquote, .admin-shell .tg-preview-emoji { border-color: #aaa8ff; }
.admin-shell .tg-preview-content code { background: #2e4072; }
.admin-shell .tg-template-toolbar button { color: var(--ink-soft); background: var(--surface-soft); border-color: var(--line-strong); }
.admin-shell .field input:focus, .admin-shell .field select:focus, .admin-shell .field textarea:focus { box-shadow: 0 0 0 3px rgba(81, 72, 216, .15); }
.admin-shell .domain-note { color: var(--ink-soft); background: var(--surface); border-color: var(--line); }
.admin-shell .switch { width: 42px; height: 24px; display: block; flex: 0 0 42px; cursor: pointer; }
.admin-shell .switch input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.admin-shell .switch-track::after { width: 18px; height: 18px; }
.admin-shell .switch input:checked + .switch-track::after { transform: translateX(18px); }
.admin-shell .switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.telegram-bot-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 18px; }
.telegram-bot-card { min-width: 0; display: grid; gap: 9px; padding: 14px 15px; text-align: left; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.telegram-bot-card.active { color: var(--brand-deep); border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 5px 16px rgba(71, 61, 201, .09); }
.telegram-bot-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.telegram-bot-card-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.telegram-bot-card-top i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #aab7cb; }
.telegram-bot-card-top i.on { background: #12a27f; }
.telegram-bot-card small { color: var(--muted); font-size: 10px; }
.panel-heading-line { display: flex; justify-content: space-between; align-items: start; gap: 14px; }
.panel-heading-line .form-intro { margin-bottom: 20px; }
.telegram-toggle-line { min-width: 0; padding: 16px 0 6px; border-top: 1px solid var(--line); }
.telegram-toggle-line .toggle-copy { min-width: 0; flex: 1; }
.telegram-toggle-line .toggle-copy strong { color: var(--ink); font-size: 13px; }
.telegram-toggle-line .toggle-copy span { color: var(--muted); line-height: 1.45; }
.admin-shell .field .tg-group-list { padding: 8px; background: var(--surface-soft); border-color: var(--line); }
.admin-shell .field .tg-group-list .tg-group-option { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; margin: 0; padding: 9px 10px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.admin-shell .field .tg-group-list input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; padding: 0; border: 0; accent-color: #5148d8; }
.tg-group-main { min-width: 0; display: grid; gap: 3px; flex: 1; }
.tg-group-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tg-group-main small { color: var(--muted); font-size: 10px; }
.tg-group-state { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border-radius: 99px; color: #7d5260; background: #faeaf0; font-size: 10px; font-style: normal; }
.tg-group-state.is-on { color: #087861; background: #e6f7f1; }
.telegram-command-note { display: grid; gap: 6px; margin-top: 18px; padding: 15px; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.tg-ad-button-preview { display: grid; justify-items: stretch; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.tg-ad-button-preview small { font-size: 10px; }
.tg-ad-button-sample { display: block; padding: 8px 12px; color: var(--brand-deep); background: var(--brand-soft); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; font-weight: 700; }
.tg-ad-settings { border: 1px solid var(--line); border-radius: 7px; }
.tg-ad-settings summary { padding: 12px; cursor: pointer; font-weight: 700; }
.tg-ad-settings summary span { color: var(--muted); font-size: 11px; font-weight: 400; }
.tg-ad-settings-body { display: grid; gap: 11px; padding: 0 12px 12px; }
.tg-ad-settings-body select { max-width: 160px; }
.tg-ad-button-row { display: grid; gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); }
.tg-ad-button-row strong { font-size: 12px; }
.tg-ad-button-row .button { justify-self: start; }
.tg-ad-button-grid { display: grid; gap: 5px; width: 100%; }
.tg-ad-button-grid .tg-ad-button-sample { min-width: 0; overflow-wrap: anywhere; }
.telegram-command-note strong { color: var(--ink); }
.telegram-command-note small { color: var(--muted); line-height: 1.5; }
.tg-streak-settings { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 13px; max-width: 950px; }
.tg-streak-settings h3 { margin: 0; font-size: 16px; }
.tg-streak-settings p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.tg-streak-settings .field { min-width: 0; }
.tg-streak-settings textarea { min-height: 120px; }
.tg-streak-settings .tg-preview-content { margin: 0; }
.auto-bet-section { max-width: 1100px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.auto-bet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.auto-bet-heading h3 { margin: 0; font-size: 15px; }
.auto-bet-status { padding: 5px 9px; border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.auto-bet-status.is-connected { color: #0f7355; background: #e2f4ec; }
.auto-bet-error { color: #a3314c; font-size: 12px; }
.auto-bet-account-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-bet-account-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 1px 0 12px; scrollbar-width: thin; }
.auto-bet-account-tab { display: grid; gap: 3px; flex: 0 0 auto; min-width: 140px; max-width: 220px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); background: var(--surface); text-align: left; cursor: pointer; }
.auto-bet-account-tab.active { border-color: #286eae; color: #185988; background: #eaf3fb; }
.auto-bet-account-tab strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.auto-bet-account-tab small { color: var(--muted); font-size: 11px; }
.auto-bet-summaries { display: grid; gap: 0; }
.auto-bet-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 68px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.auto-bet-summary-name { display: grid; gap: 5px; min-width: 130px; }
.auto-bet-summary-name strong { font-size: 13px; }
.auto-bet-summary-issue { max-width: 280px; color: #a3314c; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.auto-bet-summary-issue[hidden] { display: none; }
.auto-bet-run-state { color: var(--muted); font-size: 11px; }
.auto-bet-run-state.is-on { color: #0f7355; }
.auto-bet-summary-metrics { display: grid; grid-template-columns: repeat(3, minmax(105px, 1fr)); gap: 12px; width: min(100%, 550px); }
.auto-bet-summary-metrics span { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.auto-bet-summary-metrics strong { color: var(--ink); font-size: 13px; font-weight: 700; }
.auto-bet-summary-metrics strong.is-profit { color: #0f7355; }
.auto-bet-summary-metrics strong.is-loss { color: #a3314c; }
.auto-bet-login-action { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.auto-bet-login-action .button { min-height: 39px; }
.auto-bet-dialog { width: min(520px, calc(100vw - 28px)); max-height: min(680px, calc(100dvh - 28px)); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: 0 18px 60px rgba(19, 35, 52, .22); overflow: auto; }
.auto-bet-dialog::backdrop { background: rgba(19, 35, 52, .48); }
.auto-bet-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.auto-bet-dialog-head h3 { margin: 0; font-size: 16px; }
.auto-bet-dialog-close { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.auto-bet-dialog-close:hover { background: var(--surface-soft); }
.auto-bet-dialog-body { padding: 18px 20px 20px; }
.auto-bet-dialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auto-bet-dialog .field { min-width: 0; }
.auto-bet-dialog .field input { width: 100%; }
.auto-bet-dialog-status { min-height: 20px; margin: 16px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.auto-bet-dialog-status.is-error { color: #a3314c; }
.auto-bet-dialog [hidden] { display: none !important; }
.auto-bet-inline { display: flex; align-items: center; gap: 7px; }
.auto-bet-inline input { max-width: 125px; }
.auto-bet-inline span { color: var(--muted); font-size: 12px; }
.auto-bet-toggles { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0; }
.auto-bet-check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.auto-bet-check input { width: 16px; height: 16px; accent-color: #286eae; }
.auto-bet-group-picker { display: flex; gap: 8px; margin: 12px 0 16px; }
.auto-bet-group-picker select { min-width: 0; flex: 1; max-width: 420px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); }
.auto-bet-groups { display: grid; gap: 10px; }
.auto-bet-group { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.auto-bet-group summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; list-style-position: inside; }
.auto-bet-group summary strong { font-size: 12px; }
.auto-bet-group summary span { color: var(--muted); font-size: 12px; text-align: right; }
.auto-bet-group-body { display: grid; gap: 14px; padding: 12px 14px 17px; border-top: 1px solid var(--line); }
.auto-bet-row-head, .auto-bet-rule-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-bet-row-head > div { display: flex; gap: 8px; }
.auto-bet-rules { display: grid; gap: 10px; }
.auto-bet-rule-heading strong { font-size: 12px; }
.auto-bet-rule { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.auto-bet-rule label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.auto-bet-rule input { width: 85px; height: 34px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--surface); }
.auto-bet-log { display: grid; gap: 0; }
.auto-bet-log > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.auto-bet-log strong { color: var(--ink-soft); font-weight: 650; }
.auto-bet-log small { width: 100%; color: #a3314c; }
.auto-bet-empty { color: var(--muted); font-size: 12px; }
@media (max-width: 600px) {
  .auto-bet-summary-row { align-items: stretch; flex-direction: column; }
  .auto-bet-summary-metrics { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auto-bet-summary-metrics strong { overflow-wrap: anywhere; }
  .auto-bet-heading, .auto-bet-group-picker { align-items: stretch; flex-direction: column; }
  .auto-bet-row-head { align-items: flex-start; flex-direction: column; }
  .auto-bet-row-head > div { flex-wrap: wrap; }
  .auto-bet-group summary { align-items: flex-start; flex-direction: column; }
  .auto-bet-dialog .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.insight-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.insight-window-picker { display: inline-flex; gap: 3px; padding: 3px; background: #eef3fa; border: 1px solid #dbe4f0; border-radius: 8px; }
.insight-window-picker button { min-height: 28px; padding: 0 10px; color: #566c86; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 750; white-space: nowrap; }
.insight-window-picker button.active { color: #fff; background: #286eae; box-shadow: 0 2px 6px rgba(34, 97, 156, .18); }
html[data-theme="dark"] .insight-window-picker { background: #243649; border-color: #3b536a; }
html[data-theme="dark"] .insight-window-picker button { color: #c4d4e5; }
html[data-theme="dark"] .insight-window-picker button.active { color: #fff; background: #367dbe; }
html[data-theme="dark"] .admin-shell .button-secondary { background: #20304b; color: #d8e2f4; border-color: #405474; }
html[data-theme="dark"] .admin-shell .tg-group-state { color: #f0bcc8; background: #53344a; }
html[data-theme="dark"] .admin-shell .tg-group-state.is-on { color: #9fe7ca; background: #1c564a; }
@media (max-width: 600px) {
  .insight-heading { flex-direction: column; }
  .insight-heading-actions { width: 100%; justify-content: space-between; }
  .telegram-bot-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .telegram-toggle-line { gap: 12px; }
  .tg-group-state { max-width: 35%; }
}
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar { padding: 13px 14px 8px; }
  .admin-brand { padding: 0 3px; }
  .admin-sidebar-caption, .admin-nav-label, .admin-sidebar-bottom { display: none; }
  .admin-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 5px; margin: 8px 0 0; padding-bottom: 3px; scrollbar-width: none; }
  .admin-nav button { width: auto; flex: 0 0 auto; padding: 8px 11px; white-space: nowrap; font-size: 11px; }
  .admin-nav button .icon { width: 14px; height: 14px; }
  .admin-topbar { height: 75px; padding: 0 18px; }
  .admin-content { padding: 25px 18px 44px; }
  .admin-live-pill { display: none; }
}
@media (max-width: 540px) {
  .analytics-pagination { flex-direction: column; align-items: flex-start; }
  .admin-login-card { padding: 28px; }
  .admin-topbar h1 { font-size: 18px; }
}
@media (max-width: 600px) {
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--public-border); box-shadow: 0 -3px 12px rgba(29, 53, 78, .06); backdrop-filter: blur(15px); }
  .mobile-bottom-nav button { display: grid; justify-items: center; gap: 3px; padding: 2px 0; color: #7e8b99; background: transparent; border: 0; font-size: 10px; }
  .mobile-bottom-nav button .icon { width: 20px; height: 20px; }
  .mobile-bottom-nav button.active { color: var(--public-primary); }
  .back-to-top { right: 14px; bottom: calc(74px + env(safe-area-inset-bottom)); }
  .public-shell { font-size: 15px; }
  .history-page-jump label, .history-page-summary { font-size: 11px; }
}

@media (max-width: 820px) {
  .scratch-surface { flex-wrap: nowrap; }
  .draw-result-traits { display: none; }
}

@media (max-width: 350px) {
  .public-topbar .public-nav .mobile-api-nav { display: none; }
  .public-topbar .brand-name { max-width: calc(100vw - 112px); }
}

@media (max-width: 380px) {
  .public-main { padding-right: 8px; padding-left: 8px; }
  .draw-result-panel { padding-right: 7px; padding-left: 7px; }
  .draw-result-actions .result-mipai-button { padding-right: 6px; padding-left: 6px; }
  .draw-result-header h2 { font-size: 11px; }
  .draw-result-header h2 strong { font-size: 12px; }
  .draw-result-actions .result-setting-button, .draw-result-actions .result-mipai-button { width: 31px; height: 31px; }
}

.countdown-wrapper.is-renewed { border-color: #57c98c; animation: countdown-renewed 2.6s ease-out both; }
.countdown-wrapper.is-renewed .countdown-heading, .countdown-wrapper.is-renewed .countdown-face strong { color: #168456; }
.countdown-wrapper.is-renewed .countdown-heading .icon { color: #168456; }
.countdown-wrapper.is-renewed .countdown-bar span { background: #22aa70; }
@keyframes countdown-renewed {
  0% { background: #d8f9e9; box-shadow: 0 0 0 0 rgba(45, 180, 110, .26); }
  35% { background: #effcf5; box-shadow: 0 0 0 7px rgba(45, 180, 110, .10); }
  100% { background: var(--surface); box-shadow: 0 2px 7px rgba(29, 53, 78, .035); }
}
html[data-theme="dark"] .countdown-wrapper.is-renewed { animation-name: countdown-renewed-dark; }
html[data-theme="dark"] .countdown-wrapper.is-renewed .countdown-heading, html[data-theme="dark"] .countdown-wrapper.is-renewed .countdown-face strong { color: #79e4aa; }
@keyframes countdown-renewed-dark {
  0% { background: #174b37; box-shadow: 0 0 0 0 rgba(80, 218, 142, .3); }
  35% { background: #1b3a31; box-shadow: 0 0 0 7px rgba(80, 218, 142, .1); }
  100% { background: #17232d; box-shadow: 0 2px 7px rgba(0, 0, 0, .12); }
}

.keno-guide { margin: 14px; padding: 15px 17px; color: #40556c; background: #edf5fd; border: 1px solid #d7e8f8; border-radius: 10px; }
.keno-guide-title { display: flex; align-items: center; gap: 7px; color: #27639b; font-size: 15px; font-weight: 750; }
.keno-guide-title .icon { width: 17px; height: 17px; }
.keno-guide p { margin: 8px 0 12px; font-size: 13px; line-height: 1.7; }
.keno-guide-groups { display: flex; flex-wrap: wrap; gap: 7px; }
.keno-group-label { display: inline-flex; padding: 6px 9px; border-radius: 6px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.keno-group-a, .keno-result-a { color: #ad4e00; background: rgba(239, 108, 0, .15); }
.keno-group-b, .keno-result-b { color: #007568; background: rgba(0, 137, 123, .15); }
.keno-group-c, .keno-result-c { color: #3949ab; background: rgba(57, 73, 171, .15); }
.keno-card-list { display: grid; gap: 10px; padding: 0 14px 16px; }
.keno-card { min-width: 0; padding: 13px 15px; background: #fff; border: 1px solid #e3eaf2; border-radius: 10px; }
.keno-card:nth-child(even) { background: #f8fbff; }
.keno-card-top, .keno-card-identity, .keno-card-actions { display: flex; align-items: center; gap: 10px; }
.keno-card-top { justify-content: space-between; flex-wrap: wrap; }
.keno-card-identity strong { color: #203b58; font-size: 15px; font-variant-numeric: tabular-nums; }
.keno-card-identity span { color: #718398; font-size: 12px; }
.keno-card-sum { color: #6d7d8d; font-size: 12px; font-weight: 650; }
.keno-card-sum b { display: inline-grid; min-width: 28px; height: 28px; margin-left: 4px; place-items: center; color: #fff; background: #236bb5; border-radius: 6px; font-size: 14px; }
.keno-calc-button { min-height: 31px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; color: #185e9b; background: #edf5ff; border: 1px solid #c7dff5; border-radius: 6px; font-size: 12px; font-weight: 750; }
.keno-calc-button:hover:not(:disabled), .keno-calc-button[aria-expanded="true"] { color: #fff; background: #2474bf; border-color: #2474bf; }
.keno-calc-button:disabled { color: #8594a3; background: #f2f5f7; border-color: #e3e8ed; cursor: not-allowed; }
.keno-calc-button span { font-size: 17px; line-height: 1; }
.keno-covered { padding: 6px 10px; color: #fff; background: #545d65; border-radius: 6px; font-size: 12px; }
.keno-ball-grid { display: grid; grid-template-columns: repeat(20, 32px); gap: 4px; width: 100%; margin-top: 12px; }
.keno-ball-wrap { min-width: 0; display: inline-flex; flex-direction: column; align-items: center; }
.keno-ball-pos { height: 10px; margin-bottom: 2px; line-height: 10px; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.keno-ball-pos-spacer { color: transparent; }
.keno-ball-pos-a { color: #ef6c00; }
.keno-ball-pos-b { color: #00897b; }
.keno-ball-pos-c { color: #3949ab; }
.keno-ball { width: min(32px, 100%); aspect-ratio: 1; display: inline-grid; place-items: center; border: 2px solid; border-radius: 50%; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.keno-ball-a { color: #ef6c00; background: rgba(239, 108, 0, .15); border-color: rgba(239, 108, 0, .5); }
.keno-ball-b { color: #00897b; background: rgba(0, 137, 123, .15); border-color: rgba(0, 137, 123, .5); }
.keno-ball-c { color: #3949ab; background: rgba(57, 73, 171, .15); border-color: rgba(57, 73, 171, .5); }
.keno-ball-plain { color: #5a6b82; background: rgba(238, 242, 247, .28); border-color: rgba(216, 224, 235, .65); }
.keno-calculation { margin-top: 13px; padding: 14px; background: #f1f6fb; border: 1px solid #dce7f2; border-radius: 8px; }
.keno-calculation[hidden] { display: none; }
.keno-calculation h3 { margin: 0 0 12px; color: #274967; font-size: 14px; }
.keno-calc-line { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #dce7f2; }
.keno-calc-heading { color: #253e56; font-size: 14px; font-weight: 800; }
.keno-calc-heading small { display: block; margin-top: 2px; color: #6a7b8e; font-size: 11px; font-weight: 600; }
.keno-calc-equation, .keno-result-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.keno-calc-equation .keno-ball-wrap { width: 32px; }
.keno-calc-op { color: #6a7b8e; font-size: 14px; font-weight: 750; }
.keno-calc-total { min-width: 36px; padding: 7px 8px; color: #273e57; background: #dfe9f3; border-radius: 6px; text-align: center; font-size: 13px; font-weight: 800; }
.keno-calc-last { padding: 8px 10px; color: #fff; background: #ef6c00; border-radius: 6px; white-space: nowrap; font-size: 12px; font-weight: 800; }
.keno-calc-b .keno-calc-last { background: #00897b; }
.keno-calc-c .keno-calc-last { background: #3949ab; }
.keno-calc-result { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; color: #214766; background: #e1effc; border-radius: 7px; }
.keno-calc-result > strong { font-size: 14px; }
.keno-result-digit, .keno-result-sum { min-width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 6px; font-size: 15px; font-weight: 800; }
.keno-result-sum { min-width: 38px; color: #fff; background: #236bb5; }
.keno-calc-warning { margin: 10px 0 0; color: #ad452d; font-size: 12px; font-weight: 700; }

.insight-panel { padding: 22px; }
.insight-heading h2 { margin-top: 2px; font-size: 21px; font-weight: 800; }
.insight-heading p, .insight-source { font-size: 12px; }
.insight-eyebrow { color: #3376b6; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.insight-source { padding: 6px 9px; background: #e8f7ef; border-radius: 99px; font-weight: 750; white-space: nowrap; }
.insight-source-stale { color: #a36714; background: #fff2df; }
.insight-source-maintenance { color: #925915; background: #fff0d3; }
.insight-source-demo { color: #677889; background: #eef2f6; }
.analysis-overview { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 10px; margin: 17px 0 18px; }
.analysis-overview > div { min-width: 0; padding: 16px; background: #f3f7fb; border: 1px solid #e3eaf2; border-radius: 10px; }
.analysis-overview > .analysis-overview-main { color: #fff; background: linear-gradient(125deg, #184b7f, #267ab1); border-color: #1c6197; }
.analysis-overview span, .analysis-overview small { display: block; color: #697e91; font-size: 12px; font-weight: 650; }
.analysis-overview strong { display: block; margin: 7px 0 4px; color: #203d58; font-size: 25px; line-height: 1.15; font-weight: 800; overflow-wrap: anywhere; }
.analysis-overview-main span, .analysis-overview-main small, .analysis-overview-main p, .analysis-overview-main strong { color: #fff; }
.analysis-overview-main strong { font-size: 35px; }
.analysis-overview-main strong small { display: inline; margin-left: 3px; font-size: 13px; }
.analysis-overview-main p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; opacity: .87; }
.analysis-overview .analysis-source-value { font-size: 15px; line-height: 1.35; }
.insight-tabs { gap: 7px; margin-top: 0; padding-bottom: 13px; }
.insight-tabs button, .omission-tabs button { min-height: 34px; padding: 0 14px; font-size: 13px; font-weight: 700; }
.insight-body { padding-top: 16px; }
.insight-kpis { gap: 10px; }
.insight-kpis > div { padding: 14px; }
.insight-kpis span, .insight-kpis small { font-size: 12px; }
.insight-kpis strong { margin: 7px 0 4px; font-size: 24px; font-weight: 800; }
.insight-kpis strong small { font-size: 12px; }
.insight-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.insight-card { padding: 17px; border-radius: 10px; }
.insight-card-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 13px; }
.insight-card-heading h3, .insight-body > .insight-card-heading h3 { margin: 0; color: #2b4863; font-size: 15px; font-weight: 800; }
.insight-card-heading > span { color: #718397; font-size: 11px; font-weight: 650; text-align: right; }
.insight-chart-area { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 5px; height: 170px; }
.insight-chart-axis { display: flex; flex-direction: column; justify-content: space-between; color: #718397; font-size: 11px; font-variant-numeric: tabular-nums; }
.insight-chart-svg { width: 100%; height: 100%; overflow: visible; }
.insight-chart-grid { fill: none; stroke: #dce6f0; stroke-width: 1; stroke-dasharray: 4 4; }
.insight-chart-line { fill: none; stroke: #277ac3; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.insight-chart-caption { display: flex; justify-content: space-between; margin: 2px 0 10px 29px; color: #718397; font-size: 11px; }
.insight-recent-values { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.insight-recent-values span { min-width: 0; padding: 5px 0; color: #fff; border-radius: 5px; text-align: center; font-size: 11px; font-weight: 800; }
.insight-recent-values .large { background: #e44e49; }
.insight-recent-values .small { background: #347fc9; }
.insight-split { margin: 14px 0; }
.insight-split-label { display: flex; justify-content: space-between; color: #4e6479; font-size: 12px; font-weight: 650; }
.insight-split-label b { color: #243f59; font-size: 14px; }
.insight-split-track { height: 10px; margin-top: 7px; overflow: hidden; background: #3a87ce; border-radius: 99px; }
.insight-split-track i { display: block; height: 100%; background: #e25550; }
.insight-combo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.insight-combo-item { display: grid; gap: 3px; padding: 9px 4px; border-radius: 6px; text-align: center; }
.insight-combo-item strong { font-size: 12px; }
.insight-combo-item span { font-size: 13px; font-weight: 800; }
.insight-pattern-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.insight-pattern-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px; background: #f0f5fa; border-radius: 7px; }
.insight-pattern-item .result-trait { width: 29px; height: 29px; justify-content: center; padding: 0; font-size: 14px; flex: 0 0 auto; }
.insight-pattern-item > div { display: grid; gap: 2px; min-width: 0; }
.insight-pattern-item strong { color: #304960; font-size: 12px; }
.insight-pattern-item > div span { color: #6e8193; font-size: 11px; }
.insight-pattern-item > b { margin-left: auto; color: #2b5e8f; font-size: 13px; }
.insight-highlight { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 0; border-top: 1px solid #e4ebf2; }
.insight-highlight:first-of-type { border-top: 0; }
.insight-highlight > span { color: #60758a; font-size: 12px; }
.insight-highlight strong { color: #245f97; font-size: 18px; }
.insight-highlight small { grid-column: 1 / -1; color: #7b8d9d; font-size: 11px; }
.insight-highlight .insight-source-text { font-size: 13px; }
.insight-frequency-legend { display: flex; gap: 16px; margin-bottom: 16px; color: #60758a; font-size: 12px; }
.insight-frequency-legend span { display: inline-flex; align-items: center; gap: 6px; }
.insight-frequency-legend i { width: 12px; height: 8px; display: inline-block; border-radius: 3px; }
.insight-frequency-legend .actual { background: #347fc9; }
.insight-frequency-legend .theory { width: 3px; background: #e17b27; }
.frequency-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.frequency-item { grid-template-columns: 34px minmax(0, 1fr); gap: 4px 7px; padding: 9px; background: #f2f6fa; border-radius: 7px; }
.frequency-item > b { width: 32px; height: 32px; display: grid; place-items: center; grid-row: 1 / 3; color: #fff; background: #2d77b9; border-radius: 6px; font-size: 13px; }
.frequency-item .frequency-count { grid-column: 2; color: #314e69; font-size: 12px; font-weight: 750; }
.frequency-item .frequency-track { grid-column: 2; height: 8px; }
.frequency-item .frequency-pcts { grid-column: 1 / -1; color: #63788c; font-size: 10px; }
.frequency-track em { background: #e17b27; }
.insight-extremes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.insight-extremes > div { display: flex; align-items: baseline; gap: 5px; padding: 18px; background: #edf4fa; border-radius: 8px; }
.insight-extremes span { margin-right: auto; color: #425e77; font-size: 13px; font-weight: 700; }
.insight-extremes strong { color: #2469a4; font-size: 25px; }
.insight-extremes small { color: #6d8294; font-size: 11px; }
.insight-explain { margin: 2px 0 16px; font-size: 12px; }
.omission-tabs { margin-bottom: 13px; }
.omission-group { margin: 0 0 10px; padding: 14px; background: #f7fafc; border: 1px solid #e3eaf2; border-radius: 8px; }
.omission-group h3, .omission-positions h3 { margin-bottom: 10px; color: #35526d; font-size: 13px; font-weight: 800; }
.omission-cell { padding: 10px 4px; }
.omission-cell b { font-size: 13px; }
.omission-cell span { font-size: 11px; }
.omission-positions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.omission-positions > div { min-width: 0; padding: 14px; background: #f7fafc; border: 1px solid #e3eaf2; border-radius: 8px; }
.omission-positions .omission-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.omission-positions .combo-rank { margin-top: 11px; }
.insight-dragon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.dragon-card { display: grid; gap: 6px; justify-content: stretch; }
.dragon-card > span { color: #60758a; font-size: 12px; }
.dragon-card strong { color: #276fac; font-size: 26px; }
.dragon-card b { color: #32526e; font-size: 13px; }
.insight-cycle-card { margin-top: 0; }
.cycle-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr; gap: 10px; padding: 12px 0; font-size: 12px; }
.insight-note { font-size: 12px; line-height: 1.6; }

html[data-theme="dark"] .keno-guide { color: #c6d8e7; background: #1d3144; border-color: #385671; }
html[data-theme="dark"] .keno-guide-title, html[data-theme="dark"] .keno-card-identity strong, html[data-theme="dark"] .keno-calculation h3, html[data-theme="dark"] .keno-calc-heading { color: #e5f1fb; }
html[data-theme="dark"] .keno-card, html[data-theme="dark"] .keno-card:nth-child(even) { background: #1b2a36; border-color: #344b5d; }
html[data-theme="dark"] .keno-card-identity span, html[data-theme="dark"] .keno-card-sum, html[data-theme="dark"] .keno-calc-heading small { color: #adbfce; }
html[data-theme="dark"] .keno-calculation { background: #213543; border-color: #3c5362; }
html[data-theme="dark"] .keno-calc-line { border-color: #3c5362; }
html[data-theme="dark"] .keno-calc-total { color: #edf6fc; background: #38516a; }
html[data-theme="dark"] .keno-calc-op { color: #b3c4d2; }
html[data-theme="dark"] .keno-calc-result { color: #e7f4ff; background: #244663; }
html[data-theme="dark"] .keno-group-a, html[data-theme="dark"] .keno-result-a { color: #ffba86; background: #74411f; }
html[data-theme="dark"] .keno-group-b, html[data-theme="dark"] .keno-result-b { color: #9ce8df; background: #1e5d58; }
html[data-theme="dark"] .keno-group-c, html[data-theme="dark"] .keno-result-c { color: #cbd0ff; background: #353d77; }
html[data-theme="dark"] .keno-ball-a, html[data-theme="dark"] .keno-ball-pos-a { color: #ffab66; }
html[data-theme="dark"] .keno-ball-b, html[data-theme="dark"] .keno-ball-pos-b { color: #67d5c8; }
html[data-theme="dark"] .keno-ball-c, html[data-theme="dark"] .keno-ball-pos-c { color: #aab5ff; }
html[data-theme="dark"] .keno-ball-plain { color: #c6d6e5; background: #283948; border-color: #506373; }
html[data-theme="dark"] .analysis-overview > div:not(.analysis-overview-main), html[data-theme="dark"] .omission-group, html[data-theme="dark"] .omission-positions > div, html[data-theme="dark"] .frequency-item, html[data-theme="dark"] .insight-pattern-item { background: #21323f; border-color: #385063; }
html[data-theme="dark"] .analysis-overview span, html[data-theme="dark"] .analysis-overview small, html[data-theme="dark"] .insight-card-heading > span, html[data-theme="dark"] .insight-chart-axis, html[data-theme="dark"] .insight-chart-caption, html[data-theme="dark"] .insight-split-label, html[data-theme="dark"] .insight-highlight > span, html[data-theme="dark"] .insight-highlight small, html[data-theme="dark"] .insight-frequency-legend, html[data-theme="dark"] .frequency-item .frequency-pcts, html[data-theme="dark"] .dragon-card > span { color: #adc0d0; }
html[data-theme="dark"] .analysis-overview strong, html[data-theme="dark"] .insight-card-heading h3, html[data-theme="dark"] .insight-body > .insight-card-heading h3, html[data-theme="dark"] .insight-pattern-item strong, html[data-theme="dark"] .insight-split-label b, html[data-theme="dark"] .frequency-item .frequency-count, html[data-theme="dark"] .omission-group h3, html[data-theme="dark"] .omission-positions h3, html[data-theme="dark"] .dragon-card b { color: #e8f2fa; }
html[data-theme="dark"] .analysis-overview-main span, html[data-theme="dark"] .analysis-overview-main small, html[data-theme="dark"] .analysis-overview-main strong { color: #fff; }
html[data-theme="dark"] .insight-chart-grid { stroke: #3a5165; }
html[data-theme="dark"] .insight-highlight { border-color: #344b5d; }
html[data-theme="dark"] .insight-highlight strong, html[data-theme="dark"] .dragon-card strong { color: #83bcf2; }
html[data-theme="dark"] .insight-extremes > div { background: #294254; }
html[data-theme="dark"] .insight-extremes span, html[data-theme="dark"] .insight-extremes small { color: #c4d2dc; }
html[data-theme="dark"] .insight-extremes strong { color: #9bd0fa; }
html[data-theme="dark"] .insight-pattern-item > b { color: #9bcfff; }
html[data-theme="dark"] .insight-pattern-item > div span { color: #b4c6d5; }

@media (max-width: 820px) {
  .analysis-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-overview-main { grid-column: 1 / -1; }
  .analysis-overview-item:last-child { grid-column: 1 / -1; }
  .insight-dashboard-grid { grid-template-columns: 1fr; }
  .insight-dragon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .omission-positions { grid-template-columns: 1fr; }
  .keno-ball-grid { grid-template-columns: repeat(10, 32px); }
  .keno-calc-line { grid-template-columns: 1fr auto; }
  .keno-calc-equation { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 600px) {
  .keno-guide { margin: 10px; padding: 12px; }
  .keno-guide p { font-size: 12px; }
  .keno-guide-groups { display: grid; grid-template-columns: 1fr; }
  .keno-card-list { padding: 0 10px 12px; }
  .keno-card { padding: 11px; }
  .keno-card-top { align-items: flex-start; }
  .keno-card-identity { display: grid; gap: 2px; }
  .keno-card-identity strong { font-size: 14px; }
  .keno-card-actions { margin-left: auto; }
  .keno-card-sum { font-size: 11px; }
  .keno-card-sum b { min-width: 25px; height: 25px; }
  .keno-calc-button { padding: 0 7px; font-size: 11px; }
  .keno-ball-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
  .keno-ball { font-size: 12px; }
  .keno-calc-line { gap: 8px; }
  .keno-calc-equation .keno-ball-wrap { width: 27px; }
  .keno-calc-result { flex-wrap: wrap; }
  .insight-panel { padding: 13px; }
  .insight-heading h2 { font-size: 18px; }
  .insight-heading p, .insight-source { font-size: 11px; }
  .analysis-overview { gap: 6px; margin: 12px 0; }
  .analysis-overview > div { padding: 11px; }
  .analysis-overview strong { font-size: 20px; }
  .analysis-overview-main strong { font-size: 29px; }
  .analysis-overview .analysis-source-value { font-size: 13px; }
  .insight-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .insight-tabs button { min-width: 0; padding: 0 2px; font-size: 11px; }
  .insight-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-kpis > div { padding: 10px; }
  .insight-kpis strong { font-size: 21px; }
  .insight-card { padding: 12px; }
  .insight-chart-area { height: 150px; }
  .insight-recent-values { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .insight-combo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-pattern-grid { grid-template-columns: 1fr; }
  .frequency-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .frequency-item { padding: 7px; }
  .frequency-item .frequency-pcts { font-size: 9px; }
  .omission-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .omission-group { padding: 10px; }
  .omission-positions .omission-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cycle-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
