/* ==================== 设计变量与基础重置 ==================== */
:root {
  /* 配色体系 */
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;

  /* 结构与圆角 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-base: 1.55;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ==================== 布局容器 ==================== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.page-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap);
  min-height: 100vh;
  min-width: 0;
}

/* 桌面端左侧导航 */
.sidebar-nav {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  padding: var(--gap) 0;
  border-right: 1px solid rgba(25, 21, 35, 0.08);
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav li a {
  display: block;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-btn);
  transition: background 0.2s, color 0.2s;
}

.sidebar-nav li a:hover,
.sidebar-nav li a[aria-current="page"] {
  background: rgba(82, 20, 235, 0.08);
  color: var(--color-brand);
}

/* 移动端折叠提示 */
.mobile-nav-toggle {
  display: none;
}

/* ==================== 页头与页脚 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--color-brand);
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.copyright {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ==================== 区块与排版 ==================== */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section--dark {
  background: var(--color-dark);
  color: var(--color-paper);
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section--light .section__label {
  color: var(--color-brand);
}

.section--dark .section__label {
  color: var(--color-accent);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  max-width: 38em;
}

.hl {
  font-weight: 700;
}

.section--light .hl {
  color: var(--color-brand);
}

.section--dark .hl {
  color: var(--color-accent);
}

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  border: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 237, 110, 0.35);
}

.btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.section--dark .btn--secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  background: rgba(25, 21, 35, 0.04);
}

.section--dark .btn--secondary:hover {
  background: rgba(245, 240, 229, 0.08);
}

.btn-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.fact-line {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ==================== 卡片与网格 ==================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section--dark .card {
  background: rgba(245, 240, 229, 0.06);
  border: 1px solid rgba(245, 240, 229, 0.1);
  color: var(--color-paper);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

.card__icon {
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  color: var(--color-brand);
}

.section--dark .card__icon {
  color: var(--color-accent);
}

/* ==================== 表格与详情 ==================== */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.spec-table th,
.spec-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.spec-table th {
  font-weight: 600;
  width: 40%;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

faq details {
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}

faq summary {
  padding: 16px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(25, 21, 35, 0.02);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

faq summary::-webkit-details-marker {
  display: none;
}

faq summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-brand);
  border-bottom: 2px solid var(--color-brand);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

faq details[open] summary::before {
  transform: rotate(45deg);
}

faq .answer {
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* ==================== SVG 动效核心类 ==================== */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 同心轨道呼吸 */
.orbit-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: orbit-breathe 6s ease-in-out infinite alternate;
}

.orbit-ring:nth-child(2) { animation-delay: -2s; }
.orbit-ring:nth-child(3) { animation-delay: -4s; }

@keyframes orbit-breathe {
  0% { transform: scale(0.96); opacity: 0.5; }
  100% { transform: scale(1.04); opacity: 1; }
}

/* 元素轻微漂浮 */
.float-element {
  transform-box: fill-box;
  transform-origin: center;
  animation: gentle-float 5s ease-in-out infinite;
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 描边绘制 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: stroke-draw 8s linear infinite;
}

@keyframes stroke-draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* 输入点呼吸 */
.blink-dot {
  animation: dot-blink 1.5s ease-in-out infinite;
}

.blink-dot:nth-child(2) { animation-delay: 0.3s; }
.blink-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dot-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 通知滑入 */
.slide-in {
  animation: slide-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(12px);
}

@keyframes slide-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 响应式与无障碍 ==================== */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-nav {
    position: relative;
    top: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(25, 21, 35, 0.08);
    padding: 12px 0;
  }

  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 24px;
  }
  
  /* 防止侧边栏在小屏下过宽 */
  .sidebar-nav {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
