/* === 设计变量与基础重置 === */
:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-brand: #25D366;
  --color-brand-hover: #1ca24e;
  --color-border: #e2e8f0;
  --color-highlight: #ecfdf5;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-soft: 0 6px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.10);
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --space-section: clamp(3rem, 6vw, 6rem);
  --space-container: clamp(1.25rem, 3vw, 3rem);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  transition: color 0.2s ease, background-color 0.2s ease;
}

ul, ol {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-container);
}

/* === 排版系统 === */
h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

p {
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  max-width: 72ch;
}

.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* === 页头与导航 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 246, 248, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.8rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  padding: 0.4rem 0;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-text);
  border-bottom-color: var(--color-brand);
}

/* === 通用组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-brand);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background-color: var(--color-surface);
  border-color: var(--color-text-secondary);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  color: var(--color-brand);
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: #f8fafc;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* === FAQ 样式 === */
.faq-list details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  overflow: hidden;
}

.faq-list summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list .faq-content {
  padding: 0 1.2rem 1.2rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* === SVG 动效核心 === */
.svg-draw {
  path, circle, rect, polyline, polygon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    pathLength: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }

  @keyframes drawPath {
    0% { stroke-dashoffset: 1; }
    40%, 100% { stroke-dashoffset: 0; }
  }

  .draw-line {
    animation: drawPath 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  }

  @keyframes floatNode {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }

  .float-point {
    animation: floatNode 5s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }

  .float-delay-1 { animation-delay: 1.2s; }
  .float-delay-2 { animation-delay: 2.4s; }
  .float-delay-3 { animation-delay: 3.6s; }
}

@media (prefers-reduced-motion: reduce) {
  .draw-line, .float-point {
    animation: none !important;
  }
}

/* === 响应式适配 === */
@media (max-width: 768px) {
  .main-nav { display: none; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 1.2rem; }
}

.grid-2 {
  display: grid;
  gap: 2rem;
}

.grid-3 {
  display: grid;
  gap: 1.5rem;
}

.section-pad {
  padding: var(--space-section) 0;
}

.bg-white { background-color: var(--color-surface); }
.bg-light { background-color: var(--color-highlight); }

.step-list {
  counter-reset: step;
  list-style: none;
}

.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.2rem;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.update-date {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.related-links li {
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.related-links li:last-child { border-bottom: none; }

.related-links .arrow {
  color: var(--color-brand);
  font-size: 1.1rem;
}

footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  margin-top: 2rem;
  background: var(--color-surface);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-grid h4 {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.footer-grid a {
  display: block;
  padding: 0.3rem 0;
}

.footer-grid a:hover {
  color: var(--color-brand);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.85rem;
}
