:root {
  /* 色板 */
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 排版 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.75;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --h3-size: 1.25rem;
  --eyebrow-size: 0.8rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 布局骨架 */
.site-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* 左侧吸顶品牌栏 */
.sidebar-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--color-dark);
  padding: var(--gap) 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-paper);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }

.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sidebar-links a {
  color: rgba(246, 243, 247, 0.7);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.sidebar-links a:hover, .sidebar-links a[aria-current="page"] {
  color: var(--color-paper);
  background: rgba(237, 110, 192, 0.15);
}
.sidebar-links a[aria-current="page"] { font-weight: 600; border-left: 3px solid var(--color-accent); }

.sidebar-footer { font-size: 0.8rem; color: rgba(246, 243, 247, 0.5); line-height: 1.6; }

/* 主内容区 */
.main-content {
  padding: 0;
  overflow-x: hidden;
}

/* 通用区块容器 */
.section-wrapper {
  background: var(--color-paper);
  padding: var(--section-y) var(--gap);
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}
.section-wrapper:last-child { border-bottom: none; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* 标题系统 */
.eyebrow {
  display: inline-block;
  font-size: var(--eyebrow-size);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.paper-theme .eyebrow { color: var(--color-brand); }
.dark-theme .eyebrow { color: var(--color-accent); }

h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 16px;
}
h2 {
  font-size: var(--h2-size);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 24px;
  text-wrap: balance;
}
h3 {
  font-size: var(--h3-size);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
  margin-top: 24px;
}

.hl { font-weight: 700; }
.paper-theme .hl { color: var(--color-brand); }
.dark-theme .hl { color: var(--color-accent); }

p { margin-bottom: 16px; max-width: 38em; }
ul, ol { margin-bottom: 16px; padding-left: 24px; }
li { margin-bottom: 8px; }

/* 按钮系统 */
.btn-group { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border-color: var(--color-accent);
}
.btn-primary:hover { background: #d95aae; border-color: #d95aae; }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.dark-theme .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { background: rgba(31, 21, 35, 0.05); }
.dark-theme .btn-secondary:hover { background: rgba(246, 243, 247, 0.1); }

.btn svg { width: 20px; height: 20px; }

/* 卡片与表格 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}
.table-responsive { overflow-x: auto; margin-bottom: 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 500px;
}
th, td { padding: 12px 16px; border-bottom: 1px solid rgba(31, 21, 35, 0.1); text-align: left; }
th { font-weight: 600; background: rgba(31, 21, 35, 0.03); }
.dark-theme th { background: rgba(246, 243, 247, 0.05); color: var(--color-paper); }
.dark-theme td { color: var(--color-paper); border-color: rgba(246, 243, 247, 0.15); }

/* 步骤编号徽标 */
.step-list { counter-reset: step; list-style: none; padding-left: 0; }
.step-list li {
  position: relative;
  padding-left: 48px;
  margin-bottom: 24px;
}
.step-list li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.dark-theme .step-list li::before { background: var(--color-accent); color: var(--color-dark); }

/* 特性标签页 (纯 CSS) */
.tab-radio { display: none; }
.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid rgba(31,21,35,0.1); padding-bottom: 12px; }
.tab-nav label {
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.tab-nav label:hover { background: rgba(31,21,35,0.05); }
.tab-panel { display: none; padding-top: 16px; }
.tab-radio:checked + .tab-nav + .tab-panels .panel-target { display: block; }
#tab1:checked ~ .tab-panels .panel-1,
#tab2:checked ~ .tab-panels .panel-2,
#tab3:checked ~ .tab-panels .panel-3,
#tab4:checked ~ .tab-panels .panel-4 { display: block; }

/* 提示框 */
.callout {
  border-left: 4px solid var(--color-brand);
  background: rgba(158, 19, 221, 0.08);
  padding: 16px;
  margin: 24px 0;
  font-size: 0.95rem;
}
.dark-theme .callout { border-left-color: var(--color-accent); background: rgba(237, 110, 192, 0.1); }

/* FAQ */
details {
  border: 1px solid rgba(31, 21, 35, 0.1);
  margin-bottom: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.5);
}
.dark-theme details { border-color: rgba(246, 243, 247, 0.15); background: rgba(246, 243, 247, 0.05); }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { margin-top: 12px; margin-bottom: 0; }

/* 新闻卡片 */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.news-card { border: 1px solid rgba(31,21,35,0.1); padding: var(--gap); background: #fff; }
.dark-theme .news-card { border-color: rgba(246,243,247,0.15); background: rgba(246,243,247,0.05); }
.news-card time { display: block; font-size: 0.8rem; color: var(--color-brand); margin-bottom: 8px; font-weight: 600; }
.dark-theme .news-card time { color: var(--color-accent); }
.news-card h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.news-card p { font-size: 0.95rem; margin-bottom: 0; color: var(--color-text); }
.dark-theme .news-card p { color: var(--color-paper); }

/* SVG 基础与动效 */
.svg-visual { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-visual path, .svg-visual rect, .svg-visual circle, .svg-visual polygon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.anim-geo {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotate-slow 12s ease-in-out infinite;
}
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease-in-out infinite;
}
.anim-bubble {
  transform-box: fill-box;
  transform-origin: center;
  animation: float-gentle 6s ease-in-out infinite;
}
.anim-pulse {
  animation: pulse-opacity 3s ease-in-out infinite;
}

@keyframes rotate-slow {
  0%, 100% { transform: rotate(-2deg) scale(0.99); }
  50% { transform: rotate(2deg) scale(1.01); }
}
@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  20%, 80% { stroke-dashoffset: 0; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 响应式适配 */
@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; }
  .sidebar-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    z-index: 200;
  }
  .sidebar-links { display: none; }
  .main-content { padding-top: 64px; }
  .section-wrapper { padding: calc(var(--section-y) * 0.6) var(--gap); }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
