@charset "UTF-8";

:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5a4bd1;
  --primary-glow: rgba(108, 92, 231, 0.25);
  --accent: #fdcb6e;
  --accent-2: #fd79a8;
  --bg: #f9f8fc;
  --bg-elevated: #ffffff;
  --bg-subtle: #f3efff;
  --text: #1e1b2e;
  --text-secondary: #3d3855;
  --text-muted: #6b6580;
  --text-faint: #8b84a8;
  --border: #f0ecfa;
  --border-strong: #ddd6f0;
  --shadow-sm: 0 2px 8px rgba(30, 27, 46, 0.04);
  --shadow-md: 0 4px 16px rgba(30, 27, 46, 0.06);
  --shadow-lg: 0 12px 32px rgba(108, 92, 231, 0.1);
  --shadow-glow: 0 8px 24px var(--primary-glow);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 30px;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: saturate(180%) blur(18px);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --gradient-banner: linear-gradient(135deg, #6c5ce7 0%, #8e7cf0 40%, #a29bfe 70%, #fdcb6e 130%);
  --gradient-text: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

body.dark-mode {
  --bg: #12101a;
  --bg-elevated: #1e1b2e;
  --bg-subtle: #2a263a;
  --text: #e6e3f0;
  --text-secondary: #cbc5e0;
  --text-muted: #a8a0c0;
  --text-faint: #7d7599;
  --border: #2e2a3e;
  --border-strong: #3e3852;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 8px 24px rgba(108, 92, 231, 0.35);
  --glass-bg: rgba(30, 27, 46, 0.72);
  --glass-border: rgba(108, 92, 231, 0.2);
  --gradient-banner: linear-gradient(135deg, #2a1f4e 0%, #3d2b6b 40%, #4a3580 70%, #6c5ce7 130%);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dark-mode {
  background-color: var(--bg);
  color: var(--text);
}

::selection {
  background: var(--primary);
  color: #fff;
}

::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

body.dark-mode a {
  color: var(--primary-light);
}

body.dark-mode a:hover {
  color: #c9c0ff;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ========== 吸顶导航 ========== */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 20px rgba(30, 27, 46, 0.05);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.3s ease;
}

body.dark-mode .sticky-header {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 0;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.logo:hover {
  text-decoration: none;
  transform: scale(1.03);
}

.logo svg {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.logo:hover svg {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 6px 18px var(--primary-glow);
}

body.dark-mode .logo {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

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

body.dark-mode .nav-links a {
  color: var(--text-muted);
}

body.dark-mode .nav-links a:hover {
  color: var(--primary-light);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-box input {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  width: 170px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color 0.4s ease, width var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  width: 200px;
}

.search-box button {
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.search-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
  filter: brightness(1.08);
}

.search-box button:active {
  transform: translateY(0);
}

.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: transform var(--transition), border-color var(--transition-fast), background-color 0.4s ease, box-shadow var(--transition-fast);
}

.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.mobile-menu-btn:hover {
  border-color: var(--primary);
}

/* ========== 面包屑 ========== */
.breadcrumb {
  padding: 14px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ========== 首屏 Hero ========== */
.hero {
  padding: 52px 0 32px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.15); }
}

.hero h1 {
  font-size: 2.6rem;
  line-height: 1.28;
  margin-bottom: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-text);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 24px;
  line-height: 1.8;
}

body.dark-mode .hero p {
  color: var(--text-muted);
}

/* ========== Banner 渐变轮播 ========== */
.banner-slider {
  background: var(--gradient-banner);
  background-size: 200% 200%;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin: 20px 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 48px rgba(108, 92, 231, 0.28);
  position: relative;
  overflow: hidden;
  animation: bannerShift 10s ease infinite;
  transition: transform var(--transition), box-shadow var(--transition);
}

@keyframes bannerShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.banner-slider::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatGlow 7s ease-in-out infinite;
}

.banner-slider:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(108, 92, 231, 0.38);
}

.banner-content {
  flex: 1 1 300px;
  position: relative;
  z-index: 1;
}

.banner-content h2 {
  font-size: 1.7rem;
  margin-bottom: 12px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.5s ease;
}

.banner-content p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.7;
}

.banner-svg {
  flex: 0 0 200px;
  max-width: 200px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.18));
  transition: transform var(--transition);
}

.banner-slider:hover .banner-svg {
  transform: scale(1.06) rotate(-2deg);
}

/* ========== 数字动画区 ========== */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-around;
  padding: 32px 24px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  margin: 32px 0;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow var(--transition);
}

.stats-row:hover {
  box-shadow: var(--shadow-lg);
}

.stat-item {
  text-align: center;
  min-width: 120px;
  transition: transform var(--transition);
}

.stat-item:hover {
  transform: translateY(-4px);
}

.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== 卡片通用 ========== */
.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
}

.card h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 16px;
}

.card h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 5px;
  border-radius: 4px;
  background: var(--gradient-primary);
}

body.dark-mode .card h2 {
  color: var(--text);
}

.card h3 {
  font-size: 1.35rem;
  margin: 26px 0 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

body.dark-mode .card h3 {
  color: var(--text);
}

.card h4 {
  font-size: 1.1rem;
  margin: 18px 0 8px;
  color: var(--text-secondary);
  font-weight: 600;
}

body.dark-mode .card h4 {
  color: var(--text-secondary);
}

.card p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

body.dark-mode .card p {
  color: var(--text-secondary);
}

.card ul,
.card ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.card li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.card li::marker {
  color: var(--primary);
}

body.dark-mode .card li {
  color: var(--text-secondary);
}

.card strong {
  color: var(--text);
  font-weight: 600;
}

/* ========== 文章列表 ========== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 16px;
}

.article-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 24px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color 0.4s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.article-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
  border-color: var(--primary-light);
}

.article-card:hover::after {
  opacity: 0.03;
}

.article-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
  position: relative;
  z-index: 1;
  transition: color var(--transition-fast);
}

.article-card:hover h3 {
  color: var(--primary);
}

body.dark-mode .article-card h3 {
  color: var(--text);
}

body.dark-mode .article-card:hover h3 {
  color: var(--primary-light);
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-meta span:first-child::before {
  content: '📅';
  font-size: 0.75rem;
}

.article-meta span:last-child::before {
  content: '🏷️';
  font-size: 0.75rem;
}

.article-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

body.dark-mode .article-summary {
  color: var(--text-muted);
}

.read-more {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
  align-self: flex-start;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.read-more:hover {
  gap: 8px;
  text-decoration: none;
  color: var(--primary-dark);
}

body.dark-mode .read-more:hover {
  color: var(--primary-light);
}

/* ========== FAQ ========== */
.faq-list {
  margin-top: 8px;
}

.faq-item {
  background: var(--bg-elevated);
  border-radius: 18px;
  padding: 18px 24px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background-color 0.4s ease;
}

.faq-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.faq-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.faq-question {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text);
  transition: color var(--transition-fast);
}

.faq-item.active .faq-question {
  color: var(--primary);
}

body.dark-mode .faq-question {
  color: var(--text);
}

body.dark-mode .faq-item.active .faq-question {
  color: var(--primary-light);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, opacity 0.3s ease;
  color: var(--text-muted);
  padding-top: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0;
}

body.dark-mode .faq-answer {
  color: var(--text-secondary);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-top: 14px;
  opacity: 1;
}

.faq-icon {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--accent-2);
}

/* ========== HowTo ========== */
.howto-steps {
  counter-reset: step;
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.howto-steps li {
  counter-increment: step;
  margin-bottom: 20px;
  padding-left: 48px;
  position: relative;
  color: var(--text-secondary);
  line-height: 1.75;
}

.howto-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.howto-steps li:hover::before {
  transform: scale(1.15) rotate(-8deg);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.howto-steps li::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: -20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border-strong), transparent);
}

.howto-steps li:last-child::after {
  display: none;
}

/* ========== 滚动动画 ========== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

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

/* ========== 返回顶部 ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gradient-primary);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--primary-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 200;
  border: none;
  line-height: 1;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.back-to-top:active {
  transform: translateY(0) scale(0.98);
}

/* ========== Footer ========== */
footer {
  margin-top: 60px;
  padding: 44px 0 28px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

body.dark-mode footer {
  background: var(--bg-elevated);
  border-top-color: var(--border);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-2px);
}

body.dark-mode .footer-links a {
  color: var(--text-muted);
}

body.dark-mode .footer-links a:hover {
  color: var(--primary-light);
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

body.dark-mode .footer-info {
  border-top-color: var(--border);
}

.footer-info p {
  margin-bottom: 6px;
  line-height: 1.7;
}

.copyright {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.copyright p {
  margin-bottom: 4px;
}

/* ========== 图片懒加载占位 ========== */
.lazy-img {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.lazy-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

body.dark-mode .lazy-img {
  background: var(--bg-subtle);
}

/* ========== 辅助类 ========== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
}

.flex-between > div {
  flex: 1 1 280px;
}

/* ========== 响应式布局 ========== */

/* 平板 */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .card {
    padding: 28px 24px;
  }

  .card h2 {
    font-size: 1.6rem;
  }

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

  .article-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* 手机 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
    width: 100%;
    padding: 6px 0;
  }

  .mobile-menu-btn {
    display: block;
    order: 2;
  }

  .logo {
    order: 1;
    font-size: 1.3rem;
  }

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

  .search-box {
    width: 100%;
    order: 3;
    flex-wrap: wrap;
  }

  .search-box input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .search-box input:focus {
    width: auto;
  }

  .hero {
    padding: 36px 0 24px;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.35;
  }

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

  .banner-slider {
    padding: 28px 22px;
    border-radius: var(--radius-md);
    flex-direction: column;
    text-align: center;
  }

  .banner-content h2 {
    font-size: 1.4rem;
  }

  .banner-svg {
    flex: 0 0 auto;
    max-width: 160px;
  }

  .stats-row {
    padding: 24px 16px;
    gap: 16px;
    border-radius: var(--radius-sm);
  }

  .stat-item {
    min-width: 100px;
  }

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

  .stat-label {
    font-size: 0.85rem;
  }

  .card {
    padding: 24px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
  }

  .card h2 {
    font-size: 1.4rem;
    padding-left: 14px;
  }

  .card h3 {
    font-size: 1.2rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-card {
    padding: 20px;
  }

  .faq-item {
    padding: 16px 18px;
  }

  .faq-question {
    font-size: 1rem;
  }

  .howto-steps li {
    padding-left: 42px;
  }

  .howto-steps li::before {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .howto-steps li::after {
    left: 13px;
  }

  .flex-between {
    flex-direction: column;
    gap: 20px;
  }

  .flex-between > div {
    flex: 1 1 100%;
  }

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

  footer {
    padding: 32px 0 24px;
  }

  .footer-links {
    gap: 16px;
  }

  .footer-info {
    flex-direction: column;
    gap: 16px;
  }
}

/* 小手机 */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

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

  .banner-content h2 {
    font-size: 1.25rem;
  }

  .banner-content p {
    font-size: 0.9rem;
  }

  .stat-item {
    min-width: 80px;
  }

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

  .card h2 {
    font-size: 1.25rem;
  }

  .search-box button {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .theme-toggle {
    padding: 6px 10px;
  }
}

/* ========== 无障碍与动效偏好 ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ========== 打印样式 ========== */
@media print {
  .sticky-header,
  .back-to-top,
  .search-box,
  .theme-toggle,
  .mobile-menu-btn {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .article-card,
  .faq-item {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ========== 焦点可见性 ========== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}