/* ===== 全局重置 & 基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f8fafc;
  color: #0b1a2f;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

body.dark {
  background: #0f172a;
  color: #e2e8f0;
}

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

/* ===== 毛玻璃效果 ===== */
.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

/* ===== 卡片 ===== */
.card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.dark .card {
  background: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0b1a2f, #1e3a5f);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 60px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 1rem;
}

.dark .btn {
  background: linear-gradient(135deg, #f0c45a, #d97706);
  color: #0b1a2f;
}

.btn:hover {
  opacity: 0.9;
  transform: scale(0.97);
}

.btn-outline {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

/* ===== 徽标 ===== */
.badge {
  background: rgba(240, 196, 90, 0.12);
  color: #b45309;
  padding: 4px 14px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
}

.dark .badge {
  background: rgba(240, 196, 90, 0.2);
  color: #f0c45a;
}

/* ===== 头部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 12px 0;
  transition: background 0.3s ease;
}

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

.logo svg {
  height: 40px;
  width: auto;
  display: block;
}

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

.nav-list a {
  text-decoration: none;
  color: inherit;
  padding: 8px 14px;
  border-radius: 40px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.dark .nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: inherit;
  line-height: 1;
}

.dark-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: inherit;
  margin-left: 12px;
  line-height: 1;
}

@media (max-width: 900px) {
  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 16px;
    margin-top: 12px;
  }

  .dark .nav-list {
    background: rgba(15, 23, 42, 0.95);
  }

  .nav-list.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

/* ===== Hero 区域 ===== */
.hero {
  padding: 60px 0 80px;
  position: relative;
}

.hero-grid {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1 1 500px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, #0b1a2f, #2d4a7a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0;
}

.dark .hero h1 {
  background: linear-gradient(135deg, #f0c45a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  margin: 24px 0;
  max-width: 600px;
  opacity: 0.85;
}

.hero-visual {
  flex: 1 1 300px;
  min-height: 200px;
  background: radial-gradient(circle at 30% 40%, rgba(240, 196, 90, 0.2), transparent 60%);
  border-radius: 40px;
  padding: 20px;
}

.hero-visual svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== 通用章节 ===== */
.section {
  padding: 64px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: #f0c45a;
  border-radius: 4px;
  margin-top: 8px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* ===== 工具类 ===== */
.flex-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mt-2 {
  margin-top: 32px;
}

.mb-2 {
  margin-bottom: 32px;
}

/* ===== 页脚 ===== */
.site-footer {
  padding: 40px 0 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 40px;
}

.dark .site-footer {
  border-color: rgba(255, 255, 255, 0.05);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
}

/* ===== 滚动动画 ===== */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 计数器 ===== */
.counter {
  font-weight: 700;
  font-size: 2.2rem;
}

/* ===== 轮播 ===== */
.carousel {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  padding: 0 8px;
}

.carousel-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.carousel-btns button {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 40px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.dark .carousel-btns button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.carousel-btns button:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dark .carousel-btns button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.dark .faq-item {
  border-color: rgba(255, 255, 255, 0.05);
}

.dark .faq-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.faq-question span {
  font-size: 1.4rem;
  transition: transform 0.2s;
}

.faq-item.open .faq-question span {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s ease;
  color: inherit;
  opacity: 0.8;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding-top: 12px;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 12px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

/* ===== 文章卡片中的时间 ===== */
article time {
  display: block;
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 8px;
}

article h4 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  padding: 10px 18px;
  border-radius: 40px;
  border: none;
  background: #0b1a2f;
  color: white;
  cursor: pointer;
  opacity: 0.7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: opacity 0.2s, transform 0.2s;
  display: none;
  font-size: 0.9rem;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.dark .back-to-top {
  background: #f0c45a;
  color: #0b1a2f;
}

/* ===== 响应式微调 ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 0 60px;
  }

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

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 24px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    gap: 16px;
  }

  .card {
    padding: 16px;
  }

  .site-footer {
    padding: 24px 0 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .badge {
    font-size: 0.8rem;
  }
}