/* ===== 全局重置与基础 ===== */
*,
*::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, Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

body.dark {
  background: #0f0f1a;
  color: #e0e0e0;
}

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

/* ===== 头部 ===== */
.header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo span {
  color: #f5a623;
}

.nav {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.3s, transform 0.2s;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.hamburger:hover {
  transform: scale(1.1);
}

/* ===== 英雄区 ===== */
.hero {
  background: linear-gradient(135deg, #16213e, #0f3460);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(245, 166, 35, 0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(20px, -20px); }
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 0.8s forwards 0.2s;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 30px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeInUp 0.8s forwards 0.4s;
}

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

.btn {
  display: inline-block;
  background: #f5a623;
  color: #1a1a2e;
  padding: 14px 36px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.4);
  background: #e6951e;
}

/* ===== 通用区块 ===== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible .section-title {
  opacity: 1;
  transform: translateY(0);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #f5a623;
  margin: 10px auto;
  border-radius: 2px;
}

/* ===== 卡片 ===== */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .card {
  background: rgba(30, 30, 48, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dark .card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ===== 网格 ===== */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.3s;
}

.dark .faq-item {
  border-color: #333;
}

.faq-item:hover {
  background: rgba(245, 166, 35, 0.03);
}

.faq-question {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.3s;
}

.faq-item.active .faq-question {
  color: #f5a623;
}

.faq-question span {
  transition: transform 0.4s ease;
}

.faq-item.active .faq-question span {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding-top: 0;
  color: #555;
}

.dark .faq-answer {
  color: #aaa;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-top: 8px;
}

/* ===== 指南步骤 ===== */
.howto-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
  transition: transform 0.3s;
}

.howto-step:hover {
  transform: translateX(8px);
}

.step-num {
  background: #f5a623;
  color: #1a1a2e;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

/* ===== 评价 ===== */
.testimonial {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .testimonial {
  background: rgba(30, 30, 48, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.testimonial p {
  font-style: italic;
  margin-bottom: 16px;
}

.testimonial .author {
  font-weight: 600;
  color: #f5a623;
}

/* ===== 统计数字 ===== */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin: 40px 0;
}

.stat-item {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.visible .stat-item {
  opacity: 1;
  transform: translateY(0);
}

.stat-item:nth-child(1) { transition-delay: 0.1s; }
.stat-item:nth-child(2) { transition-delay: 0.2s; }
.stat-item:nth-child(3) { transition-delay: 0.3s; }

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #f5a623;
}

.stat-label {
  color: #666;
  margin-top: 4px;
}

.dark .stat-label {
  color: #aaa;
}

/* ===== 页脚 ===== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 40px 0;
  text-align: center;
}

.footer a {
  color: #f5a623;
  text-decoration: none;
  transition: color 0.3s;
}

.footer a:hover {
  color: #e6951e;
  text-decoration: underline;
}

.footer .legal {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 0.9rem;
}

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #f5a623;
  color: #1a1a2e;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  pointer-events: none;
  border: none;
  z-index: 999;
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.4);
}

/* ===== 搜索框 ===== */
.search-box {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.dark .search-box input {
  background: rgba(30, 30, 48, 0.8);
  border-color: #444;
  color: #e0e0e0;
}

.search-box input:focus {
  border-color: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.search-box button {
  padding: 10px 20px;
  background: #f5a623;
  border: none;
  border-radius: 30px;
  color: #1a1a2e;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

.search-box button:hover {
  background: #e6951e;
  transform: scale(1.02);
}

/* ===== 表单 ===== */
input, textarea {
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus {
  border-color: #f5a623 !important;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
  outline: none;
}

.dark input, .dark textarea {
  background: rgba(30, 30, 48, 0.8);
  border-color: #444 !important;
  color: #e0e0e0;
}

/* ===== 知识中心卡片 ===== */
#knowledge .card {
  position: relative;
  overflow: hidden;
}

#knowledge .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 166, 35, 0.05), transparent);
  transition: left 0.6s;
}

#knowledge .card:hover::before {
  left: 100%;
}

#knowledge .card small {
  color: #888;
  font-size: 0.85rem;
}

.dark #knowledge .card small {
  color: #666;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    gap: 10px;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  .nav.open {
    display: flex;
  }

  .hamburger {
    display: block;
  }

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

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

  .stats {
    gap: 20px;
  }

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

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

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 0;
  }

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

  .btn {
    padding: 12px 28px;
    font-size: 0.95rem;
  }

  .card {
    padding: 18px;
  }
}

/* ===== 滚动动画 ===== */
.section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== 暗色模式适配 ===== */
.dark .hero {
  background: linear-gradient(135deg, #0a0a1a, #0f1a2e);
}

.dark .footer {
  background: #0a0a1a;
}

.dark .btn {
  color: #1a1a2e;
}

/* ===== 选中样式 ===== */
::selection {
  background: #f5a623;
  color: #1a1a2e;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f2f5;
}

.dark ::-webkit-scrollbar-track {
  background: #0f0f1a;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}