/* =========================================
   WhatsApp 品牌落地站 - 共享样式系统
   ========================================= */

/* 设计变量 */
:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-primary-dark: #064e3b;
  --color-primary: #059669;
  --color-primary-light: #34d399;
  --color-accent: #a7f3d0;
  --color-gradient-start: #065f46;
  --color-gradient-end: #6ee7b7;
  
  --font-sans: 'Inter', 'PingFang SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.25);
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  
  --container-max: 1200px;
  --header-height: 72px;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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;
}

/* 排版系统 */
h1, h2, h3, h4 {
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary-dark);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

section {
  padding-block: var(--space-xl);
}

.section-grid {
  display: grid;
  gap: var(--space-xl);
}

/* 导航与页头 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
}

.nav-list {
  display: flex;
  gap: var(--space-md);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-primary-dark);
  background: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-primary));
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary-dark);
}

.btn-outline:hover {
  background: var(--color-accent);
}

/* 卡片 */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.8rem 1rem;
  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 */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: var(--color-surface);
  transition: all 0.2s ease;
}

details[open] {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

summary {
  padding: 1rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(45deg);
  background: var(--color-accent);
}

details p {
  padding: 0 1.2rem 1rem;
  margin: 0;
  color: var(--color-text-secondary);
}

/* 焦点状态 */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* SVG 动效基类 */
svg[data-animated] {
  overflow: visible;
}

.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.flow-dot {
  animation: dot-flow 6s linear infinite;
}

@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes dot-flow {
  0% { transform: translate(0px, 0px); opacity: 0.5; }
  25% { transform: translate(40px, -20px); opacity: 1; }
  50% { transform: translate(80px, 10px); opacity: 0.8; }
  75% { transform: translate(120px, -15px); opacity: 1; }
  100% { transform: translate(160px, 0px); opacity: 0.5; }
}

/* 减少动态效果偏好 */
@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;
  }
  .flow-line, .flow-dot {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
  }
}

/* 响应式断点 */
@media (max-width: 1024px) {
  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 3rem;
    --space-lg: 2rem;
  }
  .nav-list {
    display: none; /* 移动端简化处理 */
  }
  .section-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2rem;
  }
}
