/* =========================================
   设计变量与基础重置
   ========================================= */
:root {
  /* 莫兰迪低饱和配色 */
  --color-bg: #F8F6F3;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F0EDE8;
  --color-text-primary: #2B2F36;
  --color-text-secondary: #6B7280;
  --color-accent: #7A9E8C;
  --color-accent-hover: #658876;
  --color-accent-subtle: rgba(122, 158, 140, 0.12);
  --color-border: #E5E1DB;
  --color-focus: #5A7B6A;
  
  /* 排版系统 */
  --font-heading: "Georgia", "Noto Serif SC", "Songti SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  
  /* 间距与布局 */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --container-max: 1120px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-soft: 0 4px 24px rgba(43, 47, 54, 0.05);
  --shadow-hover: 0 8px 32px rgba(43, 47, 54, 0.09);
  --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-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: 1.7;
  overflow-x: hidden;
}

/* 流体字号 */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.3; color: var(--color-text-primary); text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-sm); color: var(--color-text-secondary); }
strong { color: var(--color-text-primary); font-weight: 600; }

/* 通用容器 */
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--space-sm); }
.section { padding-block: var(--space-lg); }
.section-alt { background-color: var(--color-surface); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: var(--space-lg); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--space-md); }

/* 链接与按钮 */
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--color-accent-hover); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.75rem; border-radius: var(--radius-sm); font-weight: 500; font-size: 1rem; cursor: pointer;
  border: none; transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  text-decoration: none;
}
.btn-primary { background-color: var(--color-accent); color: #fff; }
.btn-primary:hover { background-color: var(--color-accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-secondary { background-color: transparent; border: 1px solid var(--color-border); color: var(--color-text-primary); }
.btn-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

/* 导航与页脚 */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(248, 246, 243, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-heading); font-weight: 600; font-size: 1.2rem; color: var(--color-text-primary); text-decoration: none; }
.brand img { height: 32px; width: auto; object-fit: contain; }
.nav-links { display: flex; gap: var(--space-md); list-style: none; }
.nav-links a { color: var(--color-text-secondary); font-size: 0.95rem; font-weight: 500; padding-block: 0.5rem; position: relative; }
.nav-links a[aria-current="page"], .nav-links a:hover { color: var(--color-accent); }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--color-accent); border-radius: 2px; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }

.site-footer { background-color: var(--color-surface); border-top: 1px solid var(--color-border); padding-block: var(--space-lg); margin-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }
.footer-col h4 { font-size: 1rem; margin-bottom: var(--space-sm); font-family: var(--font-heading); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--color-text-secondary); font-size: 0.9rem; }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom { text-align: center; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 0.85rem; }

/* 卡片与组件 */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-md); transition: transform var(--transition-base), box-shadow var(--transition-base); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--color-border); font-size: 0.85rem; color: var(--color-text-secondary); }

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.95rem; }
th { background: var(--color-surface-alt); font-weight: 600; color: var(--color-text-primary); }
tr:last-child td { border-bottom: none; }
td[colspan] { text-align: center; color: var(--color-text-secondary); font-style: italic; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item summary { padding: 1.25rem 0; cursor: pointer; list-style: none; font-weight: 500; font-size: 1.1rem; position: relative; padding-right: 2rem; user-select: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-weight: 400; color: var(--color-accent); transition: transform var(--transition-base); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 1.25rem; color: var(--color-text-secondary); }

/* 步骤编号 */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps li { position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
ol.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; background: var(--color-accent-subtle); color: var(--color-accent); border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 0.9rem; }

/* SVG 基础与动效 */
svg { width: 100%; height: auto; overflow: visible; }
.svg-container { position: relative; width: 100%; max-width: 800px; margin: 0 auto; }
.wireframe-path { fill: none; stroke: var(--color-text-primary); stroke-width: 1.5; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.draw-path { animation: drawStroke 3s ease forwards; }
.highlight-sweep { fill: url(#grad-highlight); opacity: 0; animation: sweepHighlight 6s ease-in-out infinite; }

@keyframes drawStroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes sweepHighlight {
  0% { transform: translateX(-100%); opacity: 0; }
  15% { opacity: 0.6; }
  85% { opacity: 0.6; }
  100% { transform: translateX(100%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .draw-path, .highlight-sweep { animation: none !important; }
  .card:hover { transform: none; box-shadow: var(--shadow-soft); }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--color-surface); flex-direction: column; padding: var(--space-md); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-soft); }
  .nav-links.active { display: flex; }
  .mobile-menu-btn { display: block; }
  h1 { font-size: 2rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
