/* ================= 设计变量 ================= */
:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  
  --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, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* ================= 基础重置与排版 ================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--gap) 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--gap) 0; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.85; }
img, svg { display: block; max-width: 100%; height: auto; }

/* ================= 布局容器 ================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding: var(--section-y) 0;
  position: relative;
}
section + section {
  border-top: 1px solid rgba(31, 21, 35, 0.1);
}
.dark-section {
  background: var(--color-dark);
  color: var(--color-paper);
}
.dark-section a { color: var(--color-accent); }
.dark-section .hl { color: var(--color-accent); }

/* ================= 组件：卡片与面板 ================= */
.paper-card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: calc(var(--gap) * 2);
  border-radius: var(--radius-card);
}
.dark-section .paper-card {
  background: var(--color-paper);
  color: var(--color-text);
}
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}
.dark-section .visual-panel {
  background: rgba(255,255,255,0.08);
}

/* ================= 组件：按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.6rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background: #d95aa8; transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover { background: rgba(31,21,35,0.05); }
.dark-section .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.dark-section .btn-secondary:hover { background: rgba(245,240,229,0.1); }

/* ================= 组件：表格 ================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--gap) 0;
  font-size: 0.95rem;
  table-layout: fixed;
}
th, td {
  padding: 0.8rem 1rem;
  border-bottom: var(--card-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
th { font-weight: 700; background: rgba(31,21,35,0.03); }
.dark-section th { background: rgba(255,255,255,0.05); }

/* ================= 组件：FAQ ================= */
details {
  border: var(--card-border);
  margin: var(--gap) 0;
  border-radius: var(--radius-card);
}
summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 1.1rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--color-brand);
  border-bottom: 2px solid var(--color-brand);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(45deg); }
details > div { padding: 0 1.2rem 1rem 2.2rem; }

/* ================= 页头与页脚 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245,240,229,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31,21,35,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.1rem; color: var(--color-text); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--color-paper); opacity: 0.8; }
.footer-links a:hover { opacity: 1; }
.footer-copy { font-size: 0.85rem; opacity: 0.6; margin-top: 1rem; }

/* ================= 响应式网格 ================= */
.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); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .nav { gap: 1rem; }
}

/* ================= SVG 动效系统 ================= */
.svg-anim { width: 100%; height: auto; }
.svg-anim path, .svg-anim rect, .svg-anim circle, .svg-anim line, .svg-anim polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 描边自绘 */
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 4s ease forwards;
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
/* 浮动 */
.float-anim {
  animation: floatY 5s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* 呼吸点 */
.breathe-dot {
  animation: breatheOpacity 3s ease-in-out infinite;
}
@keyframes breatheOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
/* 流动线 */
.flow-line {
  stroke-dasharray: 0.2 0.8;
  animation: flowDash 2s linear infinite;
}
@keyframes flowDash {
  to { stroke-dashoffset: -1; }
}
/* 旋转/缩放中心 */
.rot-center, .scale-center {
  transform-box: fill-box;
  transform-origin: center;
}
.spin-anim {
  animation: spinSlow 12s linear infinite;
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* ================= 减少动态效果 ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
