/* ===========================================================================
   read-only-git — 主题层

   视觉语言对齐 GitHub 的公开设计规范：1px 细边框、6px 圆角、灰底面板头、
   选中 tab 用底部色条标记。配色取 GitHub 的实际色值，样式全部自己写。

   换肤：改下面这段变量即可。
   =========================================================================== */

:root {
  --bg:                #ffffff;
  --bg-subtle:         #f6f8fa;
  --bg-inset:          #f6f8fa;
  --text:              #1f2328;
  --text-muted:        #59636e;
  --border:            #d1d9e0;
  --border-strong:     #b7bfc7;
  --accent:            #0969da;
  --accent-soft:       #ddf4ff;
  --accent-mark:       #fd8c73;
  --success:           #1a7f37;
  --danger:            #cf222e;
  --warn:              #9a6700;
  --pill-bg:           #eff2f5;
  --hover:             #f6f8fa;

  --radius:            6px;
  --radius-sm:         4px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
          Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --page-width:        1280px;
  --side-width:        296px;

  /* 间距走 4px 网格，字号走阶梯。组件里不再随手写数字 */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;

  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 14px;
  --fs-md:   15px;
  --fs-lg:   17px;
  --fs-xl:   20px;
  --fs-2xl:  26px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0d1117;
    --bg-subtle:     #151b23;
    --bg-inset:      #1c232c;
    --text:          #f0f6fc;
    --text-muted:    #9198a1;
    --border:        #3d444d;
    --border-strong: #656c76;
    --accent:        #4493f8;
    --accent-soft:   #121d2f;
    --accent-mark:   #f78166;
    --success:       #3fb950;
    --danger:        #f85149;
    --warn:          #d29922;
    --pill-bg:       #212830;
    --hover:         #151b23;
  }
}

:root[data-theme="dark"] {
  --bg:            #0d1117;
  --bg-subtle:     #151b23;
  --bg-inset:      #1c232c;
  --text:          #f0f6fc;
  --text-muted:    #9198a1;
  --border:        #3d444d;
  --border-strong: #656c76;
  --accent:        #4493f8;
  --accent-soft:   #121d2f;
  --accent-mark:   #f78166;
  --success:       #3fb950;
  --danger:        #f85149;
  --warn:          #d29922;
  --pill-bg:       #212830;
  --hover:         #151b23;
}

/* --- base ---------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); font-size: 0.92em; }

.muted { color: var(--text-muted); }

h1 { font-size: 20px; font-weight: 600; margin: 0 0 8px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }

/* --- 图标 ---------------------------------------------------------------- */

/* 手绘 SVG 的描边规格统一在这里给，形状本身只管路径（见 icons.js）。
   currentColor 跟随主题，深浅色都不用单独处理。 */
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  opacity: .85;
}

/* --- 头像 ---------------------------------------------------------------- */

/* 提交者的首字母色块，颜色由 JS 按 email 散列后内联过来。
   白字配中等亮度的底，任何色相上对比都够。 */
.avatar {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
  user-select: none;
}

/* --- 加载骨架 ------------------------------------------------------------ */

/* 只做透明度起伏，不闪光不位移：它是状态反馈，不是装饰。 */
.sk {
  background: var(--pill-bg);
  border-radius: var(--radius-sm);
  animation: sk-breathe 1.4s ease-in-out infinite;
}
.sk-line { height: 12px; margin: 11px var(--sp-4); }
.sk-bar  { height: 14px; }
.sk-hint { margin: var(--sp-3) 2px; font-size: var(--fs-sm); }

@keyframes sk-breathe {
  0%, 100% { opacity: .5; }
  50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
}

/* --- 可达性 -------------------------------------------------------------- */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- 外层框架 ------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px max(16px, calc((100% - var(--page-width)) / 2));
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
}

.crumbs .sep { color: var(--text-muted); }

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* --- 仓库头 -------------------------------------------------------------- */

.repo-header { margin-bottom: 16px; }

.repo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.repo-mark { width: 20px; height: 20px; color: var(--text-muted); }

.repo-name { font-size: 20px; font-weight: 600; }

.repo-desc {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 820px;
}

.pill {
  display: inline-block;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--text-muted);
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 2em;
  white-space: nowrap;
}

.pill-muted { color: var(--text-muted); }

/* --- tab 导航 ------------------------------------------------------------ */

.repo-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--hover);
  text-decoration: none;
  border-bottom-color: var(--border-strong);
}

.nav-item.is-active {
  font-weight: 600;
  border-bottom-color: var(--accent-mark);
}

.nav-count {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  border-radius: 2em;
  color: var(--text-muted);
}

/* --- 两栏 ---------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-width);
  gap: 24px;
  align-items: start;
}

.layout-main { min-width: 0; }
.layout-side { position: sticky; top: 68px; }

@media (max-width: 1012px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout-side { position: static; }
}

/* --- panel --------------------------------------------------------------- */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--bg);
}

/* 面板不能用 overflow: hidden 来修圆角：那样会把内部浮层（比如 ref 下拉）
   连同它溢出边框的部分一起剪掉，且被剪掉的部分点不到。
   改成让首尾子元素各自贴合圆角。 */
.panel > :first-child {
  border-top-left-radius: calc(var(--radius) - 1px);
  border-top-right-radius: calc(var(--radius) - 1px);
}

.panel > :last-child {
  border-bottom-left-radius: calc(var(--radius) - 1px);
  border-bottom-right-radius: calc(var(--radius) - 1px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  flex-wrap: wrap;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.doc-ico { font-size: 14px; }

/* --- 文件工具栏 ---------------------------------------------------------- */

.file-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}

.branch-chip {
  padding: 3px 10px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

/* --- ref 选择器 ---------------------------------------------------------- */

.ref-wrap {
  position: relative;
  display: inline-flex;
}

.ref-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  padding: 3px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ref-button:hover { background: var(--bg-subtle); }

.ref-caret {
  font-size: 10px;
  opacity: .65;
}

.ref-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 220px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  overflow: hidden;
}

/* hidden 属性只是 UA 样式里的 [hidden]{display:none}，优先级最低，
   会被上面的 display:flex 盖掉——表现得就像菜单永远展开、点也切不动。
   这里显式让 [hidden] 生效。 */
.ref-menu[hidden] { display: none; }

/* 分支 / 标签两个平级分页，避免两组混在一列里分不清 */
.ref-tabs {
  display: flex;
  flex: none;
  padding: 4px 4px 0;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.ref-tab {
  flex: 1;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.ref-tab:hover { color: var(--text); }

.ref-tab.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent-mark);
}

.ref-menu-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* 默认滚动条带一层白底，在菜单里很抢眼；把轨道改成透明 */
.ref-menu-list::-webkit-scrollbar { width: 8px; }
.ref-menu-list::-webkit-scrollbar-track { background: transparent; }
.ref-menu-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.ref-menu-list::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

.ref-menu-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.ref-menu-item {
  display: block;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}

.ref-menu-item:hover { background: var(--bg-subtle); }
.ref-menu-item.is-current { font-weight: 600; }

.toolbar-commit {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.toolbar-right { white-space: nowrap; }

/* --- 文件列表 ------------------------------------------------------------ */

.file-list { list-style: none; margin: 0; padding: 0; }

.file-list li { border-bottom: 1px solid var(--border-soft); }
.file-list li:last-child { border-bottom: none; }

.file-list a {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  height: 38px;
  color: var(--text);
  font-size: var(--fs-sm);
}

.file-list a:hover { background: var(--hover); text-decoration: none; }

.file-list .icon { color: var(--text-muted); transition: color .1s; }
.file-list a:hover .icon { color: var(--accent); }

.file-name {
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name.is-dir { color: var(--accent); font-weight: 500; }

.file-sha {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  opacity: .7;
}

@media (max-width: 720px) {
  .file-sha { display: none; }
}

/* --- blob ---------------------------------------------------------------- */

.blob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}

.blob-path { font-family: var(--mono); }

.blob-meta { display: flex; align-items: center; gap: 10px; }

.blob-image { padding: 16px; text-align: center; background: var(--bg); }
.blob-image img { max-width: 100%; }

pre.blob {
  margin: 0;
  padding: var(--sp-4) 0;
  overflow-x: auto;
  background: var(--bg);
  line-height: 1.55;
  tab-size: 4;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}

/* 行号栏与正文之间一条分隔线，选中代码时行号不跟着进去 */
pre.blob .line-no {
  display: inline-block;
  width: 3.5em;
  padding-right: var(--sp-3);
  margin-right: var(--sp-4);
  text-align: right;
  color: var(--text-muted);
  user-select: none;
  border-right: 1px solid var(--border-soft);
  opacity: .75;
}

.notice {
  padding: 16px;
  background: var(--bg-inset);
  color: var(--text-muted);
  font-size: 13px;
}

.binary-note { color: var(--warn); }

.error {
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  background: var(--bg-subtle);
  font-family: var(--mono);
  font-size: 13px;
  white-space: pre-wrap;
}

/* --- 提交历史 ------------------------------------------------------------ */

.commit-list { list-style: none; margin: 0; padding: 0; }

.commit-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-soft);
}

.commit-list li:last-child { border-bottom: none; }

.commit-body { flex: 1; min-width: 0; }

/* 标题本身就是入口（点它进浏览），所以颜色留在正文色系，
   免得整列表都是链接蓝；hover 才亮出来 */
a.commit-subject {
  color: var(--text);
  text-decoration: none;
}

a.commit-subject:hover { color: var(--accent); text-decoration: underline; }

.commit-subject {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.commit-side {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  white-space: nowrap;
}

.commit-sha { color: var(--text-muted); }

/* --- 分支 / 标签列表 ----------------------------------------------------- */

.ref-list { list-style: none; margin: 0; padding: 0; }

.ref-list li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-soft);
}

.ref-list li:last-child { border-bottom: none; }

.ref-ico { width: 15px; height: 15px; color: var(--text-muted); }

.ref-main { flex: 1; min-width: 0; }

.ref-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
}

.ref-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-meta code { color: var(--text-muted); }

.ref-side { font-size: 12px; white-space: nowrap; }

/* --- 右栏 ----------------------------------------------------------------- */

.side-panel { margin-bottom: 16px; }

.side-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.side-body { font-size: 12px; }

.about-desc {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text);
  overflow-wrap: break-word;
}

.about-list { list-style: none; margin: 0; padding: 0; }

.about-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--text-muted);
  min-width: 0;
}

.about-list li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.about-ico { width: 14px; height: 14px; color: var(--text-muted); }

.about-clone {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
}

.copy-btn {
  flex: none;
  font: inherit;
  font-size: 11px;
  padding: 1px 7px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.copy-btn:hover { background: var(--hover); color: var(--text); }

.release-list { list-style: none; margin: 0; padding: 0; }

.release-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  min-width: 0;
}

.tag-ico { width: 14px; height: 14px; color: var(--text-muted); }

.release-list a {
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-more { margin: 8px 0 0; }

/* --- 文档区（README / LICENSE / ...） ------------------------------------ */

.docs-tabs {
  display: flex;
  gap: 4px;
  padding: 0 8px;
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: var(--fs-sm);
  padding: 8px 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.docs-tab .icon { width: 14px; height: 14px; }

.docs-tab:hover { color: var(--text); }

.docs-tab.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent-mark);
}

.docs-panel { overflow: hidden; }

.docs-body { background: var(--bg); }

.docs-loading { margin: 0; padding: 16px 24px; }

/* 纯文本文档（LICENSE 之类）不渲染 Markdown，等宽排 */
pre.doc-text {
  margin: 0;
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* --- README -------------------------------------------------------------- */

.readme-panel .panel-head { justify-content: flex-start; }

.readme { padding: 8px 24px 24px; font-size: 15px; overflow-wrap: break-word; }

.docs-body > .readme { padding: 8px 24px 24px; }

.readme > *:first-child { margin-top: 0; }

.readme h1, .readme h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-2);
  margin: var(--sp-6) 0 var(--sp-4);
}

.readme h1 { font-size: var(--fs-2xl); }
.readme h2 { font-size: var(--fs-xl); }
.readme h3 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-3); }
.readme p { margin: 0 0 var(--sp-4); }
.readme ul, .readme ol { margin: 0 0 var(--sp-4); padding-left: 26px; }
.readme li { margin: var(--sp-1) 0; }

.readme img { max-width: 100%; border-radius: var(--radius-sm); }

/* 表格斑马：长表格逐行对齐视线 */
.readme tr:nth-child(2n) { background: var(--bg-subtle); }

/* 折叠块：README 里的「展开看细节」，给它一个轻盒而不是裸文本 */
.readme details {
  margin: 0 0 var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--sp-4);
  background: var(--bg-subtle);
}

.readme summary {
  cursor: pointer;
  padding: var(--sp-3) 0;
  font-weight: 500;
}

.readme details > *:last-child { margin-bottom: var(--sp-4); }

.readme a { text-decoration: none; }
.readme a:hover { text-decoration: underline; }

.readme code {
  background: var(--pill-bg);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 85%;
}

.readme pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}

.readme pre code { background: none; padding: 0; font-size: 100%; }

.readme blockquote {
  margin: 0 0 16px;
  padding: 0 16px;
  border-left: 4px solid var(--border);
  color: var(--text-muted);
}

.readme table {
  border-collapse: collapse;
  margin-bottom: 16px;
  display: block;
  overflow-x: auto;
}

.readme th, .readme td {
  border: 1px solid var(--border);
  padding: 6px 13px;
}

.readme th { font-weight: 600; background: var(--bg-inset); }

.readme hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* --- 首页 ---------------------------------------------------------------- */

.repo-list { list-style: none; margin: 0; padding: 0; }

.repo-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg);
}

.repo-list li:hover { border-color: var(--border-strong); }

.repo-list a { display: block; padding: 14px 16px; color: inherit; }
.repo-list a:hover { text-decoration: none; background: var(--hover); }

.repo-list .name {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-family: var(--mono);
  color: var(--accent);
  font-size: 15px;
}

.repo-list-ico { color: var(--text-muted); }

.repo-list .desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* --- 杂项 ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: var(--fs-xs);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn .icon { width: 14px; height: 14px; }

.btn:hover { background: var(--hover); text-decoration: none; }

.crumbs + .panel, .crumbs ~ .panel { margin-top: 0; }

.layout-main > .crumbs { margin-bottom: 16px; }

/* 窄屏收一收：页面留白与侧边信息让位给正文 */
@media (max-width: 560px) {
  .page { padding: var(--sp-4) 10px 48px; }
  .commit-side { gap: var(--sp-2); }
  .ref-side { display: none; }
}
