/* =========================================
   全局设计变量与基础重置
   ========================================= */
:root {
  --color-bg: #f4f1ec;
  --color-surface: #ffffff;
  --color-primary: #3a4f38;
  --color-secondary: #7a6b52;
  --color-accent: #b89a6d;
  --color-text: #1f1f1f;
  --color-text-muted: #5c5c5c;
  --color-border: #d9d4cb;
  --color-highlight: #e8e2d8;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 6px 16px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 12px 28px rgba(0, 0, 0, 0.09);

  --spacing-section: clamp(3rem, 8vw, 6rem);
  --spacing-container: clamp(1rem, 4vw, 2rem);

  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4 {
  margin: 0 0 0.8em;
  line-height: 1.2;
  text-wrap: balance;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }

p, ul, ol, dl, blockquote {
  margin: 0;
}

ul, ol {
  padding-left: 1.2em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover, a:focus-visible {
  opacity: 0.85;
}

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-container);
}

.section {
  padding: var(--spacing-section) 0;
}

.section-header {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-top: 0.5em;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =========================================
   页头与页脚
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav { display: flex; gap: 1.5rem; }
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition-base);
}
.nav a:hover, .nav a[aria-current="page"] {
  border-bottom-color: var(--color-primary);
}

.site-footer {
  background: var(--color-primary);
  color: #eceae5;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #d0cbc2; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #a8a399;
}

/* =========================================
   按钮与交互组件
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: #2e3f2d;
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-subtle);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

/* =========================================
   表格与列表
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-highlight);
  font-weight: 600;
  color: var(--color-primary);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0,0,0,0.015); }

.step-list { counter-reset: step; list-style: none; padding: 0; }
.step-list li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
  counter-increment: step;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

/* =========================================
   FAQ 组件
   ========================================= */
.faq-group { display: flex; flex-direction: column; gap: 0.75rem; }

details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: box-shadow var(--transition-base);
}
details[open] {
  box-shadow: var(--shadow-subtle);
}

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: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  transform: rotate(-45deg);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}
details[open] > summary::before {
  transform: rotate(45deg);
}
summary + p {
  margin-top: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* =========================================
   卡片与最新动态
   ========================================= */
.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.article-meta {
  font-size: 0.85rem;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.article-body { flex: 1; display: flex; flex-direction: column; }
.article-body p { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 1rem; }

.related-list { list-style: none; padding: 0; columns: 2; column-gap: 2rem; }
@media (max-width: 768px) { .related-list { columns: 1; } }
.related-list li {
  margin-bottom: 0.8rem;
  break-inside: avoid;
}
.related-list a {
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--color-border);
  font-weight: 500;
}
.related-list a span {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

/* =========================================
   SVG 动效系统
   ========================================= */
.geo-shape {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  transition: stroke var(--transition-base);
}

.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-draw {
  animation: draw-path 4s ease-in-out infinite alternate;
}

.spin-slow {
  animation: spin-slow 12s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.align-rotate {
  animation: align-rotate 8s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.sync-flow {
  stroke: var(--color-secondary);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  animation: dash-flow 2s linear infinite;
}

@keyframes draw-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes align-rotate {
  from { transform: rotate(-6deg) scale(0.95); }
  to { transform: rotate(6deg) scale(1.05); }
}
@keyframes dash-flow {
  to { stroke-dashoffset: -14; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .spin-slow, .align-rotate, .sync-flow {
    animation: none !important;
  }
}

/* =========================================
   响应式微调
   ========================================= */
@media (max-width: 640px) {
  .header-inner { height: 56px; }
  .nav { gap: 1rem; font-size: 0.9rem; }
  .section { padding: 2.5rem 0; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
}
