/* === 设计 Token 与全局变量 === */
:root {
  /* 色板 */
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;

  /* 结构与间距 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --header-height: 64px;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* === 基础重置与排版 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

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 + .section {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dark-bg {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.dark-bg .hl {
  color: var(--color-accent);
}

.dark-bg a:not(.btn) {
  color: var(--color-accent);
}

.dark-bg .card-light {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.dark-bg .card-light .hl {
  color: var(--color-brand);
}

/* === 标题与眉标 === */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.paper-mode .eyebrow {
  color: var(--color-brand);
}

.dark-mode .eyebrow {
  color: var(--color-accent);
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.hl {
  color: var(--color-brand);
}

.dark-bg .hl {
  color: var(--color-accent);
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background-color: #d66a5b;
}

.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
}

.paper-mode .btn-secondary {
  color: var(--color-text);
  border-color: var(--color-text);
}

.dark-mode .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

/* === 卡片 === */
.card {
  background-color: rgba(0, 0, 0, 0.03);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.paper-mode .card {
  background-color: rgba(0, 0, 0, 0.03);
}

.dark-mode .card {
  background-color: rgba(255, 255, 255, 0.05);
}

.card:hover {
  transform: translateY(-4px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* === 表格 === */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  background-color: rgba(0, 0, 0, 0.03);
  padding: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

th {
  font-weight: 600;
  color: var(--color-brand);
}

.dark-bg table th {
  color: var(--color-accent);
}

tr:last-child td {
  border-bottom: none;
}

/* === FAQ === */
details {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 0;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23142CEB' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-size: contain;
  transition: transform 0.2s ease;
}

.dark-bg summary::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ED7D6E' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

details[open] summary::before {
  transform: rotate(180deg);
}

details p {
  margin-top: 0.75rem;
  margin-left: 1.5rem;
  color: rgba(0, 0, 0, 0.75);
}

.dark-bg details p {
  color: rgba(255, 255, 255, 0.8);
}

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(232, 233, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.dark-bg .site-header {
  background-color: rgba(18, 21, 49, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

.dark-bg nav a:hover, .dark-bg nav a[aria-current="page"] {
  color: var(--color-accent);
}

.site-footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* === SVG 动效 Keyframes === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes dataFlow {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* === 动效类 === */
.anim-float {
  animation: float 4s ease-in-out infinite;
}

.anim-float-delayed {
  animation: float 4.5s ease-in-out infinite 1s;
}

.anim-breathe {
  animation: breathe 2.5s ease-in-out infinite;
}

.anim-slide-in {
  animation: slideIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.anim-flow {
  stroke-dasharray: 1;
  animation: flowDash 3s linear infinite;
}

.anim-data-point {
  offset-path: path("M 100 150 C 250 150, 350 250, 500 200");
  offset-rotate: 0deg;
  animation: dataFlow 4s linear infinite;
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  nav ul {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-data-point {
    offset-path: none;
    display: none;
  }
}
