/* === 设计变量与基础设置 === */
:root {
  /* 色板 */
  --color-deep: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;

  /* 衍生色（仅用于边框、次级背景，不用于正文） */
  --color-border-light: rgba(28, 21, 35, 0.12);
  --color-border-strong: rgba(28, 21, 35, 0.25);

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --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;
  --lh-body: 1.55;
  --fw-heading: 500;
  --lh-heading: 1.15;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  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-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* === 色彩面管理 === */
.face-deep {
  background-color: var(--color-deep);
  color: var(--color-paper);
}
.face-deep .hl {
  color: var(--color-accent);
}
.face-deep a:not(.btn) {
  color: var(--color-accent);
}

.face-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}
.face-paper .hl {
  color: var(--color-brand);
}
.face-paper a:not(.btn) {
  color: var(--color-brand);
}

.card-face {
  background-color: var(--color-paper);
  color: var(--color-text);
  border-color: var(--color-text);
}

/* === 排版组件 === */
.breadcrumb {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--gap);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.face-deep .breadcrumb { color: var(--color-accent); }
.face-paper .breadcrumb { color: var(--color-brand); }

h1, h2, h3, h4 {
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  margin-top: 0;
  margin-bottom: var(--gap);
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.hl {
  font-weight: 700;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.5em;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-deep);
}
.btn-primary:hover { background-color: #e5c95b; }

.btn-secondary {
  background-color: transparent;
  border: 2px solid currentColor;
  color: currentColor;
}
.face-deep .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.face-paper .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.btn-secondary:hover { opacity: 0.85; }

.btn-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

/* === 卡片 === */
.card {
  background-color: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* === 表格 === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}
th { font-weight: 600; }
td:first-child { font-weight: 600; }
tr:last-child th, tr:last-child td { border-bottom: none; }

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
}
.faq-item summary {
  padding: 1em 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { margin-bottom: 0; font-size: 0.95rem; opacity: 0.9; }

/* === 导航 === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-border-light);
  padding: 0.75em 0;
  backdrop-filter: blur(8px);
}
.face-deep .header { background-color: rgba(35, 19, 52, 0.85); border-bottom-color: rgba(245, 243, 247, 0.1); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img { height: 32px; width: auto; }

.nav-links {
  display: flex;
  gap: 1.5em;
  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; }
.nav-link[aria-current="page"] { font-weight: 700; }

/* === Footer === */
.footer {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--gap);
}
.footer-links { display: flex; gap: 1.5em; flex-wrap: wrap; }

/* === Grid & Flex Utilities === */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.gap-lg { gap: calc(var(--gap) * 2); }

/* === SVG 动效系统 === */
.svg-anim {
  width: 100%;
  height: auto;
}
svg .orbit {
  fill: none;
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
svg .pulse-circle {
  transform-box: fill-box;
  transform-origin: center;
}
svg .float-group {
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.8; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes dashMove {
  to { stroke-dashoffset: -1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-breathe { animation: breathe 6s ease-in-out infinite; }
.anim-float { animation: floatY 4s ease-in-out infinite; }
.anim-dash { animation: dashMove 3s linear infinite; }
.anim-delay-1 { animation-delay: 1s; }
.anim-delay-2 { animation-delay: 2s; }

/* === 减少动态效果 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .orbit, .pulse-circle, .float-group { animation: none !important; }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .nav-links { display: none; } /* 简化移动端，实际项目可加汉堡菜单 */
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
