/* =========================================================
   蓝柚启动器文档
   与官网共用同一套配色与排版规则，扁平、克制、无装饰性动效
   ========================================================= */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f4f8;
  --text: #15181e;
  --text-2: #414855;
  --muted: #737c8c;
  --line: #e2e6ed;
  --line-strong: #cdd4de;
  --accent: #2563eb;
  --accent-soft: #e9f0fe;
  --btn: #1d2129;
  --btn-text: #ffffff;
  --header-bg: rgba(247, 248, 250, 0.9);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f13;
  --bg-soft: #12151a;
  --panel: #15181e;
  --panel-2: #1a1e25;
  --text: #e8eaf0;
  --text-2: #b9c0cd;
  --muted: #8c94a3;
  --line: #262b33;
  --line-strong: #3a414c;
  --accent: #7c9bff;
  --accent-soft: #16223f;
  --btn: #e8eaf0;
  --btn-text: #12141a;
  --header-bg: rgba(13, 15, 19, 0.9);
}

/* 主题色：默认蓝色，可在页眉调色盘切换 */

[data-theme="light"][data-accent="blue"],
:root:not([data-accent]) {
  --accent: #2563eb;
  --accent-soft: #e9f0fe;
}

[data-theme="light"][data-accent="sky"] {
  --accent: #0369a1;
  --accent-soft: #e6f4fb;
}

[data-theme="light"][data-accent="navy"] {
  --accent: #1e3a8a;
  --accent-soft: #e8ecf7;
}

[data-theme="light"][data-accent="teal"] {
  --accent: #0f766e;
  --accent-soft: #e6f4f2;
}

[data-theme="light"][data-accent="violet"] {
  --accent: #6d28d9;
  --accent-soft: #f0eafd;
}

[data-theme="dark"][data-accent="blue"],
[data-theme="dark"] {
  --accent: #7c9bff;
  --accent-soft: #16223f;
}

[data-theme="dark"][data-accent="sky"] {
  --accent: #5fb4e4;
  --accent-soft: #102733;
}

[data-theme="dark"][data-accent="navy"] {
  --accent: #9db0ef;
  --accent-soft: #171d33;
}

[data-theme="dark"][data-accent="teal"] {
  --accent: #5cc0b5;
  --accent-soft: #112a28;
}

[data-theme="dark"][data-accent="violet"] {
  --accent: #b79bf2;
  --accent-soft: #241d3b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-size: 12.5px;
  color: var(--text-2);
  word-break: break-all;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--panel-2);
  object-fit: cover;
}

.brand span {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 9px;
  border-left: 1px solid var(--line);
  line-height: 1;
}

.top-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-links a {
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 9px;
  border-radius: 4px;
  white-space: nowrap;
}

.top-links a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.theme-toggle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  margin-left: 4px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

/* ---------- 主题色调色盘 ---------- */

.palette {
  position: relative;
  display: inline-flex;
}

.palette-menu {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 40;
  width: 178px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.12);
}

.palette-menu[hidden] {
  display: none;
}

.palette-menu p {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.swatches {
  display: flex;
  gap: 9px;
}

.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
}

.swatch[data-accent-option="blue"] { background: #2563eb; }
.swatch[data-accent-option="sky"] { background: #0369a1; }
.swatch[data-accent-option="navy"] { background: #1e3a8a; }
.swatch[data-accent-option="teal"] { background: #0f766e; }
.swatch[data-accent-option="violet"] { background: #6d28d9; }

.swatch.is-active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- 布局 ---------- */

.layout {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 26px 64px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 52px;
}

.sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 30px 0 40px;
  scrollbar-width: thin;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
}

.sidebar .group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 22px 0 6px;
  padding-left: 10px;
}

.sidebar .group:first-child {
  margin-top: 0;
}

.sidebar a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-2);
  transition: color 0.15s ease, background 0.15s ease;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.sidebar a.is-active {
  color: var(--text);
  font-weight: 600;
  background: var(--panel);
}

/* ---------- 内容 ---------- */

.content {
  min-width: 0;
  padding-top: 34px;
}

.doc-page {
  display: none;
  max-width: 780px;
}

.doc-page.is-active {
  display: block;
  animation: doc-in 0.3s ease both;
}

@keyframes doc-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.breadcrumb {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.doc-page h1 {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 680;
  letter-spacing: -0.022em;
}

.intro {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--muted);
}

.doc-page h2 {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.doc-page h3 {
  margin-top: 26px;
  font-size: 14.5px;
  font-weight: 650;
}

.doc-page h2 + h3 {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.doc-page p {
  margin-top: 10px;
  color: var(--text-2);
}

.doc-page h1 + h2 {
  margin-top: 30px;
  padding-top: 0;
  border-top: 0;
}

.doc-page ul {
  margin-top: 10px;
  padding-left: 18px;
}

.doc-page ul li {
  margin: 5px 0;
  color: var(--text-2);
}

.doc-page ul li b {
  color: var(--text);
  font-weight: 600;
}

ol.numbered {
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line);
}

ol.numbered li {
  position: relative;
  counter-increment: step;
  padding: 11px 0 11px 34px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-2);
}

ol.numbered li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

ol.numbered li b {
  color: var(--text);
  font-weight: 600;
}

.hint {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}

table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 13px;
  border-top: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--panel-2);
  white-space: nowrap;
}

td {
  color: var(--text-2);
}

td a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.shot {
  margin-top: 18px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 团队 ---------- */

.team-card {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.team-card img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}

.team-card h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 18px;
  font-weight: 650;
}

.team-card p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */

.doc-footer {
  border-top: 1px solid var(--line);
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg-soft);
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 18px 48px;
  }

  .topbar {
    padding: 0 18px;
  }

  .brand em {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 56px;
    z-index: 20;
    max-height: none;
    margin: 0 -18px;
    padding: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar nav {
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    width: max-content;
  }

  .sidebar .group {
    display: none;
  }

  .sidebar a {
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .content {
    padding-top: 26px;
  }

  .doc-page {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: 52px;
    gap: 10px;
  }

  .brand span {
    font-size: 12.5px;
  }

  .top-links a {
    padding: 5px 6px;
    font-size: 12px;
  }

  .sidebar {
    top: 52px;
  }

  .doc-page h1 {
    font-size: 24px;
  }

  .doc-page h2 {
    font-size: 16.5px;
  }

  .team-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  th,
  td {
    padding: 9px 10px;
  }
}
