/* === 设计 Token === */
:root {
  /* 颜色系统 */
  --color-dark-surface: #13102D;
  --color-light-paper: #F7F5F3;
  --color-text-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  
  /* 派生颜色 (用于边框、次要背景等，不用于主要文字) */
  --color-border: rgba(23, 21, 35, 0.1);
  --color-border-dark: rgba(247, 245, 243, 0.1);
  --color-bg-subtle: rgba(23, 21, 35, 0.03);
  --color-bg-subtle-dark: rgba(247, 245, 243, 0.05);

  /* 形状 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --radius-sm: 8px;

  /* 阴影 */
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --card-shadow-hover: 0 14px 32px -12px rgba(23, 21, 35, 0.4);

  /* 节奏与密度 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  /* 字体 */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-weight-heading: 800;
  --font-weight-body: 400;
}

/* === 基础重置与排版 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--color-text-body);
  background-color: var(--color-light-paper);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
}

/* 深色面覆盖全局变量 */
.dark-surface {
  background-color: var(--color-dark-surface);
  color: var(--color-light-paper);
}
.dark-surface h1, .dark-surface h2, .dark-surface h3, .dark-surface p, .dark-surface li {
  color: var(--color-light-paper);
}
.dark-surface .hl {
  color: var(--color-accent);
}
.dark-surface a:not(.btn) {
  color: var(--color-accent);
}
.dark-surface .brand-color-text {
  color: var(--color-accent);
}

/* 浅色卡片在深色面上恢复纸面取色 */
.card-light-on-dark {
  background-color: var(--color-light-paper);
  color: var(--color-text-body);
  border: 1px solid var(--color-border);
}
.card-light-on-dark h3, .card-light-on-dark p, .card-light-on-dark li {
  color: var(--color-text-body);
}
.card-light-on-dark .hl {
  color: var(--color-brand);
}
.card-light-on-dark a:not(.btn) {
  color: var(--color-brand);
}

/* 容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  width: 100%;
}

/* 标题系统 */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-heading);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-top: 0;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin-top: 1em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

/* 眉标 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.light-mode .section-label {
  color: var(--color-brand);
}
.dark-mode .section-label {
  color: var(--color-accent);
}

/* 高亮关键词 */
.hl {
  color: var(--color-brand);
}
.dark-surface .hl {
  color: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark-surface);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(137, 237, 110, 0.4);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-body);
  border: 1px solid currentColor;
}
.light-mode .btn-secondary {
  border-color: var(--color-text-body);
  color: var(--color-text-body);
}
.dark-surface .btn-secondary {
  border-color: var(--color-light-paper);
  color: var(--color-light-paper);
}
.btn-secondary:hover {
  background-color: rgba(23, 21, 35, 0.05);
  transform: translateY(-2px);
}
.dark-surface .btn-secondary:hover {
  background-color: rgba(247, 245, 243, 0.1);
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: var(--card-border);
}
.card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

/* 网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* 交错图文 */
.feature-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--section-y);
}
.feature-row:nth-child(even) {
  flex-direction: row-reverse;
}
.feature-text {
  flex: 1 1 300px;
}
.feature-visual {
  flex: 1 1 300px;
  background-color: var(--color-dark-surface);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
.feature-visual svg {
  width: 100%;
  height: auto;
  max-width: 400px;
}

/* 表格 */
.table-container {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
th {
  background-color: var(--color-bg-subtle);
  font-weight: 700;
  width: 30%;
}
tr:last-child td {
  border-bottom: none;
}

/* FAQ */
.faq-item {
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.faq-item summary {
  padding: 16px 24px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
}
.faq-item .faq-answer {
  padding: 0 24px 24px;
  color: var(--color-text-body);
  line-height: 1.7;
}

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 245, 243, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}
.dark-surface .site-header {
  background-color: rgba(19, 16, 45, 0.9);
  border-bottom-color: var(--color-border-dark);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo img {
  height: 32px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--color-text-body);
  font-weight: 500;
  font-size: 0.95rem;
}
.dark-surface .nav-links a {
  color: var(--color-light-paper);
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--color-brand);
}
.dark-surface .nav-links a:hover, .dark-surface .nav-links a[aria-current="page"] {
  color: var(--color-accent);
}

/* 页脚 */
.site-footer {
  padding: 64px 0 32px;
  background-color: var(--color-dark-surface);
  color: var(--color-light-paper);
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}
.footer-col h4 {
  color: var(--color-light-paper);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 12px;
}
.footer-col a {
  color: rgba(247, 245, 243, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--color-accent);
}
.footer-bottom {
  border-top: 1px solid var(--color-border-dark);
  padding-top: 32px;
  text-align: center;
  color: rgba(247, 245, 243, 0.5);
  font-size: 0.9rem;
}

/* SVG 动效 Keyframes */
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes input-breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes notify-slide {
  0% { transform: translateX(20px); opacity: 0; }
  20% { transform: translateX(0); opacity: 1; }
  80% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(20px); opacity: 0; }
}
@keyframes line-flow {
  to { stroke-dashoffset: -20; }
}
@keyframes grid-node-flash {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 动效类 */
.anim-bubble {
  animation: bubble-float 3s ease-in-out infinite;
}
.anim-bubble-delay {
  animation: bubble-float 3s ease-in-out infinite 1.5s;
}
.anim-input-dot {
  animation: input-breathe 1.4s infinite ease-in-out both;
}
.anim-input-dot:nth-child(1) { animation-delay: 0s; }
.anim-input-dot:nth-child(2) { animation-delay: 0.2s; }
.anim-input-dot:nth-child(3) { animation-delay: 0.4s; }
.anim-notify {
  animation: notify-slide 4s ease-in-out infinite;
}
.anim-line {
  stroke-dasharray: 10 5;
  animation: line-flow 1s linear infinite;
}
.anim-grid-node {
  animation: grid-node-flash 2s ease-in-out infinite;
}
.anim-grid-node:nth-child(odd) {
  animation-delay: 0.5s;
}
.anim-grid-node:nth-child(3n) {
  animation-delay: 1s;
}

/* 减少动态效果 */
@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;
  }
  .anim-bubble, .anim-input-dot, .anim-notify, .anim-line, .anim-grid-node {
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .feature-row, .feature-row:nth-child(even) {
    flex-direction: column;
  }
  .feature-visual {
    width: 100%;
  }
  .nav-links {
    display: none; /* 简化处理，实际项目需汉堡菜单 */
  }
  .header-inner {
    justify-content: space-between;
  }
}
