/* ===== CSS 变量 & 重置 ===== */
:root {
  --primary: #1a1a2e;
  --secondary: #e94560;
  --accent: #0f3460;
  --gradient-bg: linear-gradient(135deg, #0f3460 0%, #1a1a2e 50%, #16213e 100%);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --card-bg: #1e1e3a;
  --card-radius: 20px;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0c8;
  --text-muted: #8888aa;
  --btn-primary: #e94560;
  --btn-hover: #ff6b81;
  --btn-secondary: transparent;
  --btn-secondary-border: #e94560;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
body {
  font-family: var(--font-family);
  background: var(--gradient-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--secondary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--btn-hover);
}
ul, ol {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
}
h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  margin-bottom: 0.5em;
}
h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.8em;
  position: relative;
}
h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--secondary);
  border-radius: 4px;
  margin-top: 0.3em;
}
h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  margin-bottom: 0.4em;
}
p {
  margin-bottom: 1em;
  color: var(--text-secondary);
}
section {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.7s ease forwards;
}
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }
section:nth-child(8) { animation-delay: 0.7s; }
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 玻璃 / 卡片通用 ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
}
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
}

/* ===== 按钮 ===== */
.btn, .btn-secondary {
  display: inline-block;
  padding: 0.8rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-align: center;
  letter-spacing: 0.03em;
}
.btn {
  background: var(--btn-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 69, 96, 0.4);
}
.btn:hover {
  background: var(--btn-hover);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
  transform: scale(1.03);
  color: #fff;
}
.btn-secondary {
  background: var(--btn-secondary);
  color: var(--secondary);
  border-color: var(--btn-secondary-border);
}
.btn-secondary:hover {
  background: var(--secondary);
  color: #fff;
  transform: scale(1.03);
}

/* ===== 头部导航 ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background var(--transition);
}
nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo a {
  display: flex;
  align-items: center;
}
nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}
nav ul li a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
  transition: color var(--transition);
}
nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width var(--transition);
}
nav ul li a:hover, nav ul li.active a {
  color: #fff;
}
nav ul li a:hover::after, nav ul li.active a::after {
  width: 100%;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.2rem;
  transition: transform 0.2s;
}
.menu-toggle:hover {
  transform: scale(1.1);
}

/* ===== Hero ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 6rem;
  background: radial-gradient(ellipse at 30% 50%, rgba(233, 69, 96, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(15, 52, 96, 0.3) 0%, transparent 60%);
}
#hero h1 {
  background: linear-gradient(135deg, #fff 30%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
#hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.cta-buttons {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== 下载卡片 ===== */
#download .download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
#download article {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
#download article::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
#download article:hover::before {
  opacity: 1;
}
#download article:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
}
#download article h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}
#download article p {
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* ===== About ===== */
#about {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  border: 1px solid var(--glass-border);
}
#about p {
  max-width: 800px;
}

/* ===== Guide ===== */
#guide {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
}
#guide h3 {
  color: var(--secondary);
  margin-top: 1.5rem;
}
#guide ol {
  counter-reset: step;
  padding-left: 0;
}
#guide ol li {
  counter-increment: step;
  padding: 0.6rem 0 0.6rem 2.5rem;
  position: relative;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#guide ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--secondary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
#guide ol li:last-child {
  border-bottom: none;
}
#guide a {
  color: var(--secondary);
  word-break: break-all;
}

/* ===== FAQ ===== */
.faq-item {
  background: var(--glass-bg);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item:hover {
  border-color: var(--secondary);
}
.faq-question {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}
.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--secondary);
  transition: transform var(--transition);
}
.faq-question[aria-expanded="true"]::after {
  transform: rotate(45deg);
}
.faq-question:hover {
  background: rgba(255, 255, 255, 0.05);
}
.faq-answer {
  padding: 0 1.5rem 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Articles ===== */
#articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
#articles article {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all var(--transition);
}
#articles article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}
#articles article h3 a {
  color: var(--text-primary);
}
#articles article h3 a:hover {
  color: var(--secondary);
}
#articles article p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
#articles article a:last-child {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Contact ===== */
#contact address p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
#contact address p:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Footer ===== */
footer {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 1.5rem 1.5rem;
}
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-content h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.footer-content ul li {
  margin-bottom: 0.4rem;
}
.footer-content ul li a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-content ul li a:hover {
  color: var(--secondary);
}
.footer-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== Back to Top ===== */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.5);
  display: none;
  z-index: 999;
  transition: all var(--transition);
}
#back-to-top:hover {
  background: var(--btn-hover);
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 6px 24px rgba(233, 69, 96, 0.6);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  nav ul {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 999;
  }
  nav ul.active {
    transform: translateY(0);
  }
  nav ul li {
    width: 100%;
    text-align: center;
  }
  nav ul li a {
    display: block;
    padding: 1rem 0;
    font-size: 1.1rem;
  }
  .menu-toggle {
    display: block;
  }
  section {
    padding: 3rem 1rem;
  }
  #hero {
    padding-top: 5rem;
  }
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  .btn, .btn-secondary {
    width: 80%;
    max-width: 300px;
  }
  #articles {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  .download-cards {
    grid-template-columns: 1fr;
  }
  #guide ol li {
    padding-left: 2.2rem;
  }
  #guide ol li::before {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    top: 0.7rem;
  }
}

/* ===== 暗色模式支持 (系统偏好) ===== */
@media (prefers-color-scheme: light) {
  :root {
    --primary: #1a1a2e;
    --gradient-bg: linear-gradient(135deg, #e8ecf1 0%, #d4dae3 50%, #c8d0dc 100%);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.08);
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #3a3a5c;
    --text-muted: #6a6a8a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.18);
  }
  body {
    background: var(--gradient-bg);
    color: var(--text-primary);
  }
  header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  nav ul li a {
    color: var(--text-secondary);
  }
  nav ul li a:hover {
    color: var(--primary);
  }
  #hero h1 {
    background: linear-gradient(135deg, var(--primary) 30%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  #hero p {
    color: var(--text-secondary);
  }
  .card, #download article, #articles article {
    background: var(--card-bg);
    border-color: rgba(0, 0, 0, 0.06);
  }
  .faq-item, #about {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
  }
  .faq-question {
    color: var(--text-primary);
  }
  .faq-answer {
    color: var(--text-secondary);
  }
  footer {
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
  .footer-content h3 {
    color: var(--primary);
  }
  .footer-content ul li a {
    color: var(--text-muted);
  }
  .btn {
    box-shadow: 0 4px 14px rgba(233, 69, 96, 0.3);
  }
  #back-to-top {
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
  }
  .menu-toggle {
    color: var(--primary);
  }
}