/* ==================== 设计变量 ==================== */
:root {
  --color-bg: #f6f4fb;
  --color-surface: #ffffff;
  --color-primary: #7c4dff;
  --color-primary-deep: #5e35b1;
  --color-secondary: #ff7eb3;
  --color-secondary-light: #ffb8d5;
  --color-text: #262336;
  --color-text-sub: #5c5773;
  --color-border: rgba(124, 77, 255, 0.12);
  --color-glass-bg: rgba(255, 255, 255, 0.65);
  --color-glass-border: rgba(255, 255, 255, 0.85);
  --shadow-sm: 0 4px 12px rgba(94, 53, 177, 0.06);
  --shadow-md: 0 8px 28px rgba(124, 77, 255, 0.10);
  --shadow-lg: 0 16px 40px rgba(124, 77, 255, 0.15);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --font-main: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --container-max: 1240px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 28px;
  --space-lg: 48px;
  --space-xl: 72px;
}

/* ==================== 基础重置与排版 ==================== */
*, *::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);
  background: var(--color-bg);
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* 流体字号 */
.text-hero { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; font-weight: 700; }
.text-h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; font-weight: 600; }
.text-h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.4; text-wrap: balance; font-weight: 600; }
.text-body { font-size: clamp(0.95rem, 1.5vw, 1.05rem); line-height: 1.8; }
.text-small { font-size: 0.875rem; line-height: 1.6; }

/* ==================== 布局工具 ==================== */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-sm); max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.section { padding: var(--space-xl) 0; position: relative; }
.grid-auto { display: grid; gap: var(--space-md); }
/* 防止弹性网格子项因内容过宽导致横向溢出 */
.hero-layout > *, .grid-auto > *, .link-list > * { min-width: 0; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none; outline: none; text-wrap: balance;
}
.btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff; box-shadow: 0 6px 20px rgba(124, 77, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(124, 77, 255, 0.45); }
.btn-outline {
  background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary);
}
.btn-outline:hover { background: rgba(124, 77, 255, 0.06); }

/* ==================== 组件：卡片与玻璃拟态 ==================== */
.glass-card {
  background: var(--color-glass-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.glass-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* ==================== 组件：表格 ==================== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
/* 强制内部矢量图与位图严格限制在容器内，避免 Padding 叠加溢出 */
.mockup-container svg, .hero-svg svg, section svg, section img { max-width: 100%; height: auto; display: block; }
table { background: var(--color-surface); width: 100%; min-width: 100%; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--color-border); word-break: break-word; }
th { background: rgba(124, 77, 255, 0.05); font-weight: 600; color: var(--color-primary-deep); }
tr:last-child td { border-bottom: none; }
td[align="center"] { text-align: center; }

/* ==================== 组件：FAQ ==================== */
details.faq-item {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); margin-bottom: 12px; overflow: hidden;
  transition: box-shadow 0.2s ease;
}
details.faq-item[open] { box-shadow: var(--shadow-sm); }
details.faq-item summary {
  padding: 18px 24px; font-weight: 600; cursor: pointer; user-select: none;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--color-primary);
  transition: transform 0.3s ease;
}
details.faq-item[open] summary::after { transform: rotate(45deg); }
details.faq-item .faq-answer { padding: 0 24px 20px; color: var(--color-text-sub); }

/* ==================== 组件：链接列表 ==================== */
.link-list a {
  display: block; padding: 12px 0; border-bottom: 1px dashed var(--color-border);
  color: var(--color-text-sub); transition: color 0.2s, padding-left 0.2s;
}
.link-list a:hover { color: var(--color-primary); padding-left: 6px; }
.link-list a:last-child { border-bottom: none; }

/* ==================== SVG 动效核心 ==================== */
.svg-progress path, .svg-progress circle {
  pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0;
  stroke-linecap: round; fill: none;
}
@keyframes draw-progress {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0.3; }
  100% { stroke-dashoffset: 1; }
}
.anim-draw-1 { animation: draw-progress 8s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.anim-draw-2 { animation: draw-progress 12s cubic-bezier(0.4, 0, 0.2, 1) infinite 2s; }
.anim-draw-3 { animation: draw-progress 10s cubic-bezier(0.4, 0, 0.2, 1) infinite 4s; }

/* 旋转类规范 */
.svg-spin { transform-box: fill-box; transform-origin: center; }
@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.anim-spin { animation: spin-slow 24s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-draw-1, .anim-draw-2, .anim-draw-3, .anim-spin { animation: none !important; }
}

/* ==================== 页头页脚 ==================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 244, 251, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.15rem; }
.brand img { height: 32px; width: auto; }
.main-nav ul { display: flex; gap: 24px; }
.main-nav a { font-weight: 500; padding: 8px 0; position: relative; }
.main-nav a:hover, .main-nav [aria-current="page"] { color: var(--color-primary); }
.main-nav [aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); border-radius: 2px;
}
.site-footer {
  background: #1e1b2e; color: #d1cfe0; padding: var(--space-lg) 0 var(--space-md);
  font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-col a { display: block; padding: 6px 0; opacity: 0.85; }
.footer-col a:hover { opacity: 1; color: var(--color-secondary-light); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-sm); opacity: 0.7; }

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; gap: 12px; }
  .main-nav ul { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .grid-2, .grid-3, .grid-4, .feature-grid, .case-grid, .news-grid { grid-template-columns: 1fr; }
  .section { padding: var(--space-lg) 0; }
  table { font-size: 0.9rem; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
