:root {
  --bg-paper: #f9f8f6;
  --bg-surface: #ffffff;
  --bg-card: #f3f2ef;
  --text-primary: #111111;
  --text-secondary: #444444;
  --text-muted: #6b6b6b;
  --border-subtle: #e8e7e4;
  --border-strong: #2a2a2a;
  --accent: #0f7a5d;
  --accent-hover: #0a5c46;
  --radius-sm: 6px;
  --radius-md: 12px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-focus: 0 0 0 3px rgba(15,122,93,0.35);
  --font-body: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-heading: "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --spacing-section: clamp(4rem, 8vw, 8rem);
  --spacing-block: 2.5rem;
  --max-width: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-paper);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1.5rem; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-bottom: 0.75rem; }

p { margin-bottom: 1.25rem; color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }
svg { display: block; overflow: visible; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 248, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}

.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;
  color: var(--text-primary);
  text-decoration: none;
}

.brand img {
  height: 28px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

nav a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0.4rem 0;
  position: relative;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--text-primary);
  text-decoration: none;
}

nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

/* Buttons */
.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: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--text-primary);
  color: #fff;
}

.btn-primary:hover {
  background: #2a2a2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-surface);
}

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* Sections & Layout */
.section {
  padding-block: var(--spacing-section);
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.gallery-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--bg-card);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

details {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s ease;
}

details[open] {
  border-color: var(--accent);
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
}

details[open] summary::before { content: "−"; }

details p {
  margin-top: 0.8rem;
  margin-bottom: 0;
  font-size: 0.98rem;
}

/* News Cards */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.news-card time {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  list-style: none;
}

.related-list li a {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.related-list li a:hover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.related-list .title { font-weight: 500; margin-bottom: 0.3rem; }
.related-list .desc { font-size: 0.9rem; color: var(--text-muted); }

/* Footer */
.site-footer {
  background: var(--text-primary);
  color: #eee;
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a { color: #aaa; }
.footer-links a:hover { color: #fff; }

.footer-meta {
  font-size: 0.85rem;
  color: #888;
}

/* SVG Animation Base */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.grid-canvas { width: 100%; max-width: 400px; margin: 0 auto; }
.grid-node { fill: #e0dfdc; transition: fill 0.3s ease; }
.grid-line { stroke: #d0cfc9; stroke-width: 1.5; fill: none; pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* Keyframes */
@keyframes node-pulse {
  0%, 100% { fill: #e0dfdc; opacity: 0.6; }
  50% { fill: var(--accent); opacity: 1; }
}

@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.anim-node { animation: node-pulse 5s infinite ease-in-out; }
.anim-node:nth-child(odd) { animation-delay: 0.4s; }
.anim-node:nth-child(even) { animation-delay: 1.2s; }

.anim-draw { animation: dash-flow 3s ease forwards; }
.anim-float { animation: float-up 4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .anim-node, .anim-draw, .anim-float { animation: none !important; }
}

/* 修复窄屏下 Grid/Flex 子元素因内容过宽导致的横向溢出 */
.feature-grid > article, .news-grid > article, .ui-panel > div, .download-box > div,
.split-row > * {
  min-width: 0;
}
nav ul {
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
  .split-row { grid-template-columns: 1fr; gap: 2rem; }
  .hero-layout { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  nav ul { gap: 1rem; }
  .gallery-scroll { padding-left: 1.5rem; }
  /* 强制窄屏下内联 Grid 降为一列，消除 Gap 累积与容器 Padding 冲突导致的宽度溢出 */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}
/* 抑制极小视口下因浏览器舍入误差产生的微量水平滚动条 */
html { overflow-x: hidden; }
