/* ==================== 基础重置与设计变量 ==================== */
:root {
  --color-primary: #7c3aed;
  --color-primary-light: #a78bfa;
  --color-secondary: #db2777;
  --color-secondary-light: #f472b6;
  --color-bg: #f5f3ff;
  --color-surface: rgba(255, 255, 255, 0.75);
  --color-surface-hover: rgba(255, 255, 255, 0.9);
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: rgba(124, 58, 237, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 4px 24px rgba(124, 58, 237, 0.08);
  --shadow-elevated: 0 12px 32px rgba(124, 58, 237, 0.12);
  --font-main: "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --container-max: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.85;
  color: var(--color-text);
  background: linear-gradient(180deg, #fff 0%, var(--color-bg) 100%);
  overflow-x: hidden;
}

/* ==================== 排版与容器 ==================== */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.8rem; line-height: 1.3; color: #111; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 600; margin-bottom: 1.2rem; position: relative; padding-left: 0.75rem; }
h2::before { content: ""; position: absolute; left: 0; top: 0.3em; height: 0.6em; width: 4px; border-radius: 2px; background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary)); }
h3 { font-size: clamp(1.1rem, 2vw, 1.25rem); font-weight: 600; }
p { margin-bottom: 1rem; color: #334155; text-align: justify; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--color-secondary); }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 2px; }

section { padding: 4rem 0; }
.section-header { margin-bottom: 2.5rem; }
.subtitle { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; display: block; }

/* ==================== 头部与导航 ==================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.8rem 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 32px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
nav ul { display: flex; list-style: none; gap: 24px; margin: 0; padding: 0; }
nav a { font-weight: 500; font-size: 0.95rem; color: var(--color-text-muted); padding: 0.5rem 0; position: relative; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-primary); }
nav a[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--color-primary); border-radius: 1px; }

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.75rem 1.6rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem;
  border: none; cursor: pointer; transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff; box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(219, 39, 119, 0.25); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: rgba(124, 58, 237, 0.05); color: var(--color-secondary); border-color: var(--color-secondary); }

/* ==================== 通用卡片与拼贴布局 ==================== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-elevated); background: var(--color-surface-hover); }
.card-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(219, 39, 119, 0.1)); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.card-icon svg { width: 24px; height: 24px; stroke: var(--color-primary); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==================== 表格样式 ==================== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { background: rgba(124, 58, 237, 0.05); font-weight: 600; color: #0f172a; }
td { color: #334155; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(124, 58, 237, 0.03); }

/* ==================== FAQ (Details/Summary) ==================== */
.faq-list { display: flex; flex-direction: column; gap: 16px; }
details {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 0; transition: background var(--transition-base);
}
details[open] { background: var(--color-surface-hover); }
summary {
  padding: 1.1rem 1.4rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 1.2rem; color: var(--color-primary); transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.4rem 1.2rem; margin: 0; color: #475569; line-height: 1.7; }

/* ==================== 更新卡片与推荐阅读 ==================== */
.update-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.update-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.update-date { font-size: 0.8rem; color: var(--color-text-muted); }
.update-title { font-weight: 600; color: #0f172a; line-height: 1.4; }
.update-excerpt { font-size: 0.9rem; color: #64748b; flex-grow: 1; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.related-list li { padding: 0.8rem 1rem; background: var(--color-surface); border-radius: var(--radius-sm); transition: background var(--transition-base); }
.related-list li:hover { background: rgba(124, 58, 237, 0.08); }
.related-link { font-weight: 500; display: block; margin-bottom: 2px; }
.related-desc { font-size: 0.85rem; color: var(--color-text-muted); }

/* ==================== 页脚 ==================== */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 3rem 0; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: #94a3b8; font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.copyright { text-align: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #334155; font-size: 0.85rem; color: #64748b; }

/* ==================== SVG 动效系统 ==================== */
.svg-viz { width: 100%; max-width: 400px; height: auto; margin: 0 auto; display: block; }
.path-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.animate-draw { animation: drawLine 6s ease-in-out infinite alternate; }
.breathe { animation: breathe 5s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
.transform-box-center { transform-box: fill-box; transform-origin: center; }
.float-slow { animation: floatSlow 7s ease-in-out infinite; }
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@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; }
  .animate-draw, .breathe, .float-slow { animation: none; }
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 12px; }
  nav ul { gap: 16px; flex-wrap: wrap; justify-content: center; }
  section { padding: 2.5rem 0; }
  h2::before { top: 0.2em; }
}
