/* 设计变量与基础重置 */
:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  --color-white: #FFFFFF;
  
  /* 结构约束 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  /* 排版 */
  --font-weight-title: 600;
  --letter-spacing-title: 0;
  --line-height-title: 1.25;
  --line-height-body: 1.75;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  color: var(--color-body);
  background-color: var(--color-paper);
  line-height: var(--line-height-body);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input {
  font: inherit;
  color: inherit;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(var(--color-body), 0.1); /* 使用 body 色系的低透明度作为分割线 */
  border: none;
}

/* 背景变体 */
.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.bg-dark .hl {
  color: var(--color-accent);
}

.bg-dark .brand-link {
  color: var(--color-accent);
}

.bg-dark .section-subtitle {
  color: var(--color-accent);
}

.bg-paper {
  background-color: var(--color-paper);
  color: var(--color-body);
}

.bg-paper .hl {
  color: var(--color-brand);
}

.bg-paper .brand-link {
  color: var(--color-brand);
}

.bg-paper .section-subtitle {
  color: var(--color-brand);
}

/* 卡片（无描边无阴影，靠底色区分） */
.card {
  background-color: rgba(0, 0, 0, 0.03);
  padding: var(--gap);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
}

.bg-dark .card {
  background-color: rgba(255, 255, 255, 0.05);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 24px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  background-color: #c45bd9;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-paper);
  border: 1px solid var(--color-paper);
}

.bg-paper .btn-secondary {
  color: var(--color-body);
  border-color: var(--color-body);
}

.btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* 标题系统 */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-title);
  letter-spacing: var(--letter-spacing-title);
  line-height: var(--line-height-title);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  margin-bottom: 1.5em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.25em;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75em;
}

.section-subtitle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1em;
}

.hl {
  color: var(--color-brand);
}

/* 页头 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: 16px;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-paper);
}

.logo img {
  height: 32px;
  width: auto;
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  color: var(--color-paper);
  opacity: 0.8;
  transition: opacity 0.2s;
  font-size: 0.95rem;
}

.nav a:hover, .nav a[aria-current="page"] {
  opacity: 1;
  color: var(--color-accent);
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.02);
}

.bg-dark th, .bg-dark td {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* FAQ / Details */
details {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px 0;
}

.bg-dark details {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  opacity: 0.6;
  transition: transform 0.2s;
}

details[open] summary::before {
  transform: rotate(180deg);
}

details p {
  margin-top: 12px;
  opacity: 0.9;
}

/* 网格与布局辅助 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.grid-3 {
  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;
}

.text-center {
  text-align: center;
}

.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }

/* 焦点样式 */
*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* SVG 动效关键帧 */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes flowDash {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 动效类 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 3s ease-in-out infinite alternate;
}

.anim-float {
  animation: float 4s ease-in-out infinite;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

.anim-slide {
  animation: slideIn 1.5s ease-out forwards;
}

.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 2s linear infinite;
}

/* 减少动态效果 */
@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;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide, .anim-flow {
    animation: none;
  }
}
