/* 查经工具 bible_study.php（2026-10-27）：一张「查经台」——经文是台面，原文/串珠/注释是摊在旁边的参考书。
 * 手机：经文铺满，点节后底部升起抽屉；宽屏或左右双屏：两栏同屏；上下双屏（半折书本模式）：上经文下参考。 */

.bs-body {
  --bs-paper: #FBF9F4;
  --bs-ink: #22252b;
  --bs-muted: #6b7280;
  --bs-line: #E6E0D4;
  --bs-gold: var(--v2-gold, #D4A843);
  --bs-sel: #F5E9C8;
  --bs-wj: #8a4436;
  --bs-top: 0px;      /* 网站导航栏（fixed）的高度，脚本量出来填 */
  --bs-navy: var(--v2-navy, #1B3A6B);
  --bs-fs: 19px;
  --bs-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --bs-greek: "Times New Roman", "Palatino Linotype", Palatino, "Noto Serif", serif;
  --bs-sheet: 58vh;
  background: var(--bs-paper);
}
.bs-wrap { max-width: 1240px; margin: 0 auto; padding: var(--bs-top) 16px 40px; }   /* 导航栏是 fixed，不占位：顶部留出它的高度 */

/* ── 顶栏 ── */
.bs-bar {
  position: sticky; top: var(--bs-top); z-index: 20; display: flex; align-items: center; gap: 6px;
  padding: 10px 0; background: var(--bs-paper); border-bottom: 1px solid var(--bs-line);
}
.bs-bar-btn, .bs-bar-ref, .bs-x {
  border: 0; background: none; color: var(--bs-navy); font: inherit; cursor: pointer; border-radius: 8px;
  min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
}
.bs-bar-btn { font-size: 26px; line-height: 1; }
.bs-bar-btn:disabled { color: #c9c4b8; cursor: default; }
.bs-bar-ref { font-family: var(--bs-serif); font-size: 20px; font-weight: 600; padding: 0 10px; }
.bs-bar-ref span { font-size: 12px; color: var(--bs-muted); margin-left: 2px; }
.bs-bar-aa { font-family: var(--bs-serif); font-size: 17px; }
.bs-bar-sp { flex: 1; }
.bs-bar-btn:focus-visible, .bs-bar-ref:focus-visible, .bs-x:focus-visible, .bs-v:focus-visible { outline: 2px solid var(--bs-gold); outline-offset: 2px; }

/* ── 经文 ── */
.bs-desk { display: block; }
.bs-text {
  max-width: 680px; margin: 0 auto; padding: 22px 0 0;
  font-family: var(--bs-serif); font-size: var(--bs-fs); line-height: 1.75; color: var(--bs-ink);
}
.bs-para { margin: 0 0 0.9em; text-indent: 0; }
.bs-poetry { padding-left: 1.2em; }
.bs-ind { display: inline-block; width: 0; }
.bs-ind-q2, .bs-ind-q3 { width: 1.4em; }
.bs-ps-title { font-style: italic; color: var(--bs-muted); }
.bs-v { cursor: pointer; border-radius: 4px; transition: background-color .2s ease; -webkit-tap-highlight-color: transparent; }
.bs-v:hover { background: rgba(212, 168, 67, 0.10); }
.bs-v.is-sel { background: var(--bs-sel); box-shadow: -6px 0 0 var(--bs-sel), 6px 0 0 var(--bs-sel); }
.bs-vn { font-family: var(--v2-font-sans); font-size: 0.58em; font-weight: 600; color: var(--bs-gold); margin-right: 3px; vertical-align: 0.55em; }
.bs-cuvn { font-family: var(--v2-font-sans); font-size: 0.5em; color: var(--v2-text-muted, #888); margin: 0 2px; vertical-align: 0.55em; }   /* 1919 把一节分成两节时，第二段前标 1919 的节号 */
.bs-wj { color: var(--bs-wj); }
.bs-fn {
  border: 0; background: none; padding: 0 2px; margin: 0; font-size: 0.7em; vertical-align: 0.5em;
  color: var(--bs-muted); cursor: pointer; line-height: 1;
}
.bs-src { font-family: var(--v2-font-sans); font-size: 13px; color: var(--bs-muted); margin: 26px 0 0; line-height: 1.6; }
.bs-src a { color: var(--bs-navy); }
.bs-hint { display: block; }

/* 脚注小气泡 */
.bs-pop {
  position: fixed; z-index: 60; max-width: min(360px, calc(100vw - 32px)); padding: 10px 12px;
  background: #fff; color: var(--bs-ink); border: 1px solid var(--bs-line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14); font-size: 14px; line-height: 1.55;
}

/* ── 参考栏（抽屉） ── */
.bs-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--bs-sheet);
  display: flex; flex-direction: column; background: #fff; border-top: 1px solid var(--bs-line);
  border-radius: 16px 16px 0 0; box-shadow: 0 -10px 34px rgba(27, 58, 107, .14);
  padding-bottom: env(safe-area-inset-bottom);
  transition: height .25s ease;
}
.bs-panel[hidden] { display: none; }
.bs-panel.is-full { height: 92vh; }
.bs-panel-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px 0 16px; position: relative; }
.bs-grip { position: absolute; left: 50%; top: 5px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #d9d3c6; }
.bs-panel-ref { flex: 1; font-family: var(--bs-serif); font-size: 17px; padding-top: 10px; color: var(--bs-navy); }
.bs-x { font-size: 22px; color: var(--bs-muted); }
.bs-tabs { display: flex; gap: 4px; padding: 6px 12px 0; border-bottom: 1px solid var(--bs-line); }
.bs-tabs button {
  flex: 1; border: 0; background: none; padding: 9px 4px 10px; font-size: 15px; color: var(--bs-muted);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.bs-tabs button[aria-selected="true"] { color: var(--bs-navy); font-weight: 600; border-bottom-color: var(--bs-gold); }
.bs-panel-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px 28px; font-size: 15px; line-height: 1.6; color: var(--bs-ink); }
.bs-small { font-size: 12.5px; color: var(--bs-muted); line-height: 1.5; }
.bs-sec-h { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--bs-muted); margin: 18px 0 6px; font-weight: 600; }
.bs-sec-h:first-child { margin-top: 0; }
.bs-loading { color: var(--bs-muted); }

/* 原文：希腊词一个个排开，下面是史特朗节选；只有希腊词能点 */
.bs-gwords { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.bs-gw {
  display: inline-flex; flex-direction: column; align-items: flex-start; max-width: 124px;
  border: 1px solid var(--bs-line); background: var(--bs-paper); border-radius: 8px; padding: 4px 8px 5px; cursor: pointer; text-align: left;
}
.bs-gw:hover { border-color: var(--bs-gold); }
.bs-gw.is-on { border-color: var(--bs-gold); background: var(--bs-sel); }
.bs-gw .g { font-family: var(--bs-greek); font-size: 19px; line-height: 1.25; color: var(--bs-ink); }
.bs-gw .gl { font-size: 11.5px; color: var(--bs-muted); max-width: 106px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-card { margin-top: 14px; padding: 14px; border: 1px solid var(--bs-line); border-radius: 12px; background: #fffdf8; }
.bs-card-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bs-lemma { font-family: var(--bs-greek); font-size: 26px; }
.bs-id { font-size: 12px; font-weight: 600; color: var(--bs-navy); background: #EEF2F8; border-radius: 6px; padding: 2px 7px; }
.bs-tr { color: var(--bs-muted); font-style: italic; }
.bs-morph { margin-top: 4px; font-size: 13.5px; color: var(--bs-ink); }
.bs-gloss { margin-top: 8px; }
.bs-gloss .tag { font-size: 11px; color: var(--bs-muted); margin-right: 6px; }
.bs-el { font-family: var(--bs-greek); }
.bs-count { margin-top: 12px; font-weight: 600; color: var(--bs-navy); }
.bs-linkbtn { border: 0; background: none; color: var(--bs-navy); text-decoration: underline; padding: 0; font: inherit; font-size: 13.5px; cursor: pointer; }

/* 串珠 */
.bs-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; background: var(--bs-paper); border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.bs-trail button { border: 0; background: none; color: var(--bs-navy); padding: 2px 4px; cursor: pointer; font: inherit; }
.bs-trail button[aria-current] { font-weight: 700; }
.bs-trail .arr { color: var(--bs-muted); }
.bs-trail .bs-back { margin-left: auto; text-decoration: underline; }
.bs-group { padding: 10px 0; border-bottom: 1px solid #f0ebe1; }
.bs-kw { font-family: var(--bs-serif); font-style: italic; }
.bs-kw .tag, .bs-note-en .tag { font-style: normal; font-size: 10.5px; color: var(--bs-muted); border: 1px solid var(--bs-line); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.bs-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bs-ref {
  border: 1px solid var(--bs-line); background: #fff; color: var(--bs-navy); border-radius: 999px;
  padding: 3px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.bs-ref:hover { border-color: var(--bs-gold); }
.bs-note { margin-top: 6px; font-size: 13.5px; color: #4b5060; }
.bs-kw.bs-kw-zh { font-style: normal; }   /* 中文界面：和合本 1919 本节原文截取的对应词 */
.bs-kw.bs-kw-en { font-size: 12.5px; color: var(--bs-muted); }   /* 中文界面：KJV 英文关键词，灰色小字，待换和合本用字 */
.bs-note.bs-note-en { font-size: 12.5px; color: var(--bs-muted); }   /* 中文界面：TSK 英文原注，标明、字号放小 */
.bs-note-en .tag { margin: 0 6px 0 0; }
.bs-note.bs-pre { white-space: pre-wrap; font-family: Menlo, Consolas, monospace; font-size: 11.5px; overflow-x: auto; }   /* 疑似另一码页的制表图（民 35:4，HOLD）：保留原换行 */
.bs-peek { margin: 4px 0 14px; padding: 12px 14px; border-left: 3px solid var(--bs-gold); background: var(--bs-paper); border-radius: 0 10px 10px 0; }
.bs-peek-ref { font-weight: 600; color: var(--bs-navy); margin-bottom: 4px; }
.bs-peek-text { font-family: var(--bs-serif); font-size: 16px; line-height: 1.65; }
.bs-peek-text sup { font-size: .6em; color: var(--bs-gold); margin-right: 2px; }
.bs-peek-acts { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }

/* 注释 */
.bs-henry-h { font-family: var(--bs-serif); font-size: 16px; color: var(--bs-navy); }
.bs-kind { margin: 8px 0 10px; font-size: 13px; color: var(--bs-muted); }
.bs-kind.is-start { color: #8a5a00; }
.bs-hp { font-family: var(--bs-serif); font-size: 16px; line-height: 1.7; margin: 0 0 .9em; }
.bs-hp.is-anchor { background: var(--bs-sel); box-shadow: -8px 0 0 var(--bs-sel), 8px 0 0 var(--bs-sel); border-radius: 4px; }
.bs-hp a.bs-href { color: var(--bs-navy); text-decoration: underline dotted; cursor: pointer; }
.bs-fold { margin: 10px 0; }
.bs-fold summary { cursor: pointer; color: var(--bs-navy); font-size: 13.5px; }
.bs-fold .bs-hp, .bs-fold p { font-size: 15px; }
.bs-cta { margin: 6px 0 4px; border: 1px solid var(--bs-navy); color: var(--bs-navy); background: #fff; border-radius: 999px; padding: 7px 16px; font-size: 14px; cursor: pointer; }

/* ── 选书选章 ── */
.bs-picker { position: fixed; inset: 0; z-index: 70; background: rgba(20, 26, 40, .38); display: flex; align-items: flex-end; justify-content: center; }
.bs-picker[hidden] { display: none; }
.bs-picker-card { width: 100%; max-width: 720px; max-height: 86vh; display: flex; flex-direction: column; background: #fff; border-radius: 16px 16px 0 0; }
.bs-picker-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 8px 18px; border-bottom: 1px solid var(--bs-line); }
.bs-picker-body { overflow-y: auto; padding: 4px 16px 24px; }
.bs-picker-t { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-muted); margin: 16px 0 6px; }
.bs-book { border-bottom: 1px solid #f1ece2; }
.bs-book summary { padding: 10px 2px; cursor: pointer; font-family: var(--bs-serif); font-size: 17px; }
.bs-book summary small { font-family: var(--v2-font-sans); font-size: 11px; color: #fff; background: var(--bs-gold); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.bs-chs { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; padding: 4px 0 12px; }
.bs-chs a { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 8px; background: var(--bs-paper); color: var(--bs-ink); text-decoration: none; }
.bs-chs a[aria-current] { background: var(--bs-navy); color: #fff; }

/* 手机：抽屉打开时给经文留出底部空间，选中的节能滚到抽屉上方 */
.bs-body.is-open .bs-text { padding-bottom: calc(var(--bs-sheet) + 24px); }

/* ── 宽屏 / 左右双屏：两栏同屏 ── */
@media (min-width: 900px) {
  .bs-desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 36px; align-items: start; }
  .bs-text { margin: 0; }
  .bs-panel, .bs-panel.is-full {
    position: sticky; top: calc(var(--bs-top) + 70px); height: calc(100vh - var(--bs-top) - 90px); border: 1px solid var(--bs-line); border-radius: 14px;
    box-shadow: var(--v2-shadow, 0 4px 24px rgba(27,58,107,.1)); margin-top: 18px;
  }
  .bs-grip, #bsExpand { display: none; }
  .bs-body.is-open .bs-text { padding-bottom: 0; }
  .bs-picker { align-items: center; }
  .bs-picker-card { border-radius: 16px; }
}
/* 折叠屏左右展开：分界对齐折痕（支持 viewport-segments 的浏览器） */
@media (horizontal-viewport-segments: 2) {
  .bs-desk { display: grid; grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
             column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0)); }
  .bs-wrap { max-width: none; padding: 0; }
  .bs-text { padding: 22px 20px 0; }
  .bs-panel, .bs-panel.is-full { position: sticky; top: 0; height: 100vh; border-radius: 0; margin: 0; }
}
/* 半折书本模式（上下两屏）：上半屏经文，下半屏参考栏，分界对齐折痕 */
@media (vertical-viewport-segments: 2) {
  .bs-panel, .bs-panel.is-full { top: env(viewport-segment-top 0 1); height: auto; border-radius: 0; }
  .bs-body.is-open .bs-text { padding-bottom: calc(100vh - env(viewport-segment-bottom 0 0) + 24px); }
  .bs-grip, #bsExpand { display: none; }
}
.bs-hfn { font-family: var(--v2-font-sans); font-size: .78em; color: var(--bs-muted); }   /* 编者脚注（多段小字连排，行内显示） */
/* WEB 空位（路 17:36、徒 8:37 等）：写明留空，不显示成缺数据 */
.bs-gap { font-family: var(--v2-font-sans); font-size: .72em; color: var(--bs-muted); }
.bs-gap-see { font-family: var(--v2-font-sans); font-size: .72em; color: var(--bs-navy); }
.bs-gapnote { margin-bottom: 14px; padding: 10px 12px; background: #FFF7E6; border-radius: 10px; font-size: 13.5px; line-height: 1.55; color: #5a4a2a; }
.bs-ref-bad { color: var(--bs-muted); border-style: dashed; cursor: default; }   /* 底本笔误：目标经节不存在，不可点 */
/* 希伯来原文：从右往左；一个词分前缀 / 主干 / 后缀，各段可点 */
.bs-he { font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", "Arial Hebrew", serif; }
.bs-hwords { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.bs-hw { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--bs-line); background: var(--bs-paper); border-radius: 8px; padding: 4px 6px 5px; max-width: 132px; }
.bs-hsegs { display: inline-flex; flex-direction: row; align-items: baseline; gap: 1px; }
.bs-hs { border: 0; background: none; padding: 0 2px; border-radius: 4px; cursor: pointer; font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", "Arial Hebrew", serif; font-size: 23px; line-height: 1.35; color: var(--bs-ink); }
.bs-hs-prefix, .bs-hs-suffix { color: #8a8f99; }
.bs-hs:hover { background: rgba(212, 168, 67, 0.15); }
.bs-hs.is-on { background: var(--bs-sel); color: var(--bs-ink); }
.bs-hjoin { font-size: 20px; color: var(--bs-muted); }
.bs-hgl { font-size: 11.5px; color: var(--bs-muted); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-attr { margin-top: 14px; }
/* 资料来源与许可：默认收起 */
.bs-lic summary { cursor: pointer; }
.bs-lic p { margin: 6px 0 0; }
/* 写作/读作：写作形加虚线框，读作形小一号排在下面 */
.bs-hw-k > .bs-hsegs .bs-hs { border: 1px dashed #b9a46a; }
.bs-hq { display: inline-flex; align-items: baseline; gap: 4px; margin-top: 2px; }
.bs-hq-tag { font-size: 10.5px; color: var(--bs-muted); }
.bs-hq .bs-hqsep { font-size: 17px; min-width: .35em; white-space: pre; }
.bs-hq .bs-hs { font-size: 17px; }
.bs-kq { margin: 6px 0 0; }

/* 章旨「本章导读」：中文界面章首，折叠，点开才展开（合一编写） */
.bs-cnote { margin: 0 0 18px; border: 1px solid var(--bs-line); border-radius: 10px; background: var(--bs-card, #fff); }
.bs-cnote summary { cursor: pointer; padding: 9px 14px; color: var(--bs-navy); font-size: 14.5px; list-style-position: inside; }
.bs-cnote[open] summary { border-bottom: 1px solid var(--bs-line); }
.bs-cnote p { margin: 12px 14px; font-size: 15.5px; line-height: 1.85; }
.bs-cnote .bs-cnote-src { margin-top: 0; font-size: 12px; color: var(--bs-muted); }
