:root {
  --primary: #e94560;
  --primary-dark: #c7304a;
  --primary-light: #ff6b82;
  --bg: #f8f9fc;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a72;
  --text-muted: #8a8aa0;
  --border: #e8e8f0;
  --header-bg: rgba(255, 255, 255, 0.85);
  --shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, 0.1);
  --shadow-lg: 0 16px 48px rgba(26, 26, 46, 0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
  --gradient-primary: linear-gradient(135deg, #e94560 0%, #ff6b82 100%);
  --gradient-accent: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0d0d1a;
  --bg-alt: #14142a;
  --bg-card: #1a1a2e;
  --text: #eaeaf2;
  --text-secondary: #a8a8c0;
  --text-muted: #6a6a85;
  --border: #2a2a45;
  --header-bg: rgba(13, 13, 26, 0.85);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-light);
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4 {
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
h4 { font-size: 1.05rem; }

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

section {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
}

section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--gradient-primary);
}

/* Header */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

#site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.logo svg {
  border-radius: 10px;
  transition: transform var(--transition);
}

.logo:hover svg {
  transform: rotate(-6deg) scale(1.06);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

nav[aria-label="主导航"] {
  flex: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-list li a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-list li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: all var(--transition);
  transform: translateX(-50%);
}

.nav-list li a:hover {
  color: var(--primary);
  background: rgba(233, 69, 96, 0.08);
}

.nav-list li a:hover::after {
  width: 60%;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.menu-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.site-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-search input[type="search"] {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.88rem;
  width: 200px;
  outline: none;
  transition: all var(--transition);
}

.site-search input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
  width: 240px;
}

.site-search input[type="search"]::placeholder {
  color: var(--text-muted);
}

.site-search button {
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 50px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.site-search button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.35);
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  border-color: var(--primary);
}

/* Breadcrumb */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb ol li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb [aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

/* Hero */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}

.hero-slider {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 260px;
}

.slide {
  display: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.slide.active {
  display: block;
  opacity: 1;
  animation: slideFade 0.8s ease;
}

@keyframes slideFade {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

.slide svg {
  width: 100%;
  height: auto;
  display: block;
}

.hero-content {
  position: relative;
  margin-top: -80px;
  margin-left: auto;
  margin-right: auto;
  max-width: 900px;
  padding: 2.5rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2;
  text-align: center;
}

.hero-content h1 {
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  margin: 0.35rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.35);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(233, 69, 96, 0.5);
}

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

.btn-secondary:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* Stats */
#stats {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

#stats h2 {
  text-align: center;
}

#stats h2::after {
  left: 50%;
  transform: translateX(-50%);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.stat-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.stat-item:hover::before {
  transform: scaleX(1);
}

.stat-number {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* About / content sections */
#about,
#products,
#solutions,
#cases,
#news,
#articles,
#faq,
#howto,
#contact,
#sitemap,
#links {
  background: transparent;
}

#about h3,
#products h3,
#solutions h3,
#cases h3,
#news h3,
#howto h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  padding-left: 0.9rem;
  border-left: 4px solid var(--primary);
  border-radius: 2px;
}

#about h3:first-of-type,
#products h3:first-of-type,
#solutions h3:first-of-type,
#cases h3:first-of-type,
#news h3:first-of-type,
#howto h3:first-of-type {
  margin-top: 0;
}

#products h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
  font-weight: 600;
}

/* Article cards */
#articles {
  display: block;
}

#articles h2 {
  margin-bottom: 2rem;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(233, 69, 96, 0.3);
}

.article-card:hover::before {
  transform: scaleY(1);
}

.article-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  border: none;
  padding: 0;
}

.article-card h3 a,
.article-card h3 {
  color: var(--text);
}

.article-card:hover h3 {
  color: var(--primary);
}

.article-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.article-card > p:not(.article-meta) {
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.article-card > a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.article-card > a::after {
  content: "→";
  transition: transform var(--transition);
}

.article-card > a:hover::after {
  transform: translateX(4px);
}

/* FAQ */
#faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

#faq details:hover {
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: var(--shadow-md);
}

#faq details[open] {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

#faq summary {
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 3rem;
  transition: color var(--transition);
  font-size: 0.98rem;
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: "+";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--primary);
  transition: transform var(--transition);
}

#faq details[open] summary::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

#faq summary:hover {
  color: var(--primary);
}

#faq details p {
  padding: 0 1.5rem 1.25rem;
  margin: 0;
  font-size: 0.92rem;
  animation: faqSlide 0.3s ease;
}

@keyframes faqSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HowTo */
#howto ol {
  counter-reset: step-counter;
  margin: 1.5rem 0;
}

#howto ol li {
  counter-increment: step-counter;
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

#howto ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

#howto ol li:hover {
  transform: translateX(6px);
  border-color: rgba(233, 69, 96, 0.4);
  box-shadow: var(--shadow-sm);
}

/* Contact */
#contact p {
  margin-bottom: 0.6rem;
}

/* Sitemap & Links */
#sitemap ul,
#links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#sitemap ul li a,
#links ul li a {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

#sitemap ul li a:hover,
#links ul li a:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.3);
}

/* Footer */
footer {
  background: var(--gradient-hero);
  color: #e0e0ee;
  padding: 3rem 1.5rem 2rem;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.25), transparent 70%);
  pointer-events: none;
}

footer section {
  max-width: 1200px;
  margin: 0 auto 1.75rem;
  padding: 0;
}

footer h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.6rem;
  padding-bottom: 0;
}

footer h2::after {
  display: none;
}

footer p {
  color: rgba(224, 224, 238, 0.75);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--primary-light);
}

footer a:hover {
  color: #fff;
}

footer > p {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Back to top */
#back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

#back-to-top:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 10px 30px rgba(233, 69, 96, 0.55);
}

/* Scroll reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .header-inner {
    gap: 0.75rem;
  }

  .nav-list li a {
    padding: 0.45rem 0.65rem;
    font-size: 0.86rem;
  }

  .site-search input[type="search"] {
    width: 160px;
  }

  .site-search input[type="search"]:focus {
    width: 190px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  section {
    padding: 3rem 1.25rem;
  }

  .header-inner {
    padding: 0.6rem 1.25rem;
    justify-content: space-between;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 3;
  }

  nav[aria-label="主导航"] {
    order: 5;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
  }

  nav[aria-label="主导航"].open {
    max-height: 500px;
    opacity: 1;
    padding-top: 0.75rem;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-list li a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .nav-list li a::after {
    display: none;
  }

  .site-search {
    order: 4;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
  }

  .site-search.open {
    max-height: 80px;
    opacity: 1;
    padding-top: 0.75rem;
  }

  .site-search input[type="search"] {
    flex: 1;
    width: auto;
  }

  .site-search input[type="search"]:focus {
    width: auto;
  }

  .theme-toggle {
    order: 4;
  }

  .hero {
    padding: 0 1.25rem;
  }

  .hero-slider {
    border-radius: var(--radius-lg);
    min-height: 180px;
  }

  .hero-content {
    margin-top: -50px;
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .hero-content p {
    font-size: 0.92rem;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    display: block;
    margin: 0.4rem auto;
    max-width: 260px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-item {
    padding: 1.5rem 0.75rem;
  }

  .article-card {
    padding: 1.25rem;
  }

  #faq summary {
    padding: 1rem 1.25rem;
    padding-right: 2.75rem;
    font-size: 0.92rem;
  }

  #faq details p {
    padding: 0 1.25rem 1rem;
  }

  #howto ol li {
    padding: 0.8rem 0.9rem 0.8rem 3rem;
    font-size: 0.9rem;
  }

  #back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }

  .breadcrumb {
    padding: 1rem 1.25rem 0;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 1.05rem;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  .hero-content h1 {
    font-size: 1.25rem;
  }

  footer {
    padding: 2.5rem 1.25rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

::selection {
  background: rgba(233, 69, 96, 0.25);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}