/* ============================================================
   阅读工具条 · 龙龙侠2 · v1（2026-10-15）
   给"没有阅读控件"的文章页/公众号页补上：字号 / 目录 / 翻页 / 回顶
   书页（已自带 改字号/切目录/切翻页）自动跳过，不重复。
   全部只在"阅读页"注入；不碰门面/落地页。
   可逆：删掉页面里的两行 <link>/<script> 即回原样。
   ============================================================ */
#xhtb-root, #xhtb-root * { box-sizing: border-box; }

/* 工具条本体：桌面右下竖排胶囊 */
#xhtb-root {
  position: fixed; z-index: 99998;
  right: 18px; bottom: 96px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#xhtb-root .xhtb-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(150,110,70,.28);
  background: rgba(255,252,247,.96);
  color: #7a4e2c; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 14px rgba(90,60,30,.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .12s ease, background .12s ease;
  user-select: none; padding: 0;
}
#xhtb-root .xhtb-btn:hover { transform: translateY(-1px); background: #fff; }
#xhtb-root .xhtb-btn:active { transform: scale(.94); }
#xhtb-root .xhtb-btn.主 { background: #8a5a2b; color: #fff; border-color: #8a5a2b; }
#xhtb-root .xhtb-btn.小字 { font-size: 13px; font-weight: 700; }

/* 字号气泡 */
#xhtb-字号提示 {
  position: fixed; right: 76px; bottom: 50%; transform: translateY(50%);
  background: rgba(60,40,22,.92); color: #fff; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; z-index: 99999;
  opacity: 0; transition: opacity .18s; pointer-events: none;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#xhtb-字号提示.显 { opacity: 1; }

/* 目录浮层 */
#xhtb-遮 {
  position: fixed; inset: 0; background: rgba(30,20,10,.42);
  z-index: 99990; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#xhtb-遮.开 { opacity: 1; pointer-events: auto; }
#xhtb-目录 {
  position: fixed; top: 0; right: 0; height: 100%; width: min(84vw, 360px);
  background: #fdfaf5; border-left: 1px solid #e6dcc9;
  z-index: 99993; transform: translateX(105%); transition: transform .24s ease;
  box-shadow: -6px 0 30px rgba(60,40,20,.16);
  display: flex; flex-direction: column;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
#xhtb-目录.开 { transform: translateX(0); }
#xhtb-目录 h3 {
  margin: 0; padding: 20px 22px 14px; font-size: 17px; color: #6b4423;
  border-bottom: 1px solid #ece2d0; letter-spacing: 2px; font-weight: 700;
}
#xhtb-目录 .xhtb-toc-list { overflow-y: auto; padding: 8px 0 40px; }
#xhtb-目录 a {
  display: block; padding: 11px 22px; color: #5a4a38; text-decoration: none;
  font-size: 15px; line-height: 1.5; border-left: 3px solid transparent;
}
#xhtb-目录 a:hover { background: #f6efe3; border-left-color: #c8a35f; }
#xhtb-目录 a.二 { padding-left: 40px; font-size: 14px; color: #6f5f4c; }
#xhtb-目录 .xhtb-toc-空 { padding: 20px 22px; color: #9a8b7a; font-size: 14px; }

/* 手机：底部横条 */
@media (max-width: 640px) {
  #xhtb-root {
    right: 0; left: 0; bottom: 0; flex-direction: row;
    justify-content: space-around; align-items: center; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,252,247,.97); border-top: 1px solid #e6dcc9;
    box-shadow: 0 -3px 16px rgba(90,60,30,.12);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  #xhtb-root .xhtb-btn {
    width: auto; height: 40px; flex: 1; border-radius: 10px;
    box-shadow: none; font-size: 15px;
  }
  #xhtb-root .xhtb-btn.主 { background: transparent; color: #7a4e2c; border-color: transparent; }
  #xhtb-字号提示 { bottom: 76px; right: 50%; transform: translateX(50%); }
  body.有阅读工具条 { padding-bottom: 56px; }
}

/* ============ 阅读记忆提示条 ============ */
#xhtb续读 {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: rgba(60,40,22,.94); color: #fff; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; z-index: 99997;
  box-shadow: 0 6px 24px rgba(40,25,10,.28); display: flex; align-items: center; gap: 12px;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; max-width: 92vw;
}
#xhtb续读.显 { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#xhtb续读 a { color: #ffd97a; cursor: pointer; text-decoration: none; white-space: nowrap; }
#xhtb续读 .x { opacity: .6; cursor: pointer; padding: 0 2px; }
@media (max-width: 640px) {
  #xhtb续读 { bottom: 68px; font-size: 13px; padding: 9px 13px; }
}
