/* ============================================================
   WhatsApp 官网全站共享样式
   设计变量 · 基础排版 · 布局组件 · 动画系统 · 响应式适配
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --color-bg: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-text: #1A1D21;
  --color-text-secondary: #4B5563;
  --color-accent: #25D366;
  --color-accent-hover: #1EBE57;
  --color-border: #E5E7EB;
  --color-code-bg: #F9FAFB;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  
  --container-max: 1200px;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-rounded);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* ---------- 排版系统 ---------- */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-xl) 0; position: relative; }
.section-title {
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
  text-wrap: balance;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  max-width: 680px;
  margin-bottom: var(--space-lg);
  line-height: 1.8;
}
h2 { font-size: clamp(1.4rem, 2vw, 1.75rem); margin-bottom: var(--space-md); }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; text-align: justify; }

/* ---------- 页头页脚 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-xs); }
.brand img { width: 110px; height: 34px; object-fit: contain; }
.brand span { font-weight: 600; font-size: 1.1rem; color: var(--color-text); }
nav ul { display: flex; gap: var(--space-md); }
nav a { font-size: 0.95rem; font-weight: 500; color: var(--color-text-secondary); padding: 0.4rem 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-accent); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: var(--color-accent); border-radius: 2px; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.mobile-toggle svg { width: 24px; height: 24px; stroke: var(--color-text); }

.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-lg) 0 var(--space-md); margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-md); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-sm); color: var(--color-text); }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.9rem; color: var(--color-text-secondary); }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { text-align: center; font-size: 0.85rem; color: var(--color-text-secondary); padding-top: var(--space-md); border-top: 1px solid var(--color-border); }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem;
  cursor: pointer; transition: all 0.2s ease; border: none; text-decoration: none;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-lg); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-md); }

.flex-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; }
.badge { display: inline-block; padding: 0.25rem 0.6rem; background: #EFFDF5; color: var(--color-accent); font-size: 0.8rem; font-weight: 600; border-radius: 99px; margin-bottom: 0.5rem; }

/* 表格样式 */
.table-wrap { overflow-x: auto; 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: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: var(--color-code-bg); font-weight: 600; color: var(--color-text); }
td { color: var(--color-text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFCF9; }

/* FAQ 样式 */
.faq-list { display: flex; flex-direction: column; gap: 0.8rem; }
details { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
summary { padding: 1.1rem 1.2rem; cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; color: var(--color-text-secondary); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 1.2rem 1.2rem; color: var(--color-text-secondary); line-height: 1.8; }

/* 焦点与无障碍 */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- SVG 动效系统 ---------- */
.svg-icon { width: 28px; height: 28px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.wave-path { fill: none; stroke: var(--color-accent); stroke-width: 2.5; stroke-linecap: round; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.draw-line { fill: none; stroke: var(--color-text-secondary); stroke-width: 1.5; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

@keyframes wave-flow {
  0%, 100% { transform: translateY(0); stroke-dashoffset: 0; opacity: 0.8; }
  50% { transform: translateY(-10px); stroke-dashoffset: 1; opacity: 1; }
}
@keyframes flow-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

.anim-wave-1 { animation: wave-flow 6s ease-in-out infinite; }
.anim-wave-2 { animation: wave-flow 7s ease-in-out infinite 0.8s; }
.anim-wave-3 { animation: wave-flow 8s ease-in-out infinite 1.6s; }
.anim-draw { animation: flow-draw 4s ease forwards; }
.anim-float { animation: float-pulse 5s ease-in-out infinite; }

.transform-center { 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; animation: none !important; }
  .anim-wave-1, .anim-wave-2, .anim-wave-3, .anim-draw, .anim-float { animation: none !important; }
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  nav ul { display: none; position: absolute; top: 64px; left: 0; width: 100%; background: var(--color-surface); flex-direction: column; padding: var(--space-md); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-card); }
  nav.open ul { display: flex; }
  .mobile-toggle { display: block; }
  .section { padding: var(--space-lg) 0; }
}
