/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-dark: #271334;
  --color-paper: #E9E8EA;
  --color-body: #1D1523;
  --color-brand: #8A13DD;
  --color-accent: #9EED6E;
  --color-white: #FFFFFF;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --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, "PingFang SC", "Microsoft YaHei", sans-serif;
  --line-height-base: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-body);
  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 { 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);
  position: relative;
}
.section.dark { background-color: var(--color-dark); color: var(--color-paper); }
.section.paper { background-color: var(--color-paper); color: var(--color-body); }
.section.panel { background-color: var(--color-dark); color: var(--color-paper); }

/* ==================== 排版系统 ==================== */
.micro-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section.paper .micro-label { color: var(--color-brand); }
.section.dark .micro-label { color: var(--color-accent); }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: var(--gap);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 0; }
h3 { font-size: 1.25rem; margin-top: 0; }

.text-hl { font-weight: 800; }
.section.paper .text-hl { color: var(--color-brand); }
.section.dark .text-hl { color: var(--color-accent); }

p { margin-bottom: var(--gap); max-width: 38em; }
p:last-child { margin-bottom: 0; }

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background-color: #8FD660; }

.btn-secondary {
  background-color: transparent;
}
.section.paper .btn-secondary { color: var(--color-body); border-color: var(--color-body); }
.section.dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { opacity: 0.85; }

/* ==================== 组件：卡片与面板 ==================== */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.section.paper .card { background: rgba(0, 0, 0, 0.03); }
.section.dark .card { background: rgba(255, 255, 255, 0.08); }
.card:hover { transform: translateY(-2px); }

.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); }

/* ==================== 组件：表格 ==================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
th { font-weight: 700; }
.section.paper th { border-bottom-color: rgba(0,0,0,0.15); }
.section.dark th { border-bottom-color: rgba(255,255,255,0.15); }

/* ==================== 组件：FAQ (Details/Summary) ==================== */
.faq-item {
  border: 1px solid rgba(128, 128, 128, 0.2);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
}
.section.paper .faq-item { border-color: rgba(0,0,0,0.12); }
.section.dark .faq-item { border-color: rgba(255,255,255,0.15); }

details summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 20px 16px; line-height: 1.6; color: inherit; }

/* ==================== 组件：新闻卡片 ==================== */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-date {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}
.news-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.news-excerpt { font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }

/* ==================== 页头与页脚 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(233, 232, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.section.dark ~ .site-header,
.site-header.dark-mode {
  background-color: rgba(39, 19, 52, 0.95);
  border-bottom-color: rgba(255,255,255,0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: 0.95rem; font-weight: 500; position: relative; }
.nav-links a:hover { opacity: 0.8; }
.nav-links a[aria-current="page"] { font-weight: 700; }

.site-footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}
.footer-col h4 { font-size: 1rem; margin-bottom: 12px; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ==================== SVG 动效定义 ==================== */
svg.hero-visual {
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
}
svg.hero-visual path, svg.hero-visual line, svg.hero-visual polyline {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}
@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes dashFlow {
  to { stroke-dashoffset: -1; }
}

.anim-float { animation: floatCard 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-delay { animation: floatCard 6s ease-in-out infinite 2s; transform-box: fill-box; transform-origin: center; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideInRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-flow { animation: dashFlow 2s linear infinite; }

/* ==================== 响应式与无障碍 ==================== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
