/* ============================================
   幻彩棱镜风 (Prismatic Spectrum) — Custom CSS
   ============================================ */

/* --- CSS Variables --- */
:root {
  --white: #ffffff;
  --off-white: #fafafa;
  --crystal: #f0f0ff;
  --dark-prism: #1a1a2e;
  --prism-red: #ff4444;
  --prism-orange: #ff8800;
  --prism-yellow: #ffcc00;
  --prism-green: #44cc44;
  --prism-blue: #4488ff;
  --prism-indigo: #6644ff;
  --prism-violet: #cc44ff;
  --prism-gradient: linear-gradient(90deg, #ff4444, #ff8800, #ffcc00, #44cc44, #4488ff, #6644ff, #cc44ff);
  --prism-gradient-vertical: linear-gradient(180deg, #ff4444, #ff8800, #ffcc00, #44cc44, #4488ff, #6644ff, #cc44ff);
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Noto Sans SC', sans-serif;
}

/* --- Prismatic Color-Shift Animation for Text --- */
@keyframes prismatic-shift {
  0%   { color: #ff4444; }
  14%  { color: #ff8800; }
  28%  { color: #ffcc00; }
  42%  { color: #44cc44; }
  57%  { color: #4488ff; }
  71%  { color: #6644ff; }
  85%  { color: #cc44ff; }
  100% { color: #ff4444; }
}

.prism-text {
  animation: prismatic-shift 4s linear infinite;
}

/* --- Rainbow Gradient Border Bottom (Nav) --- */
.rainbow-border-bottom {
  border-bottom: 3px solid transparent;
  border-image: var(--prism-gradient) 1;
}

/* --- Triangular Prism Shape (CSS border trick) --- */
.prism-triangle {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 180px solid rgba(255,255,255,0.15);
  position: relative;
}

.prism-triangle::after {
  content: '';
  position: absolute;
  top: 180px;
  left: -100px;
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-top: 60px solid rgba(255,255,255,0.08);
}

/* --- Prism Clip-path Shape --- */
.prism-shape {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, rgba(255,68,68,0.3), rgba(102,68,255,0.3), rgba(204,68,255,0.3));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  position: relative;
}

/* --- Rainbow Light Rays --- */
@keyframes ray-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.3); }
}

.rainbow-ray {
  position: absolute;
  width: 3px;
  height: 200px;
  transform-origin: bottom center;
  border-radius: 2px;
  animation: ray-pulse 2s ease-in-out infinite;
}

.ray-1 { background: #ff4444; left: calc(50% - 80px); bottom: 50%; transform: rotate(-35deg); animation-delay: 0s; }
.ray-2 { background: #ff8800; left: calc(50% - 48px); bottom: 50%; transform: rotate(-22deg); animation-delay: 0.2s; }
.ray-3 { background: #ffcc00; left: calc(50% - 16px); bottom: 50%; transform: rotate(-8deg); animation-delay: 0.4s; }
.ray-4 { background: #44cc44; left: calc(50% + 16px); bottom: 50%; transform: rotate(8deg); animation-delay: 0.6s; }
.ray-5 { background: #4488ff; left: calc(50% + 48px); bottom: 50%; transform: rotate(22deg); animation-delay: 0.8s; }
.ray-6 { background: #6644ff; left: calc(50% + 80px); bottom: 50%; transform: rotate(35deg); animation-delay: 1.0s; }

/* --- Floating Crystal Shapes --- */
@keyframes float-crystal {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-20px) rotate(5deg); }
  50% { transform: translateY(-10px) rotate(0deg); }
  75% { transform: translateY(-30px) rotate(-5deg); }
}

.float-crystal {
  animation: float-crystal 6s ease-in-out infinite;
}

.float-crystal-delay-1 { animation-delay: 0s; }
.float-crystal-delay-2 { animation-delay: 2s; }
.float-crystal-delay-3 { animation-delay: 4s; }

/* --- Prismatic Feature Card Top Border --- */
.prism-card {
  border-top: 3px solid transparent;
  border-image: var(--prism-gradient) 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.prism-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(102, 68, 255, 0.15);
}

/* --- Crystal Icon Circle --- */
.crystal-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--crystal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.15),
              0 0 40px rgba(68, 136, 255, 0.1),
              0 0 60px rgba(204, 68, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.crystal-icon-circle::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--prism-gradient);
  opacity: 0.3;
  z-index: -1;
}

/* --- Prismatic Counter Numbers --- */
@keyframes counter-shift {
  0%   { background: linear-gradient(135deg, #ff4444, #ff8800); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  14%  { background: linear-gradient(135deg, #ff8800, #ffcc00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  28%  { background: linear-gradient(135deg, #ffcc00, #44cc44); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  42%  { background: linear-gradient(135deg, #44cc44, #4488ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  57%  { background: linear-gradient(135deg, #4488ff, #6644ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  71%  { background: linear-gradient(135deg, #6644ff, #cc44ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  85%  { background: linear-gradient(135deg, #cc44ff, #ff4444); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
  100% { background: linear-gradient(135deg, #ff4444, #ff8800); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
}

.prism-counter {
  animation: counter-shift 3s linear infinite;
  background: linear-gradient(135deg, #ff4444, #ff8800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- FAQ Accordion Prism Indicator --- */
.faq-indicator {
  width: 4px;
  height: 100%;
  background: var(--prism-gradient);
  border-radius: 2px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.faq-item.active .faq-indicator {
  opacity: 1;
}

/* --- CTA: Dark Prism with Rainbow Overlay --- */
.cta-prism-bg {
  background: var(--dark-prism);
  position: relative;
  overflow: hidden;
}

.cta-prism-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,68,68,0.15) 0%,
    rgba(255,136,0,0.12) 14%,
    rgba(255,204,0,0.12) 28%,
    rgba(68,204,68,0.12) 42%,
    rgba(68,136,255,0.15) 57%,
    rgba(102,68,255,0.12) 71%,
    rgba(204,68,255,0.12) 85%,
    rgba(255,68,68,0.15) 100%);
  pointer-events: none;
}

/* --- Footer Rainbow Top Line --- */
.footer-rainbow-top {
  border-top: 2px solid transparent;
  border-image: var(--prism-gradient) 1;
}

/* --- Back to Top Button --- */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--prism-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(102, 68, 255, 0.4);
  font-size: 20px;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(102, 68, 255, 0.6);
}

/* --- Floating Customer Service --- */
#float-cs {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4488ff, #6644ff);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(68, 136, 255, 0.4);
  font-size: 22px;
  animation: cs-pulse 2s ease-in-out infinite;
}

@keyframes cs-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(68, 136, 255, 0.4); }
  50% { box-shadow: 0 8px 35px rgba(68, 136, 255, 0.7); }
}

#float-cs:hover {
  transform: scale(1.1);
}

/* --- Mobile Hamburger Menu --- */
.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu {
    display: block;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    z-index: 100;
  }
}

/* --- Intersection Observer Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- Section Headings --- */
.section-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(102,68,255,0.1), rgba(204,68,255,0.1));
  color: #6644ff;
  margin-bottom: 0.75rem;
}

/* --- Rainbow Button --- */
.btn-rainbow {
  background: var(--prism-gradient);
  color: white;
  padding: 12px 32px;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(102, 68, 255, 0.3);
}

.btn-rainbow:hover {
  box-shadow: 0 8px 35px rgba(102, 68, 255, 0.5);
  transform: translateY(-2px);
}

/* --- Glassmorphism Nav --- */
.nav-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* --- Prism Sparkle Dots --- */
@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: sparkle 2s ease-in-out infinite;
}

/* --- Testimonial Cards --- */
.testimonial-card {
  border: 1px solid rgba(102, 68, 255, 0.08);
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  border-color: rgba(102, 68, 255, 0.2);
  box-shadow: 0 10px 40px rgba(102, 68, 255, 0.08);
}

/* --- About Page Specific --- */
.about-prism-hero {
  background: linear-gradient(135deg, var(--crystal), var(--white));
  position: relative;
  overflow: hidden;
}

.about-prism-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--prism-gradient);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--prism-gradient);
  box-shadow: 0 0 15px rgba(102, 68, 255, 0.4);
}

/* --- Contact Page Specific --- */
.contact-input:focus {
  border-color: #6644ff;
  box-shadow: 0 0 0 3px rgba(102, 68, 255, 0.1);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--off-white);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6644ff, #cc44ff);
  border-radius: 4px;
}

/* --- Hero Background Sparkles --- */
.hero-sparkle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
