/* ===== 基础重置与变量 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

:root {
  --primary: #1a1a2e;
  --secondary: #e94560;
  --accent: #0f3460;
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --glass: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --radius: 20px;
  --transition: 0.3s ease;
}

.dark-mode {
  --bg: #0d0d0d;
  --text: #f0f0f0;
  --glass: rgba(30, 30, 40, 0.8);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background var(--transition), color var(--transition);
}

/* ===== 导航栏 ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 2rem;
  transition: background var(--transition);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--secondary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #e94560 100%);
  color: #fff;
  padding: 6rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.15) 0%, transparent 70%);
  animation: pulse 8s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero .btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--secondary);
  color: #fff;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

.hero .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(233, 69, 96, 0.6);
}

/* ===== 公共容器与标题 ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

section {
  padding: 4rem 2rem;
  transition: background var(--transition);
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  margin: 0.5rem auto;
  border-radius: 2px;
}

/* ===== 卡片与网格系统 ===== */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--secondary);
}

.card p {
  color: var(--text);
  opacity: 0.8;
}

.card svg {
  margin: 0 auto 1rem;
  display: block;
}

/* ===== 统计数字 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat-item .number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  display: block;
}

.stat-item .label {
  font-size: 1rem;
  color: var(--text);
  opacity: 0.7;
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem 0;
  cursor: pointer;
}

.faq-question {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding-top: 0;
  color: var(--text);
  opacity: 0.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-top: 1rem;
}

/* ===== 页脚 ===== */
footer {
  background: var(--primary);
  color: #fff;
  padding: 3rem 2rem 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-col h4 {
  color: var(--secondary);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--secondary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--secondary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
  transition: opacity var(--transition), transform var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: scale(1.1);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--glass);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  section {
    padding: 2rem 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .stat-item .number {
    font-size: 2.5rem;
  }
}

/* ===== 滚动动画基础样式 ===== */
.card,
.stat-item,
.faq-item,
.hero,
section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ===== 暗色模式切换按钮 ===== */
.dark-mode-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: var(--secondary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 999;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
  transition: transform var(--transition);
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
}

/* ===== 搜索框 ===== */
.search-box {
  position: fixed;
  top: 80px;
  right: 2rem;
  z-index: 999;
  background: var(--glass);
  backdrop-filter: blur(20px);
  padding: 0.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}

.search-box input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  width: 200px;
  background: var(--bg);
  color: var(--text);
}

.search-trigger {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
  color: var(--text);
}

/* ===== 文章卡片内链接 ===== */
.card a {
  color: var(--secondary);
  text-decoration: none;
  transition: opacity var(--transition);
}

.card a:hover {
  opacity: 0.8;
}

/* ===== 列表样式优化 ===== */
ul[style*="list-style:disc"],
ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

ul[style*="list-style:disc"] li,
ol li {
  margin-bottom: 0.5rem;
}

/* ===== 联系方式区域 ===== */
#contact .card p {
  word-break: break-word;
}

/* ===== 信任体系背景 ===== */
#trust {
  background: var(--glass);
}

/* ===== 产品中心背景 ===== */
#products {
  background: var(--glass);
}

/* ===== FAQ背景 ===== */
#faq {
  background: var(--glass);
}

/* ===== 热门推荐链接 ===== */
#news ul li a {
  color: var(--secondary);
  text-decoration: none;
  transition: opacity var(--transition);
}

#news ul li a:hover {
  opacity: 0.8;
}