/* ====================
   设计变量与基础重置
   ==================== */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Consolas, "Courier New", monospace;
  
  --color-bg: #f4f7f6;
  --color-surface: #ffffff;
  --color-surface-alt: #f0fdf4;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-light: #64748b;
  
  --color-primary-start: #065f46;
  --color-primary-end: #34d399;
  --color-primary-dark: #047857;
  --color-accent: #10b981;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-card: 0 4px 12px rgb(6 95 70 / 0.06), 0 1px 3px rgb(0 0 0 / 0.04);
  --shadow-hover: 0 8px 20px rgb(6 95 70 / 0.1), 0 2px 6px rgb(0 0 0 / 0.05);
  
  --container-max: 1120px;
  --spacing-section: clamp(3rem, 6vw, 5rem);
  --spacing-unit: 0.5rem;
  
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ====================
   排版与流体字号
   ==================== */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  margin-bottom: calc(var(--spacing-unit) * 4);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.15rem, 2vw + 0.25rem, 1.35rem);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

p {
  margin: 0 0 1rem;
}

strong {
  font-weight: 600;
}

a:not([class]) {
  color: var(--color-primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:not([class]):hover {
  color: var(--color-accent);
}

/* ====================
   布局容器
   ==================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: var(--spacing-section) 0;
}

.section--alt {
  background-color: var(--color-surface);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--flex-wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

/* ====================
   页头与导航
   ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary-start);
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.main-nav ul {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-primary-start);
  background: var(--color-surface-alt);
}

/* ====================
   按钮组件
   ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  text-align: center;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary-start), var(--color-accent));
  color: #ffffff;
  box-shadow: 0 4px 10px rgb(6 95 70 / 0.25);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgb(6 95 70 / 0.3);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--color-primary-start);
  color: var(--color-primary-start);
}

.btn--outline:hover {
  background: var(--color-surface-alt);
}

.btn--text {
  background: transparent;
  color: var(--color-primary-dark);
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.btn--text:hover {
  color: var(--color-accent);
}

/* ====================
   卡片与通用组件
   ==================== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  border: 1px solid #e2e8f0;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  color: var(--color-primary-start);
}

.icon-box svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--color-surface-alt);
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}

/* ====================
   表格样式
   ==================== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  background: var(--color-surface-alt);
  font-weight: 600;
  color: var(--color-primary-start);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:nth-child(even) {
  background: #f8fafc;
}

/* ====================
   FAQ 样式
   ==================== */
.faq-item {
  background: var(--color-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-primary-start);
  border-bottom: 2px solid var(--color-primary-start);
  transform: rotate(-45deg);
  transition: transform var(--transition-base);
}

.faq-item[open] summary::before {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0 1.25rem 1rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ====================
   SVG 动效核心规则
   ==================== */
.svg-flow-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 8s ease-in-out infinite alternate;
}

.svg-flow-dot {
  fill: var(--color-accent);
  animation: pulseDot 3.5s ease-in-out infinite alternate;
}

.svg-draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 10s ease-in-out infinite alternate;
}

@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

@keyframes pulseDot {
  0% { opacity: 0.3; r: 2px; }
  100% { opacity: 1; r: 3.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .svg-flow-path,
  .svg-flow-dot,
  .svg-draw-line {
    animation: none !important;
  }
}

/* ====================
   响应式适配
   ==================== */
@media (max-width: 768px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .grid--flex-wrap { flex-direction: column; align-items: flex-start; }
  .main-nav { display: none; } /* 简化处理，移动端隐藏主导航以保结构稳定 */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

@media (min-width: 769px) {
  .main-nav { display: block; }
}
