﻿:root {
  --ink: #11140f;
  --muted: #667064;
  --line: rgba(30, 43, 27, 0.12);
  --paper: #fbfaf5;
  --panel: #ffffff;
  --green: #063f31;
  --green-2: #0c6b4d;
  --gold: #d7a944;
  --gold-2: #f2d78b;
  --crimson: #a6222f;
  --blue: #163c64;
  --shadow: 0 22px 70px rgba(11, 34, 29, 0.12);
  --font: "Segoe UI", "Noto Sans", Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(215, 169, 68, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(12, 107, 77, 0.06), transparent 30%),
    #f7f4ec;
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(242, 215, 139, 0.12), transparent 18%),
    radial-gradient(circle at 84% 72%, rgba(166, 34, 47, 0.08), transparent 15%),
    linear-gradient(180deg, #0b4a3b, #06372d);
  color: white;
  overflow-y: auto;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background:
    radial-gradient(circle at 9% 24%, rgba(255, 242, 189, 0.9) 0 18px, rgba(215, 169, 68, 0.55) 19px 28px, transparent 29px),
    radial-gradient(circle at 57% 29%, rgba(255, 242, 189, 0.72) 0 14px, rgba(215, 169, 68, 0.44) 15px 24px, transparent 25px),
    radial-gradient(circle at 91% 43%, rgba(255, 242, 189, 0.68) 0 12px, rgba(215, 169, 68, 0.38) 13px 21px, transparent 22px),
    radial-gradient(circle at 24% 78%, rgba(255, 242, 189, 0.54) 0 10px, rgba(215, 169, 68, 0.28) 11px 18px, transparent 19px);
  filter: blur(0.2px);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 43, 36, 0.08), rgba(5, 43, 36, 0.42));
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(242, 215, 139, 0.62);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, #fff8d9 0 9px, transparent 10px),
    radial-gradient(circle at 38% 30%, #f5d77b, #c58d2e 54%, #7b4d10 100%);
  color: #15200f;
  font-weight: 900;
  box-shadow:
    inset -8px -9px 14px rgba(71, 44, 5, 0.28),
    inset 6px 6px 12px rgba(255, 255, 255, 0.24),
    0 10px 24px rgba(0, 0, 0, 0.24);
}

.brand-ball-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #11382f;
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.12);
}

.brand-ball-shine {
  position: absolute;
  top: 9px;
  left: 12px;
  width: 11px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  transform: rotate(-28deg);
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-sub {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
  padding: 0 14px;
  backdrop-filter: blur(4px);
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(242, 215, 139, 0.34);
  background: rgba(255, 255, 255, 0.16);
  color: white;
}

.risk-box {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid rgba(242, 215, 139, 0.32);
  border-radius: 14px;
  background: rgba(3, 31, 25, 0.46);
  backdrop-filter: blur(6px);
}

.risk-box strong {
  color: var(--gold-2);
}

.risk-box p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.main {
  min-width: 0;
  padding: 24px 28px 56px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(247, 244, 236, 0.96) 220px),
    #f7f4ec;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--crimson);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, var(--gold), #b57a20);
  color: #1e190c;
  box-shadow: 0 10px 22px rgba(181, 122, 32, 0.22);
}

.secondary-button {
  background: var(--green);
  color: white;
}

.ghost-button {
  background: white;
  color: var(--green);
  border-color: var(--line);
}

.hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 28, 23, 0.82), rgba(4, 28, 23, 0.38), rgba(4, 28, 23, 0.08));
}

.hero-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 260px;
  padding: 28px;
}

.hero-copy {
  max-width: 720px;
  color: white;
}

.hero-copy span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-copy h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 4vw, 52px);
  line-height: 1.05;
}

.update-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  padding: 16px;
  border: 1px solid rgba(242, 215, 139, 0.34);
  border-radius: 14px;
  background: rgba(4, 28, 23, 0.72);
  color: white;
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #42d282;
  box-shadow: 0 0 0 6px rgba(66, 210, 130, 0.15);
}

.update-title {
  font-weight: 800;
}

.update-meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin-top: 2px;
}

.warning-strip {
  margin: 18px 0;
  padding: 13px 16px;
  border: 1px solid rgba(166, 34, 47, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: #74202b;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(11, 34, 29, 0.05);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.section-head h2 {
  margin-bottom: 6px;
  font-size: 27px;
}

.section-head p {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.metrics-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.latest-board {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) 1.4fr;
  gap: 14px;
  margin-bottom: 14px;
}

.latest-main {
  padding: 22px;
  border: 1px solid rgba(215, 169, 68, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(6, 63, 49, 0.96), rgba(12, 107, 77, 0.9)),
    #063f31;
  color: white;
  box-shadow: var(--shadow);
}

.latest-label {
  width: fit-content;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 215, 139, 0.18);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.latest-main h3 {
  margin: 14px 0 8px;
  font-size: 26px;
}

.latest-main p {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.latest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.latest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.latest-item {
  min-height: 112px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(11, 34, 29, 0.06);
}

.latest-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.latest-item-title {
  font-weight: 900;
}

.latest-item-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mini-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-ball {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(215, 169, 68, 0.18);
  color: #7b5714;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.latest-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.metric,
.surface,
.strategy-card,
.ticket-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(11, 34, 29, 0.06);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--green);
  font-size: 30px;
}

.metric p,
.surface p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
}

.surface {
  padding: 20px;
}

.surface h3 {
  margin-bottom: 14px;
}

.timeline {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--muted);
}

.timeline span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(215, 169, 68, 0.18);
  color: #8b6718;
  font-weight: 900;
}

.large-text {
  font-size: 18px;
}

.strategy-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 14px;
}

.game-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.summary-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.summary-tile strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  line-height: 1.25;
}

.strategy-list {
  display: grid;
  gap: 10px;
}

.strategy-card {
  padding: 16px;
}

.strategy-card.active {
  border-color: rgba(215, 169, 68, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 215, 139, 0.16));
}

.strategy-card .tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(6, 63, 49, 0.08);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.strategy-card h3 {
  margin: 10px 0 6px;
}

.strategy-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.lab {
  display: grid;
  gap: 14px;
}

.pool-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ball {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff4c7, var(--gold));
  border: 1px solid rgba(139, 103, 24, 0.28);
  color: #241b07;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ball.experimental {
  background: radial-gradient(circle at 35% 25%, #e8f3ff, #78a9da);
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ticket-card {
  padding: 12px;
}

.ticket-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.mega-deep-lab {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.workflow-band {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(6, 63, 49, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(242, 215, 139, 0.1));
}

.workflow-band.technical {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(6, 63, 49, 0.06));
}

.band-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 0;
}

.band-title h3 {
  margin-bottom: 0;
}

.band-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mega-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.power-controls label,
.mega-control-grid label.selected-control,
.bao-demand-grid label.demand-active {
  border-color: rgba(215, 169, 68, 0.72);
  box-shadow: 0 0 0 3px rgba(215, 169, 68, 0.13);
}

.power-controls label,
.mega-control-grid label.selected-control,
.bao-demand-grid label.demand-active {
  position: relative;
}

.power-controls label::after,
.mega-control-grid label.selected-control::after,
.bao-demand-grid label.demand-active::after {
  content: "Đang chọn";
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(166, 34, 47, 0.1);
  color: var(--crimson);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.action-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.guide-step {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-step span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  margin-right: 6px;
  background: rgba(215, 169, 68, 0.22);
  color: #735111;
  font-weight: 900;
}

.guide-step strong {
  color: var(--green);
  font-size: 13px;
}

.guide-step small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.guide-step.active {
  border-color: rgba(166, 34, 47, 0.3);
  animation: softPulse 2.6s ease-in-out infinite;
}

.mega-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  font-size: 14px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.mega-table th,
.mega-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mega-table th {
  color: var(--green);
  background: rgba(6, 63, 49, 0.06);
  font-size: 12px;
  text-transform: uppercase;
}

.mega-table tr:last-child td {
  border-bottom: 0;
}

.method-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(215, 169, 68, 0.18);
  color: #735111;
  font-size: 12px;
  font-weight: 900;
}

.mega-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.bao-board {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
}

.bao-controls {
  display: grid;
  gap: 12px;
}

.bao-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.bao-demand-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bao-demand-grid label {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.bao-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 63, 49, 0.04);
}

.bao-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.bao-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 18px;
}

.bao-preview {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.draw-focus {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.draw-focus .bao-stat {
  background: rgba(215, 169, 68, 0.12);
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.radar-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.radar-card.active {
  border-color: rgba(166, 34, 47, 0.38);
  background: rgba(166, 34, 47, 0.07);
}

.radar-card strong {
  display: block;
  color: var(--green);
  margin-bottom: 6px;
}

.radar-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(6, 63, 49, 0.1);
  overflow: hidden;
  margin: 8px 0;
}

.radar-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--crimson));
}

.hot-ball {
  box-shadow: 0 0 0 3px rgba(166, 34, 47, 0.2);
  background: radial-gradient(circle at 35% 25%, #ffe0df, #d73b47);
  color: white;
}

.pool-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pool-pick {
  min-width: 42px;
  height: 38px;
  border: 1px solid rgba(139, 103, 24, 0.22);
  border-radius: 999px;
  background: #fff8df;
  color: #241b07;
  font-weight: 900;
}

.pool-pick.selected {
  background: var(--green);
  color: white;
  border-color: var(--green);
  animation: selectedPulse 1.7s ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(6, 63, 49, 0.14);
}

.special-ball,
.mini-ball.special-ball,
.pool-pick.special-ball {
  border-color: rgba(166, 34, 47, 0.42);
  background: radial-gradient(circle at 35% 25%, #ffe6e8, #c6283a);
  color: #fff;
}

.pool-pick.special-ball.selected,
.special-ball.hot-special {
  background: radial-gradient(circle at 35% 25%, #fff1c8, #a6192b);
  color: white;
  box-shadow: 0 0 0 4px rgba(166, 34, 47, 0.2);
}

.power-special,
.power-chip {
  border-color: rgba(166, 34, 47, 0.6) !important;
  background: radial-gradient(circle at 35% 25%, #ffe6e8, #c6283a) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(166, 34, 47, 0.12);
}

@keyframes selectedPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(6, 63, 49, 0.13);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 6px rgba(215, 169, 68, 0.22);
  }
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(166, 34, 47, 0.08);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(166, 34, 47, 0.12);
  }
}

.variant-note {
  padding: 12px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: rgba(215, 169, 68, 0.12);
  color: var(--muted);
  line-height: 1.45;
}

.source-explain {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(6, 63, 49, 0.14);
  border-radius: 12px;
  background: rgba(6, 63, 49, 0.04);
}

.source-explain strong {
  color: var(--green);
}

.source-explain span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.pool-test-list {
  display: grid;
  gap: 8px;
}

.pool-test-row {
  display: grid;
  grid-template-columns: 110px 1fr 86px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.pool-test-row.power-test-row {
  grid-template-columns: 110px minmax(190px, 1fr) minmax(150px, 0.65fr) 96px;
}

.pool-hit-badge {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 10px;
  background: rgba(166, 34, 47, 0.1);
  color: var(--crimson);
  font-weight: 900;
}

.power-chip {
  border-color: rgba(6, 63, 49, 0.22);
  background: #f6efe1;
}

.power-chip.active {
  background: rgba(166, 34, 47, 0.12);
  color: var(--crimson);
  border-color: rgba(166, 34, 47, 0.28);
}

.locked-banner {
  display: none;
  padding: 13px;
  border: 1px solid rgba(6, 63, 49, 0.18);
  border-radius: 12px;
  background: rgba(6, 63, 49, 0.08);
  color: var(--green);
  font-weight: 800;
}

.locked-banner.active {
  display: block;
}

.export-box {
  display: grid;
  gap: 12px;
}

.purchase-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(6, 63, 49, 0.18);
  border-radius: 12px;
  background: #fffdf5;
}

.purchase-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.purchase-card-head strong {
  color: var(--green);
  font-size: 16px;
}

.purchase-card-head span {
  color: var(--crimson);
  font-weight: 900;
}

.purchase-ticket-list {
  display: grid;
  gap: 8px;
}

.purchase-ticket-row {
  display: grid;
  grid-template-columns: 74px 150px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(6, 63, 49, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.purchase-ticket-row > span {
  color: var(--crimson);
  font-weight: 900;
}

.purchase-ticket-row > strong {
  color: var(--green);
  font-size: 13px;
}

.purchase-ticket-row > em {
  justify-self: end;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.latest-result-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(150px, auto);
  gap: 14px;
  align-items: center;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid rgba(166, 34, 47, 0.18);
  border-radius: 12px;
  background: rgba(255, 253, 245, 0.92);
}

.latest-result-card span,
.latest-result-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.latest-result-card strong {
  display: block;
  color: var(--green);
  font-size: 18px;
  margin: 3px 0;
}

.latest-result-card em {
  justify-self: end;
  color: var(--crimson);
  font-style: normal;
  font-weight: 950;
}

.manual-input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  font: 700 14px var(--font);
  background: rgba(255, 255, 255, 0.88);
}

.data-source-panel {
  margin: 12px 0 14px;
}

.source-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.source-mode {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 900;
}

.source-mode.active {
  border-color: rgba(166, 34, 47, 0.34);
  background: rgba(166, 34, 47, 0.09);
  color: var(--crimson);
}

.source-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}

.data-validation-box {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.data-validation-box strong {
  color: var(--green);
}

.data-validation-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.data-validation-box.valid {
  border-color: rgba(6, 127, 94, 0.25);
  background: rgba(6, 127, 94, 0.06);
}

.data-validation-box.warn {
  border-color: rgba(215, 169, 68, 0.45);
  background: rgba(215, 169, 68, 0.12);
}

.data-validation-box.invalid {
  border-color: rgba(166, 34, 47, 0.42);
  background: rgba(166, 34, 47, 0.08);
}

.validation-error {
  color: var(--crimson) !important;
}

.validation-warning {
  color: #8b6410 !important;
}

.history-panel {
  margin: 12px 0 14px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  padding-right: 3px;
}

.history-row {
  display: grid;
  grid-template-columns: 120px minmax(260px, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(6, 63, 49, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.history-row strong {
  display: block;
  color: var(--green);
  font-size: 15px;
}

.history-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-row em {
  justify-self: end;
  color: var(--crimson);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-output {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  background: #fffef9;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.audit-chip {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.audit-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-chip strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  word-break: break-word;
}

.explain-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.explain-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.68);
}

.explain-list strong {
  color: var(--green);
}

.backtest-board {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.control-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
}

select:focus,
input:focus {
  outline: none;
  border-color: rgba(215, 169, 68, 0.85);
  box-shadow: 0 0 0 4px rgba(215, 169, 68, 0.16);
}

.result-block {
  min-height: 130px;
  color: var(--muted);
  line-height: 1.6;
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.45;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metrics-grid,
  .settings-grid,
  .latest-list,
  .game-summary,
  .mega-control-grid,
  .action-guide,
  .mega-insight-grid,
  .bao-demand-grid,
  .draw-focus,
  .radar-grid,
  .bao-stats,
  .audit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strategy-layout,
  .content-grid,
  .backtest-board,
  .latest-board,
  .bao-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .hero-overlay {
    flex-direction: column;
    align-items: stretch;
  }

  .nav,
  .metrics-grid,
  .settings-grid,
  .latest-list,
  .game-summary,
  .mega-control-grid,
  .action-guide,
  .mega-insight-grid,
  .bao-demand-grid,
  .draw-focus,
  .radar-grid,
  .bao-stats,
  .audit-grid,
  .pool-panel,
  .ticket-grid,
  .pool-test-row,
  .purchase-ticket-row,
  .pool-test-row.power-test-row {
    grid-template-columns: 1fr;
  }

  .hero,
  .hero-overlay {
    min-height: 360px;
  }

  .update-card {
    min-width: 0;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .hero,
  .warning-strip,
  .nav,
  .export-actions,
  .export-output,
  .workflow-band,
  .surface:not(.export-box) {
    display: none !important;
  }

  .workflow-band:has(.export-box),
  .export-box,
  .purchase-card {
    display: grid !important;
  }

  .app-shell,
  .main {
    display: block;
    padding: 0;
  }

  .purchase-card {
    break-inside: avoid;
    border: 1px solid #222;
  }
}
