/* ============================================================
   WHATSAPP 品牌站 — 全局共享样式
   域名: cn.whatapps-fgd.com.cn
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 色彩体系 — 深绿→青柠渐变 */
  --color-primary-dark: #005a3b;
  --color-primary: #128c7e;
  --color-primary-light: #25d366;
  --color-accent: #a8e6cf;
  --color-bg: #f7f8f6;
  --color-surface: #ffffff;
  --color-text: #1a2e23;
  --color-text-secondary: #4a5e51;
  --color-border: #d0ddd5;
  --color-shadow: rgba(0, 90, 59, .08);
  --color-link: #0d7a64;
  --color-link-hover: #0a5c4a;

  /* 字体 */
  --font-sans: "Segoe UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* 间距 */
  --space-xs: .5rem;
  --space-sm: .75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-card: 0 2px 12px var(--color-shadow);
  --shadow-hover: 0 6px 24px rgba(0, 90, 59, .12);

  /* 过渡 */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 重置与基础 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 16px;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-link); text-decoration: none; transition: color .2s; }
a:hover, a:focus-visible { color: var(--color-link-hover); }

ul, ol { list-style: none; }

/* ---------- 通用工具 ---------- */
.container {
  width: min(100% - 2rem, 1120px);
  margin-inline: auto;
}

.section {
  padding: var(--space-2xl) 0;
}

.section--alt {
  background: var(--color-surface);
}

.section__header {
  max-width: 680px;
  margin-bottom: var(--space-xl);
}

.section__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  text-wrap: balance;
}

.section__desc {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .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-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

nav[aria-label="主导航"] {
  display: flex;
  gap: var(--space-lg);
}

nav a {
  font-size: .925rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: .4rem 0;
  position: relative;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--color-primary-dark);
}

nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--color-primary-light);
  border-radius: 2px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.6rem;
  border: none;
  border-radius: var(--radius-full);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .25s var(--ease-out), transform .15s, box-shadow .25s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, .25);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  box-shadow: 0 6px 24px rgba(37, 211, 102, .35);
  transform: translateY(-1px);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn--lg {
  padding: .85rem 2rem;
  font-size: 1.05rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: box-shadow .25s, transform .2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.card__text {
  font-size: .925rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* 功能网格 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.news-card {
  display: flex;
  flex-direction: column;
}

.news-card .card__date {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.news-card .card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.news-card .card__excerpt {
  font-size: .875rem;
  color: var(--color-text-secondary);
  flex: 1;
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

/* ---------- 表格 ---------- */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.platform-table th,
.platform-table td {
  padding: .85rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.platform-table th {
  background: var(--color-primary-dark);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .02em;
}

.platform-table tr:last-child td { border-bottom: none; }

.platform-table tr:hover td {
  background: rgba(37, 211, 102, .04);
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-item summary {
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  list-style: none;
  transition: background .2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23128c7e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform .25s var(--ease-out);
}

.faq-item[open] summary::before {
  transform: rotate(180deg);
}

.faq-item summary:hover { background: rgba(37, 211, 102, .04); }

.faq-item p {
  padding: 0 var(--space-lg) var(--space-md);
  font-size: .925rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
}

/* ---------- 阅读链接 ---------- */
.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.related-links li a {
  display: block;
  padding: .85rem var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  line-height: 1.5;
  transition: border-color .2s, background .2s;
}

.related-links li a:hover {
  border-color: var(--color-primary-light);
  background: rgba(37, 211, 102, .04);
}

.related-links .link-title {
  font-weight: 600;
  color: var(--color-text);
  display: block;
  margin-bottom: .25rem;
}

.related-links .link-desc {
  font-size: .825rem;
  color: var(--color-text-secondary);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, .8);
  padding: var(--space-2xl) 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xl);
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-nav a {
  color: rgba(255, 255, 255, .7);
  display: block;
  padding: .25rem 0;
  font-size: .9rem;
}

.footer-nav a:hover { color: #fff; }

.footer-copy {
  width: 100%;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, .15);
  font-size: .8rem;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}

/* ---------- SVG 动效 @keyframes ---------- */

/* 数据点沿曲线流动 */
@keyframes flowDot {
  0%   { stroke-dashoffset: 1; opacity: .5; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { stroke-dashoffset: 1; opacity: .5; }
}

.flow-dot {
  animation: flowDot 6s ease-in-out infinite;
}

.flow-dot--delay-1 { animation-delay: -1.5s; }
.flow-dot--delay-2 { animation-delay: -3s; }
.flow-dot--delay-3 { animation-delay: -4.5s; }

/* 描边自绘 */
@keyframes drawStroke {
  0%   { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4s var(--ease-out) forwards;
}

/* 脉冲呼吸 */
@keyframes pulseSoft {
  0%, 100% { opacity: .7; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.06); }
}

.pulse-soft {
  animation: pulseSoft 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* 浮动 */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.float-gentle {
  animation: floatGentle 7s ease-in-out infinite;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-name: none !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 焦点可见 ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  :root {
    --space-2xl: 3rem;
    --space-3xl: 4rem;
  }

  .header-inner { flex-wrap: wrap; height: auto; padding: .75rem 0; }

  nav[aria-label="主导航"] {
    gap: var(--space-md);
    font-size: .875rem;
  }

  .features-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .platform-table { font-size: .85rem; }
  .platform-table th,
  .platform-table td { padding: .65rem .8rem; }

  .footer-inner { flex-direction: column; }
}
