/* ==========================================
   WhatsApp 品牌站 - 全站共享样式
   设计变量、排版、页头页脚、组件、SVG动效
   ========================================== */

/* ---- 设计变量 ---- */
:root {
  /* 品牌色 */
  --brand-100: #e8f5e9;
  --brand-200: #a5d6a7;
  --brand-300: #66bb6a;
  --brand-400: #4caf50;
  --brand-500: #2e7d32;
  --brand-600: #1b5e20;
  --brand-700: #0d3b11;
  --lime-400: #aeea00;
  --lime-500: #c6ff00;

  /* 中性色 */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #eeeeee;
  --gray-300: #e0e0e0;
  --gray-400: #bdbdbd;
  --gray-500: #9e9e9e;
  --gray-600: #757575;
  --gray-700: #616161;
  --gray-800: #424242;
  --gray-900: #212121;
  --gray-950: #111111;

  /* 语义色 */
  --success: #4caf50;
  --info: #0288d1;
  --warning: #ff9800;
  --error: #d32f2f;

  /* 布局 */
  --max-width: 1200px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* 间距 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* 字体 */
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Source Code Pro", "Consolas", monospace;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(46, 125, 50, 0.15);
}

/* ---- 重置与基础 ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background-color: #ffffff;
  line-height: 1.7;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-700);
}

:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- 排版 ---- */
h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw + 0.5rem, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3vw + 0.3rem, 2.4rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.1rem, 2vw + 0.2rem, 1.4rem);
}

p {
  margin-bottom: var(--space-md);
  color: var(--gray-700);
}

small {
  font-size: 0.875rem;
  color: var(--gray-500);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--gray-100);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* ---- 通用容器 ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section--alt {
  background-color: var(--gray-50);
}

.section--gradient {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 60%, var(--lime-500) 100%);
  color: #fff;
}

.section--gradient p {
  color: rgba(255,255,255,0.85);
}

.section__heading {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section__heading h2 {
  margin-bottom: var(--space-sm);
}

.section__heading p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--brand-500);
  border-color: var(--brand-400);
}

.btn--outline:hover {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}

.btn--white {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-md);
}

.btn--white:hover {
  background: var(--brand-100);
  transform: translateY(-2px);
  color: var(--brand-700);
}

.btn--lg {
  padding: 1rem 2.4rem;
  font-size: 1.1rem;
}

.btn--sm {
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}

/* ---- 卡片 ---- */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
  transform: translateY(-3px);
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--brand-100);
  color: var(--brand-600);
}

.card__title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--gray-900);
}

.card__desc {
  color: var(--gray-600);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ---- 网格 ---- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---- 表格 ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
}

td {
  color: var(--gray-700);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--brand-100);
}

/* ---- FAQ (details/summary) ---- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-item:first-child {
  border-top: 1px solid var(--gray-200);
}

.faq-item summary {
  padding: var(--space-md) 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-800);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: color var(--transition-fast);
  position: relative;
  padding-right: var(--space-xl);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform var(--transition-base);
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--brand-500);
}

.faq-item summary:hover::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e7d32' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.faq-item .faq-answer {
  padding-bottom: var(--space-lg);
  color: var(--gray-600);
  line-height: 1.8;
}

/* ---- 文章卡片 ---- */
.article-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--brand-200);
}

.article-card__date {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: var(--space-xs);
}

.article-card__title {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
  color: var(--gray-900);
}

.article-card__excerpt {
  font-size: 0.9rem;
  color: var(--gray-600);
  flex-grow: 1;
  margin-bottom: var(--space-md);
}

/* ---- 相关链接 ---- */
.related-links {
  list-style: none;
}

.related-links li {
  padding: var(--space-sm) 0;
  border-bottom: 1px dashed var(--gray-200);
}

.related-links li:last-child {
  border-bottom: none;
}

.related-links a {
  display: block;
  padding: var(--space-sm) 0;
  color: var(--gray-700);
  transition: all var(--transition-fast);
}

.related-links a:hover {
  color: var(--brand-500);
  padding-left: var(--space-sm);
}

.related-links a small {
  display: block;
  margin-top: var(--space-xs);
  color: var(--gray-500);
  font-size: 0.8rem;
}

/* ---- 页头 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header-height);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  color: var(--gray-900);
  font-size: 1.1rem;
}

.header-brand img {
  height: 36px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-nav a {
  color: var(--gray-600);
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.header-nav a:hover {
  color: var(--brand-500);
}

.header-nav a[aria-current="page"] {
  color: var(--brand-600);
  font-weight: 600;
}

.header-nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-500);
  border-radius: 1px;
}

/* ---- 页尾 ---- */
.site-footer {
  background: var(--gray-950);
  color: var(--gray-400);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-brand img {
  height: 32px;
  width: auto;
  filter: grayscale(0.3) brightness(1.2);
}

.footer-brand p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-sm);
}

.footer-col a {
  color: var(--gray-500);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--brand-300);
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ---- Hero 区块 ---- */
.hero {
  padding: var(--space-3xl) 0;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #ffffff 0%, var(--brand-100) 50%, var(--lime-400) 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(46,125,50,0.08);
  color: var(--brand-600);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.hero__badge svg {
  width: 16px;
  height: 16px;
}

.hero h1 {
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: 1.15rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---- 下载区块 ---- */
.download-block {
  padding: var(--space-3xl) 0;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.download-info h3 {
  margin-bottom: var(--space-md);
  color: var(--gray-800);
}

.install-steps {
  list-style: none;
  counter-reset: step;
  margin-bottom: var(--space-xl);
}

.install-steps li {
  counter-increment: step;
  padding: var(--space-md) 0 var(--space-md) var(--space-xl);
  position: relative;
  color: var(--gray-700);
  border-left: 2px solid var(--gray-200);
  margin-left: var(--space-md);
}

.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: -14px;
  top: var(--space-md);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-steps li:last-child {
  border-left-color: transparent;
}

.requirements {
  margin-top: var(--space-lg);
}

.requirements dt {
  font-weight: 600;
  color: var(--gray-800);
  margin-top: var(--space-md);
}

.requirements dd {
  color: var(--gray-600);
  margin-left: var(--space-md);
}

.download-panel {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

.download-panel h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
}

.download-panel p {
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-lg);
}

.download-file-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.12);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-lg);
  word-break: break-all;
}

/* ---- SVG 动效通用 ---- */
.svg-animation {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* 数据流动效果 */
@keyframes flow-along-path {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

@keyframes flow-along-path-reverse {
  0% {
    offset-distance: 100%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    offset-distance: 0%;
    opacity: 0;
  }
}

.flow-dot {
  animation: flow-along-path 6s linear infinite;
}

.flow-dot:nth-child(2) {
  animation-delay: -2s;
}

.flow-dot:nth-child(3) {
  animation-delay: -4s;
}

@keyframes dash-draw {
  0% {
    stroke-dashoffset: 1;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 1;
  }
}

.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-draw 8s ease-in-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.6;
  }
}

.pulse-ring {
  animation: pulse-ring 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes float-up {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.float-up {
  animation: float-up 6s ease-in-out infinite;
}

@keyframes rotate-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.rotate-slow {
  animation: rotate-slow 20s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes dash-flow {
  0% {
    stroke-dashoffset: 1;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.dash-flow {
  pathLength: 1;
  stroke-dasharray: 0.05 0.02;
  animation: dash-flow 3s linear infinite;
}

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__actions {
    justify-content: center;
  }

  .grid--2, .grid--3, .grid--4 {
    grid-template-columns: 1fr;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .header-nav {
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

/* ---- 减少动态效果 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---- 工具类 ---- */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mt-lg { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-lg); }
.gap-md { gap: var(--space-lg); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
