/* ==========================================
   丙火命格 - 现代东方美学设计系统
   火系配色主题
   ========================================== */

/* ---------- CSS Variables ---------- */
:root {
  /* 主色调 - 火系暖色 */
  --bg-cream: #FDF8F3;
  --bg-cream-dark: #F5EBE0;
  --bg-ink: #1A1A1A;
  
  /* 强调色 - 朱砂与琥珀 */
  --accent-vermillion: #C94043;
  --accent-ink-blue: #8B4513;
  
  /* 辅助色 */
  --pine-green: #5B8C7B;
  --earth-gold: #C9A962;
  
  /* 火元素渐变 */
  --fire-red: #C94043;
  --fire-orange: #E8915A;
  --fire-light: #F4A460;
  
  /* 水元素 */
  --water-deep: #3A5F8A;
  --water-light: #6B8FAD;
  --water-pale: #A8C5D9;
  
  /* 木元素 */
  --wood-green: #6B9B7A;
  
  /* 金元素 */
  --metal-gold: #D4B96A;
  
  /* 土元素 */
  --earth-brown: #B8956B;
  
  /* 文字色 */
  --text-primary: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-muted: #7A7A7A;
  --text-light: #FDF8F3;
  
  /* 边框与分隔 */
  --border-light: rgba(201, 64, 67, 0.15);
  --border-medium: rgba(201, 64, 67, 0.3);
  
  /* 阴影 */
  --shadow-soft: 0 4px 20px rgba(201, 64, 67, 0.08);
  --shadow-medium: 0 8px 30px rgba(201, 64, 67, 0.12);
  --shadow-strong: 0 12px 40px rgba(201, 64, 67, 0.18);
  
  /* 间距 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ---------- Base Styles ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-cream-dark) 100%);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.title-hero {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--fire-red) 0%, var(--fire-orange) 50%, var(--earth-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-section {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--fire-red);
  position: relative;
  display: inline-block;
}

.title-section::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--fire-orange), transparent);
}

.title-card {
  font-size: 1.25rem;
  color: var(--fire-red);
}

.text-poetry {
  font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  line-height: 2;
}

.text-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background: linear-gradient(180deg, 
    rgba(201, 64, 67, 0.03) 0%, 
    rgba(232, 145, 90, 0.05) 50%,
    rgba(201, 64, 67, 0.03) 100%
  );
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: var(--space-sm) 0;
  background: rgba(253, 248, 243, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-normal);
}

.nav.scrolled {
  box-shadow: var(--shadow-soft);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fire-red);
  text-decoration: none;
  letter-spacing: 0.1em;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding: var(--space-xs) 0;
  transition: var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--fire-orange);
  transition: var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
  color: var(--fire-red);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--fire-red);
  transition: var(--transition-fast);
}

/* ---------- Cards ---------- */
.card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-normal);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: var(--border-medium);
}

.card-glass {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.card-dark {
  background: linear-gradient(135deg, #2D1810 0%, #1A0F0A 100%);
  color: var(--text-light);
  border: none;
}

.card-dark h3,
.card-dark h4 {
  color: var(--text-light);
}

/* Element Cards */
.card-water {
  border-left: 4px solid var(--water-deep);
}

.card-fire {
  border-left: 4px solid var(--fire-red);
}

.card-wood {
  border-left: 4px solid var(--wood-green);
}

.card-metal {
  border-left: 4px solid var(--metal-gold);
}

.card-earth {
  border-left: 4px solid var(--earth-brown);
}

/* ---------- Bazi Display ---------- */
.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.bazi-pillar {
  text-align: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  position: relative;
  transition: var(--transition-normal);
}

.bazi-pillar:hover {
  transform: scale(1.02);
  border-color: var(--fire-red);
  box-shadow: var(--shadow-medium);
}

.bazi-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-cream);
  padding: 2px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.bazi-tiangan {
  font-family: 'Noto Serif SC', serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  transition: var(--transition-fast);
}

.bazi-dizhi {
  font-family: 'Noto Serif SC', serif;
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.bazi-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tiangan Colors */
.tiangan-bing { color: var(--fire-red); }
.tiangan-geng { color: var(--metal-gold); }
.tiangan-wu { color: var(--earth-brown); }
.tiangan-jia { color: var(--wood-green); }
.tiangan-ren { color: var(--water-deep); }
.tiangan-xin { color: var(--metal-gold); }

/* Dizhi Colors */
.dizhi-zi { color: var(--water-deep); }
.dizhi-yin { color: var(--wood-green); }
.dizhi-shen { color: var(--metal-gold); }
.dizhi-xu { color: var(--earth-brown); }
.dizhi-wu { color: var(--fire-red); }
.dizhi-hai { color: var(--water-deep); }

/* ---------- Wuxing (Five Elements) ---------- */
.wuxing-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.wuxing-circle:hover {
  transform: scale(1.1);
}

.wuxing-water {
  background: linear-gradient(135deg, var(--water-deep), var(--water-light));
  box-shadow: 0 4px 20px rgba(58, 95, 138, 0.4);
}

.wuxing-fire {
  background: linear-gradient(135deg, var(--fire-red), var(--fire-orange));
  box-shadow: 0 4px 20px rgba(201, 64, 67, 0.4);
}

.wuxing-wood {
  background: linear-gradient(135deg, var(--wood-green), var(--pine-green));
  box-shadow: 0 4px 20px rgba(107, 155, 122, 0.4);
}

.wuxing-metal {
  background: linear-gradient(135deg, var(--metal-gold), var(--earth-gold));
  box-shadow: 0 4px 20px rgba(212, 185, 106, 0.4);
}

.wuxing-earth {
  background: linear-gradient(135deg, var(--earth-brown), var(--earth-gold));
  box-shadow: 0 4px 20px rgba(184, 149, 107, 0.4);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--fire-red), var(--fire-orange));
  color: var(--text-light);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 64, 67, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--fire-red);
  border: 2px solid var(--fire-red);
}

.btn-secondary:hover {
  background: var(--fire-red);
  color: var(--text-light);
}

.btn-accent {
  background: linear-gradient(135deg, var(--earth-gold), var(--fire-orange));
  color: var(--text-light);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 169, 98, 0.3);
}

/* ---------- Tags & Badges ---------- */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(201, 64, 67, 0.1);
  color: var(--fire-red);
}

.tag-success {
  background: rgba(91, 140, 123, 0.15);
  color: var(--pine-green);
}

.tag-warning {
  background: rgba(201, 169, 98, 0.2);
  color: var(--earth-gold);
}

.tag-danger {
  background: rgba(201, 64, 67, 0.15);
  color: var(--accent-vermillion);
}

/* ---------- Chart Containers ---------- */
.chart-container {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--border-light);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--fire-red), var(--fire-orange));
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) + 6px);
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fire-red);
  border: 3px solid var(--bg-cream);
}

.timeline-item.active::before {
  background: var(--fire-orange);
  box-shadow: 0 0 0 4px rgba(232, 145, 90, 0.2);
}

.timeline-year {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fire-red);
  margin-bottom: var(--space-xs);
}

/* ---------- Decorative Elements ---------- */
.fire-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(201, 64, 67, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.pattern-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(201, 64, 67, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(232, 145, 90, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ---------- Grid Layouts ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.flex { display: flex; }
.flex-center { justify-content: center; align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes fireGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(201, 64, 67, 0.3); }
  50% { box-shadow: 0 0 40px rgba(232, 145, 90, 0.5); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-fire-glow {
  animation: fireGlow 3s ease-in-out infinite;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ---------- Footer ---------- */
.footer {
  background: linear-gradient(180deg, var(--bg-cream-dark) 0%, rgba(201, 64, 67, 0.08) 100%);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--border-light);
}

.footer-poetry {
  font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: 1.1rem;
  color: var(--fire-red);
  letter-spacing: 0.15em;
  line-height: 2.2;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(253, 248, 243, 0.98);
    padding: var(--space-md);
    gap: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
  }
  
  .nav-links.open {
    display: flex;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .bazi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bazi-tiangan {
    font-size: 2rem;
  }
  
  .bazi-dizhi {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .bazi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .bazi-pillar {
    padding: var(--space-sm);
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .nav,
  .btn,
  .animate-float,
  .fire-glow {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

