/* =========================================
   WhatsApp 品牌落地站 - 全局样式与动效
   ========================================= */

/* 设计变量 */
:root {
  --color-primary: #25D366;
  --color-primary-dark: #128C7E;
  --color-accent-warm: #FF9F43;
  --color-accent-light: #FFF3E0;
  --color-bg: #FDFBF7;
  --color-surface: #FFFFFF;
  --color-text: #1A202C;
  --color-text-secondary: #4A5568;
  --color-border: #E2E8F0;
  --color-focus: #25D366;
  
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
  
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置与排版 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2.25rem, 5vw + 1rem, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw + 0.25rem, 1.5rem); }

p, li {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover { color: var(--color-primary); }

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  padding-left: var(--space-md);
}

li { margin-bottom: 0.5rem; }

/* 布局容器 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

section {
  padding: var(--space-lg) 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-md);
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 251, 247, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.brand-logo img {
  width: 110px;
  height: 32px;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
}

.main-nav a {
  color: var(--color-text-secondary);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
  color: #fff;
}

.btn-primary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent-warm);
  color: var(--color-text);
}

/* 卡片 */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  width: 40px;
  height: 40px;
  background: var(--color-accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-primary-dark);
  stroke-width: 1.8;
  fill: none;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-md);
}

/* 表格 */
.data-table-wrapper {
  overflow-x: auto;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-top: var(--space-md);
}

.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.platform-table th,
.platform-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.platform-table th {
  background: var(--color-bg);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.platform-table tr:last-child td { border-bottom: none; }

.platform-table tr:hover { background: var(--color-accent-light); }

/* FAQ */
.faq-list details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.faq-list summary {
  padding: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-base);
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary:hover { background: var(--color-bg); }

.faq-list summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-primary);
  transition: transform var(--transition-base);
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list .faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* 文章卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-title {
  margin-bottom: var(--space-xs);
}

.news-excerpt {
  color: var(--color-text-secondary);
  flex-grow: 1;
  margin-bottom: var(--space-sm);
}

/* 链接列表 */
.related-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.related-list li a {
  display: block;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-base);
}

.related-list li a:hover {
  border-color: var(--color-primary);
  background: var(--color-accent-light);
}

.related-list .rel-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.related-list .rel-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* 页脚 */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.footer-links a { color: var(--color-text-secondary); }
.footer-links a:hover { color: var(--color-primary-dark); }

/* SVG 动效核心规则 */
.svg-anim-star {
  animation: twinkle 6s infinite ease-in-out;
}

.svg-anim-star:nth-child(odd) { animation-duration: 8s; animation-delay: 1s; }
.svg-anim-star:nth-child(even) { animation-duration: 5s; animation-delay: 2s; }

.svg-anim-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 12s infinite ease-in-out;
}

.svg-anim-line:nth-child(2) { animation-delay: 2s; }
.svg-anim-line:nth-child(3) { animation-delay: 4s; }

.svg-anim-pulse {
  animation: pulseOpacity 4s infinite alternate ease-in-out;
}

.svg-anim-glow {
  filter: url(#glowBlur);
  animation: floatSoft 10s infinite alternate ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  20% { stroke-dashoffset: 0; }
  80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes pulseOpacity {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

@keyframes floatSoft {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  
  .main-nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
  }
  
  .main-nav.active ul {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  
  section { padding: var(--space-md) 0; }
}
