/* ===== Global Reset & Variables ===== */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b8;
  --text-heading: #ffffff;
  --accent: #7c4dff;
  --accent-light: #b388ff;
  --accent-dark: #5600e8;
  --border-color: rgba(124, 77, 255, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --max-width: 1200px;
  --header-height: 70px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 77, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(124, 77, 255, 0.6); }
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-light);
}

/* ===== Header & Nav ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  transition: background var(--transition);
}

nav[aria-label="主导航"] {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 100%;
}

nav[aria-label="主导航"] > a {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
nav[aria-label="主导航"] > a:hover {
  transform: scale(1.05);
}

nav[aria-label="主导航"] ul {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav[aria-label="主导航"] ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
nav[aria-label="主导航"] ul li a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--transition);
}
nav[aria-label="主导航"] ul li a:hover {
  color: var(--text-heading);
  background: var(--bg-glass);
}
nav[aria-label="主导航"] ul li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

nav[aria-label="主导航"] button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
nav[aria-label="主导航"] button:hover {
  background: var(--bg-glass);
  transform: scale(1.1);
}

/* ===== Main Layout ===== */
main {
  padding-top: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 60px;
}

/* ===== Banner ===== */
#banner {
  position: relative;
  margin: 24px 0 48px;
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeInUp 0.8s ease;
  box-shadow: var(--shadow);
}

.banner-slide {
  display: none;
  width: 100%;
}
.banner-slide.active {
  display: block;
  animation: fadeInUp 0.6s ease;
}

.banner-slide svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ===== Section Common ===== */
section {
  margin-bottom: 60px;
  animation: fadeInUp 0.8s ease;
}

section h1, section h2 {
  color: var(--text-heading);
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
}

section h1::after, section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
}

section h3 {
  color: var(--accent-light);
  margin: 20px 0 12px;
  font-size: 1.2rem;
}

section p {
  margin-bottom: 16px;
  color: var(--text-primary);
  max-width: 800px;
}

/* ===== About Section ===== */
#about {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
#about:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* ===== Products / Solutions / Cases ===== */
#products, #solutions, #cases, #reviews, #news, #faq, #howto, #contact {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
#products:hover, #solutions:hover, #cases:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* ===== Reviews ===== */
#reviews blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 16px 0;
  background: var(--bg-glass);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-secondary);
  transition: background var(--transition), transform var(--transition);
}
#reviews blockquote:hover {
  background: rgba(124, 77, 255, 0.1);
  transform: translateX(8px);
}

/* ===== News Articles ===== */
#news article {
  padding: 20px;
  margin: 16px 0;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
}
#news article:hover {
  border-color: var(--border-color);
  background: rgba(124, 77, 255, 0.05);
  transform: translateY(-2px);
}
#news article h4 {
  color: var(--text-heading);
  margin-bottom: 8px;
}
#news article p {
  font-size: 0.9rem;
  margin-bottom: 8px;
}
#news article a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}
#news article a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===== FAQ ===== */
#faq details {
  margin: 12px 0;
  padding: 16px 20px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
#faq details:hover {
  border-color: var(--border-color);
}
#faq details[open] {
  border-color: var(--accent);
  background: rgba(124, 77, 255, 0.05);
}
#faq summary {
  font-weight: 600;
  color: var(--text-heading);
  outline: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
#faq summary::-webkit-details-marker {
  display: none;
}
#faq summary::before {
  content: '+';
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform var(--transition);
  display: inline-block;
  width: 24px;
  text-align: center;
}
#faq details[open] summary::before {
  content: '−';
  transform: rotate(180deg);
}
#faq details p {
  padding-top: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== HowTo ===== */
#howto ol {
  padding-left: 24px;
  margin: 16px 0;
}
#howto ol li {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
#howto ol li:hover {
  background: var(--bg-glass);
}
#howto h3 {
  margin-top: 28px;
}

/* ===== Contact ===== */
#contact p {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Sitemap & Friend Links ===== */
nav[aria-label="网站地图"], nav[aria-label="友情链接"] {
  margin: 40px 0;
  padding: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
nav[aria-label="网站地图"] h2, nav[aria-label="友情链接"] h2 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}
nav[aria-label="网站地图"] ul, nav[aria-label="友情链接"] ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
nav[aria-label="网站地图"] ul li a, nav[aria-label="友情链接"] ul li a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.9rem;
}
nav[aria-label="网站地图"] ul li a:hover, nav[aria-label="友情链接"] ul li a:hover {
  color: var(--text-heading);
  background: var(--bg-glass);
}

/* ===== Footer ===== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 2;
}
footer p {
  margin-bottom: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  nav[aria-label="主导航"] {
    padding: 0 16px;
  }

  nav[aria-label="主导航"] ul {
    gap: 4px;
  }

  nav[aria-label="主导航"] ul li a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  nav[aria-label="主导航"] button {
    padding: 6px;
  }

  main {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 40px;
  }

  section h1, section h2 {
    font-size: 1.5rem;
  }

  #about, #products, #solutions, #cases, #reviews, #news, #faq, #howto, #contact {
    padding: 24px;
  }

  .banner-slide svg {
    height: 200px;
  }

  nav[aria-label="网站地图"] ul, nav[aria-label="友情链接"] ul {
    flex-direction: column;
    gap: 4px;
  }

  footer {
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  nav[aria-label="主导航"] ul li a {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  #about, #products, #solutions, #cases, #reviews, #news, #faq, #howto, #contact {
    padding: 16px;
  }

  section h1, section h2 {
    font-size: 1.3rem;
  }

  .banner-slide svg {
    height: 150px;
  }
}

/* ===== Dark Mode (already dark by default) ===== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #12122a;
    /* keep dark theme as primary, override only if needed */
  }
}

/* ===== Gradient Banner Overlay (extra flair) ===== */
#banner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(179, 136, 255, 0.05));
  pointer-events: none;
  border-radius: var(--radius);
}

/* ===== Scroll-trigger animation (fallback) ===== */
@media (prefers-reduced-motion: no-preference) {
  section {
    animation: fadeInUp 0.8s ease both;
  }
  section:nth-child(2) { animation-delay: 0.1s; }
  section:nth-child(3) { animation-delay: 0.2s; }
  section:nth-child(4) { animation-delay: 0.3s; }
  section:nth-child(5) { animation-delay: 0.4s; }
  section:nth-child(6) { animation-delay: 0.5s; }
  section:nth-child(7) { animation-delay: 0.6s; }
  section:nth-child(8) { animation-delay: 0.7s; }
  section:nth-child(9) { animation-delay: 0.8s; }
  section:nth-child(10) { animation-delay: 0.9s; }
  section:nth-child(11) { animation-delay: 1s; }
  section:nth-child(12) { animation-delay: 1.1s; }
  nav[aria-label="网站地图"], nav[aria-label="友情链接"] {
    animation: fadeInUp 0.8s ease both;
    animation-delay: 1.2s;
  }
  footer {
    animation: fadeInUp 0.8s ease both;
    animation-delay: 1.3s;
  }
}

/* ===== Utility ===== */
a {
  color: inherit;
}

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