/* ===== Mini Bread 官网共享样式（模仿 ghostty.org） ===== */
:root {
  --bg: #0f0f12;
  --bg-raise: #17181d;
  --bg-window: #141519;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f3f7;
  --text-dim: rgba(242, 243, 247, 0.6);
  --text-faint: rgba(242, 243, 247, 0.38);
  --accent: #0a84ff;
  --green: #30d158;
  --radius: 14px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
main { flex: 1; }

/* ===== Nav ===== */
nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: rgba(15, 15, 18, 0.72);
  border-bottom: 1px solid var(--border);
}
nav .wrap { display: flex; align-items: center; height: 58px; gap: 28px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand .logo { font-size: 19px; }
nav .links { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14.5px; color: var(--text-dim); }
nav .links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.38); }
.btn-lg { padding: 12px 34px; font-size: 16px; border-radius: 12px; }
.btn-wide { width: 100%; padding: 13px 20px; }

/* ===== 窗口（首页核心视觉） ===== */
.window {
  background: var(--bg-window);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.window-title {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 14px; font-weight: 600; color: rgba(242, 243, 247, 0.75);
  pointer-events: none;
}

/* ===== Footer ===== */
footer { border-top: 1px solid var(--border); padding: 30px 0 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 13.5px; color: var(--text-faint); }
footer .left { display: flex; gap: 22px; }
footer .right { margin-left: auto; }
footer a:hover { color: var(--text); }

@media (max-width: 640px) {
  nav .links { gap: 16px; font-size: 13.5px; }
}


/* ===== 面板还原 mock（按 panel.css 真实值；首页与文档页共用） ===== */
.panel {
  background: #1d1d1d;
  padding: 12px 12px 14px;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 11px; text-align: left;
  user-select: none;
}
.p-top { display: flex; gap: 8px; align-items: center; }
.p-seg {
  flex: 1; display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: 999px; padding: 3px;
}
.p-seg span {
  flex: 1; text-align: center; padding: 4px 0;
  font-weight: 500; color: rgba(255,255,255,0.6);
  border-radius: 999px; white-space: nowrap;
}
.p-seg span.on { color: #fff; font-weight: 600; background: rgba(255,255,255,0.12); }
.p-gear {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
}
.p-gear svg { width: 16.5px; height: 16.5px; }

.p-slider-row { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.p-slider {
  position: relative; flex: 1; height: 18px; border-radius: 5px;
  background: rgba(255,255,255,0.09); overflow: hidden;
}
.p-slider .fill { position: absolute; inset: 0 auto 0 0; width: 90%; background: rgba(255,255,255,0.13); }
.p-slider .ticks { position: absolute; inset: 0; }
.p-slider .ticks i {
  position: absolute; top: 50%; width: 2px; height: 5px; margin-top: -2.5px;
  background: rgba(255,255,255,0.28); border-radius: 1px;
}
.p-slider .thumb {
  position: absolute; top: 50%; left: 90%;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.p-pct { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

.p-opts { display: flex; align-items: center; gap: 6px; }
.p-pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 999px; background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6); font-weight: 600; white-space: nowrap;
}
.p-pill.set { color: #fff; }
.p-res { display: inline-flex; align-items: center; height: 28px; padding: 0 9px; gap: 5px;
  border-radius: 999px; background: rgba(255,255,255,0.08); }
.p-res em { font-style: normal; color: rgba(255,255,255,0.35); font-weight: 600; min-width: 20px; text-align: center; }
.p-res svg { width: 12px; height: 12px; color: rgba(255,255,255,0.45); }
.p-size { margin-left: auto; display: inline-flex; align-items: center; height: 28px; padding: 0 11px; gap: 5px;
  border-radius: 999px; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.35); font-weight: 600; }
.p-size .unit { color: rgba(255,255,255,0.6); }

.p-actions { display: flex; align-items: center; gap: 8px; }
.p-ic {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
}
.p-ic svg { width: 16.5px; height: 16.5px; }
.p-ic.on { background: var(--accent); color: #fff; }
.p-bg { width: 25px; height: 25px; border-radius: 50%; flex-shrink: 0; }
.p-bg.b { background: #505050; }
.p-bg.w { background: #b0b0b0; }
.p-export {
  position: relative; flex: 1; height: 32px; border-radius: 999px;
  background: #0a84ff; color: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: background .3s ease;
}
.p-export .p-fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: rgba(255,255,255,0.28); }
.p-export .p-label {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
}
.p-export.done { background: #30d158; }
.p-export.done .p-fill { display: none; }
.p-export.locked { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.4); }

/* mock 中的辅助元素 */
.p-note { font-size: 10.5px; color: rgba(255,255,255,0.4); text-align: center; padding: 2px 0 0; }
.p-strip {
  border: 1.5px dashed rgba(255,255,255,0.28); border-radius: 12px;
  background: rgba(255,255,255,0.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 14px; text-align: center;
}
.p-strip .t { font-size: 12px; font-weight: 600; color: #fff; }
.p-strip .s { font-size: 10.5px; color: rgba(255,255,255,0.6); }
.p-queue { border-radius: 12px; background: rgba(255,255,255,0.04); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.p-queue .qh { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.6); }
.p-queue .qbadge { margin-left: auto; font-size: 10px; padding: 1px 8px; border-radius: 999px; background: rgba(7,193,96,0.2); color: #07c160; font-weight: 700; }
.p-queue .qi { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,0.85); font-weight: 500; }
.p-queue .qi .dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.p-queue .qi .sz { margin-left: auto; color: rgba(255,255,255,0.35); font-size: 10px; }

/* ===== 文档页布局（仿 ghostty.org/docs） ===== */
.docs { display: flex; min-height: calc(100vh - 58px); }
.side { flex: 0 0 240px; border-right: 1px solid var(--border); }
.side-inner { position: sticky; top: 86px; padding: 36px 18px 60px 28px; }
.side a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim);
}
.side a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.side a.on { background: var(--accent); color: #fff; font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 40px 48px 90px; max-width: 800px; }
.crumb { font-size: 13px; color: var(--text-faint); border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.content h1 { margin-top: 26px; font-size: 34px; font-weight: 750; letter-spacing: -0.02em; }
.content .lead { margin-top: 12px; font-size: 16px; color: var(--text-dim); }
.content h2 { margin-top: 56px; font-size: 24px; font-weight: 700; letter-spacing: -0.015em; scroll-margin-top: 80px; }
.content h3 { margin-top: 30px; font-size: 17px; font-weight: 650; scroll-margin-top: 80px; }
.content p { margin-top: 12px; font-size: 15px; color: var(--text-dim); }
.content p b, .content li b { color: var(--text); font-weight: 600; }
.content code { font-family: var(--font-mono); font-size: 0.88em; background: rgba(255,255,255,0.07); padding: 2px 7px; border-radius: 6px; }
.content ul, .content ol { margin: 12px 0 0 22px; font-size: 15px; color: var(--text-dim); }
.content li { margin-top: 6px; }
.content li + li { margin-top: 8px; }
.content .hr { border: none; border-top: 1px solid var(--border); margin: 52px 0 0; }
.content .btn-row { margin-top: 22px; display: flex; gap: 14px; flex-wrap: wrap; }
.content .btn-row .btn { flex: 1; max-width: 300px; padding: 13px 20px; }

/* ===== 图解（figure）：mock + 序号标注 + 逐条讲解 ===== */
.fig {
  margin-top: 20px;
  border: 1px solid var(--border); border-radius: 16px;
  background: #141519; overflow: hidden;
}
.fig .fig-bar {
  padding: 9px 16px; font-size: 12px; color: var(--text-faint);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  font-family: var(--font-mono);
}
.fig .fig-body { padding: 18px; }
.fig .fig-body.panel { padding: 14px; }
.num {
  position: absolute; top: -9px; left: -9px; z-index: 3;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
  font-style: normal;
  box-shadow: 0 0 0 3px #1d1d1d;
}
.num.right { left: auto; right: -9px; }
.has-num { position: relative; }
ol.legend { list-style: none; counter-reset: n; margin: 16px 0 0; padding: 0; }
ol.legend > li {
  counter-increment: n; position: relative;
  padding-left: 34px; margin-top: 12px;
  font-size: 14.5px; color: var(--text-dim);
}
ol.legend > li::before {
  content: counter(n);
  position: absolute; left: 0; top: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
ol.legend b { color: var(--text); font-weight: 650; }

/* 对照表 */
.tbl { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tbl .tr { display: flex; border-top: 1px solid var(--border); font-size: 14px; }
.tbl .tr:first-child { border-top: none; }
.tbl .tr.head { background: rgba(255,255,255,0.03); color: var(--text); font-weight: 600; font-size: 13px; }
.tbl .td { padding: 11px 16px; color: var(--text-dim); flex: 1; }
.tbl .td.k { flex: 0 0 150px; font-weight: 650; color: var(--text); }
.tbl .td.mono { font-family: var(--font-mono); font-size: 13px; }

.tip {
  margin-top: 16px; border-left: 3px solid var(--accent);
  background: rgba(10,132,255,0.08); border-radius: 0 10px 10px 0;
  padding: 12px 16px; font-size: 14px; color: var(--text-dim);
}
.tip b { color: var(--text); }
.warn { border-left-color: #e3b341; background: rgba(227,179,65,0.08); }

@media (max-width: 800px) {
  .docs { flex-direction: column; }
  .side { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
  .side-inner { position: static; padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 4px; }
  .content { padding: 28px 22px 70px; }
  .tbl .td.k { flex-basis: 110px; }
}

/* 图解里的序号角标不被 mock 控件的 overflow 裁掉 */
.fig .p-slider, .fig .p-export, .fig .p-seg { overflow: visible; }
.fig .p-export .p-fill { border-radius: 999px 0 0 999px; overflow: hidden; }
