/* ==========================================================================
   LottoScopeData.com — 台灣彩券數據與分析平台
   Design tokens + SSR-first components. 無外部字型／CDN。
   ========================================================================== */

:root {
  --navy: #0b2545;
  --navy-700: #123258;
  --navy-600: #17406e;
  --ink: #0f1e33;
  --body: #33445c;
  --muted: #64748b;
  --line: #e4ebf5;
  --line-strong: #cbd5e1;
  --bg: #f2f6fc;
  --card: #ffffff;
  --blue: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --red: #dc2626;
  --red-soft: #fee7e7;
  --orange: #f97316;
  --gold: #f59e0b;
  --green: #15803d;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(15, 35, 70, 0.05);
  --shadow: 0 10px 30px rgba(15, 35, 70, 0.07);
  --shadow-lg: 0 20px 50px rgba(15, 35, 70, 0.12);
  --container: 1280px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --mono: "Bahnschrift", "DIN Alternate", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.4em;
  color: var(--navy);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 30px;
  font-weight: 900;
}

h2 {
  font-size: 21px;
  font-weight: 800;
}

h3 {
  font-size: 17px;
  font-weight: 800;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.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;
}

.icon {
  flex: none;
  vertical-align: -0.18em;
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 18px rgba(6, 20, 40, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  flex: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
}

.brand-text {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-text .brand-dot {
  color: #7dd3fc;
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.22);
  flex: none;
}

.market-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #eaf2ff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.market-chip svg {
  display: block;
}

.market-chip .caret {
  opacity: 0.7;
  font-size: 10px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 21px 12px;
  color: #dbe6f5;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.is-active {
  color: #fff;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--red);
  border-radius: 3px 3px 0 0;
}

.nav-link .caret {
  opacity: 0.65;
  font-size: 9px;
}

.nav-item {
  position: relative;
}

.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  display: none;
}

.nav-item:hover .nav-menu,
.nav-item:focus-within .nav-menu {
  display: block;
}

.nav-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: var(--blue-50);
  text-decoration: none;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: transparent;
  color: #e6eefc;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  background: var(--navy-700);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 20px 16px;
}

.mobile-nav a {
  display: block;
  padding: 12px 4px;
  color: #e7effb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.mobile-nav .mobile-sub {
  padding-left: 16px;
  font-size: 14px;
  color: #b9cbe6;
}

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  color: #fff;
  background: var(--navy) url("../img/hero-tw-photo.2ec12197fd90.jpg") center bottom / cover no-repeat;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(96deg, rgba(4, 17, 32, 0.68) 0%, rgba(4, 17, 32, 0.46) 34%, rgba(4, 17, 32, 0.16) 62%, rgba(4, 17, 32, 0.03) 100%);
}

.hero-inner {
  position: relative;
  padding-top: 34px;
  padding-bottom: 32px;
}

.hero--home .hero-inner {
  padding-top: 40px;
  padding-bottom: 38px;
}

.hero--compact .hero-inner {
  padding-top: 24px;
  padding-bottom: 22px;
}

.hero--compact {
  background-position: center 78%;
}

.hero h1 {
  color: #fff;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 900;
  margin-bottom: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.5px;
}

.hero-accent {
  width: 64px;
  height: 5px;
  margin: 12px 0 12px;
  background: var(--red);
  border-radius: 3px;
}

.hero-sub {
  margin: 0;
  color: #dbe7f8;
  font-size: clamp(13.5px, 1.3vw, 17px);
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e8f1ff;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 760px;
  margin-top: 22px;
  padding: 6px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(3, 15, 30, 0.35);
}

.hero-search .search-icon {
  color: #64748b;
  margin-left: 12px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 11px 4px;
  font-size: 15px;
  color: var(--ink);
}

.hero-search input::placeholder {
  color: #8296ad;
}

.hero-search button {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy-600) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}

.hero-search button:hover {
  filter: brightness(1.06);
}

.hero-compact-body {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

/* -------------------------------------------------------------- breadcrumb */
.breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 11px 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li + li::before {
  content: "›";
  color: #a7b6c9;
}

.breadcrumb a {
  color: #465873;
}

.breadcrumb [aria-current="page"] {
  color: var(--navy);
  font-weight: 700;
}

/* -------------------------------------------------------------- page layout */
.page {
  padding: 22px 0 44px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.layout--narrow {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.stack {
  display: grid;
  gap: 22px;
}

.stack--sm {
  gap: 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* ------------------------------------------------------------------- panels */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 0;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.panel-head .head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  flex: none;
}

.panel-head .head-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.panel-head .head-note {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.panel-body {
  padding: 16px 18px 18px;
}

.panel-body--flush {
  padding: 0;
}

.panel-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fafcff;
  font-size: 13px;
  color: var(--muted);
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #b45309;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}

.verified-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 11.5px;
  font-weight: 700;
}

.pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 11.5px;
  font-weight: 700;
}

/* ------------------------------------------------------------ quick entries */
.quick-entries {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.quick-entry {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 12px;
  color: var(--ink);
  border-radius: 12px;
}

.quick-entry + .quick-entry {
  border-left: 1px dashed var(--line);
}

.quick-entry:hover {
  background: var(--blue-50);
  text-decoration: none;
}

.quick-entry .quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--blue-50);
  color: var(--blue);
  flex: none;
}

.quick-entry strong {
  display: block;
  font-size: 14px;
  color: var(--navy);
  font-weight: 800;
}

.quick-entry small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* -------------------------------------------------------------- game cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 46%);
  overflow: hidden;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent, var(--blue));
}

.game-card--blue {
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
}

.game-card--red {
  --accent: #dc2626;
  --accent-soft: #fff1f1;
}

.game-card--orange {
  --accent: #f97316;
  --accent-soft: #fff7ed;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.game-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  color: var(--accent, var(--navy));
  letter-spacing: 0.5px;
}

.game-title .game-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft, var(--blue-50));
  font-size: 16px;
  font-weight: 900;
  color: var(--accent, var(--blue));
  border: 1px solid color-mix(in srgb, var(--accent, var(--blue)) 25%, #fff);
}

.game-tagline {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.game-meta {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  font-size: 13px;
}

.game-meta div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.game-meta dt {
  color: var(--muted);
  font-size: 12.5px;
}

.game-meta dd {
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ball-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  margin-right: 2px;
}

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #bfdbfe;
  color: var(--navy);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(15, 35, 70, 0.05), 0 1px 2px rgba(15, 35, 70, 0.06);
}

.ball--special {
  background: var(--red);
  border-color: #b91c1c;
  color: #fff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.ball--sm {
  width: 28px;
  height: 28px;
  font-size: 12.5px;
}

.ball--lg {
  width: 44px;
  height: 44px;
  font-size: 19px;
}

.ball--empty {
  opacity: 0.45;
}

.game-prize {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.game-prize strong {
  color: var(--navy);
  font-size: 14px;
}

.game-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  text-align: center;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy-600) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.22);
}

.btn--primary:hover {
  filter: brightness(1.07);
}

.btn--ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--navy);
}

.btn--ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn--soft {
  background: var(--blue-50);
  color: var(--blue);
  border-color: #c7ddff;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn--danger {
  background: var(--red);
  color: #fff;
}

/* ------------------------------------------------------------------- tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.data-table thead th {
  background: var(--navy);
  color: #e9f1ff;
  text-align: left;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  padding: 10px 12px;
}

.data-table thead th:first-child {
  border-top-left-radius: 10px;
}

.data-table thead th:last-child {
  border-top-right-radius: 10px;
}

.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef3fa;
  vertical-align: middle;
  color: #33445c;
}

.data-table tbody tr:hover {
  background: #f8fbff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--navy);
}

.data-table .issue {
  font-weight: 800;
  color: var(--navy);
}

.table-note {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  background: #fafcff;
  border-top: 1px solid var(--line);
}

/* ----------------------------------------------------------------- pagers */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #43566f;
  font-size: 13px;
  font-weight: 700;
}

.pager a:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

.pager .is-current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.pager .is-disabled {
  opacity: 0.4;
}

.pager .ellipsis {
  border-color: transparent;
  background: transparent;
  min-width: 18px;
}

/* ------------------------------------------------------------------ charts */
.chart-card {
  padding: 14px 16px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.chart-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.chart-card .chart-sub {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-empty {
  padding: 26px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #f8fafc;
  border-radius: 10px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.legend-item b {
  color: var(--navy);
}

.legend-item small {
  color: var(--muted);
}

.donut-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut-block .donut-holder {
  width: 45%;
  min-width: 130px;
}

.donut-meta {
  flex: 1;
  min-width: 0;
}

/* -------------------------------------------------------------- stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}

.stat-value small {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font);
  margin-left: 4px;
  font-weight: 600;
}

.stat--hot {
  border-color: #fecaca;
  background: #fff5f5;
}

.stat--hot .stat-value {
  color: #b91c1c;
}

.stat--cold {
  border-color: #bfdbfe;
  background: #f3f8ff;
}

/* ----------------------------------------------------------- toolbar/forms */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.toolbar .toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar .toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.toolbar .toolbar-sep {
  width: 1px;
  height: 26px;
  background: var(--line);
  margin: 0 2px;
}

.field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.input,
.select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.input:focus,
.select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #eef3fb;
  border-radius: 10px;
  gap: 3px;
}

.segmented a,
.segmented button {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #51627a;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.segmented a:hover,
.segmented button:hover {
  color: var(--navy);
  text-decoration: none;
}

.segmented .is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 4px rgba(15, 35, 70, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #47586f;
  font-size: 12.5px;
  font-weight: 700;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

.chip.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.chip .count {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.75;
}

/* ---------------------------------------------------------------- page tabs */
.page-tabs {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: #44546b;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.page-tab:hover {
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

.page-tab.is-active {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 100%);
  border-color: var(--navy);
  color: #fff;
}

/* ------------------------------------------------------------------ notice */
.notice {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #7c5a12;
  font-size: 13px;
}

.notice .notice-icon {
  color: #d97706;
  flex: none;
}

.notice--red {
  border-color: #fecaca;
  background: var(--red-soft);
  color: #9f1239;
}

.notice--red .notice-icon {
  color: #dc2626;
}

.notice--info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}

.notice--info .notice-icon {
  color: #2563eb;
}

.notice strong {
  color: inherit;
}

.notice p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------- callouts */
.callout {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fbff;
  font-size: 13px;
}

.callout h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.callout ul {
  margin-bottom: 0;
}

/* -------------------------------------------------------------------- ads */
.ad-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.ad-label {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(8, 18, 32, 0.78);
  color: #e5edf9;
  font-size: 10.5px;
  letter-spacing: 1px;
  font-weight: 700;
}

.ad-link {
  display: block;
  padding: 26px 18px 18px;
  background: linear-gradient(120deg, var(--from, #0b2545) 0%, var(--to, #1d4ed8) 100%);
  color: #fff;
  min-height: 132px;
}

.ad-link:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.ad-emoji {
  font-size: 22px;
  line-height: 1;
}

.ad-title {
  margin: 6px 0 2px;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}

.ad-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.ad-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
}

.ad-card--banner .ad-link {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 0;
  padding: 18px 22px;
}

.ad-card--banner .ad-title {
  font-size: 19px;
  margin: 0;
}

.ad-card--banner .ad-copy {
  flex: 1;
  min-width: 0;
}

.ad-card--banner .ad-cta {
  margin-top: 0;
  flex: none;
  padding: 8px 16px;
  font-size: 12.5px;
}

.ad-rail {
  display: grid;
  gap: 14px;
}

/* ---------------------------------------------------------------- articles */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: inherit;
  height: 100%;
}

.article-card:hover {
  text-decoration: none;
  border-color: #bfd5f6;
  box-shadow: var(--shadow);
}

.article-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 108px;
  font-size: 38px;
  background: linear-gradient(135deg, #0b2545 0%, #1d4ed8 100%);
}

.article-cover--2 {
  background: linear-gradient(135deg, #123258 0%, #0e7490 100%);
}

.article-cover--3 {
  background: linear-gradient(135deg, #111827 0%, #b91c1c 100%);
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.article-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.45;
}

.article-card p {
  margin: 0;
  font-size: 12.5px;
  color: #55677f;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .article-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.article-list {
  display: grid;
  gap: 14px;
}

.article-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
}

.article-row:hover {
  text-decoration: none;
  border-color: #bfd5f6;
}

.article-row .row-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b2545 0%, #1d4ed8 100%);
  font-size: 30px;
}

.article-row h3 {
  margin: 2px 0 4px;
  font-size: 17px;
}

.article-row p {
  margin: 0;
  color: #55677f;
  font-size: 13px;
}

/* ------------------------------------------------------------- article page */
.prose {
  color: #33445c;
  font-size: 15.5px;
  line-height: 1.9;
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 20px;
  padding-left: 11px;
  border-left: 4px solid var(--red);
}

.prose h3 {
  margin-top: 1.4em;
  font-size: 16.5px;
}

.prose p {
  margin: 0 0 1.15em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 4px solid var(--blue);
  background: #f5f9ff;
  border-radius: 0 10px 10px 0;
  color: #33445c;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 14px;
}

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
}

.prose th {
  background: #f3f7fd;
  color: var(--navy);
}

.article-header {
  padding-bottom: 4px;
}

.article-header h1 {
  font-size: clamp(25px, 3vw, 34px);
  margin-bottom: 10px;
}

.article-header .article-lead {
  font-size: 15.5px;
  color: #4d6078;
  margin-bottom: 12px;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.article-byline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.source-box {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  font-size: 13px;
}

.source-box h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

/* -------------------------------------------------------------- number tool */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #46586f;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.mode-tab .mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue);
  flex: none;
}

.mode-tab strong {
  display: block;
  font-size: 15.5px;
  font-weight: 900;
  color: var(--navy);
}

.mode-tab small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.mode-tab[aria-selected="true"],
.mode-tab.is-active {
  border-color: var(--navy);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 100%);
  color: #fff;
}

.mode-tab[aria-selected="true"] strong,
.mode-tab.is-active strong {
  color: #fff;
}

.mode-tab[aria-selected="true"] small,
.mode-tab.is-active small {
  color: #cfe0f6;
}

.mode-tab[aria-selected="true"] .mode-icon,
.mode-tab.is-active .mode-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.tool-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.tool-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tool-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
}

.tool-panel-head .icon {
  color: var(--blue);
}

.tool-panel-body {
  padding: 14px 15px;
}

.tool-panel-body--flush {
  padding: 0;
}

.game-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
}

.game-option + .game-option {
  margin-top: 8px;
}

.game-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-50);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1) inset;
}

.game-option input {
  accent-color: var(--blue);
}

.game-option .option-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}

.game-option .option-rule {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.stepper button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.stepper input {
  width: 64px;
  height: 34px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}

.option-row + .option-row {
  border-top: 1px dashed var(--line);
}

.option-row .option-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #4b5d75;
}

.option-row .option-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.stepper-buttons {
  display: inline-flex;
  gap: 4px;
}

.stepper-buttons button {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #51627a;
  cursor: pointer;
}

.stepper-buttons button.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.exclude-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--mono);
  letter-spacing: 1px;
}

.tool-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.tool-result-head .result-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
}

.tool-result-head .result-time {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.result-groups {
  display: grid;
  gap: 10px;
  padding: 14px 15px;
}

.result-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e8effa;
  flex-wrap: wrap;
}

.result-group .group-label {
  min-width: 0;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  background: #e8f0fe;
  border-radius: 6px;
  padding: 2px 8px;
  text-align: center;
  flex: none;
}

.result-group .group-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.manual-zone {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.manual-zone label {
  font-size: 12.5px;
  font-weight: 700;
  color: #4b5d75;
}

.tool-actions {
  display: flex;
  gap: 10px;
  padding: 12px 15px 15px;
}

.tool-actions .btn {
  flex: 1;
}

.warning-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: linear-gradient(90deg, #fff1f1 0%, #fff 100%);
  color: #9f1239;
  font-size: 12.5px;
}

.warning-bar .warn-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
  color: #dc2626;
  flex: none;
  padding-right: 12px;
  border-right: 1px solid #fecaca;
  font-size: 13.5px;
}

/* ------------------------------------------------------------ page sections */
.section {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head .section-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
}

.side-nav {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #46586f;
  font-size: 13px;
  font-weight: 700;
}

.side-nav a:hover {
  background: var(--blue-50);
  text-decoration: none;
}

.side-nav a.is-active {
  background: var(--navy);
  color: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 900;
  color: var(--navy);
}

.section-title .title-mark {
  color: var(--gold);
}

/* ---------------------------------------------------------------- markets */
.market-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.market-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 16px;
}

.market-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.market-list div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12.5px;
}

.market-list dt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.market-list dd {
  margin: 0;
  color: #33445c;
  font-weight: 600;
}

.market-figure {
  position: relative;
  margin-top: 12px;
  height: 74px;
  border-radius: 10px;
  overflow: hidden;
  background: url("../img/skyline.2b2c743aa2fc.svg") center / cover no-repeat;
}

/* ------------------------------------------------------------------- misc */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.meta-line .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b6c4d6;
}

.empty-state {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.empty-state strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 4px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.reading {
  max-width: 900px;
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  font-weight: 600;
  color: var(--navy);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

/* ------------------------------------------------------------------ footer */
.site-footer {
  margin-top: 40px;
  background: var(--navy);
  color: #c8d6e8;
  font-size: 13px;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 28px;
  padding: 34px 0 28px;
}

.footer-brand .brand-text {
  font-size: 19px;
}

.footer-tagline {
  margin: 10px 0 0;
  color: #9fb3cc;
  font-size: 12.5px;
  line-height: 1.7;
}

.footer-col h3 {
  color: #fff;
  font-size: 13.5px;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.footer-col a {
  color: #c8d6e8;
}

.footer-col a:hover {
  color: #fff;
}

.footer-contact {
  display: grid;
  gap: 8px;
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #dbe7f5;
  font-weight: 600;
}

.footer-contact a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #93a9c2;
  font-size: 12px;
}

.footer-disclaimer {
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #8ea6c1;
  font-size: 12px;
  line-height: 1.75;
}

/* ------------------------------------------------------------- home layout */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.home-split .grid-2,
.home-split .grid-3 {
  grid-template-columns: minmax(0, 1fr);
}

.home-split .chart-card {
  padding: 12px;
}

.home-split .donut-block {
  grid-template-columns: minmax(0, 1fr);
}

.home-split .callout {
  padding: 12px 14px;
}

.home-split > .panel {
  margin: 0;
}

.home-split > :only-child {
  grid-column: 1 / -1;
}

@media (max-width: 1100px) {
  .home-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-split .chart-card {
  padding: 12px;
}

.game-card--compact {
  gap: 8px;
  padding: 14px 14px 12px;
}

.game-card--compact .game-tagline {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  min-height: 38px;
}

.game-card--compact .game-actions {
  margin-top: auto;
  padding-top: 2px;
}

.game-card--compact .game-actions .btn {
  width: 100%;
  justify-content: center;
}

.market-figure {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #12305a 0%, #0b2545 100%);
  margin-top: 10px;
}

.market-figure img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  opacity: 0.9;
}

.market-figure figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 10px;
  background: linear-gradient(0deg, rgba(4, 16, 30, 0.9), rgba(4, 16, 30, 0));
  color: #dbe7f8;
  font-size: 11px;
  letter-spacing: 0.4px;
}

/* --------------------------------------------------------- narrow mobile */
html,
body {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

.container,
.layout,
.stack,
.panel,
.game-card,
.tool-panel,
.article-card {
  min-width: 0;
}

.hero-search input {
  min-width: 0;
  width: 100%;
}

@media (max-width: 560px) {
  .quick-entries {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-entry {
    border-left: 0 !important;
  }

  .quick-entry + .quick-entry {
    border-top: 1px dashed var(--line);
  }

  .hero-search {
    max-width: 100%;
  }

  .hero-search input {
    font-size: 13px;
    padding-left: 34px;
  }

  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .layout,
  .layout--narrow,
  .two-col {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .tool-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .tool-grid > .tool-side {
    grid-column: 1 / -1;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-grid > .game-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    gap: 12px;
  }

  .layout,
  .layout--narrow,
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-grid > .tool-side {
    grid-column: auto;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-main {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .footer-contact-col {
    grid-column: 1 / -1;
  }

  .side-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .quick-entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-entry:nth-child(2n) {
    border-left: 0;
  }

  .quick-entry:nth-child(n + 3) {
    border-top: 1px dashed var(--line);
  }

  .quick-entry:last-child {
    grid-column: 1 / -1;
  }

  .ad-card--banner .ad-link {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 14.5px;
  }

  h1 {
    font-size: 24px;
  }

  .container {
    padding: 0 14px;
  }

  .hero-inner,
  .hero--home .hero-inner {
    padding-top: 30px;
    padding-bottom: 28px;
  }

  .hero--compact .hero-inner {
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero-search {
    border-radius: 14px;
    padding: 6px;
  }

  .hero-search button {
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 13px;
  }

  .hero-search input {
    font-size: 13.5px;
  }

  .brand-text {
    font-size: 17px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand-divider,
  .market-chip {
    display: none;
  }

  .header-inner {
    min-height: 56px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .game-grid,
  .grid-2,
  .grid-3,
  .article-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-grid > .game-card:last-child {
    grid-column: auto;
  }

  .page {
    padding: 14px 0 30px;
  }

  .stack {
    gap: 16px;
  }

  .panel-head {
    padding: 13px 14px 0;
  }

  .panel-head h2,
  .panel-head h3 {
    font-size: 16px;
  }

  .panel-body {
    padding: 12px 14px 14px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-value {
    font-size: 19px;
  }

  .mode-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-tab {
    padding: 11px 13px;
  }

  .toolbar {
    padding: 10px;
  }

  .toolbar .toolbar-sep {
    display: none;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 26px 0 20px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    font-size: 11.5px;
  }

  .article-row {
    gap: 12px;
    padding: 12px;
  }

  .article-row .row-cover {
    width: 62px;
    height: 62px;
    font-size: 24px;
  }

  .article-row h3 {
    font-size: 15px;
  }

  .warning-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .warning-bar .warn-title {
    border-right: 0;
    padding-right: 0;
  }

  .result-group {
    gap: 7px;
  }

  .ball {
    width: 31px;
    height: 31px;
    font-size: 13.5px;
  }

  .ball--lg {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .donut-block {
    flex-direction: column;
    align-items: stretch;
  }

  .donut-block .donut-holder {
    width: 100%;
  }

  .data-table {
    font-size: 12.5px;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 8px 9px;
  }

  .quick-entry {
    padding: 11px 8px;
    gap: 8px;
  }

  .quick-entry .quick-icon {
    width: 34px;
    height: 34px;
  }

  .quick-entry strong {
    font-size: 12.5px;
  }

  .quick-entry small {
    font-size: 10.5px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-actions {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }
}

/* ---- page-level additions: articles, search, static pages, tools ---- */
.disclaimer-strip {
  background: #fffdf6;
  border-top: 1px solid #f3e3c2;
  border-bottom: 1px solid #f3e3c2;
  padding: 9px 0;
}

.disclaimer-strip .notice {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 12.5px;
}

.article-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.article-kicker a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.article-lede {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
}

.source-label {
  font-weight: 700;
  color: var(--navy);
}

.source-date {
  color: var(--muted);
  font-size: 12px;
}

.source-note {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.ball-row--tight {
  gap: 4px;
}

.search-hit {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-hit:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(15, 35, 70, 0.08);
}

.search-hit strong {
  font-size: 15px;
  color: var(--navy);
}

.search-hit span {
  font-size: 12.5px;
  color: var(--muted);
}

.search-hit em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
}

.code-block {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prose .code-block {
  margin-bottom: 14px;
}

.notice strong {
  font-weight: 700;
}

@media (max-width: 760px) {
  .article-lede {
    font-size: 14px;
  }

  .article-byline {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .disclaimer-strip .notice {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* 首頁精簡版彩種卡：縮小號碼球，避免 6+1 顆換行 */
.game-card--compact .ball-row { gap: 4px; margin-top: 4px; }
.game-card--compact .ball { width: 27px; height: 27px; font-size: 12.5px; border-width: 1px; }
.game-card--compact .ball-label { display: none; }
.game-card--compact .game-meta { font-size: 12px; }
.game-card--compact .game-meta dt { font-size: 11px; }

/* 首頁橫幅：保留天際線與 101，避免裁切 */
.hero--home { min-height: 250px; background-position: center bottom; }
@media (max-width: 900px) { .hero--home { min-height: 200px; background-position: center bottom; } }

/* 首頁橫幅：使用效果圖實拍照片（較矮、貼近效果圖比例） */
.hero--home .hero-inner { padding-top: 34px; padding-bottom: 30px; }
.hero--home h1 { font-size: clamp(30px, 2.9vw, 42px); }
.hero--home .hero-sub { margin-top: 6px; font-size: 14.5px; }
.hero--home .hero-search { margin-top: 18px; height: 56px; max-width: 780px; }
.hero--compact { background-position: center bottom; min-height: 150px; }
@media (max-width: 760px) {
  .hero--home { background-position: 14% 62%; background-size: cover; }
}

/* 左側玻璃遮罩：隱藏效果圖上原有的文字，保留右側實拍 101 */
.hero::before {
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  background: linear-gradient(90deg, rgba(4, 17, 32, 0.88) 0%, rgba(4, 17, 32, 0.84) 44%, rgba(4, 17, 32, 0.55) 60%, rgba(4, 17, 32, 0.12) 72%, rgba(4, 17, 32, 0) 80%);
}

/* 玻璃遮罩只覆蓋左側文字區，右側實拍保持清晰 */
.hero::before {
  inset: 0 auto 0 0 !important;
  width: 74%;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 100%);
}
.hero::before {
  width: 82%;
  background: linear-gradient(90deg, rgba(4,17,32,.9) 0%, rgba(4,17,32,.86) 50%, rgba(4,17,32,.7) 68%, rgba(4,17,32,.28) 84%, rgba(4,17,32,0) 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 72%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 72%, transparent 100%);
}
.hero--home h1 { font-size: clamp(32px, 3.1vw, 46px); letter-spacing: 0.5px; }
.hero--home .hero-sub { font-size: 15.5px; }

/* 內頁橫幅與首頁同高度（比例 6.4:1），內容垂直居中，避免照片被裁過頭 */
.hero--compact {
  min-height: clamp(190px, 15.6vw, 250px);
  display: flex;
  align-items: center;
  background-position: center bottom;
}
.hero--compact .hero-inner { width: 100%; padding-top: 0; padding-bottom: 0; }
.hero--compact h1 { font-size: clamp(28px, 2.6vw, 40px); }
@media (max-width: 760px) {
  .hero--compact { min-height: 190px; background-position: 18% 62%; }
}
.hero::before {
  width: 100%;
  background: linear-gradient(90deg, rgba(4,17,32,.9) 0%, rgba(4,17,32,.86) 38%, rgba(4,17,32,.62) 58%, rgba(4,17,32,.3) 76%, rgba(4,17,32,.08) 90%, rgba(4,17,32,0) 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 34%, rgba(0,0,0,.55) 68%, transparent 96%);
  mask-image: linear-gradient(90deg, #000 0%, #000 34%, rgba(0,0,0,.55) 68%, transparent 96%);
}
.hero::before {
  width: 76%;
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  backdrop-filter: blur(24px) saturate(1.1);
  background: linear-gradient(90deg, rgba(4,17,32,.9) 0%, rgba(4,17,32,.88) 48%, rgba(4,17,32,.8) 58%, rgba(4,17,32,.5) 68%, rgba(4,17,32,.18) 82%, rgba(4,17,32,0) 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 56%, rgba(0,0,0,.6) 72%, transparent 92%);
  mask-image: linear-gradient(90deg, #000 0%, #000 56%, rgba(0,0,0,.6) 72%, transparent 92%);
}
.hero::before {
  width: 80%;
  -webkit-backdrop-filter: blur(28px) saturate(1.05);
  backdrop-filter: blur(28px) saturate(1.05);
  background: linear-gradient(90deg, rgba(4,17,32,.92) 0%, rgba(4,17,32,.9) 52%, rgba(4,17,32,.84) 63%, rgba(4,17,32,.42) 72%, rgba(4,17,32,.12) 80%, rgba(4,17,32,0) 92%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 64%, rgba(0,0,0,.7) 74%, transparent 88%);
  mask-image: linear-gradient(90deg, #000 0%, #000 64%, rgba(0,0,0,.7) 74%, transparent 88%);
}
.hero::before {
  width: 86%;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(6, 20, 36, 0.975) 0%, rgba(6, 20, 36, 0.965) 56%, rgba(6, 20, 36, 0.9) 64%, rgba(6, 20, 36, 0.55) 72%, rgba(6, 20, 36, 0.18) 80%, rgba(6, 20, 36, 0) 90%);
  -webkit-mask-image: none;
  mask-image: none;
}
.hero::before {
  width: 100%;
  background: linear-gradient(90deg, rgba(6,20,36,.975) 0%, rgba(6,20,36,.97) 54%, rgba(6,20,36,.94) 61%, rgba(6,20,36,.72) 67%, rgba(6,20,36,.34) 72%, rgba(6,20,36,.08) 78%, rgba(6,20,36,0) 84%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 63%, transparent 84%);
  mask-image: linear-gradient(90deg, #000 0%, #000 63%, transparent 84%);
}
.hero::before {
  background: linear-gradient(90deg, rgba(6,20,36,.42) 0%, rgba(6,20,36,.7) 5%, rgba(6,20,36,.95) 11%, rgba(6,20,36,.97) 54%, rgba(6,20,36,.94) 61%, rgba(6,20,36,.72) 67%, rgba(6,20,36,.34) 72%, rgba(6,20,36,.08) 78%, rgba(6,20,36,0) 84%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 63%, transparent 84%);
  mask-image: linear-gradient(90deg, #000 0%, #000 63%, transparent 84%);
}

/* 正式橫幅：使用者提供的無文字照片（1920×640），所有欄位共用 */
.hero {
  background-image: url("../img/hero-tw-photo.2ec12197fd90.jpg");
  background-size: cover;
  background-position: center 38%;
  background-color: #0b2545;
}
.hero::before {
  width: 100%;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: linear-gradient(100deg, rgba(4, 16, 30, 0.74) 0%, rgba(4, 16, 30, 0.56) 28%, rgba(4, 16, 30, 0.26) 46%, rgba(4, 16, 30, 0.06) 58%, rgba(4, 16, 30, 0) 66%);
  -webkit-mask-image: none;
  mask-image: none;
}
.hero--home,
.hero--compact { min-height: clamp(220px, 19vw, 300px); }
.hero--home { display: flex; align-items: center; }
.hero--home .hero-inner,
.hero--compact .hero-inner { width: 100%; padding-top: 0; padding-bottom: 0; }
@media (max-width: 760px) {
  .hero--home, .hero--compact { min-height: 220px; background-position: center 45%; }
}
.hero, .hero--home, .hero--compact { background-position: center top; }
@media (max-width: 760px) { .hero, .hero--home, .hero--compact { background-position: center 18%; } }
.hero h1, .hero-sub, .hero .breadcrumb, .hero .breadcrumb a { text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35); }
.hero::before {
  background: linear-gradient(100deg, rgba(4, 16, 30, 0.8) 0%, rgba(4, 16, 30, 0.66) 26%, rgba(4, 16, 30, 0.42) 44%, rgba(4, 16, 30, 0.16) 56%, rgba(4, 16, 30, 0.03) 64%, rgba(4, 16, 30, 0) 70%);
}
.hero-sub { color: #fff !important; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 4px 18px rgba(0,0,0,.5); }
.hero::before { background: linear-gradient(100deg, rgba(4,16,30,.82) 0%, rgba(4,16,30,.7) 30%, rgba(4,16,30,.5) 46%, rgba(4,16,30,.24) 58%, rgba(4,16,30,.06) 66%, rgba(4,16,30,0) 72%); }

/* 橫幅完整顯示整張照片：容器比例與原圖一致（3:1），不再裁切 */
.hero, .hero--home, .hero--compact {
  aspect-ratio: 2172 / 724;
  min-height: 220px;
  max-height: none;
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
}
.hero--home .hero-inner, .hero--compact .hero-inner { width: 100%; padding-top: 18px; padding-bottom: 18px; }
@media (max-width: 900px) {
  .hero, .hero--home, .hero--compact { aspect-ratio: auto; min-height: 240px; background-position: 30% center; }
}

/* 6.4:1 橫幅（與效果圖版面一致，300px 高） */
.hero, .hero--home, .hero--compact {
  aspect-ratio: auto !important;
  min-height: 300px !important;
  height: 300px;
  background-image: url("../img/hero-tw.15c745f89b1f.svg") !important;
  background-size: cover;
  background-position: center center;
}
@media (max-width: 900px) {
  .hero, .hero--home, .hero--compact { height: 240px; min-height: 240px !important; background-position: 22% center; }
}

/* 回復：整張 3:1 照片完整顯示（待定稿） */
.hero, .hero--home, .hero--compact {
  aspect-ratio: 2172 / 724 !important;
  height: auto !important;
  min-height: 220px !important;
  background-image: url("../img/hero-tw-photo.2ec12197fd90.jpg") !important;
  background-size: cover;
  background-position: center center;
}
@media (max-width: 900px) {
  .hero, .hero--home, .hero--compact { aspect-ratio: auto !important; height: 240px !important; min-height: 240px !important; background-position: 30% center; }
}

/* 交付資產：橫幅、彩種標識、封面、101、頁腳剪影 */
.hero, .hero--home, .hero--compact {
  aspect-ratio: 32 / 5 !important;
  height: auto !important;
  min-height: 220px !important;
  background-image: url("../img/hero-tw.15c745f89b1f.svg") !important;
  background-size: cover !important;
  background-position: center center !important;
}
@media (max-width: 900px) {
  .hero, .hero--home, .hero--compact { aspect-ratio: auto !important; height: 230px !important; min-height: 230px !important; background-position: 30% center !important; }
}
.game-mark--img { width: auto; height: 30px; border-radius: 0; background: none; box-shadow: none; padding: 0; object-fit: contain; }
.game-card--compact .game-mark--img { height: 24px; }
.article-cover--photo { padding: 0; overflow: hidden; background: #0b2545; }
.article-cover--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.market-card { position: relative; overflow: hidden; }
.market-101 { position: absolute; right: 10px; top: 12px; width: 54px; height: auto; opacity: .9; pointer-events: none; }
.market-list { position: relative; z-index: 1; }
.footer-skyline {
  height: 120px;
  background: none;
  margin-bottom: -1px;
}
@media (max-width: 900px) { .footer-skyline { height: 70px; background-size: 1120px 70px; } }
.ad-link--image { background-size: cover; background-position: center; }
.ad-link--image .ad-title, .ad-link--image .ad-subtitle, .ad-link--image .ad-cta { text-shadow: 0 1px 4px rgba(0,0,0,.55); }
.article-hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; background: #0b2545; }
.article-hero img { display: block; width: 100%; aspect-ratio: 800 / 450; object-fit: cover; }
/* 圖片版廣告：文字堆疊左下，避免橫向擠壓 */
.ad-link--image {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  min-height: 150px;
  padding: 22px 16px 16px !important;
}
.ad-link--image .ad-title { font-size: 14.5px; line-height: 1.35; }
.ad-link--image .ad-subtitle { font-size: 11.5px; opacity: .9; }
.ad-link--image .ad-cta { margin: 6px 0 0; }
.footer-skyline {
  height: 120px;
  background: none;
  background-color: var(--bg);
  margin-bottom: 0;
}
.article-hero img { max-height: 420px; }

/* 回復手繪 SVG 橫幅（不使用任何照片素材） */
.hero, .hero--home, .hero--compact {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 300px !important;
  background: var(--navy) url("../img/hero-tw.15c745f89b1f.svg") center 42% / cover no-repeat !important;
}
.hero--sub-city, .hero--sub-mountain { background-image: url("../img/hero-tw.15c745f89b1f.svg") !important; }
.hero::before {
  inset: 0 !important;
  width: 100% !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  background: linear-gradient(100deg, rgba(6, 22, 41, .86) 0%, rgba(6, 22, 41, .6) 42%, rgba(6, 22, 41, .18) 72%, rgba(6, 22, 41, 0) 88%) !important;
}
@media (max-width: 900px) {
  .hero, .hero--home, .hero--compact { min-height: 230px !important; height: auto !important; background-position: center 38% !important; }
}
.hero--home h1 { font-size: clamp(30px, 3vw, 44px); }
.ad-link > .ad-title, .ad-link > .ad-subtitle { display: block; }
.ad-link > .ad-cta { margin-top: 12px; }

/* 市場切換（header） */
.market-switch { position: relative; }
.market-switch summary { list-style: none; cursor: pointer; }
.market-switch summary::-webkit-details-marker { display: none; }
.market-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 172px; padding: 8px; margin: 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(11, 37, 69, .18);
}
.market-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--navy); font-size: 13.5px; font-weight: 600; }
.market-menu a:hover, .market-menu a.is-active { background: #eef4ff; color: var(--blue); }
.market-flag { font-size: 10px; letter-spacing: .5px; color: #64748b; font-weight: 700; }

/* 各市場橫幅 */
body.theme-jp .hero { background-image: url("../img/hero-jp.4f4673294d7e.jpg"); }
body.theme-kr .hero { background-image: url("../img/hero-kr.345a94e20367.jpg"); }
body.theme-tw .hero { background-image: url("../img/hero-tw.15c745f89b1f.svg"); }
body.theme-jp .hero::before, body.theme-kr .hero::before {
  background: linear-gradient(100deg, rgba(6, 18, 34, .86) 0%, rgba(6, 18, 34, .7) 34%, rgba(6, 18, 34, .34) 54%, rgba(6, 18, 34, .06) 68%, rgba(6, 18, 34, 0) 76%);
}

/* 彩種圖示 */
.game-mark img, .game-mark-img { display: block; height: 30px; width: auto; max-width: 96px; object-fit: contain; }
.game-mark:has(img) { background: transparent; border: 0; box-shadow: none; }

/* 市場橫幅覆蓋（需 !important，蓋過回復手繪橫幅的規則） */
body.theme-jp .hero, body.theme-jp .hero--home, body.theme-jp .hero--compact,
body.theme-jp .hero--sub-city, body.theme-jp .hero--sub-mountain {
  background: #0b2545 url("../img/hero-jp.4f4673294d7e.jpg") center bottom / cover no-repeat !important;
}
body.theme-kr .hero, body.theme-kr .hero--home, body.theme-kr .hero--compact,
body.theme-kr .hero--sub-city, body.theme-kr .hero--sub-mountain {
  background: #0b2545 url("../img/hero-kr.345a94e20367.jpg") center bottom / cover no-repeat !important;
}
.game-mark img, .game-mark-img { height: 32px; max-width: 124px; }
body.theme-jp .game-card--compact .game-mark, body.theme-kr .game-card--compact .game-mark { width: 124px; }
/* 日韓彩種卡：避免名稱與標記擠壓換行 */
.theme-jp .game-card--compact .game-title,
.theme-kr .game-card--compact .game-title { white-space: nowrap; gap: 8px; }
.theme-jp .game-card--compact .game-mark--img img,
.theme-kr .game-card--compact .game-mark--img img { height: 26px; max-width: 92px; }
.theme-jp .game-card--compact .verified-chip,
.theme-kr .game-card--compact .verified-chip { white-space: nowrap; flex: 0 0 auto; }

/* 比例圖圖例：避免窄欄把文字擠成直排 */
.donut-block { flex-wrap: wrap; }
.donut-block .legend { flex: 1 1 150px; min-width: 140px; }
.legend-item { white-space: nowrap; }

/* 右欄資料原則卡：清單與按鈕留白 */
.principles { margin: 0 0 12px; padding-left: 18px; font-size: 12.5px; line-height: 1.85; color: var(--muted); }
.principles li + li { margin-top: 4px; }
.principles + .btn, .panel-body > .btn--block:last-child { margin-top: 2px; }
.panel-body > .btn--block { margin-top: 0; }

.ad-banner-home { margin-top: 18px; }
.ad-banner-home:empty { display: none; }

/* 依需求：橫幅直接顯示照片，不加任何蒙層 */
.hero::before { display: none !important; }
.hero h1 { text-shadow: 0 2px 16px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .45); }
.hero-sub, .hero .breadcrumb, .hero .breadcrumb a { text-shadow: 0 1px 10px rgba(0, 0, 0, .6), 0 1px 2px rgba(0, 0, 0, .45); }

/* 日韓橫幅為明亮實拍，文字改深藍以維持對比（不靠遮罩） */
body.theme-jp .hero h1,
body.theme-kr .hero h1,
body.theme-jp .hero-sub,
body.theme-kr .hero-sub,
body.theme-jp .hero .breadcrumb,
body.theme-kr .hero .breadcrumb,
body.theme-jp .hero .breadcrumb a,
body.theme-kr .hero .breadcrumb a {
  color: #0b2545 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 0 18px rgba(255, 255, 255, .35) !important;
}
body.theme-jp .hero-sub, body.theme-kr .hero-sub { color: #16324f !important; font-weight: 600; }

/* 三站橫幅：實拍 6.4:1（1920×300），直接顯示、不加蒙層 */
.hero, .hero--home, .hero--compact {
  background-image: url("../img/hero-tw.400277b20483.jpg") !important;
  background-size: cover;
  background-position: center center;
}
body.theme-jp .hero, body.theme-jp .hero--home, body.theme-jp .hero--compact {
  background-image: url("../img/hero-jp.4f4673294d7e.jpg") !important;
}
body.theme-kr .hero, body.theme-kr .hero--home, body.theme-kr .hero--compact {
  background-image: url("../img/hero-kr.345a94e20367.jpg") !important;
}
.hero h1,
.hero-sub,
.hero .breadcrumb,
.hero .breadcrumb a {
  color: #0b2545 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 0 18px rgba(255, 255, 255, .45) !important;
}

/* 台/韓橫幅左側為深色建築，文字改白色；日本維持深藍 */
.hero h1,
.hero-sub,
.hero .breadcrumb,
.hero .breadcrumb a {
  color: #ffffff !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .72), 0 1px 3px rgba(0, 0, 0, .55) !important;
}
body.theme-jp .hero h1,
body.theme-jp .hero-sub,
body.theme-jp .hero .breadcrumb,
body.theme-jp .hero .breadcrumb a {
  color: #0b2545 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65), 0 0 20px rgba(255, 255, 255, .55) !important;
}

/* 文字統一回深藍；台/韓把文字區右移，避開左側深色建築 */
.hero h1, .hero-sub, .hero .breadcrumb, .hero .breadcrumb a {
  color: #0b2545 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 0 20px rgba(255,255,255,.5) !important;
}
@media (min-width: 1100px) {
  body.theme-tw .hero .hero-inner { padding-left: 96px; }
  body.theme-kr .hero .hero-inner { padding-left: 150px; }
}
.hero h1, .hero-sub, .hero .breadcrumb, .hero .breadcrumb a {
  text-shadow: 0 1px 0 #ffffff, 0 0 6px rgba(255,255,255,.95), 0 0 24px rgba(255,255,255,.85) !important;
}
@media (min-width: 1100px) {
  body.theme-kr .hero .hero-inner { padding-left: 300px; }
  body.theme-tw .hero .hero-inner { padding-left: 110px; }
}
.hero-sub { font-size: 16px !important; font-weight: 600 !important; }
/* 副標題用膠囊底，避免在亮/暗照片上失讀 */
.hero-sub {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(11, 37, 69, .62);
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5) !important;
  backdrop-filter: blur(2px);
}

/* 首頁雙欄等高，右欄卡片撐滿，消除下方空白 */
.home-split { align-items: stretch; }
.home-split > .stack { display: flex; flex-direction: column; gap: 18px; }
.home-split > .stack > .panel:last-child { flex: 1 1 auto; display: flex; flex-direction: column; }
.home-split > .stack > .panel:last-child .panel-body { flex: 1 1 auto; }

/* 取消等高拉伸，改由內容自然撐高 */
.home-split { align-items: start; }
.home-split > .stack { display: block; }
.home-split > .stack > .panel:last-child { display: block; }

/* 網站地圖 */
.sitemap-links, .sitemap-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sitemap-links { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.sitemap-links a { font-weight: 600; }
.sitemap-articles li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.sitemap-articles li:last-child { border-bottom: 0; padding-bottom: 0; }
.sitemap-articles .muted { flex: 0 0 auto; font-size: 12px; }

/* 彩種數量少於欄寬時自動撐滿，避免右側留白 */
@media (min-width: 900px) {
  .game-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .game-grid > .game-card { min-width: 0; }
}
