/* =========================================================
   移动端「信息架构」层
   只在 ≤760px 生效；桌面端不会加载这些节点，样式也全部包在 media query 里。
   解决：长页面里读者不知道"现在在哪、还剩几章、这一章讲什么"。
   ========================================================= */

/* 默认全部隐藏：即使手机上打开后旋转到横屏/放大窗口，
   这些节点也不会以裸样式出现在桌面布局里 */
.m-progress, .m-chapter-fab, .m-sheet, .m-subtoc, .m-nextcase {
  display: none;
}

@media (max-width: 760px) {

  /* ---------- 顶部阅读进度 ---------- */
  .m-progress {
    display: block;
    position: fixed; top: 0; left: 0; right: 0; height: 2px;
    z-index: 60; pointer-events: none;
  }
  .m-progress i {
    display: block; height: 100%; width: 0;
    background: var(--acc);
    transition: width .12s linear;
  }

  /* ---------- 右下角章节按钮 ---------- */
  .m-chapter-fab {
    display: flex;
    position: fixed; right: 14px; bottom: 18px; z-index: 70;
    width: 52px; height: 52px; border-radius: 50%;
    border: 1px solid rgba(255, 107, 26, .55);
    background: rgba(11, 12, 11, .88);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    color: var(--acc);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    font-family: var(--mono); cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  }
  .m-chapter-fab b { font-size: 14px; line-height: 1; font-weight: 700; }
  .m-chapter-fab span { font-size: 9px; letter-spacing: .06em; color: var(--mute); }

  /* ---------- 章节面板 ---------- */
  .m-sheet {
    display: block;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: #0e100e;
    border-top: 1px solid var(--line2);
    border-radius: 14px 14px 0 0;
    padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform .32s var(--ease);
    max-height: 74vh; overflow: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .55);
  }
  .m-sheet.on { transform: none; }
  .m-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    font: 11px var(--mono); color: var(--dim); letter-spacing: .14em;
    margin-bottom: 10px;
  }
  .m-close {
    font: 11px var(--mono); color: var(--mute);
    background: none; border: 0; padding: 6px 0 6px 12px; cursor: pointer;
  }
  .m-sheet ol { display: flex; flex-direction: column; }
  .m-sheet li + li { border-top: 1px solid var(--line); }
  .m-sheet a { display: flex; align-items: baseline; gap: 12px; padding: 13px 2px; }
  .m-sheet a i { font: 11px var(--mono); font-style: normal; color: var(--acc); min-width: 20px; }
  .m-sheet a b { font-size: 15.5px; font-weight: 600; }
  .m-sheet li.on a b { color: var(--acc); }

  /* ---------- 每个案例的「本章」小节入口 ---------- */
  .m-subtoc {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 0 18px;
    margin: -4px 0 28px;
  }
  .m-subtoc > span {
    font: 10.5px var(--mono); color: var(--dim);
    letter-spacing: .1em; margin-right: 2px;
  }
  .m-subtoc button {
    font: 12.5px var(--sans); color: var(--fg);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    border-radius: 99px; padding: 6px 13px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-subtoc button:active { border-color: var(--acc); color: var(--acc); }

  /* ---------- 章末「下一章」 ---------- */
  .m-nextcase {
    display: block;
    margin: 56px 18px 0;
    padding: 20px 18px;
    border: 1px solid var(--line2);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 107, 26, .08), transparent 70%), var(--bg2);
  }
  .m-nextcase span {
    display: block; font: 10.5px var(--mono); color: var(--acc);
    letter-spacing: .14em;
  }
  .m-nextcase b {
    display: block; font-size: 19px; font-weight: 700;
    margin: 6px 0 8px; letter-spacing: -.01em; line-height: 1.3;
  }
  .m-nextcase em { font-style: normal; font: 12px var(--mono); color: var(--mute); }
}
