:root {
  --brand: #2b6cff;
  --brand-bg: #ecf0ff;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #303133;
  --sub: #909399;
  --border: #ebeef5;
  --red: #ff4d4f;
  --top-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h);
  background: #1f2d3d; color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 9px; object-fit: cover; display: block;
}
.brand-name { font-size: 16px; font-weight: 600; }
.brand-sub { font-size: 12px; color: #bcc4cf; }
.search input {
  width: 260px; height: 36px; border-radius: 18px; border: none; padding: 0 18px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 13px; outline: none;
}
.search input::placeholder { color: #9aa3af; }

.layout { display: flex; margin-top: var(--top-h); min-height: calc(100vh - var(--top-h)); }
.sidebar {
  width: 268px; flex: 0 0 268px; background: #fff; border-right: 1px solid var(--border);
  height: calc(100vh - var(--top-h)); position: sticky; top: var(--top-h);
  overflow-y: auto; padding: 14px 0;
}
.sb-group { margin-bottom: 6px; }
.sb-group-title {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px 6px;
  font-size: 12px; color: var(--sub); font-weight: 600; letter-spacing: .5px;
}
.sb-item {
  display: block; padding: 9px 20px 9px 40px; font-size: 14px; color: var(--text);
  cursor: pointer; border-left: 3px solid transparent; transition: .15s;
}
.sb-item:hover { background: var(--brand-bg); }
.sb-item.active { background: var(--brand-bg); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.sb-item.hidden { display: none; }

.content { flex: 1; padding: 28px 40px 80px; max-width: 1000px; }
.welcome h1 { font-size: 26px; margin-bottom: 14px; }
.welcome p { color: var(--sub); margin-bottom: 10px; font-size: 15px; }
.welcome .tip {
  background: var(--brand-bg); color: var(--brand); padding: 12px 16px; border-radius: 8px;
  font-size: 14px; margin-top: 16px;
}

.article h1 { font-size: 24px; margin-bottom: 6px; }
.article .summary { color: var(--sub); margin-bottom: 22px; font-size: 14px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px 22px; margin-bottom: 16px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex: 0 0 26px;
}
.step-title { font-size: 16px; font-weight: 600; }
.step-body { color: #41464b; font-size: 14.5px; padding-left: 38px; }
.step-img { margin: 14px 38px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.step-img img { width: 100%; display: block; }
.step-cap { font-size: 12.5px; color: var(--sub); padding: 8px 12px; background: #fafbfc; border-top: 1px solid var(--border); }

.menu-toggle {
  display: none; position: fixed; bottom: 22px; right: 22px; width: 50px; height: 50px;
  border-radius: 50%; border: none; background: var(--brand); color: #fff; font-size: 22px;
  box-shadow: 0 4px 14px rgba(43,108,255,.4); z-index: 60; cursor: pointer;
}

@media (max-width: 860px) {
  .search input { width: 150px; }
  .sidebar {
    position: fixed; left: 0; top: var(--top-h); transform: translateX(-100%);
    transition: .25s; z-index: 40; box-shadow: 4px 0 16px rgba(0,0,0,.1);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 20px 16px 80px; }
  .menu-toggle { display: block; }
}

/* ---- Markdown 渲染样式（content/*.md）---- */
.article { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 30px 36px; }
.article h1 { font-size: 24px; margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.article h2 { font-size: 19px; margin: 24px 0 10px; }
.article h3 { font-size: 16px; margin: 18px 0 8px; }
.article p { color: #41464b; font-size: 14.5px; margin-bottom: 12px; }
.article blockquote {
  border-left: 4px solid var(--brand); background: var(--brand-bg); color: var(--brand);
  padding: 10px 16px; border-radius: 0 8px 8px 0; margin: 0 0 16px; font-size: 14px;
}
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { color: #41464b; font-size: 14.5px; margin-bottom: 10px; line-height: 1.7; }
.article li strong { color: var(--text); }
.tut-img {
  display: block; max-width: 100%; height: auto; margin: 10px 0 4px;
  border: 1px solid var(--border); border-radius: 8px;
}
.article a { color: var(--brand); text-decoration: none; }
.article a:hover { text-decoration: underline; }
.loading, .err { color: var(--sub); padding: 20px; }
.err { color: var(--red); }
.edit-tip { background: #fff7e6; color: #ad6800; padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-top: 16px; }
.edit-tip code { background: #fff; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); }
