:root {
  font-family: 'DM Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  color: #202b2a;
  background: #f4f6f4;
  font-synthesis: none;
  --ink: #202b2a;
  --muted: #74807c;
  --line: #e5e9e6;
  --paper: #fff;
  --green: #24685a;
  --green-soft: #eaf4ef;
  --red: #c94f4a;
  --red-soft: #fff0ee;
  --blue: #577d9b;
  --gold: #ad864a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f6f4; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { width: 226px; position: fixed; inset: 0 auto 0 0; background: #183632; color: #f5f8f5; display: flex; flex-direction: column; padding: 26px 16px 20px; z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 33px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0; }
.brand small { display: block; margin-top: 4px; font-size: 9px; letter-spacing: 1.25px; color: #91ada4; }
.brand-mark { width: 33px; height: 33px; position: relative; border: 1px solid #83ab9c; border-radius: 50%; display: flex; justify-content: center; align-items: center; gap: 2px; transform: rotate(-25deg); }
.brand-mark i { width: 6px; height: 6px; border-radius: 50%; background: #ea6c5f; display: block; }
.brand-mark i:nth-child(2) { background: #e0bd77; transform: translateY(-5px); }
.brand-mark i:nth-child(3) { background: #77b39d; }
.nav-caption { color: #8ba59b; font-size: 10px; padding: 0 12px 9px; text-transform: uppercase; letter-spacing: 1.3px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; display: flex; align-items: center; gap: 12px; padding: 12px; color: #b6c9c1; background: transparent; border-radius: 5px; text-align: left; font-size: 13px; transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: #22453e; color: #fff; }
.nav-item.active { background: #2b5048; color: #fff; box-shadow: inset 2px 0 #ef8d76; }
.nav-symbol { font-size: 9px; font-weight: 700; color: #90ada0; letter-spacing: .4px; }
.sidebar-note { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 13px 12px; border-top: 1px solid #315149; border-bottom: 1px solid #315149; }
.sidebar-note b, .sidebar-note small { display: block; }
.sidebar-note b { font-size: 11px; font-weight: 600; }
.sidebar-note small { color: #a5bcb2; font-size: 10px; margin-top: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8bc8a8; box-shadow: 0 0 0 3px #31584c; }
.sidebar-footer { color: #89a49a; font-size: 10px; padding: 17px 12px 0; }
.main-area { min-height: 100vh; margin-left: 226px; padding: 0 42px 30px; max-width: 1600px; }
.topbar { min-height: 72px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumbs { color: #86918d; font-size: 11px; display: flex; gap: 10px; align-items: center; }
.breadcrumbs b { color: #c5ccc8; font-weight: 400; }
.breadcrumbs strong { color: #35413e; font-weight: 600; }
.top-actions { display: flex; gap: 16px; align-items: center; }
.date-chip { color: #596863; font-size: 11px; }
.button { border: 1px solid transparent; border-radius: 4px; padding: 10px 14px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: .15s ease; }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 2px 5px #163c321a; }
.button-primary:hover { background: #1c564a; transform: translateY(-1px); }
.button-quiet { background: #fff; border-color: var(--line); color: #56635e; }
.button-quiet:hover { border-color: #b8c6bf; background: #fafcfb; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.refresh-icon { font-size: 17px; line-height: 10px; color: var(--green); }
.is-loading .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sparkle { color: #f5c26f; font-size: 15px; }
.page { display: none; padding-top: 31px; animation: appear .22s ease; }
.page.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.compact-heading { align-items: flex-end; }
.eyebrow { margin: 0 0 8px; color: #789087; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; display: flex; align-items: center; gap: 9px; }
.eyebrow-line { width: 24px; height: 1px; background: #e17e6e; display: inline-block; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; line-height: 1.2; margin-bottom: 8px; letter-spacing: 0; font-weight: 650; }
h2 { font-size: 16px; line-height: 1.3; margin: 0; font-weight: 650; letter-spacing: 0; }
.heading-copy { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; margin-bottom: 29px; }
.summary-item { min-height: 79px; padding: 15px 21px; display: flex; align-items: center; gap: 14px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #ae725f; background: #fcf0eb; font-size: 11px; font-weight: 700; }
.summary-item:nth-child(2) .summary-icon { color: #427963; background: var(--green-soft); }
.summary-item:nth-child(3) .summary-icon { color: #6e8399; background: #edf3f7; }
.summary-value { font-size: 19px; font-weight: 700; line-height: 1; }
.summary-label { margin-top: 5px; color: #7c8782; font-size: 10px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 13px; gap: 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.muted { color: #8a9590; font-size: 10px; }
.today-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.game-tile { padding: 13px 14px 12px; background: var(--paper); border: 1px solid var(--line); min-width: 0; border-top: 2px solid #dba18f; }
.game-tile:nth-child(2n) { border-top-color: #78a794; }
.game-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.game-title strong { font-size: 13px; font-weight: 650; }
.game-state { font-size: 9px; color: #a56e56; background: #fff3ed; border-radius: 2px; padding: 4px 6px; white-space: nowrap; }
.game-state.ready { color: #357258; background: #edf6f0; }
.game-state.pending { color: #8c7141; background: #faf4e7; }
.tile-numbers { display: flex; gap: 4px; flex-wrap: wrap; min-height: 26px; align-items: center; }
.digit-result { display: inline-block; color: #344b42; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; line-height: 1; }
.ball { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; background: #f7e9e6; color: #bb5e52; border-radius: 50%; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ball.blue { background: #e7eff5; color: #557b96; }
.tile-sub { color: #89948f; font-size: 9px; margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-inline { color: #98a19d; font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(240px, .8fr); gap: 14px; margin-bottom: 24px; }
.panel { border: 1px solid var(--line); background: #fff; padding: 18px 19px; }
.trend-panel, .principle-panel { min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-copy { font-size: 10px; color: #84908b; margin: 7px 0 0; line-height: 1.7; }
.panel select, .entry-form select { min-width: 108px; border: 1px solid var(--line); border-radius: 3px; background: #fff; padding: 7px 9px; color: #52605b; font-size: 10px; }
.chart-wrap { margin-top: 18px; height: 166px; display: flex; align-items: stretch; gap: 9px; padding: 5px 0 0; border-bottom: 1px solid #eef0ee; }
.chart-column { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 6px; height: 100%; }
.chart-count { color: #9ba5a0; font-size: 8px; line-height: 1; }
.chart-bar { width: min(100%, 19px); min-height: 3px; border-radius: 2px 2px 0 0; background: #8db3a1; transition: height .25s; }
.chart-column.high .chart-bar { background: #d37a66; }
.chart-num { height: 13px; color: #75817c; font-size: 8px; font-variant-numeric: tabular-nums; }
.empty-chart { display: grid; place-items: center; height: 100%; width: 100%; color: #a0aaa5; font-size: 11px; border-bottom: 1px solid #eef0ee; }
.chart-legend { display: flex; gap: 14px; align-items: center; margin-top: 11px; color: #89938e; font-size: 9px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; background: #8db3a1; }
.legend-dot.hot { background: #d37a66; }
.legend-dot.cold { background: #577d9b; }
.chart-source { margin-left: auto; }
.method-mark { display: grid; place-items: center; color: #3d8168; width: 29px; height: 29px; border: 1px solid #d7e8dc; background: #eef6f0; border-radius: 50%; font-size: 17px; }
.method-stat { display: flex; align-items: baseline; gap: 9px; border-top: 1px solid #edf0ee; border-bottom: 1px solid #edf0ee; margin: 17px 0 12px; padding: 12px 0; }
.method-stat b { color: #386a57; font-size: 14px; }
.method-stat span { color: #8b9590; font-size: 9px; }
.method-copy { color: #75817b; font-size: 10px; line-height: 1.8; margin-bottom: 13px; }
.method-warning { display: flex; gap: 8px; padding: 9px 10px; background: #fcf6e9; color: #8e7344; }
.method-warning span { width: 14px; height: 14px; border: 1px solid #d9bd8c; border-radius: 50%; display: grid; place-items: center; font-size: 9px; flex: 0 0 14px; }
.method-warning p { font-size: 9px; line-height: 1.6; margin: 0; }
.recommendations-panel { margin-bottom: 24px; }
.recommendation-heading { align-items: center; margin-bottom: 14px; }
.recommendation-actions { display: flex; flex-direction: column; align-items: stretch; gap: 7px; flex-shrink: 0; min-width: 132px; }
.prediction-check-status { margin: 12px 0 0; padding: 9px 11px; border-left: 2px solid #4c8a70; background: #f1f7f3; color: #416b57; font-size: 10px; line-height: 1.7; }
.prediction-check-status:empty { display: none; }
.prediction-check-status.warning { border-left-color: #c17b36; background: #fff8ed; color: #8a4f19; }
.recommendation-group { border-top: 1px solid var(--line); padding: 12px 0 10px; }
.recommendation-group-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.recommendation-group-header strong { font-size: 12px; }
.recommendation-group-header span { font-size: 9px; color: #84908a; }
.source-coverage { display: grid; gap: 5px; padding: 10px 11px; background: #f6f8f6; border-left: 2px solid #c89c5b; }
.source-coverage.source-warning { background: #fff8ed; border-left-color: #c17b36; }
.source-coverage.source-warning strong { color: #8a4f19; }
.source-coverage strong { color: #69583d; font-size: 10px; line-height: 1.6; font-weight: 600; }
.source-coverage > span { color: #84908a; font-size: 9px; line-height: 1.6; }
.source-attempt-summary { display: block; margin-top: 3px; color: #71827b; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.source-coverage a { color: #4d806d; text-decoration: none; font-weight: 600; }
.source-coverage a:hover { text-decoration: underline; }
.source-record-list { list-style: none; margin: 7px 0 0; padding: 0; }
.source-record-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid #edf0ee; }
.source-record-list a { color: #43594f; font-size: 10px; font-weight: 600; text-decoration: none; }
.source-record-list a:hover { text-decoration: underline; }
.source-record-list span { color: #929c97; font-size: 9px; text-align: right; }
.recommendation-output { margin: 10px 0; padding: 12px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #fbfcfb; border: 1px solid var(--line); color: #344b42; font: 11px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; }
.source-empty { padding: 12px 0; color: #8c9892; font-size: 10px; }
.pick-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 9px; padding: 5px 0; border-top: 1px dashed #edf0ee; font-size: 10px; }
.pick-label { color: #809088; font-variant-numeric: tabular-nums; }
.pick-values { color: #394843; font-size: 11px; letter-spacing: .3px; font-weight: 600; }
.pick-row button { border: 0; background: transparent; color: #59806f; font-size: 9px; padding: 4px; }
.page-heading .button { margin-bottom: 3px; }
.result-status { background: #eaf4ef; color: #376f57; padding: 11px 14px; font-size: 10px; margin-bottom: 14px; border-left: 2px solid #5b9c77; }
.result-status.warning { background: #fbf4e8; color: #856d42; border-left-color: #c49a58; }
.draw-list { display: grid; gap: 9px; }
.draw-row { display: grid; grid-template-columns: 138px minmax(0, 1fr) 160px; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); padding: 15px 16px; }
.draw-game { font-size: 13px; font-weight: 650; }
.draw-meta { color: #8b9690; font-size: 9px; margin-top: 5px; }
.draw-balls { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.draw-balls .ball { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; }
.draw-plus { color: #9ba39f; font-size: 12px; padding: 0 1px; }
.draw-source { justify-self: end; text-align: right; }
.draw-source a { display: inline-block; color: #4d806d; text-decoration: none; font-size: 10px; font-weight: 600; }
.draw-source a:hover { text-decoration: underline; }
.draw-source small { display: block; margin-top: 5px; font-size: 9px; color: #929c97; }
.source-footnote { color: #8d9892; font-size: 10px; line-height: 1.7; margin-top: 15px; }
.entry-form { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 12px 14px; max-width: 760px; }
.field-label { color: #61706a; font-size: 10px; }
.entry-form select { width: 100%; }
.entry-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 3px; padding: 10px; color: #35433d; font-size: 11px; line-height: 1.6; }
.entry-form textarea:focus, .entry-form select:focus { outline: 2px solid #c6ded1; border-color: #7ca58e; }
.form-bottom { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.form-hint { color: #89948f; font-size: 9px; }
.record-heading { margin-top: 28px; }
.ticket-list { display: grid; gap: 8px; max-width: 960px; }
.ticket-row { display: grid; grid-template-columns: 110px minmax(0,1fr) 220px auto; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); }
.ticket-game { font-weight: 650; font-size: 11px; }
.ticket-period { color: #96a19b; font-size: 9px; margin-top: 4px; }
.ticket-text { font-size: 11px; color: #3c4b45; font-variant-numeric: tabular-nums; }
.ticket-check { color: #78857e; font-size: 9px; text-align: right; }
.ticket-check b { color: #438061; font-size: 11px; }
.ticket-actions { display: flex; gap: 7px; }
.text-action { padding: 5px; border: 0; color: #687871; background: none; font-size: 9px; }
.text-action:disabled { color: #a8b0ac; cursor: not-allowed; }
.text-action.delete { color: #bb6e61; }
.empty-state { background: #fff; color: #8c9892; font-size: 11px; border: 1px dashed #dce3de; padding: 26px; text-align: center; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rule-item { background: #fff; border: 1px solid var(--line); padding: 14px 16px; }
.rule-item:not([open]) > .rule-content { display: none; }
.rule-summary { display: grid; grid-template-columns: 8px minmax(0, 1fr) 18px; align-items: stretch; gap: 12px; cursor: pointer; list-style: none; }
.rule-summary::-webkit-details-marker { display: none; }
.rule-accent { width: 5px; height: 100%; min-height: 56px; background: #d78673; }
.rule-summary-content { min-width: 0; align-self: center; }
.rule-toggle { align-self: center; width: 18px; height: 18px; border: 1px solid #42635b; border-radius: 2px; color: #71e2c2; text-align: center; font-size: 13px; line-height: 16px; }
.rule-toggle::before { content: '+'; }
.rule-item[open] .rule-toggle::before { content: '-'; }
.rule-item:nth-child(2n) .rule-accent { background: #70a48a; }
.rule-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rule-title-row h2 { font-size: 14px; }
.rule-title-row small { font-size: 9px; color: #98a19c; }
.rule-main { margin: 9px 0 5px; color: #45544e; font-size: 11px; line-height: 1.7; }
.rule-sub { color: #89958e; font-size: 9px; line-height: 1.7; }
.rule-overview { margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid #203a36; }
.rule-link { display: inline-block; margin-top: 10px; color: #4d806d; font-size: 9px; text-decoration: none; }
.rule-link:hover { text-decoration: underline; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 15px; color: #8e9993; font-size: 9px; margin-top: 34px; }
.app-footer b { color: #697770; font-weight: 500; }
.visitor-count-item { flex-basis: 100%; display: inline-flex; align-items: center; gap: 6px; padding-top: 8px; }
.visitor-count-item b { color: #4d9f84; font-variant-numeric: tabular-nums; }
.visitor-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #57bd96; box-shadow: 0 0 0 3px #57bd961f; }
.toast { position: fixed; z-index: 15; bottom: 22px; left: 50%; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #1e3933; color: white; padding: 10px 16px; border-radius: 3px; box-shadow: 0 6px 20px #132e271e; font-size: 11px; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@media (max-width: 1120px) {
  .main-area { padding-inline: 26px; }
  .today-games { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .draw-row { grid-template-columns: 112px minmax(0,1fr) 110px; gap: 10px; }
  .content-grid { grid-template-columns: minmax(0, 1.3fr) minmax(220px, .8fr); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 61px; padding: 0 8px; border-top: 1px solid #315149; }
  .brand, .nav-caption, .sidebar-note, .sidebar-footer { display: none; }
  .main-nav { height: 100%; grid-template-columns: repeat(4, 1fr); gap: 1px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; border-radius: 0; font-size: 9px; }
  .nav-item.active { box-shadow: inset 0 2px #ef8d76; background: #22453e; }
  .nav-symbol { font-size: 8px; }
  .main-area { margin-left: 0; padding: 0 16px 84px; }
  .topbar { min-height: 58px; }
  .breadcrumbs { font-size: 10px; }
  .top-actions { gap: 8px; }
  .date-chip { display: none; }
  .button { padding: 9px 10px; font-size: 10px; }
  .page { padding-top: 23px; }
  .page-heading { align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading .button { align-self: flex-end; margin-bottom: 0; }
  .heading-copy { max-width: 440px; font-size: 10px; }
  .summary-item { min-height: 71px; padding: 10px 9px; gap: 8px; }
  .summary-icon { width: 25px; height: 25px; font-size: 9px; }
  .summary-value { font-size: 16px; }
  .summary-label { font-size: 8px; line-height: 1.4; }
  .summary-strip { margin-bottom: 24px; }
  .today-games { gap: 7px; }
  .game-tile { padding: 10px 9px; }
  .digit-result { font-size: 17px; }
  .game-title strong { font-size: 11px; }
  .game-state { font-size: 8px; padding: 3px 4px; }
  .ball { width: 21px; height: 21px; flex-basis: 21px; font-size: 8px; }
  .content-grid { grid-template-columns: 1fr; gap: 9px; }
  .panel { padding: 14px; }
  .chart-wrap { height: 145px; gap: 5px; }
  .method-warning p { font-size: 9px; }
  .recommendations-panel { padding: 13px 12px; }
  .recommendation-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .recommendation-actions { width: 100%; flex-direction: column; flex-wrap: nowrap; }
  .pick-row { grid-template-columns: 36px minmax(0,1fr) auto; gap: 4px; }
  .pick-values { font-size: 10px; line-height: 1.5; word-break: break-word; }
  .source-record-list li { align-items: flex-start; flex-direction: column; gap: 3px; }
  .source-record-list span { text-align: left; }
  .recommendation-output { padding: 10px; font-size: 10px; }
  .draw-row { grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 12px; }
  .draw-game-block { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .draw-meta { margin: 0; }
  .draw-balls { grid-column: 1; gap: 4px; }
  .draw-balls .ball { width: 25px; height: 25px; flex-basis: 25px; }
  .draw-source { grid-column: 2; grid-row: 2; }
  .entry-form { grid-template-columns: 1fr; gap: 8px; }
  .field-label { margin-top: 5px; }
  .form-bottom { grid-column: 1; }
  .ticket-row { grid-template-columns: 1fr auto; gap: 8px; }
  .ticket-game-block { grid-column: 1; }
  .ticket-text { grid-column: 1 / -1; grid-row: 2; }
  .ticket-check { grid-column: 1; text-align: left; }
  .ticket-actions { grid-column: 2; grid-row: 1; }
  .rules-grid { grid-template-columns: 1fr; }
  .rule-accent { min-height: 76px; }
  .app-footer { flex-direction: column; gap: 6px; font-size: 8px; margin-top: 25px; }
}

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

:root {
  color-scheme: dark;
  color: #e2efed;
  background: #07100f;
  --ink: #e2efed;
  --muted: #8ba3a0;
  --line: #24413d;
  --paper: #0d1918;
  --green: #4fe0bd;
  --green-soft: #12302b;
  --red: #ff8679;
  --red-soft: #321e1d;
  --blue: #79c2ff;
  --gold: #f2c36f;
  --surface-raised: #12211f;
  --surface-deep: #091312;
  --cyan-line: #2e6259;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #081311 0%, #0b1715 48%, #07100f 100%);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#4fe0bd0a 1px, transparent 1px), linear-gradient(90deg, #4fe0bd0a 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  pointer-events: none;
}

::selection { color: #06110f; background: #4fe0bd; }
*:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.sidebar {
  border-right: 1px solid #1d3935;
  background: #081311;
  box-shadow: 8px 0 24px #0003;
}
.brand { padding-bottom: 30px; }
.brand strong { color: #f0faf8; }
.brand small { color: #78a59b; letter-spacing: 0; }
.brand-mark {
  border-color: #4fe0bd;
  border-radius: 7px;
  transform: rotate(-8deg);
  box-shadow: 0 0 14px #4fe0bd20, inset 0 0 10px #4fe0bd12;
}
.brand-mark i:nth-child(2) { background: #f2c36f; }
.brand-mark i:nth-child(3) { background: #79c2ff; }
.nav-caption { color: #6e918a; letter-spacing: 0; }
.nav-item { color: #a7bfba; border: 1px solid transparent; border-radius: 3px; }
.nav-item:hover { color: #effbf8; background: #122723; }
.nav-item.active {
  color: #eafffa;
  background: #10231f;
  border-color: #1b4740;
  box-shadow: inset 2px 0 var(--green), 0 0 16px #4fe0bd0a;
}
.nav-symbol { color: #68aa9b; letter-spacing: 0; }
.sidebar-note { border-color: #1e3c37; }
.sidebar-note small, .sidebar-footer { color: #7c9992; }
.live-dot { background: var(--green); box-shadow: 0 0 0 3px #183b33; }

.main-area { position: relative; }
.topbar { border-color: #203d38; }
.breadcrumbs { color: #8ca6a1; }
.breadcrumbs b { color: #45615b; }
.breadcrumbs strong, .date-chip { color: #d8e7e4; }
.button { border-radius: 3px; }
.button-primary {
  color: #06110f;
  background: var(--green);
  box-shadow: 0 0 0 1px #7af3d5 inset, 0 0 18px #4fe0bd1c;
}
.button-primary:hover { color: #04100e; background: #76f0d0; }
.button-quiet {
  color: #c3d4d1;
  background: #101e1c;
  border-color: #33504a;
}
.button-quiet:hover { color: #f1fbf8; background: #172a26; border-color: #4e8074; }
.button:disabled { color: #768a86; background: #17201f; border-color: #293a37; box-shadow: none; opacity: .62; }
.refresh-icon { color: var(--green); }
.sparkle { color: #12221e; }

.eyebrow { color: #70b9a9; letter-spacing: 0; }
.eyebrow-line { background: #ff8679; }
h1, h2 { color: #eef7f5; }
.heading-copy { color: #a0b3af; }
.summary-strip {
  background: #0b1715;
  border: 1px solid #203c37;
}
.summary-item { border-color: #1c3733; }
.summary-icon { color: #ff988c; background: #321e1d; }
.summary-item:nth-child(2) .summary-icon { color: #63e8c5; background: #13342e; }
.summary-item:nth-child(3) .summary-icon { color: #8fcaff; background: #172b34; }
.summary-value { color: #eef9f6; }
.summary-label, .muted { color: #8ea39e; }
.section-heading h2 { color: #dfefeb; }

.game-tile {
  background: #0d1918;
  border-color: #294541;
  border-top-color: #ff8679;
  box-shadow: inset 0 1px #ffffff05;
}
.game-tile:nth-child(2n) { border-top-color: #4fe0bd; }
.game-title strong { color: #e8f4f1; }
.game-state { color: #f4ca78; background: #302719; }
.game-state.ready { color: #76e6c5; background: #12332d; }
.game-state.pending { color: #f2c36f; background: #302719; }
.digit-result { color: #dff6ef; }
.ball { color: #ffb0a6; background: #3a2422; border: 1px solid #71423c; }
.ball.blue { color: #9bd5ff; background: #152c38; border-color: #34596a; }
.tile-sub { color: #91a7a2; }
.empty-inline { color: #829994; }

.panel {
  background: #0c1817;
  border-color: #27423e;
  box-shadow: inset 0 1px #ffffff04, 0 8px 24px #0002;
}
.panel select, .entry-form select, .entry-form textarea {
  color: #e0efeb;
  background: #0a1514;
  border-color: #34534d;
}
.panel select:focus, .entry-form textarea:focus, .entry-form select:focus {
  outline-color: #4fe0bd;
  border-color: #4fe0bd;
}
.panel select option, .entry-form select option { color: #e0efeb; background: #0a1514; }
.panel-copy { color: #91a8a3; }
.chart-wrap {
  border-color: #25413c;
  background-image: linear-gradient(#4fe0bd0b 1px, transparent 1px), linear-gradient(90deg, #4fe0bd0b 1px, transparent 1px);
  background-size: 24px 24px;
}
.chart-count, .chart-num, .chart-legend { color: #8ea49f; }
.chart-bar { background: #48ba9e; }
.chart-column.high .chart-bar { background: #ff8679; }
.empty-chart { color: #8ea49f; border-color: #25413c; }
.legend-dot { background: #4fe0bd; }
.legend-dot.hot { background: #ff8679; }
.legend-dot.cold { background: #79c2ff; }
.method-mark { color: #68e6c4; background: #12302b; border-color: #2f685b; }
.method-stat { border-color: #25423d; }
.method-stat b { color: #69e2c1; }
.method-stat span, .method-copy { color: #9ab0ab; }
.method-warning {
  color: #f4c66f;
  background: #292217;
  border: 1px solid #5d4a28;
}
.method-warning span { border-color: #ae8744; }

.recommendations-panel { border-color: #32665b; }
.recommendation-actions { min-width: 156px; }
.prediction-check-status {
  color: #8debd0;
  background: #102823;
  border-left-color: var(--green);
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-line;
}
.prediction-check-status.warning {
  color: #ffd48a;
  background: #292217;
  border-left-color: var(--gold);
}
.recommendation-group { border-color: #28443f; }
.recommendation-group-header strong { color: #eff8f5; }
.recommendation-group-header span { color: #8ea7a1; }
.source-coverage { background: #111f1d; border-left-color: var(--gold); }
.source-coverage.source-warning { background: #292217; border-left-color: var(--gold); }
.source-coverage.source-warning strong, .source-coverage strong { color: #f1d293; }
.source-coverage > span { color: #a2b4af; }
.source-attempt-summary { color: #829a94; }
.source-coverage a, .source-record-list a, .draw-source a, .rule-link { color: #71e2c2; }
.source-record-list li { border-color: #203a36; }
.source-record-list span { color: #8ea49f; }
.recommendation-output {
  color: #dff5ed;
  background: #07110f;
  border-color: #2b5148;
  box-shadow: inset 3px 0 #4fe0bd;
}
.source-empty { color: #93a8a3; }
.pick-row { border-color: #27413d; }
.pick-label { color: #88a49d; }
.pick-values { color: #e6f5ef; letter-spacing: 0; }
.pick-row button { color: #70e2c0; }

.result-status { color: #8ee9ce; background: #102823; border-left-color: var(--green); }
.result-status.warning { color: #ffd48a; background: #292217; border-left-color: var(--gold); }
.draw-row, .ticket-row, .rule-item, .empty-state {
  color: #e0efeb;
  background: #0d1918;
  border-color: #294541;
}
.draw-game, .ticket-game, .ticket-text { color: #e4f2ef; }
.draw-meta, .ticket-period, .draw-source small { color: #90a7a1; }
.draw-plus { color: #91a8a3; }
.draw-source small { color: #9bb0ab; }
.source-footnote, .form-hint, .rule-title-row small { color: #8ca49e; }
.field-label { color: #b6cbc5; }
.entry-form textarea::placeholder { color: #718984; }
.form-hint { color: #95aba5; }
.ticket-check { color: #a6b8b3; }
.ticket-check b { color: #71e2c2; }
.text-action { color: #abc1bb; }
.text-action:disabled { color: #687b76; }
.text-action.delete { color: #ff9287; }
.empty-state { border-style: dashed; color: #95aaa5; }
.rule-item { border-radius: 2px; }
.rule-accent { background: #ff8679; }
.rule-item:nth-child(2n) .rule-accent { background: #4fe0bd; }
.rule-title-row h2 { color: #e5f2ef; }
.rule-main { color: #c5d8d2; }
.rule-sub { color: #91a8a2; }
.app-footer { color: #809791; border-color: #203d38; }
.app-footer b { color: #c4d8d2; }
.toast { color: #eafff9; background: #12352e; border: 1px solid #367362; box-shadow: 0 8px 24px #0006; }

@media (max-width: 760px) {
  .sidebar { border-top-color: #2b5149; background: #081311; }
  .nav-item.active { background: #10231f; box-shadow: inset 0 2px var(--green); }
  .main-area { padding-inline: 12px; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-item { padding-inline: 8px; }
  .recommendation-actions { width: 100%; min-width: 0; flex-direction: column; }
  .recommendation-actions .button { min-height: 40px; }
}

.rules-page-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.rules-research-status { color: #91aaa3; font-size: 10px; text-align: right; }
.rule-content { min-width: 0; margin-left: 20px; }
.rule-section { margin-top: 14px; padding-top: 11px; border-top: 1px solid #203a36; }
.rule-section h3 { margin: 0 0 8px; color: #c9ded8; font-size: 10px; font-weight: 650; }
.rule-section h3 small { color: #76d6bb; font-size: 9px; font-weight: 500; margin-left: 5px; }
.rule-play-list, .rule-source-list { list-style: none; padding: 0; margin: 0; }
.rule-play-list { display: grid; gap: 7px; }
.rule-play-list li { display: grid; grid-template-columns: minmax(95px, .38fr) minmax(0, 1fr); gap: 10px; font-size: 10px; line-height: 1.55; }
.rule-play-list b { color: #d6e7e2; font-weight: 600; }
.rule-play-list span { color: #91aaa3; }
.rule-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rule-tag { padding: 4px 7px; color: #9bd8c8; background: #102521; border: 1px solid #284b43; border-radius: 2px; font-size: 9px; line-height: 1.4; }
.record-type-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
.record-type-chip { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-left: 8px; border-left: 2px solid #536e67; }
.record-type-chip b { color: #becfca; font-size: 9px; font-weight: 500; line-height: 1.5; }
.record-type-chip small { color: #8fa49e; font-size: 8px; }
.record-type-chip.check { border-left-color: #4fe0bd; }
.record-type-chip.note { border-left-color: #edbd6d; }
.rule-source-list { display: grid; }
.rule-source { padding: 8px 0; border-bottom: 1px solid #1e3632; }
.rule-source:last-child { border-bottom: 0; }
.rule-source-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rule-source-top a { min-width: 0; color: #71e2c2; font-size: 9px; font-weight: 600; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.rule-source-top a:hover { text-decoration: underline; }
.rule-source-top span { flex: 0 0 auto; color: #829a94; font-size: 8px; }
.rule-source p { color: #91a8a2; font-size: 9px; line-height: 1.65; margin: 5px 0 0; overflow-wrap: anywhere; }
.rule-source > small { display: block; margin-top: 4px; color: #aab18c; font-size: 8px; }
.rule-source.unavailable .rule-source-top a { color: #f2bc72; }
.rule-source-pending { color: #8da49d; font-size: 9px; padding: 8px 0; }
.entry-form select { min-height: 36px; }

@media (max-width: 760px) {
  .rules-page-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .rules-research-status { text-align: left; }
  .compact-heading:has(.rules-page-actions) { flex-direction: column; align-items: stretch; }
  .record-type-list { grid-template-columns: 1fr; }
  .rule-source-top { align-items: flex-start; flex-direction: column; gap: 2px; }
  .rules-grid { gap: 8px; }
  .rule-item { padding: 10px 12px; }
  .rule-summary { grid-template-columns: 5px minmax(0, 1fr) 18px; gap: 9px; }
  .rule-accent { min-height: 44px; }
  .rule-title-row { flex-wrap: wrap; align-items: center; gap: 2px 8px; }
  .rule-title-row h2 { font-size: 13px; }
  .rule-title-row small { font-size: 8px; white-space: nowrap; }
  .rule-main { display: -webkit-box; margin: 5px 0 0; overflow: hidden; font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .rule-content { margin-left: 14px; }
}

/* ===== 数据分析页 ===== */
.analysis-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.analysis-actions select { border: 1px solid #34534d; background: #0a1514; color: #e0efeb; padding: 8px 10px; font-size: 11px; border-radius: 3px; min-width: 108px; }
.analysis-status { margin-bottom: 14px; padding: 10px 13px; color: #8ee9ce; background: #102823; border-left: 2px solid var(--green); font-size: 11px; line-height: 1.7; }
.analysis-status.warning { color: #ffd48a; background: #292217; border-left-color: var(--gold); }
.analysis-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.analysis-stat { padding: 12px 13px; background: #0c1817; border: 1px solid #27423e; border-top: 2px solid #4fe0bd; min-width: 0; }
.analysis-stat small { display: block; color: #8ea49f; font-size: 9px; margin-bottom: 6px; }
.analysis-stat b { color: #e8f6f1; font-size: 16px; font-weight: 650; letter-spacing: .2px; overflow-wrap: anywhere; }
.analysis-grid { grid-template-columns: minmax(0, 1.6fr) minmax(250px, .9fr); }
.zone-tabs { display: flex; gap: 6px; margin-top: 12px; }
.zone-tab { border: 1px solid #2b4a44; background: #0a1514; color: #9ab0ab; font-size: 10px; padding: 5px 11px; border-radius: 2px; }
.zone-tab.active { color: #07110f; background: #4fe0bd; border-color: #4fe0bd; font-weight: 600; }
.heat-chart { display: flex; align-items: flex-end; gap: 2px; margin-top: 12px; padding-top: 8px; height: 150px; overflow-x: auto; border-bottom: 1px solid #25413c; }
.heat-col { flex: 1 0 15px; min-width: 15px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.heat-val { color: #829a94; font-size: 8px; font-variant-numeric: tabular-nums; }
.heat-bar { display: block; width: 9px; background: #48ba9e; }
.heat-col.hot .heat-bar { background: #ff8679; }
.heat-col.cold .heat-bar { background: #79c2ff; opacity: .5; }
.heat-num { color: #8ea49f; font-size: 8px; white-space: nowrap; }
.heat-col.hot .heat-num { color: #ffada3; }
.heat-col.cold .heat-num { color: #8cc9ff; }
.structure-block { margin-top: 15px; padding-top: 12px; border-top: 1px solid #203a36; }
.structure-block:first-of-type { margin-top: 6px; padding-top: 0; border-top: 0; }
.mini-title { margin: 0 0 9px; color: #c9ded8; font-size: 10px; font-weight: 650; }
.interval-bars { display: grid; gap: 6px; }
.interval-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 46px; align-items: center; gap: 8px; }
.interval-label { color: #9ab0ab; font-size: 9px; font-variant-numeric: tabular-nums; }
.interval-track { display: block; height: 8px; background: #0a1514; border: 1px solid #27423e; }
.interval-track i { display: block; height: 100%; background: #4fe0bd; }
.interval-track.omit i { background: #79c2ff; }
.interval-row b { color: #cfe4de; font-size: 9px; text-align: right; font-variant-numeric: tabular-nums; }
.ratio-row { display: grid; gap: 6px; }
.ratio-head, .ratio-foot { display: flex; justify-content: space-between; gap: 8px; color: #9ab0ab; font-size: 9px; }
.ratio-track { display: flex; height: 10px; border: 1px solid #27423e; background: #0a1514; }
.ratio-track i { display: block; height: 100%; }
.ratio-track .odd { background: #ff8679; }
.ratio-track .even { background: #79c2ff; }
.ratio-track .small { background: #4fe0bd; }
.ratio-track .big { background: #edbd6d; }
.trend-map-panel, .picks-panel { margin-bottom: 24px; }
.trend-map { margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.trend-scroll { min-width: max-content; }
.trend-row { display: flex; align-items: center; gap: 1px; }
.trend-row + .trend-row { border-top: 1px solid #172e2a; }
.trend-issue { flex: 0 0 92px; display: flex; flex-direction: column; gap: 1px; color: #9ab0ab; font-size: 9px; line-height: 1.35; }
.trend-issue small { color: #6f8883; font-size: 8px; }
.trend-cell { flex: 0 0 16px; height: 17px; display: grid; place-items: center; color: #ff9c90; font-size: 8px; line-height: 1; }
.trend-cell.head { color: #7f9893; font-size: 7px; border-bottom: 1px solid #27423e; }
.trend-cell.hit { color: #ff9c90; font-size: 9px; }
.head-row .trend-issue { color: #8ea49f; }
.picks-heading { align-items: center; }
.picks-output { margin-top: 12px; display: grid; gap: 6px; }
.picks-output .pick-row { grid-template-columns: 42px minmax(0, 1fr); }
.picks-output .pick-values { font-size: 12px; letter-spacing: .6px; }
.picks-note { margin-top: 10px; color: #8ea49f; font-size: 9px; line-height: 1.7; }

/* 一键开奖核对结果区（按钮正下方） */
.check-result { margin-top: 14px; border: 1px solid #2b4a44; background: #0a1614; }
.check-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-bottom: 1px solid #23403a; background: #10201d; }
.check-result-title { display: flex; align-items: center; gap: 8px; }
.check-result-title h3 { margin: 0; color: #e4f2ee; font-size: 12px; font-weight: 650; letter-spacing: .4px; }
.check-result-mark { width: 3px; height: 14px; background: #4fe0bd; display: block; }
.check-result-window { color: #8ea49f; font-size: 9px; line-height: 1.6; }
.check-result .prediction-check-status { margin: 0; border-left: 0; background: transparent; border-radius: 0; padding: 11px 12px; }
.check-result .prediction-check-status.warning { background: #292217; }
.recommendations-panel #recommendation-list { margin-top: 16px; }

@media (max-width: 1120px) {
  .analysis-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .analysis-actions { width: 100%; justify-content: space-between; }
  .analysis-actions select { flex: 1 1 auto; }
  .analysis-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-stat b { font-size: 14px; }
  .trend-issue { flex-basis: 74px; }
}
