/* ==========================================================================
   掌心解碼 (Kaiyun Code) - 全站通用宇宙星空玻璃擬態樣式庫
   ========================================================================== */

:root {
  --bg-dark: #070614;
  --bg-card: rgba(22, 19, 48, 0.72);
  --bg-card-hover: rgba(38, 33, 80, 0.9);
  --bg-card-selected: rgba(147, 51, 234, 0.18);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-active: #A855F7;
  --border-gold: #F59E0B;
  --primary-gold: #F59E0B;
  --gold-gradient: linear-gradient(135deg, #F6D365 0%, #FDA085 100%);
  --purple-gradient: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
  --pink-gradient: linear-gradient(135deg, #EC4899 0%, #F43F5E 100%);
  --cta-gradient: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%);
  --cta-purple: linear-gradient(135deg, #9333EA 0%, #4F46E5 100%);
  --emerald-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --text-gold: #FCD34D;
  --radius-card: 16px;
  --radius-btn: 14px;
  --shadow-glow: 0 0 25px rgba(168, 85, 247, 0.35);
  --shadow-gold: 0 0 22px rgba(245, 158, 11, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 50% 5%, rgba(99, 102, 241, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 15% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 35%);
}

.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.cosmic-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
.glow-1 {
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: rgba(139, 92, 246, 0.22);
}
.glow-2 {
  bottom: 40px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: rgba(245, 158, 11, 0.15);
}
.glow-3 {
  top: 45%;
  left: -80px;
  width: 250px;
  height: 250px;
  background: rgba(236, 72, 153, 0.12);
}

.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: rgba(11, 9, 29, 0.85);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
}

/* Header */
.header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 12, 38, 0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', 'Noto Serif TC', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text-main);
}
.brand-sparkle {
  color: var(--primary-gold);
  font-size: 1.25rem;
  animation: pulse-glow 2s infinite ease-in-out;
}
.brand-name {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--purple-gradient);
  -webkit-text-fill-color: #FFF;
  font-weight: 800;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.nav-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}
.step-counter {
  font-size: 0.82rem;
  color: var(--text-gold);
  font-weight: 600;
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(90deg, #8B5CF6, #EC4899, #F59E0B);
  transition: width 0.35s ease;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.7);
}

/* Screen Content */
.screen-container {
  flex: 1;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
}

.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.6)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 1)); }
}

/* Title & Subtitle */
.screen-title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #FFFFFF 0%, #E2E8F0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.screen-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Option Cards (General) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.option-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.option-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.option-card:active {
  transform: scale(0.98);
}
.option-card.selected {
  background: var(--bg-card-selected);
  border-color: var(--border-active);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}
.option-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.option-content {
  flex: 1;
}
.option-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}
.option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.option-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.option-card.selected .option-check {
  border-color: #A855F7;
  background: #A855F7;
}
.option-check::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #FFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  display: none;
}
.option-card.selected .option-check::after {
  display: block;
}

/* Grid Options (for Tarots, Elements, Zodiacs) */
.options-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.grid-card {
  flex-direction: column;
  text-align: center;
  padding: 20px 14px;
}
.grid-card .option-icon {
  margin: 0 auto 8px;
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
}

/* Laser Palm Scan Ritual Animation */
.palm-scanner-box {
  width: 100%;
  height: 280px;
  background: rgba(15, 12, 40, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 24px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}
.palm-hand-svg {
  width: 170px;
  height: 210px;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}
.laser-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38BDF8, #F59E0B, transparent);
  box-shadow: 0 0 15px #38BDF8, 0 0 25px #F59E0B;
  animation: laserSweep 2.2s infinite ease-in-out alternate;
}
@keyframes laserSweep {
  0% { top: 5%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 92%; opacity: 0.4; }
}
.scan-grid-lines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: linear-gradient(rgba(168, 85, 247, 0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(168, 85, 247, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

/* CTA Primary Button */
.cta-button {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-btn);
  border: none;
  background: var(--cta-gradient);
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-gold);
  margin-top: 20px;
  text-decoration: none;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.7);
}
.cta-button:active {
  transform: scale(0.98);
}
.cta-purple-btn {
  background: var(--cta-purple);
  box-shadow: var(--shadow-glow);
}
.cta-purple-btn:hover {
  box-shadow: 0 0 30px rgba(147, 51, 234, 0.7);
}

/* Paywall & Combined Checkout Form */
.paywall-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pricing-card {
  background: rgba(22, 19, 48, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.pricing-card.popular {
  border-color: var(--primary-gold);
  background: rgba(45, 30, 70, 0.75);
  box-shadow: var(--shadow-gold);
}
.badge-popular {
  position: absolute;
  top: -12px;
  right: 18px;
  background: var(--gold-gradient);
  color: #070614;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
}
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
}
.price-amount {
  font-size: 1.65rem;
  font-weight: 800;
  color: #FFF;
}
.price-currency {
  font-size: 1.1rem;
  color: var(--text-gold);
}
.price-old {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-left: 8px;
}

/* Combined Registration + Payment Form */
.auth-checkout-box {
  background: rgba(18, 15, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 20px;
  margin-top: 16px;
}
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.input-group {
  margin-bottom: 14px;
}
.input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.custom-input {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0 14px;
  color: #FFF;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.custom-input:focus {
  border-color: #A855F7;
  background: rgba(255, 255, 255, 0.1);
}
.input-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Footer */
.footer {
  padding: 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 7, 24, 0.95);
  text-align: center;
  margin-top: auto;
}
.footer-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.footer-copy {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Hub Navigation Menu */
.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0 24px;
}
.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.hub-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.hub-card-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
}
.hub-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.hub-card-tag {
  font-size: 0.72rem;
  color: var(--text-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-bottom: 6px;
}
.hub-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Test-unlock + teaser */
.test-unlock-banner {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: #A7F3D0;
  line-height: 1.5;
}
.test-unlock-banner strong {
  color: #6EE7B7;
  font-size: 0.88rem;
}
.checkout-legal-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 12px 0 18px;
  line-height: 1.5;
}
.checkout-legal-note code {
  color: var(--text-gold);
  font-size: 0.72rem;
}
.checkout-preview-price {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.palm-ritual-note,
.birth-owner-hint {
  text-align: center;
  color: var(--text-gold);
  font-size: 0.82rem;
  margin: 0 0 16px;
  line-height: 1.5;
}
.teaser-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.teaser-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.teaser-score {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-gold);
}
.teaser-zodiac {
  font-size: 0.75rem;
  color: #A7F3D0;
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}
.teaser-hook {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.teaser-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.teaser-list li {
  font-size: 0.82rem;
  color: #E5E7EB;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.teaser-list li span:first-child {
  color: var(--primary-gold);
}
.teaser-work-link {
  text-align: center;
  font-size: 0.82rem;
  color: #C4B5FD;
  margin: 0 0 12px;
}
.teaser-work-link a,
.report-inline-link {
  color: #FCD34D;
}
.visual-caption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-gold);
  font-weight: 700;
  margin: 10px 0 16px;
}

/* Portrait / mandala / compass / star-chart */
.kaiyun-visual-frame {
  position: relative;
  margin: 0 auto 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kaiyun-visual-portrait {
  width: 220px;
  height: 280px;
  border-radius: 16px;
  border: 2px solid var(--primary-gold);
  box-shadow: var(--shadow-gold);
  background: #120c28;
}
.kaiyun-visual-round,
.kaiyun-visual-text {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 2px solid #F59E0B;
}
.kaiyun-visual-text {
  border-color: #C084FC;
  background: radial-gradient(circle, #2e1064, #0f0a1e);
}
.kaiyun-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kaiyun-visual-fallback,
.kaiyun-glyph-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 3.2rem;
  color: #FFF;
  text-align: center;
  padding: 16px;
}
.kaiyun-glyph-text p {
  font-size: 0.8rem;
  color: #E9D5FF;
  line-height: 1.45;
  margin-top: 8px;
}
.kaiyun-visual-frame.is-blurred .kaiyun-portrait-img,
.kaiyun-visual-frame.is-blurred .wealth-mandala,
.kaiyun-visual-frame.is-blurred .family-compass,
.kaiyun-visual-frame.is-blurred .children-starchart,
.kaiyun-visual-frame.is-blurred .kaiyun-glyph-text {
  filter: blur(10px);
  transform: scale(1.06);
}
.kaiyun-visual-lock {
  position: absolute;
  inset: 0;
  background: rgba(7, 6, 20, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  color: #FFF;
  z-index: 2;
}
.kaiyun-visual-lock-icon { font-size: 2rem; margin-bottom: 6px; }
.kaiyun-visual-lock-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-gold);
}
.kaiyun-visual-lock-sub {
  font-size: 0.72rem;
  color: #E5E7EB;
  margin-top: 4px;
}

.wealth-mandala,
.family-compass,
.children-starchart {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
}
.wealth-mandala {
  background: radial-gradient(circle, #B45309 0%, #451A03 70%, #1c0a02 100%);
  box-shadow: var(--shadow-gold);
}
.mandala-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(253, 224, 71, 0.45);
  inset: 18px;
}
.mandala-ring.r2 { inset: 36px; border-color: rgba(251, 191, 36, 0.7); }
.mandala-ring.r3 { inset: 54px; }
.mandala-coin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: #FDE68A;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.8);
}
.mandala-dir {
  position: absolute;
  font-size: 0.7rem;
  color: #FCD34D;
  font-weight: 700;
}
.mandala-dir.d-n { top: 8px; left: 50%; transform: translateX(-50%); }
.mandala-dir.d-s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.mandala-dir.d-e { right: 10px; top: 50%; transform: translateY(-50%); }
.mandala-dir.d-w { left: 10px; top: 50%; transform: translateY(-50%); }

.family-compass {
  background: radial-gradient(circle, #047857 0%, #064E3B 62%, #022c22 100%);
  border: 3px solid #34D399;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}
.compass-dial {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1px dashed rgba(167, 243, 208, 0.5);
}
.compass-needle {
  position: absolute;
  width: 4px;
  height: 72px;
  background: linear-gradient(#F87171, #E5E7EB);
  left: 50%;
  top: 38px;
  transform: translateX(-50%) rotate(-12deg);
  transform-origin: bottom center;
  border-radius: 2px;
}
.compass-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  color: #A7F3D0;
  font-size: 1.6rem;
}
.compass-bagua {
  position: absolute;
  font-size: 0.78rem;
  color: #6EE7B7;
  font-weight: 700;
}
.compass-bagua.b-n { top: 10px; left: 50%; transform: translateX(-50%); }
.compass-bagua.b-s { bottom: 10px; left: 50%; transform: translateX(-50%); }
.compass-bagua.b-e { right: 12px; top: 50%; transform: translateY(-50%); }
.compass-bagua.b-w { left: 12px; top: 50%; transform: translateY(-50%); }

.children-starchart {
  background: radial-gradient(circle, #155e75 0%, #083344 60%, #082f49 100%);
  border: 3px solid #22D3EE;
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.4);
}
.children-starchart .star {
  position: absolute;
  color: #FDE68A;
  animation: pulse-glow 2.8s infinite ease-in-out;
}
.children-starchart .s1 { top: 22px; left: 48%; font-size: 1.1rem; }
.children-starchart .s2 { top: 58px; right: 28px; font-size: 0.9rem; }
.children-starchart .s3 { bottom: 40px; left: 32px; font-size: 1rem; }
.children-starchart .s4 { top: 86px; left: 24px; font-size: 0.8rem; }
.children-starchart .s5 { bottom: 28px; right: 40px; font-size: 1.05rem; }
.star-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif TC', serif;
  font-weight: 900;
  color: #A5F3FC;
  font-size: 1.8rem;
}

.report-core-sentence {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #FFF;
  text-align: center;
  font-weight: 700;
  margin: 8px 0 18px;
}
.report-timing {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-gold);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}
.report-inline-link {
  display: block;
  text-align: center;
  margin: 8px 0 0;
  font-size: 0.85rem;
}
.report-section-card {
  background: rgba(22, 19, 48, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px;
}
.report-section-card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 8px;
}
.report-section-card p {
  font-size: 0.86rem;
  color: #E5E7EB;
  line-height: 1.6;
}
.report-advanced-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.report-advanced-row a,
.report-advanced-row button {
  flex: 1;
  min-width: 140px;
}

@media (min-width: 768px) {
  .app-container {
    max-width: 720px;
  }
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .screen-title {
    font-size: 1.65rem;
  }
  .kaiyun-visual-portrait {
    width: 260px;
    height: 340px;
  }
  .kaiyun-visual-round,
  .kaiyun-visual-text {
    width: 260px;
    height: 260px;
  }
  .wealth-mandala,
  .family-compass,
  .children-starchart {
    width: 230px;
    height: 230px;
  }
}

/* Palm camera dialog (cosmic theme, adapted from 掌心密碼) */
.camera-dialog { width: min(680px, calc(100% - 28px)); margin: auto; padding: 0; border: 1px solid rgba(168, 85, 247, 0.45); color: var(--text-main); background: #0c0818; box-shadow: 0 28px 90px rgba(0, 0, 0, .65); }
.camera-dialog::backdrop { background: rgba(4, 4, 16, .84); backdrop-filter: blur(6px); }
.camera-dialog-inner { padding: 23px; background: radial-gradient(circle at 50% 8%, rgba(139, 92, 246, .18), transparent 37%), #0c0818; }
.camera-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.camera-dialog-heading .section-kicker { margin: 0 0 6px; color: var(--text-gold); font-size: 12px; letter-spacing: .08em; }
.camera-dialog-heading h2 { margin: 0; color: #FFF; font-family: "Noto Serif TC", serif; font-size: 22px; font-weight: 700; }
.camera-close { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid rgba(168, 85, 247, .42); color: #FFF; background: transparent; cursor: pointer; font-size: 24px; line-height: 1; border-radius: 10px; }
.camera-close:hover { color: var(--text-gold); border-color: var(--text-gold); }
.camera-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid rgba(168, 85, 247, .35); background: #060412; border-radius: 14px; }
.camera-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }
.camera-guides { position: absolute; inset: 4%; display: grid; place-items: center; pointer-events: none; }
.palm-guide { position: absolute; top: 2%; left: 50%; width: auto; height: 96%; overflow: visible; filter: drop-shadow(0 0 12px rgba(7, 6, 20, .6)); transform: translateX(-50%); }
.camera-guides.is-mirrored .palm-guide { transform: translateX(-50%) scaleX(-1); }
.palm-guide-outline { fill: rgba(168, 85, 247, .08); stroke: rgba(252, 211, 77, .88); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; transition: fill .2s ease, stroke .2s ease, filter .2s ease; }
.camera-guides.is-ready .palm-guide-outline { fill: rgba(16, 185, 129, .14); stroke: #6EE7B7; filter: drop-shadow(0 0 12px rgba(110, 231, 183, .48)); }
.camera-guide-label { position: absolute; bottom: 5%; max-width: calc(100% - 22px); padding: 7px 10px; color: #FFF; border: 1px solid rgba(168, 85, 247, .46); background: rgba(7, 6, 20, .68); font-size: 11px; line-height: 1.45; letter-spacing: .05em; text-align: center; border-radius: 10px; }
.camera-focus-countdown {
  position: absolute;
  top: 38%;
  left: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: #FFF;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .88), 0 0 22px rgba(168, 85, 247, .45);
}
.camera-focus-countdown[hidden] { display: none !important; }
.camera-focus-countdown strong {
  font-size: clamp(64px, 22vw, 108px);
  font-weight: 800;
  line-height: .9;
  font-variant-numeric: tabular-nums;
}
.camera-focus-countdown small {
  color: #FDE68A;
  font-size: 13px;
  letter-spacing: .14em;
}
.camera-error { min-height: 20px; margin: 13px 0; color: #C4B5FD; font-size: 12px; line-height: 1.6; }
.camera-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.camera-actions .primary-button,
.camera-actions .secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.camera-actions .primary-button { border: 1px solid #A855F7; color: #FFF; background: var(--purple-gradient); }
.camera-actions .secondary-button { border: 1px solid rgba(255,255,255,.2); color: #FFF; background: rgba(255,255,255,.06); }
.palm-capture-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.palm-capture-actions .cta-button { margin-top: 0; }
.palm-hand-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; color: var(--text-muted); font-size: 13px; }
.palm-hand-btn {
  border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
  color: #FFF;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}
.palm-hand-btn.is-active,
.palm-hand-btn[aria-pressed="true"] {
  border-color: #A855F7;
  background: var(--purple-gradient);
}
.kaiyun-palm-thumb-wrap { margin: 12px 0; text-align: center; }
.kaiyun-palm-thumb-wrap img { max-width: 220px; border-radius: 14px; border: 1px solid rgba(168,85,247,.4); }
.palm-privacy-note {
  margin: 14px 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: left;
}

.report-tabs-hint { text-align: center; color: var(--text-gold); font-size: 0.82rem; margin: 8px 0 10px; }
.report-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.report-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #E5E7EB;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  line-height: 1.35;
  min-height: 46px;
}
.report-tab-btn:hover { border-color: #C084FC; background: rgba(168, 85, 247, 0.16); }
.report-tab-btn:active { transform: scale(0.98); }
.report-tab-btn.active {
  background: var(--purple-gradient);
  color: white;
  border-color: #A855F7;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}
.report-consult-quiet { text-align: center; margin: 22px 0 8px; }
.report-consult-quiet a {
  color: var(--text-gold);
  font-size: 0.9rem;
  text-decoration: underline;
}
.print-hint { text-align: center; color: #FCD34D; font-size: 0.8rem; margin: 8px 0 0; line-height: 1.5; }
.print-report-all { display: none; }

@media (max-width: 767px) {
  .camera-dialog-inner { padding: 17px; }
  .camera-frame { aspect-ratio: 3 / 4; max-height: 68vh; }
  .camera-actions { justify-content: stretch; }
  .camera-actions button { flex: 1 1 150px; }
  .camera-focus-countdown strong { font-size: clamp(72px, 28vw, 120px); }
  .camera-focus-countdown small { font-size: 15px; }
}

@media print {
  body { background: #fff !important; color: #111 !important; }
  .cosmic-glow, .header, .footer, .report-tabs, .report-tabs-hint, .report-advanced-row, .no-print, .print-hint { display: none !important; }
  .print-report-all { display: block !important; }
  #report-tab-content { display: none !important; }
  .report-section-card { break-inside: avoid; border: 1px solid #ddd; color: #111; background: #fff; }
  .report-core-sentence, .screen-title, .screen-subtitle { color: #111 !important; }
}

