/* === 设计变量与基础设定 === */
:root {
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;
  --color-text-on-dark: #F6F3F7;
  --color-accent-on-dark: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --body-size: 1rem;
  --line-height-body: 1.65;
  --line-height-heading: 1.25;
}

*, *::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: var(--body-size);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-text-on-dark);
}

.bg-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === 排版 === */
h1, h2, h3, h4 {
  line-height: var(--line-height-heading);
  font-weight: 600;
  letter-spacing: 0;
}

h1 { font-size: var(--h1-size); }
h2 { font-size: var(--h2-size); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; max-width: 38em; }

.text-hl {
  color: var(--color-brand);
}

.bg-dark .text-hl {
  color: var(--color-accent);
}

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.bg-paper .badge { color: var(--color-brand); }
.bg-dark .badge { color: var(--color-accent); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}

.bg-dark .btn-secondary {
  border-color: var(--color-text-on-dark);
  color: var(--color-text-on-dark);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(31, 21, 35, 0.05);
}

.bg-dark .btn-secondary:hover {
  background-color: rgba(246, 243, 247, 0.1);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* === 组件：卡片 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
}

.bg-dark .card {
  background: var(--color-paper);
  color: var(--color-text);
  border-color: rgba(31, 21, 35, 0.16);
}

.card-header {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  width: 24px;
  height: 24px;
  stroke: var(--color-brand);
  fill: none;
  stroke-width: 2;
}

.bg-dark .card-icon {
  stroke: var(--color-brand);
}

/* === 组件：表格 === */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(31, 21, 35, 0.12);
  vertical-align: top;
}

th {
  font-weight: 700;
  white-space: nowrap;
}

td:first-child {
  font-weight: 600;
  width: 35%;
}

/* === 组件：FAQ === */
details {
  border: var(--card-border);
  padding: 1rem;
  margin-bottom: var(--gap);
  background: var(--color-paper);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  position: absolute;
  right: 0;
  font-weight: 400;
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* === 组件：步骤 === */
.step-list {
  counter-reset: step;
}

.step-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content h3 {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.step-content p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 0.75rem 0;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-brand);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-brand);
}

.footer {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: 3rem 0;
  border-top: 1px solid rgba(246, 243, 247, 0.1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col a:hover {
  text-decoration: underline;
}

.copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(246, 243, 247, 0.1);
  font-size: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

/* === SVG 动效 === */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: hidden;
}

.star {
  animation: twinkle 3s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.line-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 5s ease-in-out infinite alternate;
}

.bubble-float {
  animation: floatY 4s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.notif-slide {
  animation: slideIn 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.dot-breathe {
  animation: breathe 2.5s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes floatY {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes slideIn {
  0% { transform: translateX(10px); opacity: 0.7; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes breathe {
  0% { opacity: 0.4; r: 2; }
  100% { opacity: 1; r: 3.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .line-draw { stroke-dashoffset: 0; }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .hero-layout { flex-direction: column; }
  .hero-text { margin-bottom: 2rem; }
  .hero-visual { width: 100%; max-width: 100%; }
}
