/* === Five Ways — Serene Buddhist-Inspired Design === */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=Noto+Serif+SC:wght@300;400;500;600;700&family=Ma+Shan+Zheng&display=swap');

:root {
  /* Warm, serene palette — inspired by aged parchment, brass, and earth */
  --bg-cream: #FAF6F0;
  --bg-warm: #F5EDE3;
  --bg-linen: #EDE5D8;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FDFAF6;

  /* Accent colors from the product */
  --gold: #B8860B;
  --gold-light: #D4A843;
  --gold-soft: rgba(184, 134, 11, 0.08);
  --gold-border: rgba(184, 134, 11, 0.2);
  --burgundy: #722F37;
  --burgundy-soft: rgba(114, 47, 55, 0.06);
  --sage: #7A8B6F;
  --sage-soft: rgba(122, 139, 111, 0.08);
  --copper: #A0522D;

  /* Text */
  --text-primary: #2C2416;
  --text-body: #4A3F30;
  --text-secondary: #6B5D4D;
  --text-muted: #9A8D7E;
  --text-light: #B8AE9E;

  /* Borders & Shadows */
  --border: #E6DDD0;
  --border-soft: #EDE5D8;
  --shadow-sm: 0 1px 3px rgba(44, 36, 22, 0.04);
  --shadow: 0 4px 16px rgba(44, 36, 22, 0.06);
  --shadow-lg: 0 8px 32px rgba(44, 36, 22, 0.08);
  --shadow-gold: 0 4px 20px rgba(184, 134, 11, 0.1);

  /* Misc */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-cream);
  color: var(--text-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.cn-serif { font-family: 'Noto Serif SC', 'Songti SC', serif; }

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* === Decorative Elements === */
.section-ornament {
  text-align: center; margin-bottom: 16px;
  color: var(--gold-light); font-size: 1.4rem; letter-spacing: 0.5em;
  opacity: 0.5;
}

/* === Navigation === */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1140px; margin: 0 auto; padding: 0 24px; height: 68px;
}

.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 600; color: var(--gold);
  letter-spacing: 0.06em;
}

.nav-links { display: flex; gap: 28px; list-style: none; align-items: center; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.85rem;
  font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }

.nav-cta {
  background: var(--gold); color: #fff !important;
  padding: 9px 22px; border-radius: var(--radius-pill);
  font-weight: 500 !important; font-size: 0.82rem !important;
  letter-spacing: 0.04em !important;
}
.nav-cta:hover { background: var(--gold-light) !important; color: #fff !important; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text-secondary); transition: var(--transition); border-radius: 1px; }

/* === Hero === */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(184,134,11,0.04) 0%, transparent 60%),
              var(--bg-cream);
  padding-top: 68px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(184,134,11,0.03) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero-content h1 {
  font-size: 3.4rem; line-height: 1.12; margin-bottom: 20px;
  color: var(--text-primary);
  font-weight: 400;
}
.hero-content h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-content p {
  font-size: 1.08rem; color: var(--text-secondary); margin-bottom: 32px;
  max-width: 440px; line-height: 1.9;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: var(--transition); border: none;
  letter-spacing: 0.03em;
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: var(--shadow-gold); color: #fff; }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold-soft); transform: translateY(-2px); color: var(--gold); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #20bd5a; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,0.2); color: #fff; }
.btn-lg { padding: 15px 38px; font-size: 0.92rem; }

.hero-visual {
  display: flex; justify-content: center; align-items: center;
}
.hero-visual img {
  max-width: 400px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* === Section === */
.section { padding: 90px 0; }
.section-warm { background: var(--bg-warm); }
.section-linen { background: var(--bg-linen); }
.section-label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--gold); margin-bottom: 10px; font-weight: 600;
}
.section-title {
  font-size: 2.3rem; margin-bottom: 16px; line-height: 1.25;
  font-weight: 400;
}
.section-subtitle {
  color: var(--text-secondary); font-size: 1rem; max-width: 560px;
  margin-bottom: 44px; line-height: 1.9;
}
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* === Feature Cards === */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 26px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.feature-card:hover {
  border-color: var(--gold-border); transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold-soft); display: flex;
  align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 18px;
  color: var(--gold);
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; font-weight: 500; }
.feature-card p { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.8; }

/* === Product Cards === */
.products-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.product-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  border-color: var(--gold-border); transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.product-card.featured { border-color: var(--gold-border); box-shadow: var(--shadow-gold); }
.product-image {
  width: 100%; height: 260px; object-fit: cover;
  background: var(--bg-warm);
}
.product-body { padding: 26px; }
.product-badge {
  display: inline-block; padding: 4px 14px; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  margin-bottom: 10px; background: var(--gold-soft); color: var(--gold);
}
.product-body h3 { font-size: 1.2rem; margin-bottom: 6px; }
.product-price { font-size: 1.45rem; font-weight: 600; color: var(--gold); margin-bottom: 14px; }
.product-body p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 18px; line-height: 1.8; }

/* === BaZi Calculator === */
.calculator-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 44px;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 22px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.form-input, .form-select {
  width: 100%; padding: 13px 16px;
  background: var(--bg-cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: 'Inter', sans-serif; font-size: 0.95rem;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.08);
  background: #fff;
}
.form-input::placeholder { color: var(--text-light); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A8D7E' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* === Results === */
.results-container { display: none; }
.results-container.active { display: block; }

.pillars-display {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px;
}
.pillar-card {
  background: var(--bg-cream); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 10px; text-align: center;
}
.pillar-card .pillar-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 6px;
}
.pillar-card .pillar-cn {
  font-family: 'Noto Serif SC', serif; font-size: 1.5rem;
  color: var(--gold); margin-bottom: 3px; font-weight: 500;
}
.pillar-card .pillar-element {
  font-size: 0.78rem; color: var(--text-secondary);
}

.element-bar-wrap { margin-bottom: 24px; }
.element-bar-row {
  display: flex; align-items: center; margin-bottom: 9px; gap: 10px;
}
.element-bar-label { width: 52px; font-size: 0.82rem; font-weight: 600; text-align: right; color: var(--text-secondary); }
.element-bar-track {
  flex: 1; height: 7px; background: var(--bg-linen); border-radius: 4px; overflow: hidden;
}
.element-bar-fill {
  height: 100%; border-radius: 4px; transition: width 1s ease;
}
.element-bar-count { width: 20px; font-size: 0.82rem; color: var(--text-muted); text-align: center; }

/* === Analysis Cards === */
.analysis-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.analysis-card h4 {
  font-size: 1.05rem; margin-bottom: 10px; color: var(--gold);
  font-weight: 500;
}
.analysis-card p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.8; }

/* === Radar Chart === */
.radar-container {
  width: 260px; height: 260px; margin: 0 auto 28px; position: relative;
}
.radar-container canvas { width: 100%; height: 100%; }

/* === Stone Recommendations === */
.stone-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.stone-tag {
  padding: 5px 14px; border-radius: var(--radius-pill); font-size: 0.78rem;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--bg-cream);
}

/* === Tabs === */
.tabs { display: flex; gap: 2px; margin-bottom: 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab-btn {
  padding: 11px 18px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-family: 'Inter', sans-serif; font-size: 0.85rem;
  cursor: pointer; transition: var(--transition); font-weight: 500;
  letter-spacing: 0.02em;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Fortune / Analysis Sections === */
.fortune-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.fortune-section h4 {
  font-size: 1.1rem; margin-bottom: 6px; color: var(--gold);
  display: flex; align-items: center; gap: 8px;
}
.fortune-section .fortune-level {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600; margin-bottom: 12px;
}
.fortune-level.excellent { background: rgba(122,139,111,0.12); color: var(--sage); }
.fortune-level.good { background: rgba(184,134,11,0.1); color: var(--gold); }
.fortune-level.moderate { background: rgba(160,82,45,0.1); color: var(--copper); }
.fortune-level.challenging { background: rgba(114,47,55,0.1); color: var(--burgundy); }
.fortune-section p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.9; margin-bottom: 8px; }
.fortune-section .advice {
  margin-top: 12px; padding: 14px 18px;
  background: var(--gold-soft); border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--text-body); line-height: 1.8;
  border-left: 3px solid var(--gold);
}
.fortune-section .industries {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.fortune-section .industry-tag {
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 0.78rem; background: var(--sage-soft); color: var(--sage);
  border: 1px solid rgba(122,139,111,0.15);
}

/* === Luck Pillar Timeline === */
.luck-timeline {
  display: flex; gap: 8px; overflow-x: auto; padding: 16px 0;
  margin-bottom: 16px;
}
.luck-pillar-item {
  flex-shrink: 0; text-align: center; padding: 12px 16px;
  background: var(--bg-cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 80px;
  transition: var(--transition);
}
.luck-pillar-item.current {
  border-color: var(--gold); background: var(--gold-soft);
}
.luck-pillar-item .lp-age { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.luck-pillar-item .lp-cn { font-family: 'Noto Serif SC', serif; font-size: 1.1rem; color: var(--gold); font-weight: 500; }
.luck-pillar-item .lp-element { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }

/* === Pillar Interaction Display === */
.pillar-interact {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 0;
}
.pillar-interact .pi-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 14px; background: var(--bg-cream); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.pillar-interact .pi-cn { font-family: 'Noto Serif SC', serif; font-size: 1.1rem; color: var(--gold); }
.pillar-interact .pi-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pillar-interact .pi-relation { font-size: 0.75rem; color: var(--text-secondary); padding: 0 4px; }

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid var(--border); padding: 18px 0; cursor: pointer;
}
.faq-q {
  font-size: 1rem; font-weight: 500; display: flex; justify-content: space-between; align-items: center;
  color: var(--text-primary);
}
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--gold); transition: var(--transition); }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.8; }
.faq-item.open .faq-a { max-height: 300px; padding-top: 10px; }

/* === About === */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about-grid img { border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* === CTA Banner === */
.cta-banner {
  background: linear-gradient(135deg, var(--gold-soft), rgba(184,134,11,0.02));
  border: 1px solid var(--gold-border); border-radius: var(--radius-lg);
  padding: 56px 36px; text-align: center;
}
.cta-banner h2 { font-size: 1.9rem; margin-bottom: 14px; }
.cta-banner p { color: var(--text-secondary); margin-bottom: 24px; max-width: 460px; margin-left: auto; margin-right: auto; font-size: 0.95rem; }

/* === WhatsApp Float === */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff; display: flex;
  align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 4px 16px rgba(37,211,102,0.25);
  transition: var(--transition); cursor: pointer;
}
.whatsapp-float:hover { transform: scale(1.06); box-shadow: 0 6px 24px rgba(37,211,102,0.35); }

/* === Footer === */
.footer {
  background: var(--bg-warm); border-top: 1px solid var(--border);
  padding: 52px 0 28px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer h4 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 16px; color: var(--text-secondary); font-family: 'Inter', sans-serif; font-weight: 600;
}
.footer p, .footer a { color: var(--text-muted); font-size: 0.85rem; line-height: 2; }
.footer a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center; color: var(--text-light); font-size: 0.78rem;
}

/* === Mobile === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 68px; left: 0; right: 0; background: var(--bg-cream);
    padding: 20px; gap: 14px; border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }

  .hero-inner { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .hero-content h1 { font-size: 2.3rem; }
  .hero-content p { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-visual img { max-width: 260px; margin: 0 auto; }

  .features-grid, .products-grid, .footer-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }

  .pillars-display { grid-template-columns: repeat(2, 1fr); }
  .calculator-section { padding: 24px 18px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .section { padding: 56px 0; }
  .section-title { font-size: 1.7rem; }

  .tabs { gap: 0; }
  .tab-btn { padding: 10px 12px; font-size: 0.78rem; }
}

/* === Animations === */
.fade-in {
  opacity: 0; transform: translateY(16px);
  animation: fadeIn 0.5s ease forwards;
}
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }
.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }

/* === Loading Spinner === */
.spinner {
  width: 32px; height: 32px; border: 2.5px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 18px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Tooltip === */
.tooltip {
  position: relative; display: inline-block;
  border-bottom: 1px dotted var(--gold); cursor: help; color: var(--gold);
}
.tooltip-text {
  visibility: hidden; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); color: var(--text-secondary); padding: 7px 12px;
  border-radius: var(--radius-sm); font-size: 0.78rem; white-space: nowrap;
  border: 1px solid var(--border); margin-bottom: 5px; z-index: 10;
  box-shadow: var(--shadow-sm);
}
.tooltip:hover .tooltip-text { visibility: visible; }

/* === Pricing emphasis === */
.price-strikethrough { text-decoration: line-through; color: var(--text-light); font-size: 0.85rem; }
.price-highlight { color: var(--gold); font-size: 1.9rem; font-weight: 600; }

/* === WhatsApp message preview === */
.whatsapp-preview {
  background: #075e54; border-radius: var(--radius); padding: 14px 18px;
  color: #e1ffc7; font-size: 0.85rem; max-width: 340px; margin: 16px auto 0;
  position: relative; line-height: 1.6;
}
.whatsapp-preview::before {
  content: ''; position: absolute; top: -7px; left: 18px;
  width: 0; height: 0; border-left: 7px solid transparent;
  border-right: 7px solid transparent; border-bottom: 7px solid #075e54;
}

/* =============================================
   ANALYSIS PAGE — Structured Data Components
   ============================================= */

/* Key-Value Grid */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 10px 0; }
.kv-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem;
}
.kv-label {
  color: var(--text-muted); font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em; min-width: 100px; flex-shrink: 0;
}
.kv-value { color: var(--text-body); font-weight: 500; }

/* Element Badge */
.el-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 0.78rem; font-weight: 600;
  background: var(--gold-soft); color: var(--gold);
}
.el-badge.wood { background: rgba(107,143,94,0.12); color: #4a7c59; }
.el-badge.fire { background: rgba(194,59,34,0.1); color: #c23b22; }
.el-badge.earth { background: rgba(184,134,11,0.1); color: #b8860b; }
.el-badge.metal { background: rgba(139,134,128,0.12); color: #6B5D4D; }
.el-badge.water { background: rgba(26,58,92,0.1); color: #1a3a5c; }

/* Sub-Section Card */
.sub-card {
  background: var(--bg-cream); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 10px;
}
.sub-card-title {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.sub-card-title .icon { font-size: 1rem; }

/* Section Divider */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 14px; color: var(--text-light); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.section-divider::before, .section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-soft);
}

/* Strength Meter */
.strength-meter { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.strength-bar {
  flex: 1; height: 6px; background: var(--bg-linen);
  border-radius: 3px; overflow: hidden; max-width: 200px;
}
.strength-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.strength-fill.strong { background: var(--sage); width: 90%; }
.strength-fill.moderate { background: var(--gold); width: 60%; }
.strength-fill.weak { background: var(--copper); width: 30%; }
.strength-label { font-size: 0.82rem; font-weight: 600; }

/* Relationship Tags */
.relation-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.relation-tag {
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 0.75rem; border: 1px solid;
}
.relation-tag.combo { background: rgba(122,139,111,0.08); color: var(--sage); border-color: rgba(122,139,111,0.2); }
.relation-tag.clash { background: rgba(114,47,55,0.06); color: var(--burgundy); border-color: rgba(114,47,55,0.15); }
.relation-tag.harmony { background: rgba(184,134,11,0.06); color: var(--gold); border-color: rgba(184,134,11,0.15); }
.relation-tag.harm { background: rgba(160,82,45,0.06); color: var(--copper); border-color: rgba(160,82,45,0.15); }
.relation-tag.punish { background: rgba(114,47,55,0.04); color: var(--burgundy); border-color: rgba(114,47,55,0.1); }

/* Description Block */
.desc-block { margin-bottom: 14px; }
.desc-block p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.85; margin-bottom: 6px; }
.desc-label {
  font-size: 0.75rem; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}

/* Hidden Stems Grid */
.hidden-stems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.hs-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-cream);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); font-size: 0.82rem;
}
.hs-cn { font-family: 'Noto Serif SC', serif; font-size: 1rem; color: var(--gold); font-weight: 500; }
.hs-detail { color: var(--text-secondary); }
.hs-pillar { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }

/* Ten Gods Grid */
.ten-gods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.tg-item {
  text-align: center; padding: 10px 8px;
  background: var(--bg-cream); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); font-size: 0.82rem;
}
.tg-pillar { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.tg-cn { font-family: 'Noto Serif SC', serif; font-size: 1rem; color: var(--gold); }
.tg-name { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* Element Relationship Grid */
.er-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.er-item {
  padding: 10px 14px; background: var(--bg-cream);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  font-size: 0.82rem; display: flex; align-items: center; gap: 8px;
}
.er-icon { font-size: 1.1rem; }
.er-label { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.er-value { font-weight: 500; color: var(--text-body); }

/* Luck Timeline */
.luck-timeline {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.luck-pillar-item {
  flex-shrink: 0; text-align: center; padding: 12px 14px;
  background: var(--bg-cream); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); min-width: 90px; font-size: 0.82rem;
  transition: var(--transition);
}
.luck-pillar-item.current {
  border-color: var(--gold-border); background: var(--gold-soft);
  box-shadow: var(--shadow-gold);
}
.lp-age { font-size: 0.68rem; color: var(--text-muted); margin-bottom: 4px; }
.lp-cn { font-family: 'Noto Serif SC', serif; font-size: 1.05rem; color: var(--gold); font-weight: 500; }
.lp-element { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

/* Recommendation Card */
.rec-card {
  background: linear-gradient(135deg, var(--gold-soft), rgba(184,134,11,0.04));
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  padding: 20px 22px; margin-top: 16px;
}
.rec-card h4 { color: var(--gold); margin-bottom: 10px; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .kv-grid { grid-template-columns: 1fr; }
  .hidden-stems-grid { grid-template-columns: 1fr 1fr; }
  .ten-gods-grid { grid-template-columns: repeat(3, 1fr); }
  .er-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
}

/* =============================================
   FLOATING CALLIGRAPHY — Immersive Ancient Book
   ============================================= */

/* Parchment texture base */
body {
  background:
    /* Subtle paper grain */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(180,160,130,0.015) 2px,
      rgba(180,160,130,0.015) 4px
    ),
    /* Warm vignette */
    radial-gradient(ellipse at 50% 0%, rgba(210,180,130,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(180,150,100,0.06) 0%, transparent 50%),
    var(--bg-cream);
}

/* ═══════════════════════════════════════════════════════
   3D FLOATING GOLDEN CALLIGRAPHY — 鎏金毛笔字空间
   ═══════════════════════════════════════════════════════ */

/* Main container — 3D perspective scene */
.calligraphy-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* 3D perspective — creates the depth tunnel */
  perspective: 900px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

/* Warm ambient glow */
.calligraphy-bg::before {
  content: '';
  position: absolute;
  top: -20%; left: -20%; right: -20%; bottom: -20%;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(184,134,11,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 75% 85%, rgba(184,134,11,0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(255,215,0,0.03) 0%, transparent 60%);
  z-index: 1;
  animation: ambientDrift 20s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -1%) scale(1.03); }
}

/* Edge vignette */
.calligraphy-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    linear-gradient(to right, rgba(250,246,240,0.65) 0%, transparent 18%, transparent 82%, rgba(250,246,240,0.65) 100%),
    linear-gradient(to bottom, rgba(250,246,240,0.55) 0%, transparent 10%, transparent 90%, rgba(250,246,240,0.55) 100%);
  z-index: 2;
}

/* ─── COLUMN BASE — 3D positioned strips ─── */
.calli-column {
  position: absolute;
  top: 0;
  width: 100%;
  height: 220%;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  transform-style: preserve-3d;
}

/* ─── GILDED CHARACTER — 鎏金毛笔字 ─── */
.calli-char {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', 'Noto Serif SC', serif;
  font-weight: 400;
  writing-mode: vertical-rl;
  line-height: 1;
  position: relative;
  /* 鎏金渐变 */
  background: linear-gradient(
    160deg,
    #8B6914 0%,
    #B8860B 12%,
    #DAA520 25%,
    #FFD700 40%,
    #FFEC8B 50%,
    #FFD700 60%,
    #DAA520 75%,
    #B8860B 88%,
    #8B6914 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 300%;
  animation: goldShimmer 8s ease-in-out infinite;
}

@keyframes goldShimmer {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* ═══ 3D DEPTH LAYERS ═══ */

/* ─── FAR LAYER — deep in background, small, blurred ─── */
.calli-column.far {
  opacity: 0.2;
  /* Push far back into Z space */
  transform: translateZ(-400px) scale(0.55);
  animation: calliDriftFar 140s linear infinite;
}
.calli-column.far .calli-char {
  font-size: 2.2rem;
  margin: 32px 0;
  /* Depth blur — far = blurry */
  filter: blur(1.5px) drop-shadow(0 0 6px rgba(218,165,32,0.12));
}

/* ─── MID LAYER — middle depth ─── */
.calli-column.mid {
  opacity: 0.25;
  transform: translateZ(-150px) scale(0.82);
  animation: calliDriftMid 90s linear infinite;
}
.calli-column.mid .calli-char {
  font-size: 3.5rem;
  margin: 42px 0;
  filter: blur(0.5px) drop-shadow(0 0 10px rgba(218,165,32,0.18));
}

/* ─── NEAR LAYER — close, large, sharp ─── */
.calli-column.near {
  opacity: 0.18;
  transform: translateZ(100px) scale(1.15);
  animation: calliDriftNear 55s linear infinite;
}
.calli-column.near .calli-char {
  font-size: 6rem;
  margin: 60px 0;
  filter: drop-shadow(0 0 16px rgba(218,165,32,0.25)) drop-shadow(0 0 40px rgba(184,134,11,0.1));
}

/* ─── CLOSEST LAYER — floating right in front of you ─── */
.calli-column.closest {
  opacity: 0.12;
  transform: translateZ(350px) scale(1.5);
  animation: calliDriftClosest 40s ease-in-out infinite alternate;
}
.calli-column.closest .calli-char {
  font-size: 10rem;
  margin: 90px 0;
  filter: drop-shadow(0 0 25px rgba(218,165,32,0.3)) drop-shadow(0 0 60px rgba(184,134,11,0.12));
}

/* ═══ 3D DRIFT ANIMATIONS — with Z-axis wobble ═══ */

/* Far — slow drift, subtle Z oscillation */
@keyframes calliDriftFar {
  0%   { transform: translateZ(-400px) scale(0.55) translateY(0) translateX(0) rotateY(0deg); }
  25%  { transform: translateZ(-380px) scale(0.56) translateY(-12.5%) translateX(2px) rotateY(1deg); }
  50%  { transform: translateZ(-410px) scale(0.54) translateY(-25%) translateX(-3px) rotateY(-0.5deg); }
  75%  { transform: translateZ(-390px) scale(0.55) translateY(-37.5%) translateX(3px) rotateY(0.8deg); }
  100% { transform: translateZ(-400px) scale(0.55) translateY(-50%) translateX(0) rotateY(0deg); }
}

/* Mid — moderate drift with Y rotation */
@keyframes calliDriftMid {
  0%   { transform: translateZ(-150px) scale(0.82) translateY(-50%) translateX(0) rotateY(0deg) rotateX(0deg); }
  25%  { transform: translateZ(-130px) scale(0.83) translateY(-37.5%) translateX(-4px) rotateY(-1.5deg) rotateX(0.3deg); }
  50%  { transform: translateZ(-160px) scale(0.81) translateY(-25%) translateX(3px) rotateY(1deg) rotateX(-0.2deg); }
  75%  { transform: translateZ(-140px) scale(0.82) translateY(-12.5%) translateX(-5px) rotateY(-0.8deg) rotateX(0.4deg); }
  100% { transform: translateZ(-150px) scale(0.82) translateY(0) translateX(0) rotateY(0deg) rotateX(0deg); }
}

/* Near — faster, more pronounced movement */
@keyframes calliDriftNear {
  0%   { transform: translateZ(100px) scale(1.15) translateY(0) translateX(0) rotateY(0deg) rotateX(0deg); }
  20%  { transform: translateZ(120px) scale(1.17) translateY(-10%) translateX(6px) rotateY(2deg) rotateX(-0.5deg); }
  40%  { transform: translateZ(80px) scale(1.13) translateY(-20%) translateX(-5px) rotateY(-1.5deg) rotateX(0.8deg); }
  60%  { transform: translateZ(130px) scale(1.18) translateY(-30%) translateX(8px) rotateY(1.8deg) rotateX(-0.3deg); }
  80%  { transform: translateZ(90px) scale(1.14) translateY(-40%) translateX(-7px) rotateY(-2deg) rotateX(0.6deg); }
  100% { transform: translateZ(100px) scale(1.15) translateY(-50%) translateX(0) rotateY(0deg) rotateX(0deg); }
}

/* Closest — dramatic float, like it's drifting past your face */
@keyframes calliDriftClosest {
  0%   { transform: translateZ(350px) scale(1.5) translateY(-8%) translateX(-10px) rotateY(-3deg) rotateX(1deg); }
  25%  { transform: translateZ(380px) scale(1.55) translateY(-15%) translateX(8px) rotateY(2.5deg) rotateX(-0.8deg); }
  50%  { transform: translateZ(320px) scale(1.45) translateY(-5%) translateX(-6px) rotateY(-2deg) rotateX(1.2deg); }
  75%  { transform: translateZ(370px) scale(1.52) translateY(-12%) translateX(12px) rotateY(3deg) rotateX(-0.5deg); }
  100% { transform: translateZ(350px) scale(1.5) translateY(-10%) translateX(-8px) rotateY(-2.5deg) rotateX(0.8deg); }
}

/* ─── COLUMN POSITIONS ─── */
.calli-column:nth-child(1)  { left: 3%; }
.calli-column:nth-child(2)  { left: 12%; }
.calli-column:nth-child(3)  { left: 22%; }
.calli-column:nth-child(4)  { left: 33%; }
.calli-column:nth-child(5)  { left: 44%; }
.calli-column:nth-child(6)  { left: 55%; }
.calli-column:nth-child(7)  { left: 66%; }
.calli-column:nth-child(8)  { left: 77%; }
.calli-column:nth-child(9)  { left: 88%; }
.calli-column:nth-child(10) { left: 96%; }

/* Stagger animation start */
.calli-column:nth-child(1)  { animation-delay: 0s; }
.calli-column:nth-child(2)  { animation-delay: -20s; }
.calli-column:nth-child(3)  { animation-delay: -40s; }
.calli-column:nth-child(4)  { animation-delay: -12s; }
.calli-column:nth-child(5)  { animation-delay: -55s; }
.calli-column:nth-child(6)  { animation-delay: -28s; }
.calli-column:nth-child(7)  { animation-delay: -65s; }
.calli-column:nth-child(8)  { animation-delay: -8s; }
.calli-column:nth-child(9)  { animation-delay: -48s; }
.calli-column:nth-child(10) { animation-delay: -22s; }

/* ─── INDIVIDUAL CHARACTER FLOAT — 微漂移 ─── */
.calli-char {
  animation: goldShimmer 8s ease-in-out infinite, charFloat3D 6s ease-in-out infinite;
}
.calli-column .calli-char:nth-child(odd)  { animation-duration: 8s, 5s; }
.calli-column .calli-char:nth-child(even) { animation-duration: 8s, 7s; }
.calli-column .calli-char:nth-child(3n)   { animation-duration: 8s, 9s; }

@keyframes charFloat3D {
  0%, 100% { transform: translateY(0) translateX(0) translateZ(0); }
  25%      { transform: translateY(-5px) translateX(3px) translateZ(8px); }
  50%      { transform: translateY(3px) translateX(-2px) translateZ(-5px); }
  75%      { transform: translateY(-4px) translateX(2px) translateZ(6px); }
}

/* ─── GOLD DUST PARTICLES — floating in 3D ─── */
.ink-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(218,165,32,0.25) 0%, rgba(184,134,11,0.1) 40%, transparent 70%);
  animation: goldDust3D linear infinite;
  will-change: transform;
  transform-style: preserve-3d;
}
@keyframes goldDust3D {
  0%   { transform: translateY(0) translateZ(-200px) scale(1) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.7; }
  50%  { transform: translateY(-50vh) translateZ(100px) scale(0.6) rotate(180deg); opacity: 0.4; }
  90%  { opacity: 0.2; }
  100% { transform: translateY(-100vh) translateZ(300px) scale(0.2) rotate(360deg); opacity: 0; }
}

/* ─── CONTENT SITS ABOVE ─── */
body > *:not(.calligraphy-bg) {
  position: relative;
  z-index: 3;
}

/* Hero */
.hero {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(184,134,11,0.04) 0%, transparent 60%),
    transparent;
}

/* Section backgrounds */
.section-warm {
  background: rgba(245,237,227,0.82);
  backdrop-filter: blur(10px);
}
.section-linen {
  background: rgba(237,229,216,0.82);
  backdrop-filter: blur(10px);
}

/* Cards — frosted glass */
.feature-card,
.product-card,
.analysis-card,
.calculator-section,
.fortune-section {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Navigation — frosted */
.nav {
  background: rgba(250,246,240,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Footer — slightly more opaque */
.footer {
  background: rgba(245,237,227,0.92);
  backdrop-filter: blur(8px);
}

/* Reduce calligraphy on mobile for performance */
@media (max-width: 768px) {
  .calligraphy-bg { perspective: 600px; }
  .calli-column.closest { display: none; }
  .calli-column.near { opacity: 0.12; transform: translateZ(50px) scale(1.08); }
  .calli-column.near .calli-char { font-size: 4rem; }
  .calli-column.mid { opacity: 0.16; transform: translateZ(-80px) scale(0.88); }
  .calli-column.mid .calli-char { font-size: 2.5rem; }
  .calli-column.far { opacity: 0.14; transform: translateZ(-250px) scale(0.65); }
  .calli-column.far .calli-char { font-size: 1.5rem; }
  .ink-particle { display: none; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .calli-column { animation: none !important; }
  .ink-particle { animation: none !important; }
}
