/* 全局重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* 主题变量 */
:root {
  --primary: #1a1a2e;
  --secondary: #e94560;
  --accent: #0f3460;
  --bg: #f5f5f5;
  --text: #1a1a2e;
  --card-bg: rgba(255,255,255,0.85);
  --glass: rgba(255,255,255,0.25);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --radius: 16px;
  --transition: 0.3s ease;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 暗黑模式 */
body.dark {
  --primary: #e94560;
  --secondary: #e94560;
  --accent: #0f3460;
  --bg: #0a0a1a;
  --text: #eee;
  --card-bg: rgba(20,20,40,0.9);
  --glass: rgba(255,255,255,0.05);
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, var(--primary), var(--accent), #1a1a2e);
}

/* 毛玻璃 */
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

/* 圆角阴影 */
.rounded-shadow {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--secondary);
  color: #fff;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  transition: background var(--transition), transform 0.2s;
  border: none;
  cursor: pointer;
}
.btn:hover {
  background: #c0392b;
  transform: scale(1.02);
}

/* 导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26,26,46,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
.logo span {
  color: var(--secondary);
}
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
  padding: 6px 0;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* 暗黑切换按钮 */
.dark-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.3s;
}
.dark-toggle:hover {
  color: var(--secondary);
}

/* Hero */
.hero {
  padding: 100px 20px 80px;
  text-align: center;
  background: linear-gradient(135deg, #1a1a2e, #0f3460, #1a1a2e);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
  opacity: 0.9;
}
.hero .btn {
  background: var(--secondary);
}

/* 搜索框 */
.search-box {
  display: flex;
  max-width: 400px;
  margin: 20px auto 30px;
}
.search-box input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 40px 0 0 40px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  font-size: 1rem;
}
.search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}
.search-box button {
  padding: 12px 20px;
  border: none;
  background: var(--secondary);
  color: #fff;
  border-radius: 0 40px 40px 0;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s;
}
.search-box button:hover {
  background: #c0392b;
}

/* 轮播 */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 40px 0;
  height: 400px;
}
.carousel-inner {
  display: flex;
  transition: transform 0.6s ease;
  height: 100%;
}
.carousel-item {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.3s;
}
.carousel-btn:hover {
  background: rgba(255,255,255,0.4);
}
.carousel-btn.prev {
  left: 16px;
}
.carousel-btn.next {
  right: 16px;
}

/* 面包屑 */
.breadcrumb {
  padding: 12px 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}
.breadcrumb a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.3s;
}
.breadcrumb a:hover {
  color: var(--secondary);
}

/* 模块通用 */
.section {
  padding: 60px 0;
}
.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
  font-weight: 700;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  margin: 12px auto 0;
  border-radius: 4px;
}

/* 网格 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* 数据统计 */
.stats {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  text-align: center;
}
.stat-item h3 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--secondary);
}
.stat-item p {
  font-size: 1rem;
  opacity: 0.8;
}

/* FAQ */
.faq-item {
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.faq-question {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}
.faq-question:hover {
  background: rgba(233,69,96,0.05);
}
.faq-question span {
  font-size: 1.4rem;
  transition: transform 0.3s;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  padding: 0 20px;
}
.faq-item.active .faq-answer {
  max-height: 400px;
  padding: 0 20px 16px;
}
.faq-item.active .faq-question span {
  transform: rotate(45deg);
}

/* 返回顶部 */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--secondary);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
}
#backToTop:hover {
  background: #c0392b;
}

/* 滚动动画 */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 图片懒加载占位（备用） */
.lazy-placeholder {
  background: linear-gradient(135deg, #eee, #ddd);
  border-radius: 12px;
}
body.dark .lazy-placeholder {
  background: linear-gradient(135deg, #222, #333);
}

/* 页脚 */
footer {
  background: #111;
  color: rgba(255,255,255,0.7);
  padding: 40px 0;
}
footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.3s;
}
footer a:hover {
  color: var(--secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
footer ul {
  list-style: none;
}
footer ul li {
  margin-bottom: 6px;
}
footer h4 {
  color: #fff;
  margin-bottom: 12px;
}

/* 网站地图 & 友情链接 */
section .grid-4 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}
section .grid-4 a:hover {
  color: var(--secondary);
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background: rgba(26,26,46,0.98);
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    padding: 20px;
    gap: 16px;
    z-index: 99;
  }
  .nav-links.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .carousel {
    height: 240px;
  }
  .carousel-item {
    font-size: 1.4rem;
  }
  .stats {
    flex-direction: column;
    align-items: center;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .search-box {
    max-width: 100%;
  }
  .section-title {
    font-size: 1.6rem;
  }
}

/* 小屏额外优化 */
@media (max-width: 480px) {
  .hero {
    padding: 60px 16px 50px;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .carousel {
    height: 180px;
  }
  .carousel-item {
    font-size: 1.2rem;
  }
  .card {
    padding: 16px;
  }
}

/* 暗黑模式下的微调 */
body.dark .card {
  border: 1px solid rgba(255,255,255,0.05);
}
body.dark .faq-item {
  border: 1px solid rgba(255,255,255,0.05);
}
body.dark .breadcrumb a {
  color: rgba(255,255,255,0.6);
}
body.dark .search-box input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}