:root {
  --primary-pine: #0f4c3a;
  --primary-pine-dark: #064e3b;
  --primary-pine-light: #16654e;
  --accent-mint: #f0fdf4;
  --accent-mint-border: #bbf7d0;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-card: #e2e8f0;
  --text-main: #020617;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
  touch-action: manipulation;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-pine);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(15, 76, 58, 0.25);
  flex-shrink: 0;
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 700;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--primary-pine);
}

main {
  padding: 24px 0 80px;
}

.breadcrumb-nav {
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-nav a {
  color: var(--primary-pine);
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.breadcrumb-nav a:hover {
  opacity: 0.8;
}

.breadcrumb-nav .separator {
  color: #cbd5e1;
  font-size: 11px;
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 800;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

.intro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tracker-tag {
  font-size: 12px;
  font-weight: 900;
  color: var(--primary-pine);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.main-heading {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
  line-height: 1.3;
}

.btn-pill {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1.5px solid var(--border-card);
  background: #ffffff;
  color: var(--text-secondary);
  font-family: inherit;
}

.btn-pill:active {
  transform: scale(0.97);
}

.btn-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* 四大主力彩種 Tab 切換列 */
.tabs-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 64px;
  z-index: 95;
  will-change: transform;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn:hover {
  background: #f1f5f9;
}

.tab-btn.active {
  background: var(--primary-pine);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 76, 58, 0.25);
}

.tab-title-text {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.tab-time-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-base);
  transition: color 0.2s ease;
}

.tab-btn.active .tab-time-badge {
  color: rgba(255, 255, 255, 0.9);
}

/* 直播與呼吸燈 */
.live-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseRed 1.6s infinite;
}

@keyframes pulseRed {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.live-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
}

.ball-animate-drop {
  animation: ballDrop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ballDrop {
  0% { opacity: 0; transform: translateY(-24px) scale(0.7); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.hero-pine-card {
  background: linear-gradient(135deg, var(--primary-pine) 0%, var(--primary-pine-dark) 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  box-shadow: 0 10px 28px -4px rgba(15, 76, 58, 0.3);
  position: relative;
  overflow: hidden;
}

.pine-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.pine-card-badge {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-weight: 800;
}

.pine-balls-stage {
  margin: 14px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.white-ball {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary-pine);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.white-ball.special-ball {
  background: #f59e0b;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-hero-share-line {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: #06C755;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(6, 199, 85, 0.35);
  transition: all 0.15s ease;
  font-family: inherit;
  margin-top: 14px;
}

.btn-hero-share-line:active {
  transform: scale(0.98);
}

.btn-hero-share-line:hover {
  opacity: 0.95;
}

.pine-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 14px;
  margin-top: 14px;
}

.overview-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.overview-top span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 800;
}

.overview-top h3 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  margin-top: 4px;
}

.overview-metrics {
  display: flex;
  gap: 14px;
  margin: 18px 0;
}

.metric-item {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.metric-item strong {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: var(--primary-pine);
  font-family: var(--font-mono);
  line-height: 1.1;
}

.metric-item span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 800;
  margin-top: 4px;
  display: inline-block;
}

.overview-footer {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-card);
  padding-top: 14px;
  font-weight: 600;
}

/* 碰數計算機號碼選擇器 */
.checker-balls-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border-card);
}

.check-ball-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.check-ball-btn:active {
  transform: scale(0.92);
}

.check-ball-btn:hover {
  border-color: var(--primary-pine);
}

.check-ball-btn.selected {
  background: linear-gradient(135deg, #0f4c3a 0%, #16654e 100%);
  color: #ffffff;
  border-color: #0f4c3a;
  box-shadow: 0 3px 8px rgba(15, 76, 58, 0.35);
  transform: scale(1.05);
}

.calc-card-wrap {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.03);
  margin-bottom: 40px;
}

.calc-mode-switch {
  display: inline-flex;
  align-items: center;
  background: #eef2f6;
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  gap: 4px;
  margin-bottom: 20px;
}

.calc-mode-btn {
  padding: 9px 22px;
  border-radius: 9px;
  border: none;
  font-size: 14.5px;
  font-weight: 900;
  cursor: pointer;
  background: transparent;
  color: #475569;
  transition: all 0.15s ease;
  font-family: inherit;
}

.calc-mode-btn.active {
  background: linear-gradient(135deg, #0f4c3a 0%, #16654e 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 76, 58, 0.3);
}

.pillar-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pillar-tab-btn {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.pillar-tab-btn.active {
  background: #0f4c3a;
  color: #ffffff;
  border-color: #0f4c3a;
  box-shadow: 0 2px 6px rgba(15, 76, 58, 0.25);
}

.pillar-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.pillar-box-item {
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.pillar-box-item.active {
  border-color: #0f4c3a;
  background: #f0fdf4;
  box-shadow: 0 0 0 1.5px #0f4c3a;
}

.calc-result-dashboard {
  background: linear-gradient(to right bottom, #f8fafc, #f1f5f9);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 20px;
  margin-top: 18px;
}

.calc-stat-metric {
  flex: 1;
  min-width: 95px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.calc-stat-metric strong {
  display: block;
  font-size: 21px;
  font-weight: 900;
  color: var(--primary-pine);
  font-family: var(--font-mono);
}

.calc-stat-metric span {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.section-wrap {
  margin-bottom: 44px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
}

.range-control-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
}

.range-btn-group {
  display: inline-flex;
  align-items: center;
  background: #eef2f6;
  padding: 4px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  gap: 4px;
}

.range-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.range-btn:active {
  transform: scale(0.96);
}

.range-btn.active {
  background: linear-gradient(135deg, #0f4c3a 0%, #16654e 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 76, 58, 0.35);
}

/* 導航分頁切換列 (四等分) */
.model-nav-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 16px 0;
}

.model-nav-btn {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.model-nav-btn:active {
  transform: scale(0.97);
}

.model-nav-btn.active.lucky {
  background: linear-gradient(135deg, #0f4c3a 0%, #064e3b 100%);
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 76, 58, 0.25);
}

.model-nav-btn.active.unlucky {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  border-color: #991b1b;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(185, 28, 28, 0.22);
}

.model-nav-btn.active.tails-btn {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.22);
}

.model-nav-btn.active.hero-btn {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.model-ranking-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-ranking-title .badge {
  font-size: 14px;
  background: #e2e8f0;
  color: #334155;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
}

.models-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.model-card {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.model-card.lucky {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
}

.model-card.unlucky {
  background: #fffafa;
  border: 1.5px solid #fecaca;
  color: var(--text-main);
}

.model-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.model-name {
  font-size: 19px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-card.lucky .model-name {
  color: #0f4c3a;
}

.model-card.unlucky .model-name {
  color: #991b1b;
}

.model-tag {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 6px;
}

.model-card.lucky .model-tag {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.model-card.unlucky .model-tag {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.model-desc-text {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.model-balls-stage {
  padding: 18px 16px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.model-card.lucky .model-balls-stage {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border: 1.5px solid #e2e8f0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.model-card.unlucky .model-balls-stage {
  background: linear-gradient(to bottom, #fffafa, #fee2e2);
  border: 1.5px solid #fecaca;
  box-shadow: inset 0 2px 4px rgba(220,38,38,0.03);
}

.card-ball-3d {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.5px;
  transition: transform 0.2s ease;
}

.card-ball-lucky {
  background: radial-gradient(circle at 35% 30%, #22c55e 0%, #16654e 65%, #064e3b 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 76, 58, 0.35), inset 0 -2px 5px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

.card-ball-unlucky {
  background: radial-gradient(circle at 35% 30%, #f87171 0%, #dc2626 65%, #991b1b 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.35), inset 0 -2px 5px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

/* 歷史回測實測框 */
.backtest-box {
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  margin-bottom: 20px;
}

.model-card.lucky .backtest-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.model-card.unlucky .backtest-box {
  background: #ffffff;
  border: 1px solid #fecaca;
}

.backtest-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 900;
  font-size: 15px;
}

.backtest-pills-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.backtest-pill {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
}

.model-card.lucky .backtest-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.model-card.unlucky .backtest-pill {
  background: #fff5f5;
  border: 1px solid #fecaca;
}

.backtest-pill span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.backtest-pill strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  margin-top: 4px;
}

.model-card.lucky .backtest-pill strong {
  color: #0f4c3a;
}

.model-card.unlucky .backtest-pill strong {
  color: #dc2626;
}

.card-actions-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-card-share-line {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  background: #06C755;
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 10px rgba(6, 199, 85, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-card-share-line:active {
  transform: scale(0.98);
}

/* 🌟 英雄榜專屬卡片樣式 */
.heroes-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.hero-banner-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #334155;
  border-radius: 16px;
  padding: 24px 28px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.hero-member-card {
  background: #ffffff;
  border: 1.5px solid #fde68a;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-member-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.16);
}

.hero-badge-gold {
  position: absolute;
  top: 18px;
  right: 18px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

.hero-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.hero-author-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

.hero-strategy-title {
  font-size: 14px;
  font-weight: 800;
  color: #b45309;
  margin-top: 2px;
}

.hero-formula-box {
  background: #fefce8;
  border: 1px dashed #fde047;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #713f12;
  line-height: 1.6;
  font-weight: 600;
}

.hero-balls-stage {
  background: linear-gradient(to bottom, #fffbeb, #fef3c7);
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  cursor: pointer;
  flex-wrap: wrap;
}

.hero-ball {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #d97706 70%, #b45309 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 19px;
  box-shadow: 0 4px 10px rgba(180, 83, 9, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.6);
}

.hero-stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.hero-stat-pill {
  flex: 1;
  background: #ffffff;
  border: 1px solid #fef08a;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.hero-stat-pill span {
  font-size: 12px;
  font-weight: 700;
  color: #854d0e;
  display: block;
}

.hero-stat-pill strong {
  font-size: 17px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #b45309;
  display: block;
  margin-top: 2px;
}

/* 歷史開獎記錄 */
.history-card-wrap {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  margin-bottom: 48px;
}

.history-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 14px;
}

.history-list-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-row-item:active {
  transform: scale(0.98);
}

.history-meta-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.history-date-text {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.history-period-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.history-balls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.hist-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 15px;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.hist-ball-pine {
  background: radial-gradient(circle at 35% 30%, #16654e 0%, #0f4c3a 70%, #064e3b 100%);
}

.hist-ball-red {
  background: radial-gradient(circle at 35% 30%, #ef4444 0%, #dc2626 70%, #991b1b 100%);
}

.hist-ball-blue {
  background: radial-gradient(circle at 35% 30%, #38bdf8 0%, #0284c7 70%, #0369a1 100%);
}

.hist-ball-green {
  background: radial-gradient(circle at 35% 30%, #22c55e 0%, #16a34a 70%, #15803d 100%);
}

.hist-ball-special {
  background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #d97706 70%, #b45309 100%);
  border: 1.5px solid #ffffff;
}

.btn-load-more-hist {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  color: var(--text-secondary);
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 尾數分析旗艦版樣式 */
.tails-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 860px) {
  .tails-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tails-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.tails-card h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tails-ai-rec {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.tail-badge-box {
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.tail-badge-box.hot {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  color: #b91c1c;
}

.tail-badge-box.omission {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
}

.tail-badge-box.kill {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
}

.tail-badge-box.streak {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #1e40af;
}

.tail-badge-box.multi {
  background: #fefce8;
  border: 1.5px solid #fde047;
  color: #854d0e;
}

.tail-badge-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 8px;
  z-index: 1;
}

.tail-badge-number {
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  z-index: 1;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.tail-badge-balls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  z-index: 1;
}

.tail-ball-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-copy-tail {
  margin-top: 14px;
  background: #06C755;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(6,199,85,0.25);
  transition: all 0.15s ease;
}

.btn-copy-tail:active {
  transform: scale(0.97);
}

.temp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 15px;
}

.temp-label {
  font-weight: 900;
  font-family: var(--font-mono);
  width: 38px;
  color: var(--text-secondary);
  text-align: right;
}

.temp-bar-bg {
  flex: 1;
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.temp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.temp-val {
  width: 68px;
  text-align: right;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 14px;
}

.bg-heat-hot {
  background: #ef4444;
}

.bg-heat-warm {
  background: #f59e0b;
}

.bg-heat-cool {
  background: #10b981;
}

.btn-pine {
  background: var(--primary-pine);
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.story-support-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}

.space-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 28px 30px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

footer {
  border-top: 1px solid var(--border-card);
  background: #ffffff;
  padding: 36px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 24px;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #f1f5f9;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.text-search-input {
  padding: 12px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  z-index: 2000;
  display: none;
}

/* 🌟 手機版適配 */
@media (max-width: 860px) {
  .container {
    padding: 0 12px;
  }
  .header-inner {
    height: 50px;
  }
  .header-nav {
    display: none !important;
  }
  .tabs-card {
    top: 50px;
    padding: 4px;
    gap: 5px;
    height: 54px;
    margin-bottom: 14px;
  }
  .tab-btn {
    padding: 4px 4px;
  }
  .tab-title-text {
    font-size: 13px;
    white-space: nowrap;
  }
  .tab-time-badge {
    font-size: 9px;
  }
  .hero-pine-card {
    padding: 18px 16px;
    min-height: 250px;
  }
  .pine-balls-stage {
    gap: 8px;
    justify-content: flex-start;
  }
  .white-ball {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 16px;
  }
  .btn-hero-share-line {
    height: 44px;
    font-size: 14px;
  }
  .dashboard-grid, .tails-ai-rec {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .checker-balls-selector {
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  }
  .toast-box {
    left: 20px;
    right: 20px;
    bottom: 24px;
    text-align: center;
  }

  .history-row-item {
    padding: 10px 10px;
    gap: 6px;
  }
  .history-meta-left {
    min-width: 78px;
    flex-shrink: 0;
  }
  .history-date-text {
    font-size: 12.5px;
    white-space: nowrap;
    letter-spacing: -0.5px;
  }
  .history-period-text {
    font-size: 11px;
    white-space: nowrap;
  }
  .history-balls-right {
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: visible;
  }
  .hist-ball {
    width: 27px;
    height: 27px;
    font-size: 12px;
  }

  .calc-card-wrap {
    padding: 18px 16px;
  }

  .model-nav-pills {
    gap: 8px;
  }
  .model-nav-btn {
    padding: 10px 8px;
    font-size: 13.5px;
  }
}
