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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  line-height: 1.6;
  color: #1a1a2e;
  background: #f5f7fa;
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

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

/* ===== DARK MODE ===== */
body.dark {
  background: #0f0f1a;
  color: #e0e0e0;
}

body.dark header {
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(12px);
}

body.dark nav {
  background: rgba(15, 15, 26, 0.9);
}

body.dark nav ul a {
  color: #ccc;
}

body.dark nav ul a:hover {
  color: #e94560;
}

body.dark section {
  background: rgba(20, 20, 35, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.05);
}

body.dark section h2 {
  color: #f0f0f0;
}

body.dark article {
  background: rgba(30, 30, 50, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
}

body.dark footer {
  background: #0a0a14;
  color: #aaa;
}

body.dark #darkModeToggle {
  background: rgba(255,255,255,0.1);
  color: #ffd700;
}

/* ===== HEADER & NAV ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

header.sticky {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav ul a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.3s ease;
}

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

nav ul a:hover::after {
  width: 100%;
}

nav ul a:hover {
  color: #e94560;
}

#darkModeToggle {
  background: rgba(0,0,0,0.05);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

#darkModeToggle:hover {
  background: rgba(233, 69, 96, 0.15);
  transform: scale(1.1);
}

/* ===== HERO SECTION ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(233,69,96,0.15) 0%, transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(0,212,255,0.1) 0%, transparent 50%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -2%) scale(1.05); }
}

#hero > div {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

#hero h1 {
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  animation: fadeInUp 0.8s ease forwards;
}

#hero p {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: rgba(255,255,255,0.85);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

#hero a[role="button"] {
  display: inline-block;
  padding: 0.9rem 2.8rem;
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 50px;
  box-shadow: 0 8px 30px rgba(233,69,96,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

#hero a[role="button"]:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(233,69,96,0.5);
}

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

/* ===== GENERAL SECTION STYLING ===== */
main section {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 3rem 2rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.04);
  transition: background 0.4s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  animation: sectionFadeIn 0.8s ease forwards;
}

@keyframes sectionFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

main section:nth-child(2) { animation-delay: 0.1s; }
main section:nth-child(3) { animation-delay: 0.2s; }
main section:nth-child(4) { animation-delay: 0.3s; }
main section:nth-child(5) { animation-delay: 0.4s; }
main section:nth-child(6) { animation-delay: 0.5s; }
main section:nth-child(7) { animation-delay: 0.6s; }
main section:nth-child(8) { animation-delay: 0.7s; }
main section:nth-child(9) { animation-delay: 0.8s; }

section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #e94560, #f5a623);
  border-radius: 4px;
}

/* ===== ABOUT SECTION ===== */
#about p {
  font-size: 1.05rem;
  max-width: 800px;
  margin-bottom: 1rem;
  color: #444;
}

body.dark #about p {
  color: #ccc;
}

/* ===== PRODUCTS SECTION ===== */
#products > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

article {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

article:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

body.dark article:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

article h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #1a1a2e;
}

body.dark article h3 {
  color: #f0f0f0;
}

article p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.7;
}

body.dark article p {
  color: #bbb;
}

/* ===== SERVICES SECTION ===== */
#services ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

#services li {
  background: rgba(233,69,96,0.06);
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  font-weight: 500;
  color: #333;
  border-left: 4px solid #e94560;
  transition: background 0.3s ease, transform 0.2s ease;
}

body.dark #services li {
  color: #ddd;
  background: rgba(233,69,96,0.1);
}

#services li:hover {
  background: rgba(233,69,96,0.12);
  transform: translateX(6px);
}

/* ===== RESOURCES SECTION ===== */
#resources > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

#resources article {
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.15);
}

#resources article h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

#resources article h3 a {
  color: #1a1a2e;
  transition: color 0.3s ease;
}

body.dark #resources article h3 a {
  color: #e0e0e0;
}

#resources article h3 a:hover {
  color: #e94560;
}

#resources article p {
  font-size: 0.9rem;
  color: #666;
}

body.dark #resources article p {
  color: #aaa;
}

/* ===== FAQ SECTION ===== */
#faq details {
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  margin-bottom: 0.8rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.3s ease;
}

body.dark #faq details {
  background: rgba(30,30,50,0.5);
}

#faq details[open] {
  background: rgba(233,69,96,0.05);
}

body.dark #faq details[open] {
  background: rgba(233,69,96,0.08);
}

#faq summary {
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0;
  color: #1a1a2e;
  transition: color 0.3s ease;
}

body.dark #faq summary {
  color: #e0e0e0;
}

#faq summary:hover {
  color: #e94560;
}

#faq details p {
  margin-top: 0.8rem;
  padding: 0.5rem 0;
  color: #555;
  font-size: 0.95rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

body.dark #faq details p {
  color: #bbb;
  border-top-color: rgba(255,255,255,0.05);
}

/* ===== HOWTO SECTION ===== */
#howto ol {
  counter-reset: step;
  max-width: 700px;
  margin-top: 1.5rem;
}

#howto li {
  counter-increment: step;
  padding: 0.8rem 0 0.8rem 3rem;
  position: relative;
  font-size: 1rem;
  color: #444;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

body.dark #howto li {
  color: #ccc;
  border-bottom-color: rgba(255,255,255,0.04);
}

#howto li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

#howto li strong {
  color: #1a1a2e;
}

body.dark #howto li strong {
  color: #f0f0f0;
}

/* ===== CONTACT SECTION ===== */
#contact p {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark #contact p {
  color: #ccc;
}

#contact p::before {
  content: '•';
  color: #e94560;
  font-weight: bold;
  font-size: 1.3rem;
}

/* ===== FOOTER ===== */
footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

footer > div {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

footer p {
  font-size: 0.9rem;
}

footer nav a {
  color: #aaa;
  font-size: 0.9rem;
  margin: 0 0.3rem;
  transition: color 0.3s ease;
}

footer nav a:hover {
  color: #e94560;
}

/* ===== BACK TO TOP BUTTON ===== */
button[aria-label="返回顶部"] {
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(233,69,96,0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
}

button[aria-label="返回顶部"]:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 36px rgba(233,69,96,0.5);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav {
    padding: 0.5rem 1rem;
  }

  nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    order: 3;
    margin-top: 0.5rem;
  }

  nav ul a {
    font-size: 0.85rem;
  }

  #darkModeToggle {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  main section {
    margin: 1rem 0.8rem;
    padding: 2rem 1.2rem;
    border-radius: 18px;
  }

  #hero {
    padding: 5rem 1.2rem 3rem;
  }

  #products > div,
  #resources > div,
  #services ul {
    grid-template-columns: 1fr;
  }

  footer > div {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  nav ul {
    gap: 0.6rem;
  }

  nav ul a {
    font-size: 0.8rem;
  }

  #hero h1 {
    font-size: 1.8rem;
  }

  #hero p {
    font-size: 0.95rem;
  }

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