/* =========================================
   WhatsApp 官网全局样式 (style.css)
   ========================================= */

/* === 设计变量 === */
:root {
  --bg-base: #090D14;
  --bg-surface: #111723;
  --bg-card: #161D2B;
  --bg-card-hover: #1C2538;
  --border-primary: #253045;
  --border-accent: #2D4A3E;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #25D366;
  --accent-hover: #20BA5C;
  --accent-glow: rgba(37, 211, 102, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
  --font-heading: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --container-max: 1180px;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-bottom: var(--space-lg); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); margin-bottom: var(--space-md); }
p { margin-bottom: var(--space-md); color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
ul, ol { padding-left: var(--space-lg); }
li { margin-bottom: var(--space-sm); }

/* === 布局容器 === */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-md); }
.section { padding: var(--space-3xl) 0; }
.grid-auto { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* === 导航与页头 === */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(9, 13, 20, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-primary); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-link { display: flex; align-items: center; gap: var(--space-sm); }
.logo-img { height: 32px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); letter-spacing: 0.05em; }
.main-nav ul { display: flex; list-style: none; gap: var(--space-lg); }
.main-nav a { font-size: 0.95rem; color: var(--text-secondary); padding: 0.4rem 0; position: relative; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text-primary); }
.main-nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px; background: var(--accent); border-radius: 2px; }
.mobile-toggle { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; }
@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; width: 100%; background: var(--bg-surface); padding: var(--space-lg); border-bottom: 1px solid var(--border-primary); }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: var(--space-md); }
  .mobile-toggle { display: block; }
}

/* === 通用组件 === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.8rem 1.6rem; border-radius: var(--radius-md); font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: var(--accent); color: #08100A; box-shadow: 0 0 12px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 0 18px rgba(37, 211, 102, 0.3); }
.btn-outline { background: transparent; border: 1px solid var(--border-primary); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.card { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-lg); padding: var(--space-lg); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-accent); }
.tag { display: inline-block; padding: 0.2rem 0.6rem; background: var(--accent-glow); color: var(--accent); font-size: 0.75rem; font-weight: 600; border-radius: 4px; margin-bottom: var(--space-sm); }
.divider { height: 1px; background: var(--border-primary); margin: var(--space-2xl) 0; }

/* === 表格样式 === */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 260px;
}
th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  min-width: 0;
  overflow-wrap: break-word;
}
th { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; font-size: 0.95rem; }
td { color: var(--text-secondary); font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(37, 211, 102, 0.03); }

/* === FAQ (Details/Summary) === */
.faq-list { display: flex; flex-direction: column; gap: var(--space-md); }
.faq-item { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--radius-md); overflow: hidden; }
.faq-item summary { padding: 1.2rem 1.5rem; cursor: pointer; font-weight: 600; color: var(--text-primary); 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.25rem; color: var(--accent); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 1.5rem 1.2rem; margin: 0; color: var(--text-secondary); line-height: 1.6; }

/* === SVG 动效核心规则 === */
.svg-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.svg-animate-draw { animation: drawPath 3.5s ease-in-out infinite alternate; }
.svg-node { animation: floatNode 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes floatNode {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .svg-animate-draw, .svg-node { animation: none !important; }
}

/* === 焦点与无障碍 === */
:focus-visible { outline: 2px solid var(--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; }

/* === 响应式微调 === */
@media (max-width: 640px) {
  .grid-auto { grid-template-columns: 1fr; }
  .section { padding: var(--space-2xl) 0; }
  h2 { margin-bottom: var(--space-md); }
}

/* 窄屏布局修正：消除内联网格硬编码导致的横向溢出 */
@media (max-width: 768px) {
  #hero > .container > div,
  #interface .container > div {
    grid-template-columns: 1fr !important;
  }
  #related ul {
    columns: 1 !important;
  }
  #quickstart ol li {
    padding-left: 2.5rem;
  }
}
