/* ============================================================
   bible_chuckle/styles.css
   Full design with light/dark mode, responsive
   Inspired by line.twgbr.org — warm, clean, readable
   ============================================================ */

/* ─── CSS Custom Properties (Light Mode) ─── */
:root {
  --bg: #fefaf3;
  --bg-card: #ffffff;
  --bg-alt: #f5efe0;
  --bg-hover: #faf5e8;
  /* Stronger browns on cream: primary copy was washing out vs --text-muted + opacity */
  --text: #2a2218;
  --text-heading: #1a1510;
  --text-muted: #4a4238;
  --text-accent: #c8842c;
  --accent: #c8842c;
  --accent-hover: #a66b1e;
  --accent-light: #fef3e0;
  --accent-glow: rgba(200, 132, 44, 0.15);
  --border: #e8e0d0;
  --border-light: #f0ebe0;
  --header-bg: #3d3226;
  --header-text: #fefaf3;
  --header-accent: #e0b04a;
  --shadow-sm: 0 1px 3px rgba(61, 50, 38, 0.06);
  --shadow-md: 0 4px 16px rgba(61, 50, 38, 0.08);
  --shadow-lg: 0 8px 32px rgba(61, 50, 38, 0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
  /* Latin before CJK; system fonts before Noto so Latin still reads if Inter is blocked */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Noto Sans TC", "Microsoft JhengHei";
  --font-serif: "Georgia", "Times New Roman", serif, "Noto Serif TC";
  --font-mono: "SF Mono", "Cascadia Code", "Consolas", monospace;
  --max-width: 900px;
}

/* ─── CSS Custom Properties (Dark Mode) ─── */
body.dark {
  --bg: #1a1d23;
  --bg-card: #252830;
  --bg-alt: #2d3038;
  --bg-hover: #30333b;
  --text: #e8e0d4;
  --text-heading: #f0e8dc;
  --text-muted: #9d9588;
  --text-accent: #e0b04a;
  --accent: #e0b04a;
  --accent-hover: #f0c560;
  --accent-light: #3d3420;
  --accent-glow: rgba(224, 176, 74, 0.15);
  --border: #3a3d44;
  --border-light: #32353c;
  --header-bg: #14161a;
  --header-text: #e8e0d4;
  --header-accent: #e0b04a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.30);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition-slow), color var(--transition-slow);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* EN: hide duplicate all-caps line (heading is already English). */
body.lang-en .testament-heading .heading-en {
  display: none;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Header ─── */
#header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-slow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.header-home {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.header-home:hover { opacity: 0.85; }

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.logo-text-zh { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.logo-text-en {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.7;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Search ─── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 220px;
  padding: 8px 36px 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: rgba(255,255,255,0.10);
  color: var(--header-text);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}
.search-box input::placeholder { color: rgba(255,255,255,0.45); }
.search-box input:focus {
  outline: none;
  border-color: var(--header-accent);
  background: rgba(255,255,255,0.16);
  width: 280px;
}

.search-icon {
  position: absolute;
  right: 12px;
  font-size: 14px;
  opacity: 0.5;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  font-size: 18px;
  color: var(--header-text);
  opacity: 0.7;
  padding: 2px 4px;
  border-radius: 50%;
  line-height: 1;
}
.search-clear:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.search-clear.hidden { display: none; }

/* ─── Icon Buttons ─── */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  transition: background var(--transition);
  color: var(--header-text);
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }

/* Language toggle — pill buttons (中文 | EN) */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--header-text);
}
.lang-toggle:hover { background: transparent; }

.lang-toggle .lang-zh,
.lang-toggle .lang-en {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
  transition: background var(--transition), color var(--transition);
}

body.lang-zh .lang-toggle .lang-zh,
body.lang-en .lang-toggle .lang-en {
  color: #1a1a1a;
  background: #ececec;
}

body.dark .lang-toggle .lang-zh,
body.dark .lang-toggle .lang-en {
  color: rgba(232, 224, 212, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

body.dark.lang-zh .lang-toggle .lang-zh,
body.dark.lang-en .lang-toggle .lang-en {
  color: #1a1a1a;
  background: #ececec;
}

/* Dark mode toggle */
.dark-icon-dark { display: none; }
body.dark .dark-icon-light { display: none; }
body.dark .dark-icon-dark { display: inline; }

/* ─── Search Results Overlay ─── */
.search-results {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.search-results.hidden { display: none; }

.search-results-inner {
  max-width: var(--max-width);
  margin: 8px auto 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border: 1px solid var(--border);
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  color: var(--text-heading);
}

.search-results-close {
  font-size: 24px;
  opacity: 0.5;
  padding: 0 4px;
  color: var(--text);
}
.search-results-close:hover { opacity: 1; }

.search-results-list { padding: 8px; }

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }

.search-result-book { font-weight: 600; color: var(--accent); font-size: 15px; }
.search-result-title { font-size: 17px; margin: 2px 0; color: var(--text-heading); }
.search-result-snippet { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.search-result-empty { padding: 24px; text-align: center; color: var(--text-muted); }

/* ─── Main ─── */
#main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}

/* ─── Book List View ─── */
.testament-section { margin-bottom: 36px; }

.testament-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.testament-heading .heading-zh { font-size: 22px; }
.testament-heading .heading-en { font-size: 14px; color: var(--text-muted); font-weight: 400; font-family: "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 80px;
  box-shadow: var(--shadow-sm);
}
.book-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  background: var(--accent-light);
}
.book-card:active { transform: translateY(0); }

.book-card .card-short {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}

.book-card .card-name-zh { font-size: 14px; font-weight: 500; color: var(--text-heading); }
.book-card .card-name-en { font-size: 11px; color: var(--text); margin-top: 2px; font-family: "Inter", sans-serif; }
.book-card .card-chapters { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ─── Chapter List View ─── */
.chapter-view-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.chapter-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-back:hover { background: var(--accent-light); }

.chapter-view-title {
  width: 100%;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-heading);
}
.chapter-view-title .title-en { font-size: 15px; font-weight: 400; color: var(--text-muted); display: block; }

.chapter-view-toolbar .book-nav-top {
  margin-bottom: 0;
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
  justify-content: flex-end;
}

.chapter-view-toolbar .book-nav-top .book-nav-spacer {
  display: none;
}

.book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.book-nav-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.book-nav-spacer {
  flex: 1;
  min-width: 0;
}

.book-nav .btn-prev,
.book-nav .btn-next {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(100%, 320px);
}

.book-nav-label {
  font-weight: 700;
  color: var(--text-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-meta {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 14px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.chapter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-heading);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.chapter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: scale(1.08);
}
.chapter-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.08);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.chapter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chapter-toc {
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.chapter-toc-heading {
  margin-bottom: 12px;
  color: var(--text-heading);
  font-size: 20px;
  line-height: 1.35;
}

.chapter-toc-list {
  display: grid;
  gap: 8px;
}

.chapter-toc-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.chapter-toc-item:not(.chapter-toc-item-disabled):hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.chapter-toc-item-disabled {
  color: var(--text-muted);
  box-shadow: none;
}

.chapter-toc-chapter {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: nowrap;
}

.chapter-toc-title {
  color: var(--text-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.chapter-toc-tagline {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.chapter-toc-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.chapter-toc-loading {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── Content View ─── */
.content-view { animation: fadeSlideIn 0.3s ease; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-header {
  margin-bottom: 28px;
}

.content-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.content-nav-bottom {
  margin-top: 28px;
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.content-nav .btn-back { margin-right: auto; }

.btn-prev, .btn-next {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-prev:hover, .btn-next:hover { background: var(--accent-light); }
.btn-prev:disabled, .btn-next:disabled { opacity: 0.3; cursor: default; }
.btn-prev:disabled:hover, .btn-next:disabled:hover { background: transparent; }

.content-book-name {
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.content-book-name .book-name-en {
  font-size: 12px;
  opacity: 0.82;
  font-weight: 400;
  font-family: "Inter", sans-serif;
}

.content-chapter-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 8px;
}

.content-chapter-title-en {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-heading);
  font-family: "Inter", sans-serif;
  line-height: 1.3;
  margin-bottom: 12px;
}

.content-tagline {
  font-size: 18px;
  font-style: italic;
  color: var(--text);
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 8px;
}

.chapter-audio {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}

.chapter-audio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chapter-audio-icon { font-size: 18px; line-height: 1; }

.chapter-audio-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
}

.chapter-audio-badge {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-light);
}

.chapter-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chapter-audio-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.chapter-audio-play:hover { background: var(--accent-hover); }

.chapter-audio-seek {
  flex: 1 1 140px;
  min-width: 120px;
  accent-color: var(--accent);
}

.chapter-audio-time {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

.chapter-audio-speed-label { margin-left: auto; }

.chapter-audio-speed {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Commentary Sections ─── */
.commentary-section {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.commentary-section .section-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  line-height: 1.4;
}
.commentary-section .section-heading-en {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: "Inter", sans-serif;
}

.commentary-section .section-body {
  font-size: 18px;
  line-height: 1.85;
  color: var(--text);
  font-family: var(--font-serif);
}

.content-tagline p,
.commentary-section .section-body p,
.content-closing p {
  margin: 0 0 0.7em;
}

.content-tagline p:last-child,
.commentary-section .section-body p:last-child,
.content-closing p:last-child {
  margin-bottom: 0;
}

/* ─── Closing / Key Verses ─── */
.content-closing {
  padding: 20px 24px;
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-heading);
  border: 1px solid var(--border);
  font-family: var(--font-serif);
}

.key-verses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.key-verse-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
}

.content-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.content-empty .empty-icon { font-size: 48px; margin-bottom: 16px; }
.content-empty .empty-title { font-size: 20px; font-weight: 600; color: var(--text-heading); margin-bottom: 8px; }
.content-empty .empty-desc { font-size: 16px; line-height: 1.6; }

/* ─── Visit Counter ─── */
.visit-counter {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.visit-counter-visible {
  opacity: 0.8;
}

.visit-counter strong {
  color: var(--accent);
  font-weight: 700;
}

/* ─── Welcome (Home) ─── */
.welcome {
  text-align: center;
  padding: 56px 20px 28px;
}

.welcome-icon {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.welcome-icon img {
  width: clamp(96px, 22vw, 120px);
  height: clamp(96px, 22vw, 120px);
  border-radius: 28px;
  object-fit: cover;
  box-shadow:
    0 12px 40px rgba(61, 50, 38, 0.14),
    0 4px 12px rgba(61, 50, 38, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.55);
}

body.dark .welcome-icon img {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.welcome h1 {
  font-size: 36px;
  font-weight: 900;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.welcome h1 .welcome-sub {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}
/* Bilingual layout only: secondary welcome line uses the opposite script’s face. */
body.lang-zh .welcome h1 .welcome-sub {
  font-family: "Inter", system-ui, sans-serif;
}
body.lang-en .welcome h1 .welcome-sub {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.welcome p {
  font-size: 18px;
  color: var(--text);
  margin-top: 12px;
  line-height: 1.6;
}

/* ─── Footer ─── */
#footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.footer-small { font-size: 12px; margin-top: 4px; color: var(--text-muted); }

/* ─── Loading / States ─── */
.hidden { display: none !important; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .header-inner { padding: 10px 14px; min-height: 52px; }
  .logo-text-zh { font-size: 18px; }
  .logo-text-en { font-size: 11px; }
  .logo-icon { width: 32px; height: 32px; }

  .search-box input { width: 140px; font-size: 14px; }
  .search-box input:focus { width: 180px; }

  .book-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
  .book-card { padding: 12px 6px; min-height: 70px; }
  .book-card .card-short { font-size: 18px; }
  .book-card .card-name-zh { font-size: 13px; }
  .book-card .card-name-en { font-size: 10px; }

  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
  .chapter-btn { font-size: 14px; }
  .chapter-toc-item { grid-template-columns: minmax(60px, auto) 1fr; gap: 10px; }

  .book-nav .btn-prev,
  .book-nav .btn-next { max-width: 48%; font-size: 13px; }

  .content-chapter-title { font-size: 24px; }
  .content-chapter-title-en { font-size: 18px; }
  .content-tagline { font-size: 16px; }
  .commentary-section { padding: 14px 16px; }
  .commentary-section .section-heading { font-size: 17px; }
  .commentary-section .section-body { font-size: 16px; }

  .welcome h1 { font-size: 28px; }
  .welcome h1 .welcome-sub { font-size: 16px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }

  .header-inner { padding: 8px 10px; min-height: 48px; gap: 8px; }
  .logo-text-en { display: none; }
  .logo-text-zh { font-size: 17px; }
  .logo-icon { width: 28px; height: 28px; }

  .search-box input { width: 100px; font-size: 13px; padding: 6px 30px 6px 10px; }
  .search-box input:focus { width: 130px; }

  .icon-btn { width: 34px; height: 34px; }

  .book-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
  .book-card { padding: 10px 4px; min-height: 60px; border-radius: var(--radius-sm); }
  .book-card .card-short { font-size: 16px; }
  .book-card .card-name-zh { font-size: 12px; }
  .book-card .card-name-en { display: none; }
  .book-card .card-chapters { display: none; }

  .chapter-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
  .chapter-btn { font-size: 13px; }
  .chapter-toc-heading { font-size: 18px; }
  .chapter-toc-item { grid-template-columns: 1fr; gap: 4px; padding: 11px 12px; }
  .chapter-toc-title { font-size: 14px; }

  .book-nav-bottom { gap: 6px; }
  .book-nav-bottom .btn-prev,
  .book-nav-bottom .btn-next { max-width: 100%; flex: 1 1 auto; justify-content: center; }
  .book-nav-bottom .btn-prev { justify-content: flex-start; }
  .book-nav-bottom .btn-next { justify-content: flex-end; }

  .chapter-view-toolbar .book-nav-top .book-nav-label { display: none; }
  .chapter-view-toolbar .book-nav-top .btn-prev,
  .chapter-view-toolbar .book-nav-top .btn-next {
    max-width: none;
    flex: 0 1 auto;
    font-size: 12px;
    padding: 6px 10px;
  }

  .testament-heading { font-size: 17px; }
  .testament-heading .heading-en { font-size: 11px; }

  .content-chapter-title { font-size: 22px; }
  .content-chapter-title-en { font-size: 16px; }
  .commentary-section .section-body { font-size: 15px; }

  #main { padding: 16px 10px 32px; }
}
