/* =========================================
   设计变量与基础设置
   ========================================= */
:root {
  --bg-base: #fdfaf7;
  --bg-surface: #ffffff;
  --bg-soft: #f4efe9;
  --bg-warm-gradient: linear-gradient(135deg, #fff4eb 0%, #fce8e0 100%);
  --color-primary: #d9563a;
  --color-primary-hover: #c2452b;
  --color-secondary: #e8a87c;
  --color-text-main: #1e1e1e;
  --color-text-sub: #5a5a5a;
  --color-text-faint: #8c8c8c;
  --color-border: #e6e0d8;
  --color-accent: #25d366;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --transition-fast: 0.2s ease-out;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--bg-base);
  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;
}

ul, ol {
  list-style: none;
}

/* =========================================
   排版系统
   ========================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-xl) 0;
  position: relative;
}

.section-alt {
  background-color: var(--bg-soft);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-sm);
  color: var(--color-text-main);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: var(--space-md);
  color: var(--color-text-main);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: var(--space-xs);
  color: var(--color-text-main);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-sub);
}

.text-muted {
  color: var(--color-text-faint);
  font-size: 0.9rem;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* =========================================
   组件：按钮
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover, .btn-primary:focus-visible {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(217, 86, 58, 0.25);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-main);
}

.btn-outline:hover, .btn-outline:focus-visible {
  border-color: var(--color-text-main);
  background-color: rgba(0,0,0,0.02);
}

.btn-icon {
  width: 20px;
  height: 20px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* =========================================
   组件：卡片
   ========================================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all var(--transition-base);
}

.card:hover, .card:focus-within {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--color-secondary);
}

.card-grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* =========================================
   组件：表格
   ========================================= */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: var(--bg-soft);
  font-weight: 600;
  color: var(--color-text-main);
  white-space: nowrap;
}

td {
  color: var(--color-text-sub);
}

tr:last-child td {
  border-bottom: none;
}

/* =========================================
   组件：FAQ (Details/Summary)
   ========================================= */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item details {
  padding: var(--space-sm) 0;
}

.faq-item summary {
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--color-text-main);
  transition: color var(--transition-fast);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform var(--transition-base);
  color: var(--color-text-faint);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--color-primary);
}

.faq-item summary:hover {
  color: var(--color-primary);
}

.faq-item p {
  margin-top: var(--space-xs);
  padding-left: var(--space-sm);
  border-left: 2px solid var(--color-secondary);
  max-width: 95%;
}

/* =========================================
   组件：导航与页头页脚
   ========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo img {
  height: 28px;
  width: auto;
}

.nav-list {
  display: flex;
  gap: var(--space-md);
}

.nav-link {
  font-size: 0.95rem;
  color: var(--color-text-sub);
  padding: 0.4rem 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link[aria-current="page"] {
  color: var(--color-primary);
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-list {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
  }
  .nav-list.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

.footer {
  background: var(--bg-soft);
  padding: var(--space-lg) 0;
  margin-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--color-text-faint);
}

/* =========================================
   SVG 动效：等高线流动
   ========================================= */
.svg-contain {
  width: 100%;
  height: auto;
  overflow: visible;
}

.contour-path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  opacity: 0.6;
}

.contour-path.alt-1 { stroke: var(--color-secondary); }
.contour-path.alt-2 { stroke: var(--color-text-faint); opacity: 0.3; }

@keyframes contourFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.animate-contour {
  animation: contourFlow 6s linear infinite;
}

.animate-contour.delay-1 { animation-delay: -1.5s; }
.animate-contour.delay-2 { animation-delay: -3s; }
.animate-contour.delay-3 { animation-delay: -4.5s; }

@media (prefers-reduced-motion: reduce) {
  .animate-contour {
    animation: none !important;
  }
  .card {
    transform: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* =========================================
   辅助类与工具
   ========================================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-lg) 0;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: var(--bg-soft);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-sub);
  margin-bottom: var(--space-xs);
}

.update-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.update-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-top: 0.5rem;
}

.link-arrow:hover {
  text-decoration: underline;
}

.related-list li {
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.related-list li:last-child {
  border-bottom: none;
}

.related-desc {
  font-size: 0.9rem;
  color: var(--color-text-faint);
  max-width: 60%;
  text-align: right;
}
