/* 紫府命理 - 美化样式 */

/* ===== 动画定义 ===== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 179, 177, 0.2); }
  50% { box-shadow: 0 0 40px rgba(255, 179, 177, 0.4); }
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

/* ===== 星星装饰 ===== */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #FFB3B1;
  border-radius: 50%;
  animation: star-twinkle 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 15%; animation-delay: 0.5s; width: 3px; height: 3px; }
.star:nth-child(3) { top: 5%; left: 25%; animation-delay: 1s; }
.star:nth-child(4) { top: 30%; left: 8%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 15%; left: 35%; animation-delay: 2s; width: 4px; height: 4px; background: #E9C349; }
.star:nth-child(6) { top: 25%; left: 45%; animation-delay: 0.3s; }
.star:nth-child(7) { top: 8%; left: 55%; animation-delay: 1.2s; width: 3px; height: 3px; }
.star:nth-child(8) { top: 35%; left: 62%; animation-delay: 0.8s; }
.star:nth-child(9) { top: 12%; left: 72%; animation-delay: 2.5s; background: #E9C349; }
.star:nth-child(10) { top: 22%; left: 82%; animation-delay: 1.8s; }
.star:nth-child(11) { top: 40%; left: 88%; animation-delay: 0.2s; width: 3px; height: 3px; }
.star:nth-child(12) { top: 18%; left: 92%; animation-delay: 3s; }
.star:nth-child(13) { top: 50%; left: 3%; animation-delay: 0.7s; }
.star:nth-child(14) { top: 45%; left: 20%; animation-delay: 1.3s; width: 4px; height: 4px; background: #E9C349; }
.star:nth-child(15) { top: 55%; left: 40%; animation-delay: 2.2s; }
.star:nth-child(16) { top: 60%; left: 60%; animation-delay: 0.4s; width: 3px; height: 3px; }
.star:nth-child(17) { top: 48%; left: 75%; animation-delay: 1.6s; }
.star:nth-child(18) { top: 52%; left: 90%; animation-delay: 2.8s; background: #E9C349; }
.star:nth-child(19) { top: 70%; left: 12%; animation-delay: 0.9s; }
.star:nth-child(20) { top: 65%; left: 28%; animation-delay: 1.1s; width: 2px; height: 2px; }

/* ===== Hero 区域增强 ===== */
.hero-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 177, 0.15) 0%, transparent 70%);
  animation: pulse-soft 4s ease-in-out infinite;
}

.hero-glow-gold {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 195, 73, 0.1) 0%, transparent 70%);
  animation: pulse-soft 5s ease-in-out infinite;
  animation-delay: 1s;
}

/* 命盘圆环装饰 */
.chart-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 177, 0.2);
  animation: rotate-slow 60s linear infinite;
}

.chart-ring::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #FFB3B1;
  border-radius: 50%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* ===== 卡片增强 ===== */
.card-mystical {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.card-mystical::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 179, 177, 0.1), transparent);
  transition: left 0.5s ease;
}

.card-mystical:hover::before {
  left: 100%;
}

.card-mystical:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(255, 179, 177, 0.1);
}

/* ===== 课程卡片 ===== */
.course-card {
  background: linear-gradient(135deg, #1c1b1b 0%, #201f1f 100%);
  border: 1px solid rgba(74, 69, 77, 0.3);
  transition: all 0.3s ease;
}

.course-card:hover {
  border-color: rgba(255, 179, 177, 0.3);
  background: linear-gradient(135deg, #201f1f 0%, #2a2a2a 100%);
}

.course-card .course-icon {
  transition: all 0.3s ease;
}

.course-card:hover .course-icon {
  transform: scale(1.1) rotate(5deg);
  color: #FFB3B1;
}

/* ===== 按钮增强 ===== */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn-primary:hover::after {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ===== 文字效果 ===== */
.text-shimmer {
  background: linear-gradient(
    90deg,
    #FFB3B1 0%,
    #E9C349 25%,
    #FFB3B1 50%,
    #E9C349 75%,
    #FFB3B1 100%
  );
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-glow-strong {
  text-shadow: 
    0 0 10px rgba(255, 179, 177, 0.5),
    0 0 20px rgba(255, 179, 177, 0.3),
    0 0 40px rgba(255, 179, 177, 0.2);
}

/* ===== 分隔线装饰 ===== */
.divider-ornate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.divider-ornate::before,
.divider-ornate::after {
  content: '';
  height: 1px;
  width: 100px;
  background: linear-gradient(90deg, transparent, rgba(240, 181, 221, 0.3));
}

.divider-ornate::after {
  background: linear-gradient(90deg, rgba(240, 181, 221, 0.3), transparent);
}

.divider-ornate .icon {
  color: rgba(240, 181, 221, 0.5);
  animation: pulse-soft 2s ease-in-out infinite;
}

/* ===== 浮动装饰元素 ===== */
.float-element {
  animation: float 6s ease-in-out infinite;
}

.float-element:nth-child(2) { animation-delay: 1s; }
.float-element:nth-child(3) { animation-delay: 2s; }

/* ===== 命盘十二宫样式 ===== */
.palace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  aspect-ratio: 1;
}

.palace-cell {
  border: 1px solid rgba(255, 179, 177, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.palace-cell:hover {
  background: rgba(255, 179, 177, 0.1);
  border-color: rgba(255, 179, 177, 0.3);
}

.palace-center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  border: 2px solid rgba(233, 195, 73, 0.2);
  background: radial-gradient(circle, rgba(59, 19, 51, 0.3), transparent);
}

/* ===== 评论区域 ===== */
.comment-card {
  background: linear-gradient(135deg, #2a2a2a 0%, #1c1b1b 100%);
  border-left: 2px solid rgba(255, 179, 177, 0.3);
  padding: 16px;
  margin: 8px 0;
  transition: all 0.2s ease;
}

.comment-card:hover {
  border-left-color: #FFB3B1;
  background: linear-gradient(135deg, #353534 0%, #2a2a2a 100%);
}

/* ===== 表单输入 ===== */
.input-mystical {
  background: rgba(14, 14, 14, 0.8);
  border: none;
  border-bottom: 1px solid rgba(74, 69, 77, 0.5);
  transition: all 0.3s ease;
}

.input-mystical:focus {
  border-bottom-color: #E9C349;
  background: rgba(14, 14, 14, 1);
  box-shadow: 0 4px 12px rgba(233, 195, 73, 0.1);
}

/* ===== 导航栏 ===== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #E9C349;
  transition: width 0.3s ease;
}

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

.nav-link.active::after {
  width: 100%;
  background: #E9C349;
}

/* ===== 页面特定样式 ===== */

/* 知识课堂页面 */
.knowledge-header {
  position: relative;
}

.knowledge-header::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 19, 51, 0.2), transparent);
  border-radius: 50%;
}

/* 案例分享页面 */
.case-card {
  background: linear-gradient(180deg, #1c1b1b 0%, #201f1f 100%);
  border: 1px solid rgba(74, 69, 77, 0.2);
  transition: all 0.4s ease;
}

.case-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(233, 195, 73, 0.3);
  box-shadow: 
    0 15px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(233, 195, 73, 0.1);
}

/* 排盘页面 */
.order-form-container {
  position: relative;
}

.order-form-container::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 179, 177, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(233, 195, 73, 0.05) 0%, transparent 50%);
  border-radius: 20px;
  z-index: -1;
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
  .star:nth-child(n+10) { display: none; } /* 移动端减少星星数量 */
  
  .hero-glow, .hero-glow-gold {
    width: 150px;
    height: 150px;
  }
  
  .chart-ring {
    display: none;
  }
}

/* ===== 深色模式优化 ===== */
.dark-mode-enhanced {
  --bg-primary: #131313;
  --bg-secondary: #1c1b1b;
  --bg-tertiary: #201f1f;
  --text-primary: #e5e2e1;
  --text-muted: #ccc4ce;
  --accent-pink: #FFB3B1;
  --accent-gold: #E9C349;
  --accent-purple: #3b1333;
}

/* ===== 打印样式 ===== */
@media print {
  .stars-bg, .hero-glow, .chart-ring {
    display: none;
  }
}