
.waitlist-section {
  margin: 2.5rem auto 0;
  padding: 1.75rem 1.25rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.waitlist-form {
  margin-top: 1rem;
}

.waitlist-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.waitlist-row input[type="email"] {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 0.95rem;
}

.waitlist-row input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.waitlist-btn {
  padding-inline: 1.4rem;
}

.waitlist-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: rgba(100, 116, 139, 0.95);
}

.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;
}
/* Page 3 specific layout */
.page3-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page3-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page3-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
  padding: max(env(safe-area-inset-top), 1rem) 1rem 1rem;
  border-bottom: 1px solid rgba(13, 148, 136, 0.1);
  text-align: center;
}

.page3-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.25rem;
}

.page3-header .subtitle {
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  margin: 0 0 1rem;
}

/* Results Actions Section - card + entrance animation */
.results-actions {
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.05), rgba(20, 184, 166, 0.04));
  border: 1px solid rgba(13, 148, 136, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(13, 148, 136, 0.08);
  margin: 1.25rem 1rem 0.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
}

body.results-ready .results-actions {
  animation: slideUp 0.5s ease forwards;
}

body.results-ready .results-actions .share-buttons .share-btn:nth-child(1) { opacity: 0; animation: slideUp 0.4s ease forwards; animation-delay: 0.12s; }
body.results-ready .results-actions .share-buttons .share-btn:nth-child(2) { opacity: 0; animation: slideUp 0.4s ease forwards; animation-delay: 0.2s; }

/* Share Buttons - two in a row */
.share-buttons {
  display: flex;
  gap: 0.625rem;
  justify-content: center;
  margin: 0 auto;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  border: none;
  box-sizing: border-box;
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-btn:active {
  transform: translateY(0);
}

/* Primary: Copy link */
#share-link-btn {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.25);
}

#share-link-btn:hover {
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
}

/* Secondary: Start a new chart */
.share-btn-secondary {
  background: transparent;
  color: #0d9488;
  border: 2px solid #0d9488;
  box-shadow: none;
}

.share-btn-secondary:hover {
  background: rgba(13, 148, 136, 0.08);
  border-color: #0f766e;
  color: #0f766e;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.12);
}

.share-btn .btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.share-btn .btn-text {
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .results-actions {
    padding: 1rem 1rem;
  }
  
  .share-buttons {
    gap: 0.5rem;
  }
  
  .share-btn {
    padding: 0.6rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .share-btn .btn-icon {
    font-size: 0.9375rem;
  }
  
  .share-btn .btn-text {
    font-size: 0.8125rem;
  }
  
  .show-more-btn {
    font-size: 0.8125rem;
    padding: 0.625rem 0.875rem;
  }
}

.page3-main {
  padding: 1rem 1rem max(env(safe-area-inset-bottom), 1rem);
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Chart sections */
.chart-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.08);
}

.section-title {
  font-size: clamp(1.125rem, 3vw, 1.25rem);
  font-weight: 600;
  color: #0d9488;
  margin: 0 0 0.75rem;
  text-align: center;
}

.section-description {
  font-size: 0.9375rem;
  color: #64748b;
  text-align: center;
  margin: -0.5rem 0 0.75rem;
  line-height: 1.6;
  font-style: italic;
}

.section-intro {
  font-style: normal;
  color: #0f172a;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Chart error message */
.chart-error {
  color: #dc2626;
  padding: 1.5rem;
  text-align: center;
  background: #fef2f2;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Ba Zi Grid */
.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bazi-pillar {
  text-align: center;
  transition: transform 0.3s ease;
}

.bazi-pillar:hover {
  transform: translateY(-4px);
}

.bazi-pillar:hover .pillar-value {
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
}

.pillar-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pillar-value {
  background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
  color: #ffffff;
  padding: 1rem 0.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.pillar-stem, .pillar-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.pillar-char {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
}

.pillar-pinyin {
  font-size: 0.625rem;
  opacity: 0.8;
  font-weight: 400;
  text-transform: capitalize;
  letter-spacing: 0.5px;
}

.element-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 600;
  margin-top: 0.125rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  cursor: help;
}

.element-badge:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.element-badge.wood {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #ffffff;
}

.element-badge.fire {
  background: linear-gradient(135deg, #ef4444, #f87171);
  color: #ffffff;
}

.element-badge.earth {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #ffffff;
}

.element-badge.metal {
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
  color: #1e293b;
}

.element-badge.water {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #ffffff;
}

.day-master {
  text-align: center;
  font-size: 0.875rem;
  color: #334155;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(8, 145, 178, 0.08));
  border-radius: 12px;
  border: 1px solid rgba(13, 148, 136, 0.15);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.1);
}

.day-master strong {
  font-size: 1.25rem;
  color: #0d9488;
  font-weight: 700;
  margin: 0 0.25rem;
}

/* Five Elements Chart */
.elements-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.element-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.element-name {
  min-width: 60px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.element-bar-wrap {
  flex: 1;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  height: 28px;
  position: relative;
}

.element-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.element-bar.wood { background: linear-gradient(90deg, #10b981 0%, #34d399 100%); }
.element-bar.fire { background: linear-gradient(90deg, #ef4444 0%, #f87171 100%); }
.element-bar.earth { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%); }
.element-bar.metal { background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%); }
.element-bar.water { background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%); }

.element-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  min-width: 35px;
  text-align: right;
}

/* Ten Gods Chart */
.tengods-chart {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tengod-item {
  border: 2px solid transparent;
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.3s ease;
}

.tengod-item:hover {
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.tengod-item.expanded {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15);
}

.tengod-row {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 10px;
  transition: background 0.2s ease;
}

.tengod-row:hover {
  background: rgba(139, 92, 246, 0.03);
}

/* Style D: name → hook (centered) → bar row */
.tengod-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  align-items: stretch;
}

.tengod-name {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.tengod-item.expanded .tengod-name {
  color: #8b5cf6;
}

.tengod-hook-header {
  font-size: 0.9375rem;
  font-weight: 400;
  color: #64748b;
  line-height: 1.45;
  text-align: center;
  letter-spacing: 0.01em;
  padding: 0.125rem 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tengod-item.expanded .tengod-hook-header {
  color: #7c3aed;
  font-weight: 500;
}

.tengod-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

.tengod-bar-wrap {
  flex: 1;
  min-width: 0;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: visible;
  height: 28px;
  position: relative;
}

.tengod-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 8px;
}

.tengod-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 进度条内部右侧显示（大百分比） */
.tengod-value-inside-right {
  margin-left: auto;
  text-align: right;
}

/* 进度条内部左侧显示（中等百分比） */
.tengod-value-inside-left {
  text-align: left;
  padding-left: 4px;
}

.tengod-value-outside {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #8b5cf6;
  white-space: nowrap;
}

.expand-icon {
  font-size: 0.75rem;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.3s ease, color 0.3s ease;
  user-select: none;
}

.tengod-item.expanded .expand-icon {
  transform: rotate(180deg);
  color: #8b5cf6;
}

/* Ten Gods Detail Panel */
.tengod-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 0;
  padding: 0 1rem;
}

.tengod-item.expanded .tengod-detail {
  max-height: 2000px;
  opacity: 1;
  padding: 1.25rem 1rem 1rem;
}

.tengod-detail-content {
  font-size: 1rem;
  line-height: 1.7;
  color: #475569;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(168, 139, 250, 0.03));
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid #8b5cf6;
}

.tengod-detail-content .tengod-hook {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #7c3aed;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.tengod-detail-content strong {
  color: #8b5cf6;
  font-weight: 600;
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.tengod-detail-content strong:first-child {
  margin-top: 0;
  font-size: 1.0625rem;
}

.tengod-detail-content br + br {
  display: block;
  content: "";
  margin-top: 0.5rem;
}

/* Description Meta (badges and read time) */
.desc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.desc-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.desc-badge.core {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(168, 139, 250, 0.25));
  color: #6d28d9;
  border: 2px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.desc-badge.notable {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(96, 165, 250, 0.22));
  color: #1d4ed8;
  border: 2px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.desc-badge.minor {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(203, 213, 225, 0.2));
  color: #475569;
  border: 2px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 2px 6px rgba(148, 163, 184, 0.1);
}

.read-time {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Show More Button */
.show-more-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(168, 139, 250, 0.05));
  border: 2px dashed rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  color: #8b5cf6;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.show-more-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 139, 250, 0.1));
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.show-more-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(168, 139, 250, 0.1));
  border-style: solid;
}

/* Remaining Ten Gods (secondary traits) */
.remaining-tengods {
  margin-top: 1rem;
}

.tengod-item-secondary {
  opacity: 0.85;
}

.tengod-item-secondary .tengod-name {
  color: #64748b;
  font-size: 0.875rem;
}

.tengod-item-secondary .tengod-bar {
  background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%);
}

/* Modal styles removed - using inline expansion instead */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Shen Sha */
.shensha-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shensha-tag {
  padding: 0.5rem 0.875rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.shensha-tag.auspicious {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.shensha-tag.inauspicious {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.shensha-tag.neutral {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

/* AI Content */
.ai-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #475569;
}

.ai-placeholder {
  font-style: italic;
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .page3-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .chart-section {
    padding: 1rem 0.75rem;
  }
  
  .pillar-char {
    font-size: 1.125rem;
  }
  
  .element-badge {
    width: 16px;
    height: 16px;
    font-size: 0.5rem;
  }
  
  .bazi-grid {
    gap: 0.375rem;
  }
  
  .pillar-value {
    padding: 0.75rem 0.25rem;
  }
  
  .tengod-name {
    font-size: 0.9375rem;
  }
  
  .tengod-hook-header {
    font-size: 0.875rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  .tengod-item.expanded .tengod-detail {
    padding: 1rem 0.75rem 0.75rem;
  }
  
  .tengod-detail-content {
    font-size: 0.9375rem;
    padding: 0.875rem 0.75rem;
  }
  
  .tengod-detail-content .tengod-hook {
    font-size: 1rem;
  }
  
  .tengod-detail-content strong:first-child {
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .page3-main {
    padding: 1.5rem 1.5rem;
  }
  
  .chart-section {
    padding: 1.5rem;
  }
  
  .bazi-grid {
    gap: 0.75rem;
  }
  
  .pillar-char {
    font-size: 1.75rem;
  }
  
  .results-actions {
    padding: 2rem 1.5rem;
  }
  
  .action-prompt {
    font-size: 1.0625rem;
    margin-bottom: 1.5rem;
  }
  
  .share-buttons {
    gap: 1rem;
  }
  
  .share-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
  
  .element-badge {
    width: 22px;
    height: 22px;
    font-size: 0.625rem;
  }
}
