
:root{
  --bg:#fafafa;
  --card:#ffffff;
  --text:#222;
  --muted:#666;
  --line:rgba(0,0,0,.08);
  --hover:rgba(0,0,0,.04);
  --active:rgba(0,0,0,.06);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.7;
}

.header{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(250,250,250,.92);
  backdrop-filter:saturate(120%) blur(8px);
  border-bottom:1px solid var(--line);
}
.header-inner{
  max-width:1100px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  gap:12px;
  align-items:center;
}
.brand{ font-weight:900; }
.header a{ color:inherit; text-decoration:none; }
.header a:hover{ text-decoration:underline; }

.layout{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
  display:flex;
  gap:16px;
  align-items:flex-start;
}

.sidebar{
  width:280px;
  position:sticky;
  top:56px;
  max-height: calc(100vh - 72px);
  overflow:auto;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
}
.sidebar h2{
  font-size:14px;
  margin:0 0 10px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.02em;
}
.toc a{
  display:block;
  padding:6px 8px;
  border-radius:10px;
  text-decoration:none;
  color:inherit;
  font-size:14px;
  line-height:1.35;
}
.toc a:hover{ background:var(--hover); }
.toc a.active{ background:var(--active); font-weight:900; }
.toc a[data-level="1"]{ font-weight:900; }
.toc a[data-level="2"]{ padding-left:18px; }
.toc a[data-level="3"]{ padding-left:34px; }
.toc a[data-level="4"]{ padding-left:50px; color:var(--muted); }

.content{
  flex:1;
  min-width:0;
}

/* 标题/段落可读性增强 */
.c1{ text-align:center; font-weight:900; font-size:26px; margin:18px 0 10px; }
.c2{ text-align:center; font-weight:800; font-size:18px; margin:10px 0 10px; color:#333; }
.c3{ text-align:left; font-weight:800; font-size:16px; margin:18px 0 8px; padding:6px 10px; background:#f0f0f0; border-left:4px solid #888; border-radius:8px; }
.c4{ text-align:left; font-weight:700; font-size:15px; margin:12px 0 6px; color:#444; }

.para{
  margin:0 0 10px;
  padding:8px 10px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.pno{
  display:inline-block;
  width:3.5em;
  text-align:left;
  vertical-align:top;
  font-weight:900;
  color:var(--muted);
}
.pbody{
  display:inline-block;
  width: calc(100% - 3.5em);
  text-align:left;
  vertical-align:top;
  word-break: break-word;
}

/* 锚点滚动上方留白 */
.c1,.c2,.c3,.c4{ scroll-margin-top:70px; }

/* 索引页树状列表 */
.tree{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
}
.tree details{ padding:4px 0; }
.tree summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  gap:10px;
  align-items:baseline;
}
.tree summary::-webkit-details-marker{ display:none; }
.tree .label{ font-weight:800; }
.tree .count{ color:var(--muted); font-variant-numeric:tabular-nums; }
.tree a{ color:inherit; text-decoration:none; }
.tree a:hover{ text-decoration:underline; }

@media (max-width: 980px){
  .layout{
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .content{
    flex: 1;
    min-width: 0;
  }

  .sidebar{
    width: clamp(120px, 34vw, 280px);
    flex: 0 0 clamp(120px, 34vw, 280px);

    position: sticky;
    top: 56px;

    max-height: calc(100vh - 72px);
    overflow: auto;

    padding: 8px;
  }

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

  .toc a[data-level="2"]{ padding-left:12px; }
  .toc a[data-level="3"]{ padding-left:20px; }
  .toc a[data-level="4"]{ padding-left:28px; }
}

/* ===== 索引折叠箭头（静态） ===== */

/* summary 行布局 */
.tree summary{
  cursor:pointer;
  display:flex;
  align-items:baseline;
  gap:8px;
}

/* 隐藏浏览器默认 marker（Safari/Chrome） */
.tree summary::-webkit-details-marker{
  display:none;
}

/* 箭头*/
.tree summary::before{
  content:"▶";
  font-size:11px;
  line-height:1;
  color:var(--muted);
  margin-top:2px; /* 箭头更贴合文字基线*/
}

/* 展开状态：箭头变 ▼ */
.tree details[open] > summary::before{
  content:"▼";
}

/* 让 summary 的标题区域更易点中 */
.tree summary{
  padding:4px 6px;
  border-radius:10px;
}
.tree summary:hover{
  background:var(--hover);
}


