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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--accent2);
}

img, svg {
  max-width: 100%;
  display: block;
}

/* === CSS 变量（暗色模式默认） === */
:root {
  --primary: #1a1a2e;
  --secondary: #16213e;
  --accent: #ffd700;
  --accent2: #e94560;
  --bg: #0f0f23;
  --text: #ffffff;
  --card-bg: rgba(255,255,255,0.05);
  --glass: rgba(255,255,255,0.1);
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
  --radius: 16px;
  --transition: 0.3s ease;
  --nav-bg: rgba(26,26,46,0.85);
  --border-light: rgba(255,255,255,0.05);
  --text-muted: rgba(255,255,255,0.7);
  --text-dim: rgba(255,255,255,0.5);
}

/* 亮色模式变量 */
[data-theme="light"] {
  --primary: #ffffff;
  --secondary: #f0f2f5;
  --bg: #f8f9fa;
  --text: #1a1a2e;
  --card-bg: rgba(0,0,0,0.03);
  --glass: rgba(255,255,255,0.8);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
  --nav-bg: rgba(255,255,255,0.85);
  --border-light: rgba(0,0,0,0.05);
  --text-muted: rgba(0,0,0,0.6);
  --text-dim: rgba(0,0,0,0.4);
}

/* === 工具类 === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 按钮 === */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-align: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e6b800);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(255,215,0,0.4);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}
.btn-secondary:hover {
  background: var(--accent);
  color: var(--primary);
  transform: translateY(-3px);
}

/* === Header === */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.3s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
}
nav ul li a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}
nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
nav ul li a:hover::after,
nav ul li a.active::after {
  width: 100%;
}
.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.theme-toggle,
.search-toggle,
.menu-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.3rem;
  padding: 4px;
  transition: color 0.3s ease;
  line-height: 1;
}
.theme-toggle:hover,
.search-toggle:hover,
.menu-toggle:hover {
  color: var(--accent);
}
.menu-toggle {
  display: none;
}

/* === Hero / Banner === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}
.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.15), transparent);
  top: -200px;
  right: -200px;
  animation: float 12s ease-in-out infinite;
}
.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233,69,96,0.1), transparent);
  bottom: -100px;
  left: -100px;
  animation: float 15s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-30px) scale(1.1); }
}
.hero-content {
  text-align: center;
  z-index: 1;
  padding: 40px 20px;
  max-width: 900px;
}
.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 30px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Banner Carousel */
.banner-carousel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 40px auto;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
}
.carousel-slide {
  min-width: 100%;
  padding: 60px 40px;
  text-align: center;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
}
.carousel-slide h3 {
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: var(--accent);
}
.carousel-slide p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
}
.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}
.carousel-btn {
  pointer-events: auto;
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.3s ease, color 0.3s ease;
}
.carousel-btn:hover {
  background: var(--accent);
  color: var(--primary);
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}
.carousel-dot.active {
  background: var(--accent);
  width: 30px;
  border-radius: 5px;
}

/* === 通用 Section === */
section {
  padding: 80px 0;
}
.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto 50px;
  font-size: 1.1rem;
}

/* === Grid / Cards === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}
.card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}
.card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === Counter === */
.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
}
.counter-item {
  padding: 24px;
}
.counter-item .number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
}
.counter-item .label {
  color: var(--text-muted);
  margin-top: 8px;
}

/* === FAQ === */
.faq-item {
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
}
.faq-question {
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}
.faq-question:hover {
  background: rgba(255,255,255,0.05);
}
.faq-question .arrow {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}
.faq-question.open .arrow {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 24px;
}
.faq-answer.open {
  max-height: 400px;
  padding: 0 24px 20px;
}
.faq-answer p {
  color: var(--text-muted);
  line-height: 1.7;
}

/* === HowTo === */
.howto-steps {
  counter-reset: step;
}
.howto-step {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
}
.howto-step::before {
  counter-increment: step;
  content: counter(step);
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.howto-step h4 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}
.howto-step p {
  color: var(--text-muted);
}

/* === Article Cards === */
.article-card {
  padding: 24px;
}
.article-card .date {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.article-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.article-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.article-card .read-more {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: text-decoration 0.3s ease;
}
.article-card .read-more:hover {
  text-decoration: underline;
}

/* === Footer === */
footer {
  background: var(--primary);
  border-top: 1px solid var(--border-light);
  padding: 60px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--accent);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  color: var(--text-dim);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}
.footer-col ul li a:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.footer-bottom a {
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.footer-bottom a:hover {
  color: var(--accent);
}
.qr-grid {
  display: flex;
  gap: 16px;
}
.qr-code {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 0.6rem;
  color: var(--text-dim);
}
.qr-code svg {
  width: 50px;
  height: 50px;
}

/* === Back to Top === */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,215,0,0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}
.back-to-top.show {
  display: flex;
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 25px rgba(255,215,0,0.4);
}

/* === Search Modal === */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.search-modal.open {
  display: flex;
}
.search-modal-content {
  background: var(--primary);
  padding: 40px;
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
}
.search-modal input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 50px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.search-modal input:focus {
  border-color: var(--accent2);
}
.search-modal input::placeholder {
  color: var(--text-dim);
}
.search-results {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}
.search-results div {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: color 0.3s ease;
}
.search-results div:hover {
  color: var(--accent);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary);
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border-light);
  }
  nav ul.open {
    display: flex;
  }
  .menu-toggle {
    display: block;
  }
  .carousel-slide {
    padding: 40px 20px;
  }
  .carousel-slide h3 {
    font-size: 1.4rem;
  }
  .counter-item .number {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .hero p {
    font-size: 1rem;
  }
  .section-title {
    font-size: 1.6rem;
  }
  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 30px;
  }
  .card {
    padding: 24px 16px;
  }
  .faq-question {
    font-size: 1rem;
    padding: 16px 20px;
  }
  .howto-step {
    flex-direction: column;
    gap: 12px;
  }
  .howto-step::before {
    margin-bottom: 4px;
  }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* === 亮色模式微调 === */
[data-theme="light"] .glass {
  border-color: rgba(0,0,0,0.05);
}
[data-theme="light"] .card {
  border-color: rgba(0,0,0,0.05);
}
[data-theme="light"] .hero p {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .section-subtitle {
  color: rgba(0,0,0,0.5);
}
[data-theme="light"] .card p {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .faq-answer p {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .howto-step p {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .article-card p {
  color: rgba(0,0,0,0.6);
}
[data-theme="light"] .article-card .date {
  color: rgba(0,0,0,0.4);
}
[data-theme="light"] footer {
  border-top-color: rgba(0,0,0,0.05);
}
[data-theme="light"] .footer-bottom {
  border-top-color: rgba(0,0,0,0.05);
}
[data-theme="light"] .footer-col ul li a {
  color: rgba(0,0,0,0.5);
}
[data-theme="light"] .footer-bottom {
  color: rgba(0,0,0,0.5);
}
[data-theme="light"] .footer-bottom a {
  color: rgba(0,0,0,0.5);
}
[data-theme="light"] .carousel-dot {
  background: rgba(0,0,0,0.2);
}