/* === 设计变量与基础重置 === */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-border: rgba(25, 21, 35, 0.16);
  
  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  
  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.container {
  width: min(var(--content-max), calc(100% - 2rem));
  margin-inline: auto;
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.panel {
  background: var(--bg-color, var(--color-paper));
  border-radius: var(--radius-card);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: var(--gap);
  border: var(--card-border) var(--color-border);
  box-shadow: var(--card-shadow, none);
}
.dark-section { --bg-color: var(--color-dark); }
.paper-section { --bg-color: var(--color-paper); }

/* 取色覆盖规则 */
.dark-section .text-default { color: var(--color-paper); }
.dark-section .text-brand { color: var(--color-accent); }
.dark-section .text-accent { color: var(--color-accent); }
.dark-section .link-main { color: var(--color-accent); }
.dark-section .hl { color: var(--color-accent); }

.card-light {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border) var(--color-border);
  border-radius: var(--radius-card);
}
.card-light .text-default { color: var(--color-text); }
.card-light .text-brand { color: var(--color-brand); }
.card-light .link-main { color: var(--color-brand); }
.card-light .hl { color: var(--color-brand); }

/* === 排版组件 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
  color: var(--color-brand);
}
.dark-section .badge { color: var(--color-accent); }

h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.8em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.5em; }
p { margin-bottom: 0.8em; max-width: 38em; }
.hl { font-weight: 700; }
.text-brand { color: var(--color-brand); }
.text-accent { color: var(--color-accent); }
.link-main { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dark-section .link-main { color: var(--color-accent); }

/* === 按钮 === */
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5em; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background: #bde060; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.dark-section .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}
.btn-secondary:hover { background: rgba(25, 21, 35, 0.05); }
.dark-section .btn-secondary:hover { background: rgba(247, 245, 243, 0.08); }

/* === 网格与交错布局 === */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
.alternate-row { display: flex; flex-direction: row; gap: var(--gap); }
.alternate-row.reverse { flex-direction: row-reverse; }
@media (max-width: 900px) { .alternate-row, .alternate-row.reverse { flex-direction: column; } }

/* === 核心功能卡片 === */
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-icon {
  width: 40px; height: 40px;
  background: rgba(82, 20, 235, 0.1);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--color-brand);
}
.dark-section .feature-icon { background: rgba(200, 237, 110, 0.15); color: var(--color-accent); }

/* === 流程条 === */
.flow-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
}
.flow-node {
  flex: 1;
  min-width: 140px;
  background: var(--color-paper);
  border: var(--card-border) var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  text-align: center;
  position: relative;
}
.dark-section .flow-node { background: var(--color-dark); border-color: rgba(247,245,243,0.2); }
.flow-arrow {
  flex-shrink: 0;
  width: 24px; height: 24px;
  color: var(--color-brand);
}
.dark-section .flow-arrow { color: var(--color-accent); }

/* === 表格 === */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}
.spec-table th, .spec-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}
.spec-table th { font-weight: 600; width: 35%; color: var(--color-text); }
.dark-section .spec-table th { color: var(--color-paper); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  border: var(--card-border) var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-paper);
  overflow: hidden;
}
.dark-section .faq-item { background: var(--color-dark); border-color: rgba(247,245,243,0.2); }
.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 20px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-content { padding: 0 20px 16px; line-height: 1.6; }

/* === 步骤条 === */
.step-list { display: flex; gap: 24px; counter-reset: step; }
.step-item { flex: 1; counter-increment: step; position: relative; padding-left: 48px; }
.step-item::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 0.9rem;
}
.step-title { font-weight: 600; margin-bottom: 4px; }
.step-desc { font-size: 0.95rem; color: var(--color-text); opacity: 0.85; }
.dark-section .step-desc { color: var(--color-paper); }

/* === 新闻卡片 === */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card {
  background: var(--color-paper);
  border: var(--card-border) var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.dark-section .news-card { background: var(--color-dark); border-color: rgba(247,245,243,0.2); }
.news-date { font-size: 0.8rem; opacity: 0.7; }
.news-title { font-weight: 600; line-height: 1.4; }
.news-excerpt { font-size: 0.95rem; opacity: 0.85; line-height: 1.6; }

/* === 页头页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 243, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}
.dark-section.site-header { background: rgba(20, 14, 37, 0.9); border-color: rgba(247,245,243,0.15); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.dark-section .nav-links a { color: var(--color-paper); }
.dark-section .nav-links a:hover, .dark-section .nav-links a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 24px;
  border-top: 1px solid rgba(247,245,243,0.1);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { opacity: 0.8; font-size: 0.9rem; }
.footer-col ul li a:hover { opacity: 1; }
.footer-bottom { text-align: center; font-size: 0.85rem; opacity: 0.6; border-top: 1px solid rgba(247,245,243,0.1); padding-top: 24px; }

/* === SVG 动效系统 === */
.svg-panel {
  width: 100%;
  height: auto;
  display: block;
}
/* 绘制线条 */
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 4s ease-in-out infinite alternate;
}
@keyframes draw-path {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
/* 卡片漂浮 */
.float-layer {
  animation: float-panel 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes float-panel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* 呼吸点 */
.breath-dot {
  animation: breath 3s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes breath {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
/* 滑入通知 */
.slide-in-notif {
  animation: slide-notif 7s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes slide-notif {
  0%, 100% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(12px); opacity: 0.85; }
  80% { transform: translateX(4px); opacity: 0.95; }
}
/* 消息气泡浮现循环 */
.msg-bubble {
  animation: bubble-pop 5s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes bubble-pop {
  0%, 100% { transform: translateY(0); opacity: 1; }
  30% { transform: translateY(-5px); opacity: 0.8; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw-line, .float-layer, .breath-dot, .slide-in-notif, .msg-bubble {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
