/* === 设计变量与基础重置 === */
:root {
  --color-primary: #25D366;
  --color-primary-dark: #128C7E;
  --color-accent: #FFC371;
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-text: #1A1D23;
  --color-text-secondary: #4B5563;
  --color-border: #E5E7EB;
  --color-focus: #0EA5E9;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 32px rgba(0, 0, 0, 0.09);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --spacing-section: clamp(60px, 8vh, 100px);
  --container-max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s; }
ul, ol { list-style: none; }

/* === 排版系统 === */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.section { padding: var(--spacing-section) 0; }
.section-header { margin-bottom: clamp(24px, 4vw, 48px); text-align: center; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 700; margin-bottom: 0.6em; color: var(--color-text); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; margin-bottom: 0.5em; color: var(--color-text); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.35rem); font-weight: 600; margin-bottom: 0.4em; }
p { margin-bottom: 1em; color: var(--color-text-secondary); }
.text-center { text-align: center; }
.text-grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* === 页头与导航 === */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; }
.nav ul { display: flex; gap: 24px; }
.nav a { font-weight: 500; font-size: 0.95rem; padding: 6px 10px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a[aria-current="page"] { background: var(--color-bg); color: var(--color-primary-dark); }
.nav a[aria-current="page"] { font-weight: 600; }

/* === 按钮组件 === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.25s ease; border: none; outline: none;
}
.btn:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45); }
.btn-outline {
  background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

/* === 卡片与画布 === */
.card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: 24px;
  box-shadow: var(--shadow-card); transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--color-border);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--color-bg); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card-icon svg { width: 24px; height: 24px; stroke-width: 1.8; }
.feature-list li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px;
  background: var(--color-primary); border-radius: 50%;
}
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary);
  color: #fff; font-weight: 700; font-size: 0.9rem; margin-right: 8px; vertical-align: middle;
}

/* === 表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; background: var(--color-surface); min-width: 500px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-bg); font-weight: 600; color: var(--color-text); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }

/* === FAQ 手风琴 === */
.faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 12px; background: var(--color-surface); }
.faq-item summary {
  padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--color-text);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 16px; margin: 0; font-size: 0.95rem; color: var(--color-text-secondary); }
.faq-item:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* === 文章与链接区块 === */
.update-card { display: flex; flex-direction: column; height: 100%; }
.update-meta { font-size: 0.85rem; color: #6B7280; margin-bottom: 8px; }
.update-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.update-excerpt { flex-grow: 1; margin-bottom: 16px; }
.btn-link { font-size: 0.9rem; color: var(--color-primary-dark); font-weight: 500; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--color-border); padding-bottom: 12px; }
.related-item:last-child { border-bottom: none; }
.related-desc { font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 4px; }

/* === 页脚 === */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 48px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; gap: 32px; margin-bottom: 32px; }
.footer-links a { display: inline-block; margin-right: 16px; color: var(--color-text-secondary); font-size: 0.95rem; }
.footer-links a:hover { color: var(--color-primary-dark); }
.footer-bottom { text-align: center; font-size: 0.85rem; color: #9CA3AF; padding-top: 24px; border-top: 1px solid var(--color-border); }

/* === SVG 动效定义 === */
.star-dot { fill: #FFC371; opacity: 0.6; }
.anim-star-1 { animation: twinkle 4s ease-in-out infinite; }
.anim-star-2 { animation: twinkle 5.5s ease-in-out infinite 1s; }
.anim-star-3 { animation: twinkle 7s ease-in-out infinite 2.5s; }
.connection-line { stroke: var(--color-primary); stroke-width: 1.5; fill: none; stroke-dasharray: 1; stroke-dashoffset: 0; pathLength: 1; }
.anim-draw { animation: dashDraw 8s ease-in-out infinite; }
.interface-glow { filter: drop-shadow(0 0 12px rgba(37, 211, 102, 0.25)); }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes dashDraw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
  .anim-star-1, .anim-star-2, .anim-star-3, .connection-line, .anim-draw,
  html, .card, .btn, .btn-primary:hover { animation: none !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
