/* ============================================================
   实验人 / SZSY.REN — VitePress 默认主题风格
   令牌命名与 VitePress 默认主题（--vp-*）保持一致，便于后续换肤：
   改 --vp-c-brand-1/2/3 即可整体换主色。
   ============================================================ */

:root {
  /* 背景 */
  --vp-c-bg: #ffffff;
  --vp-c-bg-alt: #f6f6f7;
  --vp-c-bg-soft: #f6f6f7;
  --vp-c-bg-elv: #ffffff;
  /* 文字 */
  --vp-c-text-1: rgba(60, 60, 67);
  --vp-c-text-2: rgba(60, 60, 67, 0.78);
  --vp-c-text-3: rgba(60, 60, 67, 0.56);
  /* 线 */
  --vp-c-divider: rgba(60, 60, 67, 0.29);
  --vp-c-gutter: rgba(60, 60, 67, 0.12);
  /* 品牌（VitePress 默认 indigo） */
  --vp-c-brand-1: #3451b2;
  --vp-c-brand-2: #3a5ccc;
  --vp-c-brand-3: #5672cd;
  --vp-c-brand-soft: rgba(100, 108, 255, 0.14);
  /* 按钮 */
  --vp-button-brand-bg: var(--vp-c-brand-1);
  --vp-button-brand-hover-bg: var(--vp-c-brand-2);
  --vp-button-brand-active-bg: var(--vp-c-brand-3);
  --vp-button-brand-text: #ffffff;
  --vp-button-alt-bg: var(--vp-c-bg-alt);
  --vp-button-alt-hover-bg: #ebebec;
  --vp-button-alt-text: var(--vp-c-text-1);
  /* 首页 Hero */
  --vp-home-hero-name-color: transparent;
  --vp-home-hero-name-background: linear-gradient(120deg, #3451b2 30%, #7c89ff);
  /* 布局 */
  --vp-nav-height: 64px;
  --vp-layout-max-width: 1280px;
  --vp-font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

html.dark {
  --vp-c-bg: #1b1b1f;
  --vp-c-bg-alt: #161618;
  --vp-c-bg-soft: #202127;
  --vp-c-bg-elv: #202127;
  --vp-c-text-1: rgba(255, 255, 245, 0.86);
  --vp-c-text-2: rgba(235, 235, 245, 0.6);
  --vp-c-text-3: rgba(235, 235, 245, 0.38);
  --vp-c-divider: rgba(84, 84, 88, 0.48);
  --vp-c-gutter: rgba(84, 84, 88, 0.2);
  --vp-c-brand-1: #a8b1ff;
  --vp-c-brand-2: #5c73e7;
  --vp-c-brand-3: #3e63dd;
  --vp-c-brand-soft: rgba(100, 108, 255, 0.16);
  --vp-button-brand-bg: var(--vp-c-brand-3);
  --vp-button-brand-hover-bg: var(--vp-c-brand-2);
  --vp-button-alt-bg: #32363f;
  --vp-button-alt-hover-bg: #3f444f;
  --vp-button-alt-text: var(--vp-c-text-1);
  --vp-home-hero-name-background: linear-gradient(120deg, #a8b1ff 30%, #5c73e7);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--vp-c-bg);
  color: var(--vp-c-text-1);
  font-family: var(--vp-font-family-base);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--vp-c-brand-1);
  text-decoration: none;
}

a:hover {
  color: var(--vp-c-brand-2);
}

.container {
  max-width: var(--vp-layout-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================ 顶部导航 ============================ */
.VPNavBar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--vp-c-gutter);
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(50%) blur(8px);
  -webkit-backdrop-filter: saturate(50%) blur(8px);
}

html.dark .VPNavBar {
  background-color: rgba(27, 27, 31, 0.8);
}

.VPNavBar .container {
  height: var(--vp-nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.VPNavBar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--vp-c-text-1);
  font-weight: 600;
}

.VPNavBar-title:hover {
  color: var(--vp-c-text-1);
}

.VPNavBar-logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--vp-home-hero-name-background);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.VPNavBar-name {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.VPNavBar-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--vp-c-text-3);
  border-left: 1px solid var(--vp-c-divider);
  padding-left: 8px;
}

.VPNavBar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.VPNavBar-link {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--vp-c-text-1);
  transition: color 0.2s, background-color 0.2s;
}

.VPNavBar-link:hover {
  color: var(--vp-c-brand-1);
  background-color: var(--vp-c-bg-soft);
}

.VPNavBar-link--muted {
  color: var(--vp-c-text-2);
}

/* 主题切换（对齐 VitePress 的 VPSwitchAppearance） */
.VPSwitch {
  position: relative;
  width: 40px;
  height: 22px;
  margin-left: 8px;
  padding: 0;
  border: 1px solid var(--vp-c-divider);
  border-radius: 11px;
  background-color: var(--vp-c-bg-soft);
  cursor: pointer;
  transition: border-color 0.25s;
}

.VPSwitch:hover {
  border-color: var(--vp-c-brand-1);
}

.VPSwitch-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vp-c-text-2);
  line-height: 0;
  transition: opacity 0.25s;
}

.VPSwitch-icon--sun {
  left: 4px;
}

.VPSwitch-icon--moon {
  right: 4px;
}

html:not(.dark) .VPSwitch-icon--sun,
html.dark .VPSwitch-icon--moon {
  opacity: 0.35;
}

html:not(.dark) .VPSwitch-icon--moon,
html.dark .VPSwitch-icon--sun {
  opacity: 1;
  color: var(--vp-c-brand-1);
}

/* ============================ 首页 Hero ============================ */
.VPHomeHero {
  padding: 96px 0 64px;
  text-align: center;
}

.VPBadge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 3px 12px;
  border: 1px solid var(--vp-c-divider);
  border-radius: 14px;
  background-color: var(--vp-c-bg-soft);
  color: var(--vp-c-text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.VPHomeHero-name {
  font-size: clamp(40px, 7vw, 56px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vp-home-hero-name-color);
  background: var(--vp-home-hero-name-background);
  -webkit-background-clip: text;
  background-clip: text;
  width: fit-content;
  margin: 0 auto;
}

.VPHomeHero-text {
  margin: 12px auto 0;
  max-width: 22em;
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--vp-c-text-1);
}

.VPHomeHero-tagline {
  margin: 24px auto 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 28px;
  color: var(--vp-c-text-2);
}

.VPHomeHero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.VPHomeHero-actions--left {
  justify-content: flex-start;
}

/* ============================ 按钮 ============================ */
.VPButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.25s, background-color 0.25s, border-color 0.25s;
}

.VPButton.brand {
  background-color: var(--vp-button-brand-bg);
  color: var(--vp-button-brand-text);
}

.VPButton.brand:hover {
  background-color: var(--vp-button-brand-hover-bg);
  color: var(--vp-button-brand-text);
}

.VPButton.brand:active {
  background-color: var(--vp-button-brand-active-bg);
}

.VPButton.alt {
  border-color: var(--vp-c-divider);
  background-color: var(--vp-button-alt-bg);
  color: var(--vp-button-alt-text);
}

.VPButton.alt:hover {
  border-color: var(--vp-c-brand-1);
  background-color: var(--vp-button-alt-hover-bg);
  color: var(--vp-c-brand-1);
}

/* ============================ 特性卡片（VPFeatures） ============================ */
.VPFeatures {
  padding: 24px 0 8px;
}

.VPFeatures-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.VPFeature {
  height: 100%;
  padding: 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  background-color: var(--vp-c-bg-soft);
  transition: border-color 0.25s;
}

.VPFeature:hover {
  border-color: var(--vp-c-brand-1);
}

.VPFeature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 8px;
  background-color: var(--vp-c-bg);
  color: var(--vp-c-brand-1);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.VPFeature-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.01em;
  color: var(--vp-c-text-1);
}

.VPFeature-details {
  margin-top: 8px;
  font-size: 14px;
  line-height: 24px;
  color: var(--vp-c-text-2);
}

/* ============================ 章节（VP doc 风格） ============================ */
.VPSection {
  padding-bottom: 8px;
}

.VPSection h2 {
  margin: 64px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--vp-c-divider);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--vp-c-text-1);
}

.VPSection h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--vp-c-text-1);
}

.VPProse p {
  font-size: 16px;
  line-height: 28px;
  color: var(--vp-c-text-2);
}

.VPProse--two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

/* 自定义块（对齐 VitePress custom container） */
.VPCustomBlock {
  margin: 0;
  padding: 16px 20px;
  border-left: 4px solid var(--vp-c-brand-1);
  border-radius: 8px;
  background-color: var(--vp-c-brand-soft);
}

.VPCustomBlock p {
  font-size: 16px;
  line-height: 28px;
  color: var(--vp-c-text-1);
}

.VPCardGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.VPCard {
  padding: 20px 24px;
  border: 1px solid var(--vp-c-divider);
  border-radius: 12px;
  background-color: var(--vp-c-bg-alt);
}

.VPCard p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 24px;
  color: var(--vp-c-text-2);
}

.VPSteps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.VPStep {
  padding-top: 16px;
  border-top: 2px solid var(--vp-c-brand-1);
}

.VPStep-index {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--vp-c-brand-1);
}

.VPStep h3 {
  margin-top: 4px;
}

.VPStep p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 24px;
  color: var(--vp-c-text-2);
}

/* ============================ 页脚（VPFooter） ============================ */
.VPFooter {
  margin-top: 96px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--vp-c-gutter);
  background-color: var(--vp-c-bg-alt);
}

.VPFooter-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.VPFooter-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--vp-c-text-1);
}

.VPFooter-text {
  margin-top: 8px;
  font-size: 13px;
  line-height: 22px;
  color: var(--vp-c-text-2);
}

.VPFooter-heading {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--vp-c-text-1);
}

.VPFooter-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.VPFooter-column a {
  font-size: 13px;
  color: var(--vp-c-text-2);
}

.VPFooter-column a:hover {
  color: var(--vp-c-brand-1);
}

.VPFooter-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--vp-c-gutter);
}

.VPFooter-bottom p {
  font-size: 13px;
  color: var(--vp-c-text-3);
}

/* 锚点定位避让吸顶导航 */
[id] {
  scroll-margin-top: calc(var(--vp-nav-height) + 16px);
}

/* ============================ 响应式 ============================ */
@media (max-width: 960px) {
  .VPFeatures-grid,
  .VPSteps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .VPCardGrid,
  .VPProse--two,
  .VPFooter-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 18px;
  }

  .VPNavBar .container {
    gap: 8px;
  }

  .VPNavBar-title {
    min-width: 0;
  }

  .VPNavBar-name {
    white-space: nowrap;
  }

  .VPNavBar-tag {
    display: none;
  }

  .VPNavBar-menu {
    min-width: 0;
    flex-shrink: 1;
    gap: 0;
  }

  /* 小屏收起次要入口（节奏 / 站点状态），避免把布局撑宽 */
  .VPNavBar-link--optional {
    display: none;
  }

  .VPNavBar-link {
    padding: 6px 7px;
    font-size: 13px;
    white-space: nowrap;
  }

  .VPSwitch {
    margin-left: 4px;
    flex-shrink: 0;
  }

  .VPHomeHero {
    padding: 64px 0 40px;
  }

  .VPHomeHero-actions {
    gap: 12px;
  }

  .VPFeatures-grid,
  .VPSteps {
    grid-template-columns: 1fr;
  }

  .VPSection h2 {
    margin-top: 48px;
  }

  .VPFooter {
    margin-top: 64px;
  }
}
