/* === 设计变量与基础重置 === */
:root {
  --bg-primary: #FAF9F6;
  --bg-secondary: #F0EFEB;
  --text-primary: #0A0A0A;
  --text-secondary: #4A4A4A;
  --border-subtle: #D6D5D1;
  --accent-dark: #1A1A1A;
  --spacing-unit: 1rem;
  --container-max: 1200px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

ul, ol {
  list-style: none;
}

/* === 排版系统 === */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.section-padding {
  padding: clamp(3.5rem, 8vh, 6rem) 0;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.4rem, 5.5vw + 0.5rem, 4.5rem);
  line-height: 1.08;
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw + 0.5rem, 2.8rem);
  line-height: 1.15;
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  width: 40%;
  height: 3px;
  background: var(--text-primary);
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.25rem, 1.5rem);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

p {
  font-size: clamp(1rem, 1.1vw + 0.5rem, 1.125rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 68ch;
}

/* === 导航与页头页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo img {
  height: 32px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
  margin-right: 0.75rem;
}

.brand-name {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
}

.main-nav ul {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent-dark);
}

.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
}

.site-footer {
  background: var(--accent-dark);
  color: #EAEAEA;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand img {
  height: 28px;
  filter: brightness(0) invert(1);
}

.footer-links ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.footer-links a {
  color: #B0B0B0;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-meta {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #333;
}

/* === 通用组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-primary {
  background: var(--text-primary);
  color: #FFFFFF;
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--text-primary);
  color: #FFFFFF;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.flex-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* === 表格样式 === */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #FFF;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

/* === FAQ 样式 === */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #FFF;
  transition: box-shadow var(--transition-base);
}

details:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-left: 2rem;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-primary);
  border-bottom: 2px solid var(--text-primary);
  transform: translateY(-60%) rotate(45deg);
  transition: transform var(--transition-base);
}

details[open] summary::before {
  transform: translateY(-40%) rotate(-135deg);
}

details[open] summary {
  border-bottom: 1px solid var(--border-subtle);
}

details p {
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* === 焦点可见性 === */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* === SVG 动效系统 === */
.svg-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.wireframe-path {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.sweep-highlight {
  fill: none;
  stroke: url(#highlightGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@keyframes drawIn {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes sweepAcross {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.draw-animated {
  animation: drawIn 5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sweep-animated {
  animation: sweepAcross 7s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@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;
  }
  .wireframe-path, .sweep-highlight {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}
