:root {
  --bg: #2c2824;
  --paper: #fffdf8;
  --paper-soft: #f8f2e8;
  --paper-edge: #eadcc8;
  --ink: #2d2925;
  --muted: #7f7468;
  --muted-soft: #9a9084;
  --accent: #8b6f47;
  --accent-soft: rgba(139, 111, 71, 0.12);
  --ui-text: #d8c9b2;
  --ui-text-hover: #efe4d5;
  --line: rgba(205, 193, 176, 0.62);
  --line-soft: rgba(205, 193, 176, 0.3);
  --panel-line: rgba(214, 203, 187, 0.72);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 24px 60px rgba(0, 0, 0, 0.16);
  --font-scale: 1;
  --star-g1-1: #ede6d8;
  --star-g1-2: #e4d7be;
  --star-g1-3: #dcc8a5;
  --star-g2-1: #d4b77d;
  --star-g2-2: #c9a863;
  --star-g2-3: #be9a4a;
  --star-g3-1: #b38b3e;
  --star-g3-2: #a27c34;
  --star-g3-3: #916e2b;
  --star-g4-1: #7a5c24;
  --star-g4-2: #5f471b;
  --star-g4-3: #453313;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: radial-gradient(
    circle at top,
    #5d564d 0%,
    #423c35 40%,
    #2d2925 100%
  );
  color: var(--ink);
}

/* =========================
   顶部
   ========================= */

.page-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px;
}

.site-footer {
  margin-top: 14px;
  padding: 8px 4px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted-soft);
  font-size: calc(12px * var(--font-scale));
}

.site-footer-version {
  font-weight: 700;
}

.site-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.site-topbar-title {
  min-width: 0;
}

.site-topbar-title h1 {
  margin: 0;
  font-size: calc(32px * var(--font-scale));
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.brand-ask,
.brand-me {
  color: #f6efe4;
}

.brand-bible {
  color: #f0be62;
}

.brand-me {
  cursor: pointer;
}

.brand-subtitle {
  display: inline-block;
  margin-left: 12px;
  color: var(--ui-text);
  font-size: calc(14px * var(--font-scale));
  line-height: 1.3;
  font-weight: 500;
  vertical-align: middle;
}

.brand-ellipsis {
  color: #f0be62;
  font-weight: 800;
  display: inline-block;
  font-size: 1.32em;
  line-height: 1;
  vertical-align: middle;
}

.site-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#authUserName {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.top-action-btn {
  height: 36px;
  min-width: 56px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 248, 238, 0.18);
  background: rgba(255, 253, 248, 0.1);
  color: var(--ui-text);
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.top-action-btn:hover {
  background: rgba(255, 253, 248, 0.18);
  color: var(--ui-text-hover);
}

.top-action-btn:active {
  transform: translateY(0.5px);
}

/* =========================
   书布局
   ========================= */

.book-layout {
  position: relative;
  border-radius: 26px;
  overflow: visible;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.left-blank-page-btn {
  position: absolute;
  left: 22px;
  top: 260px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 48px;
  padding: 0 16px;
  border-radius: 8px 0 0 8px;
  border: 2px dashed rgba(255, 233, 233, 0.8);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 52%),
    linear-gradient(165deg, #d82d2d 0%, #b81f1f 45%, #9d1717 100%);
  color: #fff7f7;
  text-decoration: none;
  font-size: calc(14px * var(--font-scale));
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 18px rgba(122, 20, 20, 0.34);
  clip-path: polygon(0 0, 84% 0, 100% 50%, 84% 100%, 0 100%);
}

.left-blank-page-btn:hover {
  filter: brightness(1.06);
}

.left-blank-page-btn::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  width: 12px;
  height: 100%;
  background: linear-gradient(to right, rgba(66, 10, 10, 0.5), rgba(66, 10, 10, 0.05));
  border-radius: 4px 0 0 4px;
}

.blank-page-body {
  min-height: 70vh;
  border: 1px dashed rgba(190, 170, 140, 0.36);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.72);
  padding: 12px;
}

.blank-page-title {
  padding: 8px 0;
  color: var(--muted-soft);
  font-weight: 700;
}

.blank-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(190, 170, 140, 0.45);
  background: rgba(255, 253, 248, 0.92);
  color: var(--muted);
  text-decoration: none;
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
}

.book-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    transparent 12%,
    transparent 88%,
    rgba(82, 63, 40, 0.03)
  );
  z-index: 0;
}

.book-layout::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 100%;
  border-top-right-radius: 26px;
  border-bottom-right-radius: 26px;
  background: linear-gradient(
    to left,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.05),
    transparent
  );
  pointer-events: none;
  z-index: 1;
}

.book-spread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 120px);
  background: linear-gradient(
    90deg,
    #f3e6d0 0%,
    #fffdf8 47%,
    #e7d6bb 50%,
    #fffdf8 53%,
    #f3e6d0 100%
  );
  border-radius: 26px;
  overflow: hidden;
  z-index: 2;
}

.book-spread::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 42px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right,
    rgba(120, 96, 63, 0.18),
    rgba(120, 96, 63, 0.07),
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

/* =========================
   页面
   ========================= */

.book-page {
  position: relative;
  z-index: 2;
  padding: 28px 34px 32px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
}

.book-side-extend-tags {
  position: absolute;
  left: -14px;
  top: 150px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.book-side-extend-tag {
  position: relative;
  left: 0;
  top: 0;
  z-index: 1;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  min-width: 118px;
  height: 40px;
  padding: 0 18px 0 30px;
  color: #fff9ef;
  font-size: calc(16px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: left;
  cursor: pointer;
  background: linear-gradient(180deg, #9f8258 0%, #826743 100%);
  clip-path: polygon(0 0, 84% 0, 100% 50%, 84% 100%, 0 100%);
  box-shadow: 0 6px 12px rgba(63, 46, 24, 0.26);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-side-extend-tag:hover {
  filter: brightness(1.04);
  transform: translateX(1px);
}

.notebook-layout .book-spread {
  min-height: calc(100vh - 120px);
  height: auto;
}

.notebook-card {
  min-height: 420px;
}

.notebook-editor {
  min-height: calc(50vh - 120px);
  height: auto;
  padding: 10px 0;
  font-size: calc(18px * var(--font-scale));
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
  outline: none;
}

.notebook-app {
  padding: 0;
}

.notebook-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 140px);
  background: linear-gradient(90deg, #f3e6d0 0%, #fffdf8 100%);
  border-radius: 26px;
  overflow: hidden;
}

.notebook-col {
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 140px);
}

.notebook-col-editor {
  border-right: 0;
  padding: 0 14px 14px;
}

.notebook-col-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 14px 12px;
  font-size: calc(28px * var(--font-scale));
  font-weight: 800;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid var(--line);
}

.notebook-back-link {
  display: block;
  text-decoration: none;
}

.notebook-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notebook-actions {
  display: inline-flex;
  gap: 6px;
}

.notebook-action-btn {
  height: 30px;
  border: 1px solid rgba(190, 170, 140, 0.45);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
}

.notebook-list {
  padding: 8px;
}

.notebook-col-books .notebook-list {
  display: block;
  padding: 0;
}

.notebook-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: calc(17px * var(--font-scale));
  font-weight: 700;
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.notebook-col-books .notebook-item {
  width: 100%;
  margin: 0;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  justify-content: flex-start;
  white-space: normal;
}

.notebook-col-books .notebook-item.active {
  border-left: 0;
  border-right: 0;
  border-top: 1px solid rgba(139, 111, 71, 0.28);
  border-bottom: 1px solid rgba(139, 111, 71, 0.28);
}

.notebook-item:hover {
  background: rgba(139, 111, 71, 0.08);
}

.notebook-item.active {
  background: rgba(139, 111, 71, 0.16);
  border-color: rgba(139, 111, 71, 0.25);
}

.notebook-color-dot {
  width: 8px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
}

.notebook-color-dot.teal {
  background: #2a9d8f;
}
.notebook-color-dot.amber {
  background: #d9a441;
}
.notebook-color-dot.olive {
  background: #91ad39;
}
.notebook-color-dot.blue {
  background: #2f8fce;
}
.notebook-color-dot.rose {
  background: #cc6f73;
}

.notebook-editor-area {
  width: 100%;
  min-height: calc(100vh - 220px);
  border: none;
  background: transparent;
  resize: vertical;
  outline: none;
  padding: 12px 6px;
  color: var(--ink);
  font-size: calc(34px * var(--font-scale));
  line-height: 1.65;
  font-weight: 600;
}

.notebook-note-card {
  border: 0;
  border-bottom: 1px solid rgba(190, 170, 140, 0.45);
  border-radius: 0;
  background: transparent;
  padding: 12px 4px 12px 2px;
  margin-bottom: 0;
  min-height: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.notebook-note-card:hover {
  background: rgba(255, 253, 248, 0.45);
}

.notebook-note-title {
  font-size: calc(18px * var(--font-scale));
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 4px;
}

.notebook-note-content {
  font-size: calc(17px * var(--font-scale));
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  margin-top: 0;
}

.notebook-note-content.is-divine-speech-note {
  color: #b67f1a;
  font-weight: 600;
}

.notebook-note-rank {
  color: #b67f1a;
  font-weight: 800;
  margin-right: 8px;
}

.notebook-note-source {
  font-size: calc(14px * var(--font-scale));
  color: var(--muted);
  font-weight: 700;
  margin-left: 8px;
}

/* 收藏条目卡片排列 */
.notebook-col-notes .notebook-list {
  display: block;
  padding: 8px 12px 16px;
}

.notebook-home-link {
  text-decoration: none;
}

@media (max-width: 900px) {
  .notebook-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .notebook-col-head {
    font-size: calc(22px * var(--font-scale));
  }

  .notebook-item {
    font-size: calc(15px * var(--font-scale));
    min-height: 40px;
  }

  .notebook-editor-area {
    font-size: calc(26px * var(--font-scale));
  }

  .notebook-col-notes .notebook-list {
    display: block;
  }
}

@media (max-width: 700px) {
  .notebook-app {
    border-radius: 18px;
    overflow: hidden;
  }

  .notebook-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 120px);
  }

  .notebook-col {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .notebook-col-editor {
    border-bottom: 0;
    padding: 0 10px 12px;
  }

  .notebook-col-head {
    position: static;
    font-size: calc(18px * var(--font-scale));
    padding: 10px 10px 8px;
  }

  .notebook-list {
    display: flex;
    gap: 8px;
    padding: 8px 10px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .notebook-col-notes .notebook-list {
    display: block;
    gap: 8px;
    overflow: visible;
    padding: 8px 10px 12px;
  }

  .notebook-list::-webkit-scrollbar {
    display: none;
  }

  .notebook-item {
    width: auto;
    min-width: max-content;
    white-space: nowrap;
    min-height: 38px;
    border-radius: 999px;
    padding: 0 12px;
    font-size: calc(14px * var(--font-scale));
  }

  .notebook-color-dot {
    width: 6px;
    height: 18px;
  }

  .notebook-editor-area {
    min-height: calc(100vh - 330px);
    font-size: calc(20px * var(--font-scale));
    line-height: 1.72;
    padding: 10px 2px 14px;
  }
}


.book-page:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(120, 96, 63, 0.25),
    rgba(120, 96, 63, 0.08),
    transparent
  );
  pointer-events: none;
}

.book-page:last-child::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  background: linear-gradient(
    to left,
    rgba(70, 52, 30, 0.25),
    rgba(70, 52, 30, 0.08),
    transparent
  );
  pointer-events: none;
}

/* =========================
   左页顶部工具栏
   ========================= */

.page-toolbar {
  position: relative;
  z-index: 30;
  margin-bottom: 8px;
  overflow: visible;
}

.reading-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.85fr) minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding-right: 18px;
}

.reading-toolbar > * {
  width: 100%;
  min-width: 0;
}

.reading-toolbar > .inline-display-toggle {
  width: auto;
}

.reading-toolbar .toolbar-trigger {
  min-width: 0 !important;
}

.toolbar-trigger,
button.toolbar-trigger,
.reading-toolbar button {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  padding: 0 18px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: calc(15px * var(--font-scale));
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toolbar-trigger:hover,
button.toolbar-trigger:hover,
.reading-toolbar button:hover {
  background: rgba(248, 241, 229, 0.62);
  border-color: rgba(170, 148, 117, 0.4);
}

.toolbar-trigger:active {
  background: rgba(242, 234, 220, 0.7);
}

.toolbar-trigger-wide {
  min-width: 230px;
}

.inline-display-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  height: 44px;
  padding: 0 4px;
  color: var(--muted-soft);
  font-size: calc(17px * var(--font-scale));
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.inline-display-toggle.active {
  color: var(--muted);
  font-weight: 800;
}

.inline-display-toggle:hover {
  color: var(--muted);
  background: transparent !important;
}

.display-mode-switch {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border-radius: 16px;
  padding: 4px 3px;
  background: rgba(139, 111, 71, 0.16);
  gap: 2px;
  overflow: hidden;
}

.display-mode-switch .display-mode-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 0;
  flex: 1 1 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(127, 116, 104, 0.6);
  font-size: calc(14px * var(--font-scale));
  font-weight: 600;
  line-height: 1;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  gap: 0;
}

.display-mode-switch .display-mode-btn.active {
  background: #f8f4ec;
  color: #6f6355;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(76, 62, 42, 0.2);
}

.toolbar-trigger-toggle {
  min-width: 98px;
}

#qaViewPanel {
  width: auto !important;
  max-width: min(420px, calc(100vw - 56px)) !important;
}

#qaViewPanel .toolbar-panel-simple {
  padding: 12px !important;
}

#qaViewPanel .chapter-grid-wrap {
  border-top: 0;
  padding-top: 0;
}

#qaViewList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#qaViewList .option-item {
  min-height: 42px;
  justify-content: center;
}

#qaViewList .option-item.active {
  background: rgba(139, 111, 71, 0.2) !important;
}

#qaViewActionList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#qaViewActionList .option-item {
  min-height: 42px;
  justify-content: center;
}

#contentTypeTrigger {
  min-width: 160px;
}

#primaryVersionTrigger {
  min-width: 140px;
}

.toolbar-caret {
  font-size: 12px;
  line-height: 1;
  opacity: 0.7;
}

/* =========================
   悬浮面板系统
   ========================= */

.toolbar-panel {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  left: 0 !important;
  z-index: 120 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  animation: panelFadeIn 0.18s ease;
}

.toolbar-panel[hidden] {
  display: none !important;
}

/* 大面板：书卷章节 */
#bookChapterPanel {
  width: 760px !important;
  max-width: calc(100vw - 140px) !important;
}

#bookChapterPanel .toolbar-panel-inner {
  max-height: 49.5vh !important;
}

/* 小面板：类型 / 版本 / 对照 */
#contentTypePanel,
#qaViewPanel,
#primaryVersionPanel {
  width: 460px !important;
  max-width: calc(100vw - 140px) !important;
}

.toolbar-panel-inner {
  position: relative !important;
  max-height: 56vh !important;
  overflow-y: auto !important;
  background: rgba(255, 253, 248, 0.98) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(190, 170, 140, 0.55) !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.18), 0 10px 24px rgba(0, 0, 0, 0.08) !important;
  padding: 0 !important;
}

.toolbar-panel-inner::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 28px;
  width: 56px;
  height: 14px;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.14),
    transparent 70%
  );
  filter: blur(4px);
  pointer-events: none;
}

.toolbar-panel-book,
.toolbar-panel-simple {
  padding: 16px 18px !important;
}

.toolbar-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px !important;
}

.toolbar-panel-title {
  font-size: calc(16px * var(--font-scale));
  font-weight: 800 !important;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.toolbar-panel-close {
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(190, 170, 140, 0.45);
  background: rgba(240, 235, 225, 0.8) !important;
  color: var(--muted);
  font-size: calc(14px * var(--font-scale));
  font-weight: 700 !important;
  cursor: pointer;
}

.toolbar-panel-close:hover {
  background: rgba(255, 253, 248, 0.95);
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   面板内部控件
   ========================= */

.book-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.book-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(190, 170, 140, 0.4);
  background: rgba(255, 253, 248, 0.6);
  color: var(--muted);
  font-size: calc(14px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}

.book-tab.active {
  background: rgba(139, 111, 71, 0.18);
  border-color: rgba(139, 111, 71, 0.28);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.book-item {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid rgba(190, 170, 140, 0.4);
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: calc(14px * var(--font-scale));
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.book-item:hover {
  background: #fffdf8;
  border-color: rgba(150, 130, 100, 0.7);
  transform: translateY(-1px);
}

.book-item.active {
  background: rgba(139, 111, 71, 0.15);
  border-color: rgba(139, 111, 71, 0.45);
  font-weight: 700;
}

.chapter-grid-wrap {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.chapter-grid-title {
  font-size: calc(14px * var(--font-scale));
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.chapter-item {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(190, 170, 140, 0.4);
  background: rgba(255, 253, 248, 0.7);
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chapter-item:hover {
  background: #fffdf8;
}

.chapter-item.active {
  background: rgba(139, 111, 71, 0.18);
  border-color: rgba(139, 111, 71, 0.28);
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-list-multi {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.option-item {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(190, 170, 140, 0.4);
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: calc(16px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.option-item:hover {
  background: rgba(255, 253, 248, 0.96);
  border-color: rgba(181, 164, 140, 0.95);
}

.option-item.active {
  background: rgba(139, 111, 71, 0.12);
  border-color: rgba(139, 111, 71, 0.28);
}

/* =========================
   标题区
   ========================= */

.title-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 6px;
}

.title-nav-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.title-nav-side-right {
  justify-content: flex-end;
}

.title-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 24px;
  color: rgba(127, 116, 104, 0.42);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.title-nav-btn:hover {
  background: rgba(139, 111, 71, 0.08);
  color: rgba(127, 116, 104, 0.85);
}

.title-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.title-nav-mini-btn {
  height: 30px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(127, 116, 104, 0.42);
  font-size: calc(22px * var(--font-scale));
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.title-nav-mini-btn:hover {
  color: rgba(127, 116, 104, 0.85);
}

.page-title-block,
.page-title-block-stacked {
  position: relative;
  text-align: center;
  margin: 10px 0 12px;
}

.page-chapter-number {
  margin: 6px 0 0;
  font-size: calc(100px * var(--font-scale));
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--muted);
}

.page-book-title {
  margin-top: 6px;
  font-size: calc(34px * var(--font-scale));
  line-height: 1.18;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
}

.repeated-words-wrap {
  text-align: center;
  margin-bottom: 30px;
}

.repeated-words-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 18px;
  font-size: calc(16px * var(--font-scale));
  line-height: 1.75;
  color: var(--muted);
  font-weight: 600;
}

.repeated-word-item {
  display: inline-flex;
  white-space: nowrap;
}

.repeated-word-count {
  color: rgba(127, 116, 104, 0.72);
}

/* =========================
   内容
   ========================= */

.blocks-stack {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.chapter-feedback-wrap {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(190, 170, 140, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.95) 0%, rgba(252, 245, 230, 0.9) 100%);
  box-shadow: 0 6px 18px rgba(97, 76, 48, 0.08);
}

.chapter-feedback-title {
  font-size: calc(22px * var(--font-scale));
  color: #a06c10;
  font-weight: 800;
  margin-bottom: 8px;
}

.chapter-feedback-input {
  width: 100%;
  min-height: 88px;
  border: 1px solid rgba(186, 140, 67, 0.45);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: calc(17px * var(--font-scale));
  line-height: 1.55;
  padding: 10px 12px;
  resize: vertical;
}

.chapter-feedback-input::placeholder {
  font-size: calc(22px * var(--font-scale));
  color: rgba(160, 108, 16, 0.7);
  font-weight: 700;
}

.chapter-feedback-input:focus {
  outline: none;
  border-color: rgba(186, 140, 67, 0.75);
  box-shadow: 0 0 0 3px rgba(186, 140, 67, 0.16);
}

.chapter-feedback-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chapter-feedback-btn {
  height: 38px;
  border: 1px solid #b57a16;
  border-radius: 999px;
  background: linear-gradient(180deg, #d69a2b 0%, #b87a12 100%);
  color: #fff;
  font-size: calc(16px * var(--font-scale));
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
  margin-left: auto;
  box-shadow: 0 4px 10px rgba(133, 84, 10, 0.28);
}

.chapter-feedback-btn:hover {
  filter: brightness(1.06);
}

.chapter-feedback-status {
  font-size: calc(17px * var(--font-scale));
  color: var(--muted-soft);
}

.chapter-feedback-approved-title {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: calc(14px * var(--font-scale));
  color: var(--muted);
  font-weight: 700;
}

.chapter-approved-list {
  display: grid;
  gap: 8px;
}

.chapter-approved-item {
  border-top: 1px solid rgba(190, 170, 140, 0.45);
  padding-top: 8px;
  color: var(--ink);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.6;
}

.chapter-approved-meta {
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
}

.notebook-settings-modal {
  max-width: 760px;
}

.notebook-settings-group {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(190, 170, 140, 0.35);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
}

.notebook-settings-group .label {
  margin: 8px 0 6px;
  font-size: calc(14px * var(--font-scale));
  color: var(--muted);
  font-weight: 700;
}

.notebook-settings-actions {
  justify-content: flex-start;
}

#saveNotebookProfileBtn,
#saveNotebookPasswordBtn,
#logoutNotebookBtn {
  height: 42px;
  min-width: 158px;
  padding: 0 22px;
  border-radius: 20px;
  font-size: calc(18px * var(--font-scale));
  border: none !important;
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

#saveNotebookProfileBtn:hover,
#saveNotebookPasswordBtn:hover,
#logoutNotebookBtn:hover {
  background: var(--accent) !important;
  filter: none !important;
  box-shadow: none !important;
}

.flow-card {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.flow-card:last-child {
  border-bottom: none;
}

.flow-card-scripture-only {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.flow-card-scripture-fallback .flow-scripture {
  margin-bottom: 0;
  padding: 0;
  border-top: none;
  border-bottom: none;
}

.flow-card h3 {
  margin: 0 0 10px;
  font-size: calc(26px * var(--font-scale));
  line-height: 1.28;
  color: var(--muted-soft);
  font-weight: 800;
}

.blocks-stack .flow-card:first-child h3 {
  margin-top: 14px;
}

.flow-scripture {
  padding: 10px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.flow-verse {
  font-size: calc(20px * var(--font-scale));
  line-height: 1.9;
  color: var(--ink);
  margin: 3px 0 4px;
}

.flow-verse-sub {
  font-size: calc(15px * var(--font-scale));
  line-height: 1.52;
  color: var(--muted);
  margin-top: 2px;
}

.verse-no {
  color: #b67f1a;
  font-weight: 700;
  margin-right: 8px;
}

.verse-unit-divine-speech {
  color: #b67f1a;
  font-weight: 600;
}

.flow-verse .verse-unit.verse-unit-divine-speech,
.flow-verse-sub .verse-unit.verse-unit-divine-speech {
  color: #b67f1a !important;
}

.flow-verse-continuous {
  display: block;
}

.flow-verse-continuous .verse-unit {
  display: inline;
}

.flow-verse-continuous.is-rtl {
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
}

.flow-verse-continuous.is-rtl .verse-unit {
  direction: rtl;
  unicode-bidi: isolate;
}

.flow-verse-continuous.is-rtl .verse-no {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  margin-left: 8px;
  margin-right: 0;
}

.flow-verse-rtl {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
  white-space: normal;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-break: anywhere;
}

.flow-verse-rtl-row {
  display: inline;
  max-width: 100%;
}

.flow-verse-rtl-row bdi[dir="rtl"] {
  display: inline;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mini-section {
  padding: 0;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
}

.plain-list li {
  margin: 6px 0;
  font-size: calc(17px * var(--font-scale));
  line-height: 1.72;
  color: var(--muted);
}

body.question-only-mode .plain-list li {
  font-size: calc(19px * var(--font-scale));
  line-height: 1.78;
}

.question-fav-item {
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 6px;
  transition: background 0.15s ease;
}

.question-fav-item:hover {
  background: rgba(139, 111, 71, 0.1);
}

.question-fav-item.is-favorited {
  background: rgba(139, 111, 71, 0.2);
}

.plain-list-emphasis li {
  font-weight: 600;
}

.hl-word {
  display: inline;
  border-radius: 3px;
  padding: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl-1 {
  background: rgba(235, 214, 122, 0.42);
}

.hl-2 {
  background: rgba(222, 201, 128, 0.3);
}

.hl-3 {
  background: rgba(214, 193, 130, 0.2);
}

/* =========================
   右页底部导航
   ========================= */

.page-head-spacer {
  height: 0;
}

.chapter-nav {
  display: grid;
  grid-template-columns: 96px 1fr 96px;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.chapter-nav-title {
  text-align: center;
  font-size: calc(15px * var(--font-scale));
  line-height: 1.5;
  color: var(--muted);
  font-weight: 700;
}

.nav-btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}

.nav-btn:hover {
  background: rgba(248, 241, 229, 0.62);
}

.nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* =========================
   弹窗 / 管理后台
   ========================= */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(4px);
  padding: 24px;
}

.modal-card {
  width: min(100%, 920px);
  max-height: 90vh;
  overflow: auto;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(214, 203, 187, 0.72);
  box-shadow: 0 24px 60px rgba(15, 12, 10, 0.25);
}

.modal-card-sm {
  max-width: 520px;
  margin-top: 10vh;
}

.modal-card-admin {
  max-width: 1280px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: calc(28px * var(--font-scale));
  color: var(--muted);
}

.modal-dark-btn {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  color: #6f655a;
}

.modal-dark-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #4a4035;
}

.section-title {
  font-size: calc(15px * var(--font-scale));
  font-weight: 800;
  margin: 16px 0 10px;
  color: var(--muted);
}

.label {
  display: block;
  font-size: calc(12px * var(--font-scale));
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.toolbar-stack {
  display: grid;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  font-size: calc(15px * var(--font-scale));
}

.check-grid label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.custom-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 12px;
  font-size: calc(15px * var(--font-scale));
  border: 1px solid rgba(214, 203, 187, 0.72);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-family: inherit;
}

.single-input {
  min-height: auto !important;
  height: 46px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 12px 15px;
  font-size: calc(15px * var(--font-scale));
  font-weight: 800;
  cursor: pointer;
}

.secondary-btn {
  border: 1px solid rgba(214, 203, 187, 0.72);
  background: #fff;
  color: var(--muted);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: calc(15px * var(--font-scale));
  font-weight: 800;
  cursor: pointer;
}

.primary-btn:hover,
.secondary-btn:hover {
  filter: brightness(0.98);
}

.error-text {
  margin-top: 8px;
  font-size: calc(13px * var(--font-scale));
  color: #b42318;
}

.auth-hint-bar {
  margin: 4px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(181, 122, 22, 0.2);
  color: #8a5a0a;
  font-weight: 800;
  font-size: calc(18px * var(--font-scale));
  line-height: 1.35;
}

.star-level {
  font-size: 14px;
  letter-spacing: 2px;
  font-weight: 500;
  text-shadow: 0 0 4px rgba(212, 183, 125, 0.25);
}

.result-box {
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(214, 203, 187, 0.62);
  border-radius: 12px;
  padding: 14px;
  font-size: calc(15px * var(--font-scale));
  color: var(--muted);
  line-height: 1.7;
}

.result-box-plain {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.empty-state {
  font-size: calc(16px * var(--font-scale));
  color: var(--muted-soft);
  line-height: 1.8;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-tab-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(214, 203, 187, 0.72);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: calc(14px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}

.admin-tab-btn.active {
  background: rgba(139, 111, 71, 0.14);
  border-color: rgba(139, 111, 71, 0.28);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.admin-left-col,
.admin-right-col {
  min-width: 0;
}

.admin-preview-box {
  min-height: 420px;
  margin: 0;
  padding: 14px;
  background: #faf8f4;
  border: 1px solid rgba(214, 203, 187, 0.72);
  border-radius: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  line-height: 1.7;
}

.admin-preview-result {
  min-height: 420px;
  padding: 14px;
  background: #faf8f4;
  border: 1px solid rgba(214, 203, 187, 0.72);
  border-radius: 14px;
  overflow: auto;
}

.test-result-title {
  font-size: calc(22px * var(--font-scale));
  font-weight: 800;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.test-result-line {
  font-size: calc(15px * var(--font-scale));
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 10px;
}

.test-result-seg {
  border: 1px solid rgba(214, 203, 187, 0.72);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.test-result-seg h4 {
  margin: 0 0 8px;
  font-size: calc(18px * var(--font-scale));
  color: var(--muted);
  line-height: 1.5;
}

.test-result-seg ul {
  margin: 0;
  padding-left: 20px;
}

.test-result-seg li {
  margin: 6px 0;
  color: var(--muted);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.7;
}

/* =========================
   响应式
   ========================= */

@media (max-width: 1100px) {
  .book-spread {
    grid-template-columns: 1fr;
    background: var(--paper);
  }

  .book-spread::after {
    display: none;
  }

  .book-layout::after {
    width: 60px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.14), transparent);
  }

  .site-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-topbar-actions {
    justify-content: flex-start;
  }

  .book-page:last-child::after {
    display: none;
  }

  .page-chapter-number {
    font-size: calc(84px * var(--font-scale));
  }

  .page-book-title {
    font-size: calc(30px * var(--font-scale));
  }

  .flow-card h3 {
    font-size: calc(24px * var(--font-scale));
  }

  .book-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .chapter-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  #bookChapterPanel,
  #contentTypePanel,
  #qaViewPanel,
  #primaryVersionPanel {
    width: min(100%, calc(100vw - 48px)) !important;
    max-width: min(100%, calc(100vw - 48px)) !important;
  }

  .toolbar-trigger,
  button.toolbar-trigger,
  .reading-toolbar button {
    height: 42px;
    font-size: calc(15px * var(--font-scale));
  }

  .option-item {
    min-height: 52px;
    font-size: calc(16px * var(--font-scale));
  }
}

@media (max-width: 900px) {
  .admin-two-col {
    grid-template-columns: 1fr;
  }

  .admin-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .reading-toolbar {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.85fr) minmax(0, 1fr) minmax(
        0,
        1.4fr
      );
  }

  .book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chapter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 10px 8px 16px;
  }

  .site-topbar {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .site-topbar-title h1 {
    font-size: calc(26px * var(--font-scale));
    line-height: 1.08;
  }

  .brand-subtitle {
    display: block;
    margin-left: 0;
    margin-top: 6px;
    max-width: min(92vw, 520px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: calc(12px * var(--font-scale));
    line-height: 1.25;
  }

  .site-topbar-actions {
    gap: 6px;
    justify-content: flex-start;
  }

  .top-action-btn {
    height: 30px;
    padding: 0 10px;
    font-size: calc(12px * var(--font-scale));
  }

  .book-layout {
    border-radius: 18px;
  }

  .book-spread {
    border-radius: 18px;
  }

  .book-page {
    padding: 18px 16px 22px;
  }

  .toolbar-trigger,
  button.toolbar-trigger,
  .reading-toolbar button {
    height: 40px;
    padding: 0 12px;
    font-size: calc(14px * var(--font-scale));
  }

  .reading-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px !important;
    padding-right: 0;
  }

  #bookChapterTrigger {
    grid-column: span 1;
  }

  #hideScriptureBtn {
    grid-column: span 1;
  }

  #contentTypeTrigger {
    grid-column: span 1;
  }

  #primaryVersionTrigger {
    grid-column: span 1;
  }

  .toolbar-panel {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-top: 10px;
  }

  .toolbar-panel-inner {
    border-radius: 18px !important;
    max-height: none !important;
  }

  .toolbar-panel-book,
  .toolbar-panel-simple {
    padding: 14px !important;
  }

  .toolbar-panel-title {
    font-size: calc(16px * var(--font-scale));
  }

  .toolbar-panel-close {
    height: 38px !important;
    padding: 0 14px !important;
    font-size: calc(14px * var(--font-scale));
  }

  .option-item {
    min-height: 48px !important;
    padding: 0 16px !important;
    font-size: calc(15px * var(--font-scale)) !important;
    border-radius: 14px !important;
  }

  .page-chapter-number {
    font-size: calc(72px * var(--font-scale));
  }

  .page-book-title {
    font-size: calc(26px * var(--font-scale));
    letter-spacing: 0.5px;
  }

  .repeated-words-line {
    font-size: calc(14px * var(--font-scale));
  }

  .flow-card h3 {
    font-size: calc(22px * var(--font-scale));
  }

  .flow-verse {
    font-size: calc(18px * var(--font-scale));
    line-height: 1.78;
  }

  .plain-list li {
    font-size: calc(16px * var(--font-scale));
  }

  .chapter-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .chapter-nav-title {
    grid-column: 1 / -1;
    order: -1;
  }

  .modal-mask {
    padding: 12px;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chapter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .book-item,
  .chapter-item {
    min-height: 40px !important;
    font-size: calc(13px * var(--font-scale)) !important;
  }
}

/* ===== 最后一轮压缩面板高度与节奏 ===== */

.page-toolbar {
  margin-bottom: 2px !important;
}

.reading-toolbar {
  margin-bottom: 8px !important;
}

#bookChapterPanel {
  width: 700px !important;
  max-width: calc(100vw - 150px) !important;
}

.toolbar-panel-inner {
  max-height: 52vh !important;
}

.toolbar-panel-book {
  padding: 14px 16px !important;
}

.toolbar-panel-head {
  margin-bottom: 12px !important;
}

.book-tab-row {
  margin-bottom: 10px !important;
}

.book-grid {
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.book-item {
  min-height: 36px !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
}

.chapter-grid-wrap {
  padding-top: 10px !important;
}

.chapter-grid {
  gap: 8px !important;
}

.chapter-item {
  min-height: 34px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
}

.toolbar-panel-close {
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
}

/* 让左页阅读区露出来更多 */
.blocks-stack {
  margin-top: 2px !important;
}

/* ===== FINAL：让面板变“轻” ===== */

.toolbar-panel-inner {
  background: rgba(255, 253, 248, 0.92) !important;

  /* 减弱实体感 */
  border: 1px solid rgba(190, 170, 140, 0.35) !important;

  /* 阴影变轻 */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06) !important;

  backdrop-filter: blur(6px);
}

/* 面板整体再降一点视觉重量 */
.toolbar-panel {
  top: calc(100% + 12px) !important;
}

/* ===== 顶部“连接感”增强 ===== */

/* 按钮 hover 更明显 */
.toolbar-trigger:hover {
  background: #fffdf8 !important;
  border-color: rgba(140, 120, 90, 0.6) !important;
}

/* ===== 内容区再轻一点 ===== */

.book-item,
.chapter-item {
  background: rgba(255, 253, 248, 0.55) !important;
}

/* hover 更清晰 */
.book-item:hover,
.chapter-item:hover {
  background: rgba(255, 253, 248, 0.95) !important;
}

/* 当前选中更明确 */
.book-item.active,
.chapter-item.active {
  background: rgba(139, 111, 71, 0.18) !important;
}

/* ===== 关闭按钮弱化 ===== */

.toolbar-panel-close {
  background: rgba(240, 235, 225, 0.6) !important;
  border-color: rgba(190, 170, 140, 0.35) !important;
}

/* ===== final touch ===== */

.reading-toolbar {
  gap: 8px !important;
  margin-bottom: 4px !important;
}

.toolbar-trigger,
button.toolbar-trigger,
.reading-toolbar button {
  height: 40px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  border-radius: 14px !important;
}

#bookChapterPanel {
  width: 640px !important;
  max-width: calc(100vw - 180px) !important;
}

.toolbar-panel {
  top: calc(100% + 8px) !important;
}

.toolbar-panel-inner {
  max-height: 44vh !important;
  background: rgba(255, 253, 248, 0.9) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

.toolbar-panel-book {
  padding: 10px 12px !important;
}

.book-grid {
  gap: 6px !important;
  margin-bottom: 8px !important;
}

.book-item {
  min-height: 32px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
}

.chapter-grid-wrap {
  padding-top: 6px !important;
}

.chapter-grid {
  gap: 6px !important;
}

.chapter-item {
  min-height: 30px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

.toolbar-panel-close {
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

/* ===== 内容类型：收窄 + 标签组样式 ===== */
#contentTypePanel {
  width: 95% !important;
  max-width: calc(100vw - 56px) !important;
}

#contentTypePanel .toolbar-panel-simple {
  padding: 12px !important;
  height: 700px !important;
  max-height: 700px !important;
  overflow-y: auto !important;
}

#contentTypePanel .chapter-grid-wrap {
  margin-top: 10px;
  padding-top: 12px !important;
}

#primaryVersionPanel .toolbar-panel-simple {
  padding: 14px 16px !important;
}

#primaryVersionPanel .chapter-grid-wrap + .chapter-grid-wrap {
  margin-top: 12px;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.version-item {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(190, 170, 140, 0.4);
  background: rgba(255, 253, 248, 0.66);
  color: var(--muted);
  font-size: calc(13px * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.version-item:hover {
  background: #fffdf8;
  border-color: rgba(150, 130, 100, 0.7);
}

.version-item.active {
  background: rgba(139, 111, 71, 0.18);
  border-color: rgba(139, 111, 71, 0.35);
}

.version-item-checkable {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.version-item-check {
  min-width: 16px;
  text-align: right;
  color: var(--accent);
  font-weight: 800;
}

#contentTypeList {
  display: inline-flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

#contentTypeList .option-item {
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(190, 170, 140, 0.45) !important;
  border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
  border-radius: 12px !important;
  background: rgba(255, 253, 248, 0.72) !important;
  font-size: calc(14px * var(--font-scale)) !important;
}

#contentTypeList .option-item:last-child {
  border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
}

#contentTypeList .option-item.active {
  background: rgba(139, 111, 71, 0.2) !important;
}

#contentDisplayList {
  display: inline-flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

#contentDisplayList .option-item {
  min-height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(190, 170, 140, 0.45) !important;
  border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
  border-radius: 12px !important;
  background: rgba(255, 253, 248, 0.72) !important;
  font-size: calc(14px * var(--font-scale)) !important;
}

#contentDisplayList .option-item:last-child {
  border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
}

#contentDisplayList .option-item.active {
  background: rgba(139, 111, 71, 0.2) !important;
}

#contentActionList {
  display: inline-flex !important;
  gap: 8px;
}

#contentActionList .option-item {
  min-height: 40px !important;
  padding: 0 14px !important;
  font-size: calc(14px * var(--font-scale)) !important;
}

@media (max-width: 700px) {
  .left-blank-page-btn {
    left: 14px;
    top: 92px;
    min-width: 76px;
    height: 40px;
    font-size: calc(12px * var(--font-scale));
    clip-path: none;
    border-radius: 10px;
  }

  .left-blank-page-btn::before {
    display: none;
  }

  #contentTypePanel {
    max-width: 100% !important;
  }

  #contentTypeList {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #contentTypeList .option-item {
    border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
    border-bottom: 1px solid rgba(190, 170, 140, 0.45) !important;
  }

  #contentDisplayList {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #contentDisplayList .option-item {
    border-right: 1px solid rgba(190, 170, 140, 0.45) !important;
    border-bottom: 1px solid rgba(190, 170, 140, 0.45) !important;
  }

  #contentActionList {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .version-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   收藏功能
   ========================= */


.verse-unit-favorite {
  cursor: pointer;
  border-radius: 8px;
  padding: 0 4px;
  transition: background 0.15s ease;
}

.verse-unit-favorite:hover {
  background: rgba(139, 111, 71, 0.12);
}

.verse-unit-favorite.is-favorited {
  background: rgba(139, 111, 71, 0.24);
}

.verse-unit-favorite.favorite-flash {
  animation: favoriteFlash 0.9s ease;
}

@keyframes favoriteFlash {
  0% {
    background: rgba(180, 145, 94, 0.4);
  }
  100% {
    background: rgba(139, 111, 71, 0.24);
  }
}

/* 书卷面板：约 4 列宽度 + 屏幕高度自适应 */
#bookChapterPanel {
  width: 90% !important;
  max-width: calc(100vw - 56px) !important;
}

#bookChapterPanel .book-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

#bookChapterPanel .toolbar-panel-inner {
  height: 700px !important;
  max-height: 700px !important;
}

/* ===== FINAL OVERRIDE：统一面板尺寸 ===== */
#bookChapterPanel {
  width: 95% !important;
  max-width: 95% !important;
}

#primaryVersionPanel,
#contentTypePanel {
  width: 95% !important;
  max-width: 95% !important;
}

#bookChapterPanel .toolbar-panel-inner,
#primaryVersionPanel .toolbar-panel-inner,
#primaryVersionPanel .toolbar-panel-simple,
#contentTypePanel .toolbar-panel-inner,
#contentTypePanel .toolbar-panel-simple {
  height: 700px !important;
  max-height: 700px !important;
  overflow-y: auto !important;
}

/* ===== FINAL OVERRIDE：顶部三按钮等宽并左对齐 ===== */
.reading-toolbar {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 8px !important;
}

#bookChapterTrigger,
#primaryVersionTrigger,
#contentTypeTrigger {
  width: 80px !important;
  min-width: 80px !important;
  flex: 0 0 80px !important;
}

@media (max-width: 700px) {
  .reading-toolbar {
    flex-wrap: wrap !important;
  }
}

