/* ===== 樱花视频 - 全站样式表 ===== */
/* 规范：高对比度、圆角卡片、毛玻璃、渐变Banner、响应式、暗色模式、滚动动画 */

/* ---------- 设计令牌与变量 ---------- */
:root {
  /* 浅色模式 */
  --bg-light: #fafcfe;
  --surface-light: #ffffff;
  --surface-soft-light: #f0f6fa;
  --text-light: #1f2a37;
  --heading-light: #111827;
  --muted-light: #3e4c59;
  --border-light: #d3dee8;
  --brand-light: #1b6a8f;
  --brand-strong-light: #0f4c6b;
  --brand-soft-light: #dceef7;
  --accent-light: #e8a0b4;
  --shadow-light: 0 4px 20px rgba(15, 60, 90, 0.08);
  --shadow-hover-light: 0 12px 32px rgba(15, 60, 90, 0.15);
  --footer-bg-light: #eaf1f6;
  --code-bg-light: #f1f5f9;

  /* 暗色模式（prefers-color-scheme 覆盖） */
  --bg-dark: #0f172a;
  --surface-dark: #1e293b;
  --surface-soft-dark: #16213a;
  --text-dark: #e5edf5;
  --heading-dark: #f8fafc;
  --muted-dark: #a7b8c9;
  --border-dark: #334b5e;
  --brand-dark: #69b8d8;
  --brand-strong-dark: #9ed4ee;
  --brand-soft-dark: #1c3247;
  --accent-dark: #f0a5b8;
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover-dark: 0 14px 36px rgba(0, 0, 0, 0.6);
  --footer-bg-dark: #0a111c;
  --code-bg-dark: #0b1520;

  /* 圆角与过渡 */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 999px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-light);
  color: var(--text-light);
  line-height: 1.75;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

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

a {
  color: var(--brand-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-strong-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-light);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p, li {
  color: var(--text-light);
}

ul, ol {
  padding-left: 1.5rem;
}

blockquote {
  border-left: 5px solid var(--brand-light);
  background: var(--surface-soft-light);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

/* ---------- 暗色模式（自动跟随系统） ---------- */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
  }

  h1, h2, h3, h4, h5, h6 {
    color: var(--heading-dark);
  }

  p, li, blockquote {
    color: var(--text-dark);
  }

  blockquote {
    background: var(--surface-soft-dark);
    border-left-color: var(--brand-dark);
  }

  a {
    color: var(--brand-dark);
  }

  a:hover {
    color: var(--brand-strong-dark);
  }
}

/* ---------- 容器与布局工具 ---------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ---------- 通用卡片样式（磨砂玻璃 + 圆角 + 悬浮动画） ---------- */
.card,
.article-card,
.faq-item,
.howto-box,
.section-box,
.inner-card {
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-light);
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth), background-color 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.82);
  animation: fadeInUp 0.5s ease backwards;
}

.card:hover,
.article-card:hover,
.faq-item:hover,
.howto-box:hover,
.section-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover-light);
  border-color: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  .card,
  .article-card,
  .faq-item,
  .howto-box,
  .section-box,
  .inner-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: var(--border-dark);
    box-shadow: var(--shadow-dark);
  }

  .card:hover,
  .article-card:hover,
  .faq-item:hover,
  .howto-box:hover,
  .section-box:hover {
    box-shadow: var(--shadow-hover-dark);
    border-color: var(--brand-dark);
  }
}

/* ---------- 导航栏（毛玻璃） ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(190, 210, 225, 0.5);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .navbar {
    background: rgba(15, 23, 42, 0.75);
    border-bottom-color: rgba(51, 75, 94, 0.5);
  }
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--brand-light), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.03);
}

@media (prefers-color-scheme: dark) {
  .logo {
    background: linear-gradient(135deg, var(--brand-dark), var(--accent-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.nav-links {
  display: flex;
  gap: 0.4rem 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  transition: background-color 0.2s, color 0.2s;
}

.nav-links a:hover {
  background: var(--brand-soft-light);
  color: var(--brand-strong-light);
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .nav-links a {
    color: var(--text-dark);
  }
  .nav-links a:hover {
    background: var(--brand-soft-dark);
    color: var(--brand-strong-dark);
  }
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem 0.15rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-left: 0.5rem;
}

.search-box:focus-within {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(27, 106, 143, 0.15);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  padding: 0.4rem 0;
  color: var(--text-light);
  width: 100%;
  min-width: 120px;
}

@media (prefers-color-scheme: dark) {
  .search-box {
    background: var(--surface-dark);
    border-color: var(--border-dark);
  }
  .search-box input {
    color: var(--text-dark);
  }
}

.search-box input::placeholder {
  color: var(--muted-light);
  opacity: 0.7;
}

.dark-toggle {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s;
  line-height: 1;
}

.dark-toggle:hover {
  transform: rotate(20deg);
  background: rgba(127, 179, 211, 0.2);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  padding: 1.2rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-light);
}

.breadcrumb a {
  color: var(--muted-light);
}

.breadcrumb a:hover {
  color: var(--brand-light);
}

.breadcrumb span {
  font-weight: 600;
  color: var(--text-light);
}

@media (prefers-color-scheme: dark) {
  .breadcrumb,
  .breadcrumb a,
  .breadcrumb span {
    color: var(--muted-dark);
  }
  .breadcrumb span {
    color: var(--text-dark);
  }
}

/* ---------- Hero（渐变Banner） ---------- */
.hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  position: relative;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: linear-gradient(120deg, #0b2f44 0%, #1c5a74 45%, #2a7f9c 100%);
  color: #f0f9ff;
  overflow: hidden;
  animation: fadeSlideIn 0.8s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232, 160, 180, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 1.2rem;
  color: white;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
  max-width: 900px;
  animation: fadeSlideIn 0.8s 0.1s ease both;
}

.hero p {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 780px;
  color: rgba(240, 249, 255, 0.95);
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: fadeSlideIn 0.8s 0.2s ease both;
}

@media (prefers-color-scheme: dark) {
  .hero {
    background: linear-gradient(135deg, #0a1a24 0%, #123a4d 60%, #1a4a60 100%);
  }
  .hero h1,
  .hero p {
    color: #eaf4fb;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  }
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  animation: fadeSlideIn 0.8s 0.3s ease both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 2.2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  min-height: 3rem;
}

.btn:hover {
  transform: translateY(-3px);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-primary {
  background: #ffffff;
  color: #0f4c6b;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #f0f9ff;
  color: #0b3b4f;
  border-color: #f0f9ff;
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    background: #e2f0f8;
    color: #0f2a38;
  }
  .btn-outline {
    color: #cbe4f2;
    border-color: rgba(160, 200, 230, 0.7);
  }
  .btn-outline:hover {
    background: rgba(160, 200, 230, 0.15);
  }
}

/* 统计卡片 */
.stat-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.8rem;
  text-align: center;
  min-width: 150px;
  transition: transform 0.3s ease, background-color 0.3s;
  animation: fadeSlideIn 0.6s ease both;
}

.stat-item:nth-child(1) { animation-delay: 0.4s; }
.stat-item:nth-child(2) { animation-delay: 0.5s; }
.stat-item:nth-child(3) { animation-delay: 0.6s; }

.stat-item:hover {
  transform: translateY(-5px) scale(1.03);
  background: rgba(255, 255, 255, 0.2);
}

.stat-item .stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ffffff;
  display: block;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-item span:not(.stat-number) {
  font-size: 0.9rem;
  color: rgba(240, 245, 255, 0.85);
  display: block;
  margin-top: 0.3rem;
}

@media (prefers-color-scheme: dark) {
  .stat-item {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(100, 160, 200, 0.3);
  }
  .stat-item .stat-number {
    color: #d9ecf9;
  }
}

/* ---------- 区块标题 ---------- */
.section {
  margin: clamp(2.5rem, 5vw, 4.5rem) 0;
  scroll-margin-top: 5.5rem;
}

.section h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  margin-bottom: 2rem;
  padding-left: 1.2rem;
  border-left: 6px solid var(--brand-light);
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 1.2rem;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-light), transparent);
  border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
  .section h2 {
    border-left-color: var(--brand-dark);
  }
  .section h2::after {
    background: linear-gradient(90deg, var(--brand-dark), transparent);
  }
}

/* ---------- 文章卡片 ---------- */
.article-card {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease backwards;
}

.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-light), var(--accent-light));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.article-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.article-card .date {
  font-size: 0.85rem;
  color: var(--muted-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-card p:not(.date) {
  font-size: 0.95rem;
  flex: 1;
}

.article-card a {
  align-self: flex-start;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.2s ease;
}

.article-card a::after {
  content: "→";
  transition: transform 0.2s ease;
}

.article-card a:hover {
  gap: 0.5rem;
}

.article-card a:hover::after {
  transform: translateX(3px);
}

@media (prefers-color-scheme: dark) {
  .article-card .date {
    color: var(--muted-dark);
  }
}

/* 为文章卡片添加滚动动画延迟 */
.article-card:nth-child(1) { animation-delay: 0s; }
.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.25s; }
.article-card:nth-child(7) { animation-delay: 0.3s; }
.article-card:nth-child(8) { animation-delay: 0.35s; }
.article-card:nth-child(9) { animation-delay: 0.4s; }
.article-card:nth-child(10) { animation-delay: 0.45s; }

/* ---------- FAQ ---------- */
.faq-item {
  margin-bottom: 1rem;
  padding: 1.5rem 1.8rem;
  animation: fadeInUp 0.4s ease backwards;
}

.faq-item:nth-child(odd) { animation-delay: 0.05s; }
.faq-item:nth-child(even) { animation-delay: 0.1s; }

.faq-question {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  .faq-question:hover {
    color: var(--brand-dark);
  }
}

.faq-answer {
  padding-left: 1.2rem;
  border-left: 3px solid var(--brand-light);
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

@media (prefers-color-scheme: dark) {
  .faq-answer {
    border-left-color: var(--brand-dark);
  }
}

/* ---------- 教程 HowTo ---------- */
.howto-box {
  padding: 2rem;
  line-height: 1.8;
}

.howto-box h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.howto-box h4 {
  margin: 1.5rem 0 0.8rem;
  font-size: 1.05rem;
  color: var(--brand-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.howto-box h4::before {
  content: "✦";
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  .howto-box h4 {
    color: var(--brand-dark);
  }
}

.howto-box ul,
.howto-box ol {
  padding-left: 1.8rem;
  margin: 0.8rem 0;
}

.howto-box li {
  margin-bottom: 0.5rem;
}

.howto-box ol li::marker {
  color: var(--brand-light);
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .howto-box ol li::marker {
    color: var(--brand-dark);
  }
}

.howto-box strong {
  color: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  .howto-box strong {
    color: var(--brand-dark);
  }
}

/* ---------- 引用卡片 ---------- */
blockquote.card {
  font-size: 1rem;
  line-height: 1.8;
  position: relative;
  padding: 2rem 2rem 2rem 3rem;
}

blockquote.card::before {
  content: "“";
  position: absolute;
  top: 0.8rem;
  left: 1.2rem;
  font-size: 3.5rem;
  color: var(--brand-light);
  opacity: 0.3;
  font-family: Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  blockquote.card::before {
    color: var(--brand-dark);
  }
}

/* ---------- 联系区块 ---------- */
#contact .grid-2 > div {
  background: var(--surface-soft-light);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  border: 1px solid var(--border-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#contact .grid-2 > div:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-light);
}

#contact p {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}

#contact strong {
  color: var(--heading-light);
}

@media (prefers-color-scheme: dark) {
  #contact .grid-2 > div {
    background: var(--surface-soft-dark);
    border-color: var(--border-dark);
  }
  #contact strong {
    color: var(--heading-dark);
  }
}

/* ---------- 页脚 ---------- */
.footer {
  background: var(--footer-bg-light);
  border-top: 1px solid var(--border-light);
  padding-top: 3rem;
  margin-top: 4rem;
  transition: background-color 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .footer {
    background: var(--footer-bg-dark);
    border-top-color: var(--border-dark);
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer h4 {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  position: relative;
  display: inline-block;
}

.footer h4::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--brand-light);
  border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
  .footer h4::after {
    background: var(--brand-dark);
  }
}

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

.footer li {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  transition: padding-left 0.2s ease;
}

.footer li:hover {
  padding-left: 4px;
}

.footer a {
  color: var(--text-light);
  font-weight: 400;
}

.footer a:hover {
  color: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  .footer a {
    color: var(--text-dark);
  }
  .footer a:hover {
    color: var(--brand-dark);
  }
}

.footer p {
  font-size: 0.95rem;
  opacity: 0.85;
}

.copyright {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--muted-light);
}

@media (prefers-color-scheme: dark) {
  .copyright {
    border-top-color: var(--border-dark);
    color: var(--muted-dark);
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 锚点导航 ---------- */
.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: var(--surface-soft-light);
  border-radius: var(--radius-full);
  justify-content: center;
  border: 1px solid var(--border-light);
}

.anchor-nav a {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  transition: background-color 0.2s, color 0.2s;
}

.anchor-nav a:hover {
  background: var(--brand-light);
  color: white;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .anchor-nav {
    background: var(--surface-soft-dark);
    border-color: var(--border-dark);
  }
  .anchor-nav a:hover {
    background: var(--brand-dark);
    color: #0f172a;
  }
}

/* ---------- 滚动动画（视口进入触发） ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 滚动进入可视区动画 (使用 IntersectionObserver 或简单 viewport 检测) */
@media (prefers-reduced-motion: no-preference) {
  .card, .article-card, .faq-item, .howto-box, .section-box, blockquote.card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  /* 渐进式加载动画 */
  .article-card:nth-child(1) { animation-delay: 0s; }
  .article-card:nth-child(2) { animation-delay: 0.06s; }
  .article-card:nth-child(3) { animation-delay: 0.12s; }
  .article-card:nth-child(4) { animation-delay: 0.18s; }
  .article-card:nth-child(5) { animation-delay: 0.24s; }
  .article-card:nth-child(6) { animation-delay: 0.3s; }
  .article-card:nth-child(7) { animation-delay: 0.36s; }
  .article-card:nth-child(8) { animation-delay: 0.42s; }
  .article-card:nth-child(9) { animation-delay: 0.48s; }
  .article-card:nth-child(10) { animation-delay: 0.54s; }

  .faq-item:nth-child(1) { animation-delay: 0s; }
  .faq-item:nth-child(2) { animation-delay: 0.05s; }
  .faq-item:nth-child(3) { animation-delay: 0.1s; }
  .faq-item:nth-child(4) { animation-delay: 0.15s; }
  .faq-item:nth-child(5) { animation-delay: 0.2s; }
  .faq-item:nth-child(6) { animation-delay: 0.25s; }
  .faq-item:nth-child(7) { animation-delay: 0.3s; }
  .faq-item:nth-child(8) { animation-delay: 0.35s; }
  .faq-item:nth-child(9) { animation-delay: 0.4s; }
  .faq-item:nth-child(10) { animation-delay: 0.45s; }
  .faq-item:nth-child(11) { animation-delay: 0.5s; }
  .faq-item:nth-child(12) { animation-delay: 0.55s; }
  .faq-item:nth-child(13) { animation-delay: 0.6s; }
  .faq-item:nth-child(14) { animation-delay: 0.65s; }
  .faq-item:nth-child(15) { animation-delay: 0.7s; }
}

/* 禁用动画偏好 */
@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;
  }
}

/* ---------- 细节优化 ---------- */
::selection {
  background: rgba(27, 106, 143, 0.2);
  color: var(--heading-light);
}

@media (prefers-color-scheme: dark) {
  ::selection {
    background: rgba(105, 184, 216, 0.3);
    color: var(--heading-dark);
  }
}

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

::-webkit-scrollbar-track {
  background: var(--surface-soft-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 5px;
}

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

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-track {
    background: var(--surface-soft-dark);
  }
  ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--brand-dark);
  }
}

/* 链接下划线动画 */
a:not(.btn):not(.nav-links a):not(.article-card a) {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 0.3s ease;
}

a:not(.btn):not(.nav-links a):not(.article-card a):hover {
  background-size: 100% 2px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1;
    min-width: 100%;
    margin-top: 0.5rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .stat-grid {
    gap: 0.8rem;
  }

  .stat-item {
    min-width: 100px;
    padding: 0.8rem 1rem;
  }

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

  .section h2 {
    font-size: 1.4rem;
  }

  .card, .article-card, .faq-item, .howto-box {
    padding: 1.2rem 1rem;
  }

  .btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }

  .anchor-nav {
    border-radius: var(--radius-md);
    justify-content: flex-start;
  }
}

/* 打印优化 */
@media print {
  .navbar, .footer, .btn-group, .breadcrumb, .anchor-nav {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .card, .article-card, .faq-item, .howto-box {
    box-shadow: none;
    border: 1px solid #ddd;
    background: white;
  }
}

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

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

@media (prefers-color-scheme: dark) {
  :focus-visible {
    outline-color: var(--brand-dark);
  }
}

/* 文章卡片链接的伪元素调整 */
.article-card a {
  background-image: none !important;
}

.article-card a:hover {
  color: var(--brand-light);
}

@media (prefers-color-scheme: dark) {
  .article-card a:hover {
    color: var(--brand-dark);
  }
}