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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  background: #f8f9fa;
  color: #1a1a2e;
  transition: background 0.3s, color 0.3s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #e94560;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #e94560;
  color: #fff;
}

.btn-primary:hover {
  background: #d63850;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

body.dark .card {
  background: #1a1a2e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

body.dark .section-subtitle {
  color: #aaa;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

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

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s;
}

body.dark .header {
  background: rgba(15, 15, 26, 0.95);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 36px;
  height: 36px;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  transition: color 0.3s;
  position: relative;
}

.nav a:hover {
  color: #e94560;
  text-decoration: none;
}

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

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.3s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 6rem 0 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 at 30% 50%, rgba(233, 69, 96, 0.08) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  position: relative;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 2rem;
  position: relative;
}

.hero .btn {
  margin: 0.5rem;
}

.hero .btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}

.hero .btn-outline:hover {
  background: #fff;
  color: #1a1a2e;
}

/* Banner轮播 */
.banner-carousel {
  position: relative;
  height: 300px;
  overflow: hidden;
  border-radius: 12px;
  margin: 2rem 0;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: slideAnim 12s infinite;
}

.banner-slide:nth-child(1) { animation-delay: 0s; }
.banner-slide:nth-child(2) { animation-delay: 4s; }
.banner-slide:nth-child(3) { animation-delay: 8s; }

@keyframes slideAnim {
  0% { opacity: 0; }
  5% { opacity: 1; }
  30% { opacity: 1; }
  35% { opacity: 0; }
  100% { opacity: 0; }
}

.banner-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff;
  font-size: 1.5rem;
  flex-direction: column;
  gap: 1rem;
}

.banner-slide h3 {
  font-size: 2rem;
}

.banner-slide p {
  max-width: 500px;
  font-size: 1rem;
  opacity: 0.9;
}

/* 统计动画 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

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

body.dark .stat-number {
  color: #ff6b7a;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

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

/* FAQ */
.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}

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

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: inherit;
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.faq-item.active .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 0 0.5rem;
  display: none;
  color: #555;
  line-height: 1.7;
}

body.dark .faq-answer {
  color: #ccc;
}

.faq-item.active .faq-answer {
  display: block;
}

/* HowTo */
.howto-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.howto-step-number {
  background: #e94560;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

/* 文章卡片 */
.article-card .card {
  height: 100%;
}

.article-card .card-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0.5rem 0;
}

.article-card .card-excerpt {
  color: #555;
  font-size: 0.95rem;
}

body.dark .article-card .card-excerpt {
  color: #bbb;
}

/* Footer */
.footer {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 1.5rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
}

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

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

.footer h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer ul {
  list-style: none;
  padding: 0;
}

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

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

/* 返回顶部 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e94560;
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

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

/* 搜索模拟 */
.search-box {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 1rem auto;
}

.search-box input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  color: #1a1a2e;
}

body.dark .search-box input {
  background: #2a2a3e;
  border-color: #444;
  color: #e0e0e0;
}

.search-box button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  background: #e94560;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* 滚动高亮 */
.nav-highlight {
  color: #e94560 !important;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
  }
  .nav.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .banner-carousel {
    height: 200px;
  }
  .banner-slide h3 {
    font-size: 1.3rem;
  }
}

@media (prefers-color-scheme: dark) {
  body:not(.light) {
    background: #0f0f1a;
    color: #e0e0e0;
  }
  body:not(.light) .card {
    background: #1a1a2e;
  }
  body:not(.light) .section-subtitle {
    color: #aaa;
  }
  body:not(.light) .faq-answer {
    color: #ccc;
  }
}

/* 可访问性: focus */
a:focus-visible,
.btn:focus-visible,
button:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

/* 暗黑模式切换动画 */
.theme-transition {
  transition: background 0.3s, color 0.3s;
}