/* =========================================
   WhatsApp Web 品牌落地站 - 全局样式
   ========================================= */

/* 设计变量 */
:root {
  --color-bg: #0B132B;
  --color-surface: #112240;
  --color-surface-hover: #162a4f;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-accent: #FF6B35;
  --color-accent-hover: #ff8a5c;
  --color-text: #CCD6F6;
  --color-heading: #FFFFFF;
  --color-muted: #8892b0;
  
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --max-width: 1120px;
  --spacing-section: clamp(4rem, 8vw, 6rem);
  --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;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 1rem;
  -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 var(--transition-base);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

section {
  padding: var(--spacing-section) 0;
  position: relative;
}

section:nth-child(even) {
  background-color: rgba(17, 34, 64, 0.4);
}

/* 排版层级 */
h1, h2, h3, h4 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  margin-bottom: 2rem;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 70ch;
}

.muted {
  color: var(--color-muted);
}

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img {
  width: 132px;
  height: 36px;
  object-fit: contain;
}

.nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-heading);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--color-text);
}

/* 卡片网格 */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  align-items: center;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

/* 表格 */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--color-heading);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* 步骤列表 */
.step-list {
  counter-reset: step;
  list-style: none;
}

.step-item {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}

.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* FAQ */
.faq-list {
  list-style: none;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

details {
  padding: 1.25rem 0;
  transition: open 0.3s ease;
}

summary {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

details p {
  margin-top: 1rem;
  color: var(--color-text);
  line-height: 1.6;
}

details:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* 新闻卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.news-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
}

.news-excerpt {
  flex-grow: 1;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-size: 0.95rem;
}

.link-btn {
  align-self: flex-start;
  font-weight: 500;
  color: var(--color-accent);
  padding: 0;
  border-bottom: 1px dashed var(--color-accent);
}

.link-btn:hover {
  color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* 相关链接 */
.related-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.related-item a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: border-color var(--transition-base);
}

.related-item a:hover {
  border-color: var(--color-accent);
}

.related-title {
  font-weight: 600;
  color: var(--color-heading);
  display: block;
  margin-bottom: 0.25rem;
}

.related-desc {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 3rem 0;
  margin-top: 2rem;
  background: rgba(0, 0, 0, 0.2);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand img {
  width: 120px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.copyright {
  width: 100%;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}

/* SVG 动效基础 */
.svg-canvas {
  width: 100%;
  height: auto;
  overflow: visible;
}

.wave-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.anim-wave-1 { animation: drawWaveRise 6s ease-in-out infinite; }
.anim-wave-2 { animation: drawWaveRise 8s ease-in-out infinite reverse; }
.anim-wave-3 { animation: drawWaveRise 7s ease-in-out infinite 0.4s; }

@keyframes drawWaveRise {
  0% { stroke-dashoffset: 1; transform: translateY(0); }
  50% { stroke-dashoffset: 0; transform: translateY(6px); }
  100% { stroke-dashoffset: 1; transform: translateY(0); }
}

.pulse-dot {
  animation: pulseOpacity 4s ease-in-out infinite;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.flow-node {
  transform-box: fill-box;
  transform-origin: center;
  animation: nodeFloat 5s ease-in-out infinite;
}

@keyframes nodeFloat {
  0%, 100% { transform: scale(1) translateX(0); }
  50% { transform: scale(1.08) translateX(4px); }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .header-inner {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-list {
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* 减少动态效果偏好 */
@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;
  }
  .wave-line {
    stroke-dashoffset: 0;
  }
  html {
    scroll-behavior: auto;
  }
}
