/* === 基础变量与设计系统 === */
:root {
  /* 颜色体系 */
  --color-bg-dark: #271334;
  --color-bg-paper: #E9E8EA;
  --color-text-body: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-white: #FFFFFF;
  
  /* 派生颜色 (用于边框、次级元素) */
  --color-border-light: rgba(29, 21, 35, 0.1);
  --color-bg-card-dark: #301840;
  --color-bg-card-paper: #DCD9DC;

  /* 圆角 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-sm: 8px;

  /* 间距与布局 */
  --content-max: 960px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --header-h: 64px;
  
  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  color: var(--color-text-body);
  background-color: var(--color-bg-paper);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* === 通用组件 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.bg-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
}

.bg-paper {
  background-color: var(--color-bg-paper);
  color: var(--color-text-body);
}

/* 眉标 (Section Label) */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: var(--gap);
  text-transform: uppercase;
}

.bg-paper .section-label { color: var(--color-brand); }
.bg-dark .section-label { color: var(--color-accent); }

/* 标题 */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: var(--gap);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 1.5);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

/* 强调词 */
.hl {
  font-weight: 700;
}
.bg-paper .hl { color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  border: none;
  min-height: 48px;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-bg-dark);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid currentColor;
}

.bg-paper .btn-secondary {
  border-color: var(--color-text-body);
  color: var(--color-text-body);
}

.bg-dark .btn-secondary {
  border-color: var(--color-white);
  color: var(--color-white);
}

/* === 卡片 === */
.card {
  background-color: var(--color-bg-card-paper);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5);
  /* 无阴影，无描边，靠背景色区分 */
}

.bg-dark .card {
  background-color: var(--color-bg-card-dark);
  color: var(--color-white);
}

/* === 表格 === */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background-color: var(--color-bg-card-paper);
  padding: var(--gap);
}

.bg-dark .table-wrapper {
  background-color: var(--color-bg-card-dark);
  color: var(--color-white);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

th {
  font-weight: 600;
  color: var(--color-brand);
}

.bg-dark th {
  color: var(--color-accent);
}

tr:last-child td {
  border-bottom: none;
}

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
}

details summary {
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: transform 0.2s;
}

details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

details p {
  margin-top: 0;
  margin-bottom: 1rem;
  opacity: 0.9;
}

/* === 页头 === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--header-h);
}

.bg-dark .header {
  background-color: rgba(39, 19, 52, 0.85);
  border-bottom: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo img {
  width: auto;
  height: 32px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.nav-link:hover, .nav-link[aria-current="page"] {
  opacity: 1;
  color: var(--color-brand);
}

.bg-dark .nav-link {
  color: var(--color-white);
}
.bg-dark .nav-link:hover, .bg-dark .nav-link[aria-current="page"] {
  color: var(--color-accent);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

/* === 页脚 === */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--color-border-light);
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.footer-col a {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 1;
}

/* === SVG 动效系统 === */
.svg-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* 1. 星点明灭 (Hero 背景) */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.star-point {
  animation: twinkle 4s infinite ease-in-out;
}
.star-delay-1 { animation-delay: 1s; }
.star-delay-2 { animation-delay: 2s; }
.star-delay-3 { animation-delay: 3s; }

/* 2. 连线流动 */
@keyframes dash-flow {
  to { stroke-dashoffset: -20; }
}

.connection-line {
  stroke-dasharray: 4 6;
  animation: dash-flow 2s linear infinite;
}

/* 3. 消息气泡浮动 */
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.bubble-anim {
  animation: float-bubble 3s ease-in-out infinite;
}

/* 4. 呼吸灯效果 (输入框光标) */
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.cursor-dot {
  animation: breathe 1.5s ease-in-out infinite;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* 简化处理，实际项目可做抽屉菜单 */
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero-layout {
    flex-direction: column-reverse;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .scenario-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
