/* ============================================================
   WhatsApp 官网共享样式系统 (style.css)
   设计变量 · 基础排版 · 页头页脚 · 组件 · SVG 动效 · 无障碍
   ============================================================ */

/* 1. 设计变量 */
:root {
  --bg-primary: #09090b;
  --bg-secondary: #131316;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --border: #27272a;
  --radius: 12px;
  --font-stack: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --container-max: 1100px;
  --header-height: 64px;
}

/* 2. 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font-stack); line-height: 1.6; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.02em; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5vw + 1rem, 4rem); font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 4vw + 0.5rem, 3rem); font-weight: 700; margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.25rem, 3vw + 0.25rem, 1.75rem); font-weight: 600; margin-bottom: 1rem; }
p { margin-bottom: 1rem; color: var(--text-secondary); text-wrap: pretty; }
code { background: var(--bg-card); padding: 0.2em 0.4em; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9em; color: var(--accent); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 5rem 0; position: relative; }

/* 3. 网格与布局辅助 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.section-title-center { text-align: center; max-width: 700px; margin: 0 auto 3rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-4 { margin-top: 4rem; }

/* 4. 页头与导航 */
header { position: sticky; top: 0; z-index: 100; background: rgba(9,9,11,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; }
nav a { font-size: 0.95rem; color: var(--text-secondary); position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--text-primary); }
nav a[aria-current="page"] { font-weight: 600; }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px; background: var(--accent); border-radius: 1px; }

/* 5. 页脚 */
footer { border-top: 1px solid var(--border); padding: 3rem 0; background: var(--bg-secondary); margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { color: var(--text-primary); margin-bottom: 1rem; font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-secondary); font-size: 0.9rem; }
.copyright { text-align: center; margin-top: 2rem; color: var(--text-secondary); font-size: 0.85rem; }

/* 6. 通用组件 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 1.75rem; border-radius: var(--radius); font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.2s ease; border: none; outline: none; white-space: nowrap; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,0.25); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: transform 0.2s, border-color 0.2s, background 0.2s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--bg-card-hover); }
.table-wrapper { overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-primary); font-weight: 600; background: var(--bg-card); }
td { color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(34,197,94,0.05); }

/* 7. FAQ 组件 */
details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; transition: border-color 0.2s; }
details:hover { border-color: var(--accent); }
summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; color: var(--accent); transition: transform 0.2s; line-height: 1; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.25rem 1.25rem; color: var(--text-secondary); margin-bottom: 0; }

/* 8. SVG 动效系统 */
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-node {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -6px); }
}
.svg-draw path, .svg-draw line, .svg-draw polyline, .svg-draw polygon, .svg-draw circle {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 3s ease forwards;
}
.svg-draw.delay-1 path, .svg-draw.delay-1 circle, .svg-draw.delay-1 rect, .svg-draw.delay-1 line { animation-delay: 0.2s; }
.svg-draw.delay-2 path, .svg-draw.delay-2 circle, .svg-draw.delay-2 rect, .svg-draw.delay-2 line { animation-delay: 0.4s; }
.svg-draw.delay-3 path, .svg-draw.delay-3 circle, .svg-draw.delay-3 rect, .svg-draw.delay-3 line { animation-delay: 0.6s; }
.node-float { animation: float-node 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@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; }
  .svg-draw path, .svg-draw line, .svg-draw polyline, .svg-draw polygon, .svg-draw circle { animation: none; stroke-dashoffset: 0; }
  .node-float { animation: none; transform: none; }
}

/* 9. 响应式适配 */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; gap: 1rem; height: auto; padding: 1rem 0; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  section { padding: 3rem 0; }
}
