/* =========================================================
   OpenBible — Design System & Layout
   Warm Cream / Indigo theme, 3-column SPA
   ========================================================= */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

/* ── Color Tokens ── */
:root {
    /* Backgrounds */
    --bg-app: #f5f3ef;
    --bg-surface: #ffffff;
    --bg-hover: #f0ede8;
    --bg-active: #ede9ff;
    --bg-panel: #fdfcfb;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.45);

    /* Text */
    --text-primary: #1a1814;
    --text-secondary: #5c5752;
    --text-tertiary: #a09a94;
    --text-on-accent: #ffffff;

    /* Accent / Brand */
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --accent-light: #ede9ff;
    --accent-mid: #c7c5f7;
    --accent-gold: #c9a55a;
    --accent-gold-light: #faf3e0;
    --accent-gradient: linear-gradient(135deg, #5865f2, #7c3aed);
    --accent-gradient-hover: linear-gradient(135deg, #4752c4, #6d28d9);

    /* Borders */
    --border: #e8e2db;
    --border-strong: #cec8c0;

    /* Shadows — warmer, more layered */
    --shadow-sm: 0 1px 2px rgba(26, 24, 20, 0.04), 0 1px 3px rgba(26, 24, 20, 0.06);
    --shadow-md: 0 2px 4px rgba(26, 24, 20, 0.03), 0 4px 12px rgba(26, 24, 20, 0.07);
    --shadow-lg: 0 4px 8px rgba(26, 24, 20, 0.04), 0 12px 32px rgba(26, 24, 20, 0.10);
    --shadow-xl: 0 8px 16px rgba(26, 24, 20, 0.06), 0 24px 64px rgba(26, 24, 20, 0.14);
    --shadow-accent: 0 4px 16px rgba(88, 101, 242, 0.25);
    --shadow-gold: 0 4px 16px rgba(201, 165, 90, 0.2);

    /* Layout */
    --left-nav-w: 260px;
    --right-panel-w: 340px;
    --top-bar-h: 58px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Typography */
    --font-ui: 'DM Sans', -apple-system, sans-serif;
    --font-display: 'Playfair Display', 'Georgia', serif;
    --font-text: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'SF Mono', 'Fira Mono', monospace;

    /* Transitions */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Dark Mode ── */
body[data-theme="dark"] {
    --bg-app: #0f0f0e;
    --bg-surface: #1a1918;
    --bg-hover: #222120;
    --bg-active: #2a2854;
    --bg-panel: #161514;
    --glass-bg: rgba(26, 25, 24, 0.78);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.62);
    /* 0.36 对比度仅 3.3:1，未达 WCAG AA(4.5)；提到 0.48 → 约 4.9:1，弱化文字仍可读 */
    --text-tertiary: rgba(255, 255, 255, 0.48);
    /* 分隔线在深色下原 0.08 过淡几乎不可见，略提升可见度 */
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --accent: #8b9bff;
    --accent-hover: #7482f0;
    --accent-light: rgba(139, 155, 255, 0.12);
    --accent-mid: rgba(139, 155, 255, 0.25);
    --accent-gold: #d4b06a;
    --accent-gold-light: rgba(212, 176, 106, 0.12);
    --accent-gradient: linear-gradient(135deg, #8b9bff, #a78bfa);
    --accent-gradient-hover: linear-gradient(135deg, #7482f0, #8b5cf6);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 4px 20px rgba(139, 155, 255, 0.3);
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-ui);
    background: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input,
textarea {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── App Shell ── */
.app-shell {
    display: grid;
    grid-template-columns: var(--left-nav-w) 1fr 4px var(--right-panel-w);
    grid-template-rows: 100vh;
    height: 100vh;
    overflow: hidden;
}

/* Panel hidden transition */
.app-shell.panel-hidden {
    grid-template-columns: var(--left-nav-w) 1fr 0px 0px;
}

.app-shell.nav-hidden {
    grid-template-columns: 0px 1fr 4px var(--right-panel-w);
}

.app-shell.panel-hidden.nav-hidden {
    grid-template-columns: 0px 1fr 0px 0px;
}

/* ── Panel Resize Handle ── */
.panel-resize-handle {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 20;
    transition: background 0.15s;
}

.panel-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 40px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.2s;
}

.panel-resize-handle:hover {
    background: var(--border);
}

.panel-resize-handle:hover::after {
    background: var(--text-tertiary);
}

.panel-resize-handle.dragging {
    background: var(--accent-mid);
}

.panel-resize-handle.dragging::after {
    background: var(--accent);
}

.app-shell.panel-hidden .panel-resize-handle {
    display: none;
}

/* =========================================================
   LEFT NAV
   ========================================================= */
.left-nav {
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--top-bar-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.brand-logo {
    height: 45px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
}


/* ── Sidebar collapse button — prominent ── */
#nav-collapse-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    color: var(--accent);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    cursor: pointer;
}

#nav-collapse-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
    transform: scale(1.05);
}

.nav-views {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.15s;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 12px;
    flex-shrink: 0;
}

/* Bible navigator */
.bible-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
}

.testament-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    background: var(--bg-hover);
    padding: 3px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.testament-btn {
    flex: 1;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.testament-btn.active {
    background: var(--bg-surface);
    color: var(--accent);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.book-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.book-list::-webkit-scrollbar {
    width: 4px;
}

.book-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.book-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.12s;
    font-weight: 400;
}

.book-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.book-btn.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.book-btn .book-abbr {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Chapter chips below active book */
.chapter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 4px 8px 6px 20px;
}

.ch-chip {
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-hover);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.ch-chip:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.ch-chip.active {
    background: var(--accent);
    color: white;
}

.nav-bottom {
    padding: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

/* =========================================================
   CENTER COLUMN
   ========================================================= */
.center-col {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-app);
}

/* Top bar */
.top-bar {
    height: var(--top-bar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

.breadcrumb-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.breadcrumb-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.15s;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-btn:hover {
    background: var(--border);
}

.breadcrumb-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
}

/* Hide book/chapter breadcrumbs when left nav is open (info already visible in sidebar) */
.app-shell:not(.nav-hidden) .breadcrumb-book-btn,
.app-shell:not(.nav-hidden) .breadcrumb-ch-btn {
    display: none;
}

.breadcrumb-dot {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    user-select: none;
}

.version-pill {
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    font-family: var(--font-ui);
    transition: border-color 0.15s;
}

.version-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.icon-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

.pill-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-ui);
    transition: all 0.15s;
}

.pill-action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Content area */
.content-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.view {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 60px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    position: relative;
}

.view::-webkit-scrollbar {
    width: 4px;
}

.view::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.hidden-view {
    display: none !important;
}

.active-view {
    display: flex;
    flex-direction: column;
}

/* ── Selection bar (Sticky top-right in reading view) ── */
.selection-bar {
    display: flex;
    align-items: center;
    height: 32px;
    box-sizing: border-box;
    padding: 0 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    gap: 5px;
    position: sticky;
    top: 0;
    z-index: 20;
    align-self: flex-end;
    margin-bottom: -32px;
    animation: selBarEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

@keyframes selBarEnter {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selection-bar.hidden {
    display: none !important;
}

body[data-theme="dark"] .selection-bar {
    background: var(--bg-panel);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Group containers */
.sel-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Divider between groups */
.sel-divider {
    width: 1px;
    height: 14px;
    background: var(--border);
    flex-shrink: 0;
    opacity: 0.6;
}

body[data-theme="dark"] .sel-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* Count badge */
.sel-count {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    font-family: var(--font-ui);
    line-height: 1;
}

.sel-count #sel-count {
    color: var(--accent);
    font-weight: 700;
}

body[data-theme="dark"] .sel-count {
    background: rgba(255, 255, 255, 0.06);
}

/* Color dots */
.sel-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s var(--ease-spring), box-shadow 0.15s;
    flex-shrink: 0;
}

.sel-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sel-dot:active {
    transform: scale(0.95);
}

body[data-theme="dark"] .sel-dot {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Icon buttons (copy, etc.) */
.sel-btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sel-btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

/* Pill action buttons */
.sel-btn-pill {
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font-ui);
    flex-shrink: 0;
    line-height: 1;
}

.sel-btn-pill.btn-ai {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.sel-btn-pill.btn-ai:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
    transform: translateY(-1px);
}

.sel-btn-pill.btn-ai:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(88, 101, 242, 0.2);
}

.sel-btn-pill.btn-note {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.sel-btn-pill.btn-note:hover {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

/* Close button */
.sel-close-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    color: var(--text-tertiary);
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-left: 2px;
}

.sel-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

body[data-theme="dark"] .sel-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* On very small mobile screens, compact the selection bar */
@media (max-width: 400px) {
    .selection-bar {
        padding: 3px 6px;
        gap: 3px;
    }

    .sel-count {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    .sel-dot {
        width: 14px;
        height: 14px;
    }

    .sel-btn-pill {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .sel-btn-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .sel-close-btn {
        width: 22px;
        height: 22px;
    }

    .sel-divider {
        height: 16px;
    }
}

/* ── Chapter label bar ── */
.chapter-label-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 4px;
}

.ch-nav-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ── Chapter nav buttons (in top bar) ── */
.ch-nav-text-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ch-nav-text-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

.ch-nav-text-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Bible text ── */
.bible-text {
    flex: 1;
    padding: 0 40px 32px;
}

/* Chapter heading inside bible reader */
.ch-heading {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    font-family: var(--font-text);
    letter-spacing: -0.01em;
}

/* Verse */
.verse {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    cursor: pointer;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    line-height: 1.6;
    letter-spacing: -0.02em;
    font-family: var(--font-text);
    font-size: 1.22rem;
    color: var(--text-primary);
    position: relative;
    border: 1px solid transparent;
}

.verse-content {
    flex: 1;
    word-break: break-word;
}

.verse:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body[data-theme="dark"] .verse:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.verse.selected {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--text-primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.15);
}

.verse.in-range {
    background: var(--accent-light);
    color: var(--text-primary);
}

/* Verse number superscript */
.verse-num {
    font-size: 0.58em;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0.4em;
    /* superscript effect in flex */
    margin-right: 3px;
    font-family: var(--font-ui);
    user-select: none;
    transition: color 0.15s, text-shadow 0.2s;
    flex-shrink: 0;
}

.verse:hover .verse-num {
    color: #5865f2;
    text-shadow: 0 0 8px rgba(88, 101, 242, 0.45);
}

body[data-theme="dark"] .verse:hover .verse-num {
    color: #8b9bff;
    text-shadow: 0 0 8px rgba(139, 155, 255, 0.5);
}



/* ── Pinyin / Ruby Styling ── */
.verse ruby {
    ruby-position: over;
    ruby-align: center;
    /* Native ruby layout is best for text alignment */
    margin: 0 1px;
    /* Just a tiny bit of horizontal breathing room */
}

.verse rt {
    font-size: 0.55em;
    color: var(--text-tertiary);
    font-family: var(--font-ui), sans-serif;
    font-weight: 400;
    /* Lighter font weight so it doesn't fight the main text */
    letter-spacing: 0.02em;
    user-select: none;
    opacity: 0.85;
    /* Soften the pinyin specifically to reduce noise */
}


/* Highlight colors */
.verse[data-highlight="#FEF08A"] {
    background: #FEF08A !important;
}

.verse[data-highlight="#BBF7D0"] {
    background: #BBF7D0 !important;
}

.verse[data-highlight="#BAE6FD"] {
    background: #BAE6FD !important;
}

.verse[data-highlight="#FBCFE8"] {
    background: #FBCFE8 !important;
}

.verse[data-highlight="#DDD6FE"] {
    background: #DDD6FE !important;
}

body[data-theme="dark"] .verse[data-highlight="#FEF08A"] {
    background: rgba(254, 240, 138, 0.25) !important;
}

body[data-theme="dark"] .verse[data-highlight="#BBF7D0"] {
    background: rgba(187, 247, 208, 0.2) !important;
}

body[data-theme="dark"] .verse[data-highlight="#BAE6FD"] {
    background: rgba(186, 230, 253, 0.2) !important;
}

body[data-theme="dark"] .verse[data-highlight="#FBCFE8"] {
    background: rgba(251, 207, 232, 0.2) !important;
}

body[data-theme="dark"] .verse[data-highlight="#DDD6FE"] {
    background: rgba(221, 214, 254, 0.2) !important;
}

/* Note indicator on verse */
.verse-note-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: super;
    margin-left: 2px;
}

/* Note icon on verse (clickable) */
.verse-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    color: #d97706;
    cursor: pointer;
    vertical-align: super;
    margin-left: 3px;
    padding: 2px 3px;
    border-radius: 3px;
    transition: all 0.2s ease;
    opacity: 0.8;
    position: relative;
    z-index: 2;
    animation: noteIconPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.verse-note-icon:hover {
    opacity: 1;
    color: #b45309;
    background: rgba(217, 119, 6, 0.12);
    transform: scale(1.2);
}

body[data-theme="dark"] .verse-note-icon {
    color: #fbbf24;
    opacity: 0.8;
}

body[data-theme="dark"] .verse-note-icon:hover {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.15);
    opacity: 1;
}

@keyframes noteIconPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    60% {
        transform: scale(1.15);
    }

    100% {
        opacity: 0.75;
        transform: scale(1);
    }
}

.no-data-state,
.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-data-state i,
.loading-state i {
    font-size: 2rem;
    opacity: 0.3;
}

/* View headings */
.view-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 32px 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.view-header-title i {
    color: var(--accent);
}

.view-content {
    padding-bottom: 60px;
}

/* =========================================================
   RIGHT STUDY PANEL
   ========================================================= */
.study-panel {
    background: var(--bg-panel);
    border-left: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: transform 0.3s ease;
    min-width: 240px;
}

.panel-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
    flex-shrink: 0;
    height: var(--top-bar-h);
    align-items: flex-end;
    gap: 2px;
}

/* .panel-tab 的规范定义已合并到下方唯一一处（原本拆成 3 处 base 规则相互覆盖，易混乱） */

.panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.panel-tab.active {
    color: var(--accent);
    font-weight: 600;
    border-bottom-color: var(--accent);
    background: var(--bg-surface);
}

/* 动态适配选项卡中的图片 icon，使其在未激活时呈现与文字相同的灰度，在激活时恢复原色 */
.panel-tab .tab-icon-img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.15s ease;
}

.panel-tab:hover .tab-icon-img {
    filter: grayscale(30%);
    opacity: 0.85;
}

.panel-tab.active .tab-icon-img {
    filter: none;
    opacity: 1;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.tab-content::-webkit-scrollbar {
    width: 4px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.tab-content.hidden {
    display: none;
}

.panel-section {
    padding: 16px 16px 0;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-ui);
}

.section-label i {
    color: var(--accent);
}

/* ── AI tab ── */
.ai-search-box {
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 14px;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}

.ai-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.ai-search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ai-search-input::placeholder {
    color: var(--text-tertiary);
}

.ai-search-submit {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--accent);
    border: none;
    color: white;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.ai-search-submit:hover {
    background: var(--accent-hover);
}

/* Preset question buttons */
.ai-preset-questions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 12px;
}

.ai-preset-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-family: var(--font-ui);
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1.4;
}

.ai-preset-btn:hover {
    border-color: var(--accent-mid);
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.1);
}

.ai-preset-btn i {
    color: var(--accent);
    font-size: 0.82rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.ai-messages {
    flex: 1;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-end;
}

.ai-bubble {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ai-bubble-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.ai-bubble-text {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    width: fit-content;
    max-width: 85%;
}

.ai-bubble-text p+p {
    margin-top: 6px;
}

.tip-text {
    font-size: 0.78rem;
    margin-top: 8px !important;
    color: var(--text-tertiary);
}

.tip-text strong {
    color: var(--text-secondary);
}

.user-bubble {
    flex-direction: row-reverse;
}

.user-bubble .ai-bubble-icon {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* AI logo avatar */
.ai-logo-icon {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border);
    padding: 0 !important;
    overflow: hidden;
}

.ai-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* User avatar image */
.user-bubble .ai-bubble-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* User avatar letter fallback */
.user-bubble .ai-bubble-icon .avatar-letter {
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-ui);
    line-height: 1;
}

.user-bubble .ai-bubble-text {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
    flex: none;
    width: fit-content;
    max-width: 85%;
}

/* ── Tab ref pill (shown at top of each tab) ── */
.tab-ref-pill-wrap {
    padding: 12px 16px 10px;
    border-bottom: 1px solid var(--border);
    animation: fadeUp 0.3s ease;
}

/* ── Study tab ── */
.verse-ref-section {
    padding-bottom: 0;
}

/* NOTE: 慧读面板的速览区不再居中——它是流式布局的第一块内容 */
.study-no-selection {
    display: flex;
    flex-direction: column;
    padding: 4px 0 0;
    color: var(--text-tertiary);
    gap: 10px;
}

.study-tab-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    gap: 10px;
}

.no-sel-icon {
    font-size: 2.4rem;
    opacity: 0.2;
    color: var(--accent);
}

.study-no-selection p,
.study-tab-no-selection p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Resource media cards in resources tab */
.resource-media-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 6px;
}

.resource-media-card:hover {
    border-color: var(--accent-mid);
    background: var(--accent-light);
}

.resource-media-card .media-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.resource-media-card .media-info {
    flex: 1;
    min-width: 0;
}

.resource-media-card .media-info .media-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-media-card .media-info .media-meta {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ── AI 面板可滚动内容区 ── */
/* NOTE: tab-ai 拆分为 ai-panel-scroll (可滚动) + ai-input-footer (固定底部)
   这样速览和选节结果叠放在一个流式容器里，选节后平滑向上滚动而非替换 */
.tab-content#tab-ai {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 禁止 tab 自身滚动，由内部 ai-panel-scroll 处理 */
}

.ai-panel-scroll {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    display: flex;
    flex-direction: column;
}

.ai-panel-scroll::-webkit-scrollbar {
    width: 4px;
}

.ai-panel-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* 选节区与速览之间的视觉分隔线 */
.verse-selection-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 6px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-ui);
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.verse-selection-divider i {
    color: var(--accent);
    font-size: 0.65rem;
    animation: bounceDown 1.2s ease infinite;
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(3px);
    }
}

.study-selection-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeUp 0.3s ease;
}

.study-ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-ui);
    width: fit-content;
    animation: pillPulse 0.4s ease;
}

@keyframes pillPulse {
    from {
        transform: scale(0.95);
        opacity: 0.7;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.study-verse-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 12px 14px;
    max-height: 160px;
    overflow-y: auto;
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-primary);
    scrollbar-width: none;
}

.study-verse-block::-webkit-scrollbar {
    display: none;
}

.study-verse-ref-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    font-family: var(--font-ui);
}

/* AI summary card */
.ai-summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    min-height: 56px;
}

.ai-loading {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
}

.ai-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotPulse 1.1s infinite ease-in-out;
}

.ai-loading span:nth-child(2) {
    animation-delay: 0.18s;
}

.ai-loading span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.35;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-summary-text {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary);
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Commentary items */
.commentary-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.commentary-item:last-child {
    border-bottom: none;
}

.commentary-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-ui);
}

.commentary-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Cross refs */
.cross-ref-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cross-ref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.12s;
}

.cross-ref-item:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.cross-ref-item i {
    color: var(--accent);
    font-size: 0.75rem;
}

/* ── Skeleton Screen Loading ── */
.skeleton-commentary {
    padding: 12px 0;
    animation: fadeUp 0.3s ease;
}

.skeleton-line {
    height: 13px;
    background: linear-gradient(90deg, var(--border) 25%, var(--bg-hover) 37%, var(--bg-surface) 50%, var(--bg-hover) 63%, var(--border) 75%);
    background-size: 400% 100%;
    border-radius: 4px;
    margin-bottom: 10px;
    animation: skeletonShimmer 1.8s ease infinite;
}

.skeleton-line.skeleton-title {
    width: 35%;
    height: 15px;
    margin-bottom: 14px;
    border-radius: 3px;
}

.skeleton-line.short {
    width: 55%;
}

.skeleton-spacer {
    height: 18px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Contextual AI Preset Buttons ── */
.ai-preset-btn.contextual {
    background: linear-gradient(135deg, var(--accent-light), rgba(88, 101, 242, 0.12));
    border-color: var(--accent-mid);
    color: var(--accent);
    font-weight: 600;
    position: relative;
}

.ai-preset-btn.contextual::before {
    content: '\f0eb';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    margin-right: 4px;
    opacity: 0.7;
}

.ai-preset-btn.contextual:hover {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(88, 101, 242, 0.22));
    border-color: var(--accent);
}

/* ── Tag Explain Modal ── */
.tag-explain-modal {
    position: relative;
    z-index: 10;
    width: min(560px, 92vw);
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    max-height: 86vh;
}

.tag-explain-header {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #4338ca 100%);
    padding: 24px 24px 32px;
    position: relative;
    text-align: left;
}

.tag-explain-subtitle {
    color: #ddd6fe;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tag-explain-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}

.tag-explain-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ddd6fe;
    font-size: 0.75rem;
}

.tag-explain-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #c4b5fd;
    display: inline-block;
}

.tag-explain-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.tag-explain-close:hover {
    color: white;
}

.tag-explain-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 16px;
    background: white;
    border-radius: 24px 24px 0 0;
}

.tag-explain-body {
    overflow-y: auto;
    padding: 8px 24px 24px;
    flex: 1;
}

.tag-explain-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 0;
    color: var(--text-tertiary);
}

.tag-explain-loading>p {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 12px;
    color: var(--text-secondary);
}

.tag-explain-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
    color: #b91c1c;
    font-size: 0.875rem;
}

.tag-explain-section {
    border-radius: 16px;
    border: 1px solid;
    overflow: hidden;
    margin-bottom: 12px;
}

.tag-explain-section-header {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-explain-section-header-num {
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.tag-explain-section-header-title {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.tag-explain-section-body {
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.tag-explain-s1 {
    border-color: #ddd6fe;
    background-color: #f5f3ff;
}

.tag-explain-s1 .tag-explain-section-header {
    background: linear-gradient(to right, #8b5cf6, #7c3aed);
}

.tag-explain-s1 .tag-explain-section-body {
    color: #5b21b6;
}

.tag-explain-s2 {
    border-color: #bfdbfe;
    background-color: #eff6ff;
}

.tag-explain-s2 .tag-explain-section-header {
    background: linear-gradient(to right, #3b82f6, #0891b2);
}

.tag-explain-s2 .tag-explain-section-body {
    color: #1e40af;
}

.tag-explain-s3 {
    border-color: #a7f3d0;
    background-color: #ecfdf5;
}

.tag-explain-s3 .tag-explain-section-header {
    background: linear-gradient(to right, #10b981, #0d9488);
}

.tag-explain-s3 .tag-explain-section-body {
    color: #065f46;
}

/* ── Share Card Modal ── */
.share-modal {
    position: relative;
    z-index: 1;
    width: min(580px, 95vw);
    max-height: 88vh;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border);
}

body[data-theme="dark"] .share-modal {
    background: rgba(28, 25, 41, 0.85);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .share-modal {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), var(--shadow-xl);
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

body[data-theme="dark"] .share-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.share-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.share-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
}

.share-modal-title i {
    color: var(--accent);
}

.share-modal-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.share-modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-modal-close-btn:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.share-canvas-wrap {
    padding: 24px;
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-y: auto;
    flex: 1;
}

.share-canvas-wrap::-webkit-scrollbar {
    width: 6px;
}
.share-canvas-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.share-canvas-wrap::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.share-canvas-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.share-canvas-wrap canvas {
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 1px 6px rgba(0, 0, 0, 0.06), 0 0 30px rgba(88, 101, 242, 0.08);
    max-width: 100%;
    height: auto;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}

.share-canvas-wrap canvas:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 1px 12px rgba(0, 0, 0, 0.08), 0 0 45px rgba(88, 101, 242, 0.18);
}

.share-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    width: 100%;
}

.share-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
}

.share-actions button:hover {
    border-color: var(--accent-mid);
    background: var(--accent-light);
    color: var(--accent);
}

.share-actions button.primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(88, 101, 242, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.share-actions button.primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.4);
    transform: translateY(-1.5px);
}

.share-actions button.primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(88, 101, 242, 0.2);
}

/* Share button in note/ai cards */
.note-share-btn,
.ai-share-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.note-share-btn:hover,
.ai-share-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

/* ── VIP Quota & Upgrade ── */
.ai-quota-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

.ai-quota-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-quota-count .count-num {
    font-weight: 700;
    color: var(--accent);
}

.ai-quota-count .count-num.exhausted {
    color: #ef4444;
}

.ai-quota-upgrade {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.15s;
}

.ai-quota-upgrade:hover {
    opacity: 0.8;
}

.vip-upgrade-card {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    color: white;
    animation: fadeUp 0.3s ease;
    margin: 16px;
}

.vip-upgrade-card .vip-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vip-upgrade-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.vip-upgrade-card p {
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.5;
    margin-bottom: 16px;
}

.vip-upgrade-card .vip-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    margin-bottom: 20px;
    font-size: 0.82rem;
}

.vip-upgrade-card .vip-features span {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.vip-upgrade-card .vip-features i {
    color: #fbbf24;
    font-size: 0.7rem;
}

.vip-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e1b4b;
    font-weight: 700;
    font-size: 0.92rem;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    font-family: var(--font-ui);
}

.vip-upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
}

/* ── Notes tab ── */
.note-context {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    font-style: italic;
}

.note-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.note-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color 0.15s;
}

.note-textarea:focus {
    border-color: var(--accent);
}

.note-textarea::placeholder {
    color: var(--text-tertiary);
}

.save-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--accent);
    border: none;
    color: white;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background 0.15s;
    font-family: var(--font-ui);
    align-self: flex-end;
}

.save-note-btn:hover {
    background: var(--accent-hover);
}

.notes-list {
    flex: 1;
    padding: 0 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    animation: fadeUp 0.3s ease;
}

.note-card-ref {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 5px;
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    padding: 2px 6px 2px 0;
    transition: background 0.15s, color 0.15s;
}

.note-card-ref[onclick] {
    cursor: pointer;
}

.note-card-ref[onclick]:hover {
    background: var(--accent-light);
    text-decoration: underline;
}

.note-card-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.note-card-date {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    text-align: right;
}

/* ── AI 问答笔记卡片 ── */
/* NOTE: 与手写笔记共用 .note-card，额外添加 .note-card-ai 区分视觉 */
.note-card-ai {
    border-left: 3px solid var(--accent);
    background: linear-gradient(135deg, var(--bg-surface), var(--accent-light) 200%);
}

.note-ai-badge {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--accent);
    opacity: 0.75;
    font-family: var(--font-ui);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 用户提问行 */
.note-ai-question {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

.note-ai-question i {
    color: var(--accent);
    font-size: 0.78rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* AI 回答区域 */
.note-ai-answer {
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--text-secondary);
    /* 长答案最多展示 5 行，点击笔记时可展开 */
    max-height: 8.5em;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

/* 渐隐遮罩提示可展开 */
.note-ai-answer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5em;
    background: linear-gradient(transparent, var(--bg-surface));
    pointer-events: none;
}

.note-ai-answer.expanded {
    max-height: none;
}

.note-ai-answer.expanded::after {
    display: none;
}

.note-card-ai .note-card-ref {
    width: 100%;
    display: flex;
    align-items: center;
}

/* =========================================================
   NOTES — history toolbar (search / filter / sort / group)
   ========================================================= */
.notes-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 4px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

.notes-toolbar.hidden {
    display: none;
}

.notes-toolbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notes-count-badge {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    font-weight: 500;
}

/* Search box */
.notes-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notes-search-icon {
    position: absolute;
    left: 11px;
    font-size: 0.76rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.notes-search-input {
    width: 100%;
    padding: 7px 30px 7px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-ui);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.notes-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.notes-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
    display: flex;
    align-items: center;
}

.notes-search-clear:hover {
    color: var(--text-secondary);
}

.notes-search-clear.hidden {
    display: none;
}

/* Controls row: type chips + book select + sort/group buttons */
.notes-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notes-chips {
    display: flex;
    gap: 4px;
}

.notes-chip {
    padding: 3px 11px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s;
}

.notes-chip:hover {
    border-color: var(--accent-mid);
}

.notes-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.notes-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notes-book-select {
    max-width: 104px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-family: var(--font-ui);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.notes-book-select:focus {
    border-color: var(--accent);
}

.notes-icon-btn {
    width: 27px;
    height: 27px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.76rem;
    transition: all 0.15s;
}

.notes-icon-btn:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
}

.notes-icon-btn.active {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

/* Group-by-book headers */
.notes-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 4px 5px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    cursor: pointer;
    user-select: none;
}

.notes-group-header:hover {
    color: var(--accent);
}

.notes-group-header .chevron {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    transition: transform 0.2s var(--ease-out);
}

.notes-group.collapsed .chevron {
    transform: rotate(-90deg);
}

.notes-group-count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    background: var(--bg-hover);
    padding: 1px 8px;
    border-radius: var(--radius-full);
}

.notes-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notes-group.collapsed .note-card {
    display: none;
}

/* Compact handwritten note text: clamp to 3 lines, click to expand */
.note-card-text.clampable {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}

.note-card-text.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

/* Search-match highlight */
mark.note-hl {
    background: var(--accent-light);
    color: var(--accent-hover);
    padding: 0 1px;
    border-radius: 3px;
}

[data-theme="dark"] mark.note-hl {
    background: rgba(139, 155, 255, 0.28);
    color: #c7c5f7;
}



/* =========================================================
   ENCYCLOPEDIA (百科) — dictionary / media / article / devotional
   ========================================================= */
/* 首字母索引条 */
/* 词典搜索框 */
.enc-dict-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

.enc-dict-search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

.enc-dict-search-input {
    width: 100%;
    padding: 9px 32px 9px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.86rem;
    outline: none;
    font-family: var(--font-ui);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.enc-dict-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.enc-dict-search-clear {
    position: absolute;
    right: 9px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px;
    display: flex;
    align-items: center;
}

.enc-dict-search-clear:hover {
    color: var(--text-secondary);
}

.enc-dict-search-clear.hidden {
    display: none;
}

.enc-dict-count {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    margin-bottom: 12px;
}

/* 词典列表/释义按需加载占位 */
.enc-dict-loading-row {
    display: flex;
    justify-content: center;
    padding: 32px 0;
    color: var(--accent);
    font-size: 1.1rem;
}
.enc-dict-loading {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.enc-letter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.enc-letter {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-ui);
}

.enc-letter:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
}

.enc-letter.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* 词典分组 */
.enc-dict-group {
    margin-bottom: 22px;
}

.enc-dict-letter-head {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-ui);
    padding: 4px 0 10px;
    border-bottom: 2px solid var(--accent-light);
    margin-bottom: 10px;
}

.enc-dict-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.enc-dict-item:hover {
    border-color: var(--accent-mid);
    box-shadow: var(--shadow-sm);
}

.enc-dict-term {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.enc-dict-chevron {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    transition: transform 0.2s var(--ease-out);
}

.enc-dict-item.open .enc-dict-chevron {
    transform: rotate(180deg);
}

.enc-dict-def {
    max-height: 0;
    overflow: hidden;
    padding: 0 16px;
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--text-secondary);
    transition: max-height 0.25s var(--ease-out), padding 0.25s var(--ease-out);
}

.enc-dict-item.open .enc-dict-def {
    max-height: 1200px;
    padding: 0 16px 15px;
}

/* 词典释义里的经文引用 —— 可点击跳转 */
.enc-verse-ref {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    padding: 0 1px;
    border-radius: 3px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.enc-verse-ref:hover {
    background: var(--accent-light);
    text-decoration: underline;
}

/* 影音卡片列表（仅标题+分类+时长，无人名） */
.enc-media-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enc-media-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.enc-media-card:hover {
    border-color: var(--accent-mid);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.enc-media-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.85rem;
}

.enc-media-icon.is-video {
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.enc-media-info {
    flex: 1;
    min-width: 0;
}

.enc-media-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enc-media-meta {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.enc-media-dur {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* 影音内嵌播放器（本面板播放，不跳走） */
.enc-media-player {
    animation: fadeUp 0.3s ease;
}

.enc-media-player .ap-back-btn {
    margin-bottom: 14px;
}

.enc-media-player-head {
    margin-bottom: 14px;
}

.enc-media-player-badge {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.enc-media-player-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.enc-media-player-stage {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.enc-media-video {
    width: 100%;
    max-height: 60vh;
    display: block;
    background: #000;
}

.enc-media-audio {
    width: 100%;
    display: block;
    background: var(--bg-hover);
}

.enc-media-player-desc {
    margin-top: 14px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.enc-media-nourl {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    background: var(--bg-hover);
}

/* 文章 / 灵修 卡片列表 — 公众号式 */
.enc-article-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.enc-article-card {
    display: flex;
    gap: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s;
    animation: fadeUp 0.3s ease;
}

.enc-article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-mid);
}

.enc-article-cover {
    width: 112px;
    flex-shrink: 0;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.8rem;
    background: var(--accent-light);
}

.enc-article-body {
    flex: 1;
    padding: 14px 16px 14px 0;
    min-width: 0;
}

.enc-article-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.enc-article-summary {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.enc-article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.76rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

.enc-tag {
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
}

/* 详情阅读 — 公众号式长文 */
.enc-reader {
    max-width: 720px;
    margin: 0 auto;
    animation: fadeUp 0.3s ease;
}

.enc-reader .ap-back-btn {
    margin-bottom: 18px;
}

.enc-reader-cover {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    background: var(--accent-light);
}

.enc-reader-title {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-family: var(--font-text);
}

.enc-reader-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

.enc-reader-content {
    font-size: 1.02rem;
    line-height: 1.95;
    color: var(--text-primary);
}

.enc-reader-content p {
    margin: 0 0 1.3em;
}

/* 「全部」聚合区 */
.enc-all-section {
    margin-bottom: 30px;
}

.enc-all-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.enc-more {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-ui);
}

.enc-more:hover {
    text-decoration: underline;
}

.enc-dict-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.enc-dict-chip {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.enc-dict-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* 右侧面板「百科」tab 容器 — 适配窄面板宽度 */
.encyclopedia-panel {
    padding: 14px 16px 24px;
}

/* 窄面板内：标签更紧凑、可横向滚动 */
.encyclopedia-panel .mv-header {
    margin-bottom: 16px;
}

.encyclopedia-panel .mv-tabs {
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.encyclopedia-panel .mv-tabs::-webkit-scrollbar {
    display: none;
}

.encyclopedia-panel .mv-tab {
    padding: 6px 13px;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* 窄面板内：影音卡片、文章卡片缩紧 */
.encyclopedia-panel .enc-article-cover {
    width: 84px;
    min-height: 78px;
    font-size: 1.4rem;
}

.encyclopedia-panel .enc-article-body {
    padding: 11px 12px 11px 0;
}

.encyclopedia-panel .enc-article-title {
    font-size: 0.92rem;
}

.encyclopedia-panel .enc-reader-title {
    font-size: 1.3rem;
}

.encyclopedia-panel .enc-reader-cover {
    height: 140px;
}

.encyclopedia-panel .audio-card {
    padding: 10px 12px;
}

/* ── Bookmarks tab ── */
.bookmark-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s;
    animation: fadeUp 0.3s ease;
}

.bookmark-card:hover {
    border-color: var(--accent);
}

.bookmark-ref {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    font-family: var(--font-ui);
}

.bookmark-text {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-secondary);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: var(--font-text);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    text-align: center;
    color: var(--text-tertiary);
    gap: 10px;
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.2;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.empty-state span {
    font-size: 0.8rem;
}

/* =========================================================
   OVERLAYS
   ========================================================= */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay.hidden {
    display: none;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
}

/* ── Smart Search Modal ── */
.search-modal {
    position: relative;
    z-index: 1;
    width: min(640px, 94vw);
    background: var(--bg-surface);
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    animation: searchSlideIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes searchSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 6px;
    border-bottom: 1px solid var(--border);
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-hover);
    border-radius: 14px;
    padding: 10px 14px;
    transition: box-shadow 0.25s ease, background 0.2s;
}

.search-input-wrap:focus-within {
    background: var(--bg-surface);
    box-shadow: 0 0 0 2px var(--accent), 0 4px 20px rgba(88, 101, 242, 0.12);
}

.search-icon {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.search-input-wrap:focus-within .search-icon {
    color: var(--accent);
}

.search-modal-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-ui);
    min-width: 0;
}

.search-modal-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.search-shortcut-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    opacity: 0.6;
}

.search-shortcut-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 4px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: var(--font-ui);
    color: var(--text-tertiary);
    line-height: 1;
}

.search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: var(--text-tertiary);
    color: var(--bg-surface);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.6rem;
    opacity: 0.5;
    transition: opacity 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.search-clear-btn:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.search-close-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

/* ── Suggestion Layer ── */
/* 搜索范围筛选条：全部 / 旧约 / 新约 */
.search-scope-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.search-scope-chip {
    padding: 5px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-ui);
    transition: all 0.15s var(--ease-out);
}

.search-scope-chip:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
}

.search-scope-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.search-suggestions {
    padding: 0;
    max-height: 52vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.search-suggestions:empty {
    display: none;
}

.search-suggest-group {
    padding: 10px 14px 4px;
}

.search-suggest-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    padding: 0 2px;
}

.search-suggest-label i {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Book suggestion pills */
.search-book-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.search-book-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--bg-hover);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-ui);
}

.search-book-pill:hover,
.search-book-pill.active {
    background: rgba(88, 101, 242, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.search-book-pill .pill-abbr {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* History items */
.search-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.search-history-item:hover,
.search-history-item.active {
    background: var(--bg-hover);
}

.search-history-item i {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.search-history-item .history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-item .history-remove {
    opacity: 0;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 4px;
    transition: opacity 0.15s;
}

.search-history-item:hover .history-remove {
    opacity: 0.6;
}

.search-history-item .history-remove:hover {
    opacity: 1;
    color: var(--accent);
}

.search-history-clear-btn {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 2px 6px;
    transition: color 0.15s;
}

.search-history-clear-btn:hover {
    color: var(--accent);
}

/* Semantic hint cards */
.search-semantic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.search-semantic-item:hover,
.search-semantic-item.active {
    background: var(--bg-hover);
}

.search-semantic-item i {
    color: var(--accent);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Search Results ── */
.search-results {
    max-height: 52vh;
    overflow-y: auto;
    padding: 6px 8px;
    scrollbar-width: thin;
}

.search-results:empty {
    display: none;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-hover);
}

.search-result-ref {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-ui);
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-result-ref::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

.search-result-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-family: var(--font-text);
    padding-left: 9px;
}

.search-highlight {
    background: linear-gradient(to bottom, transparent 40%, rgba(254, 240, 138, 0.5) 40%);
    color: var(--text-primary);
    font-weight: 500;
    border-radius: 0;
}

[data-theme="dark"] .search-highlight {
    background: linear-gradient(to bottom, transparent 40%, rgba(250, 204, 21, 0.2) 40%);
}

.search-result-count {
    padding: 6px 14px;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
}

#search-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 14px 16px;
}
.search-load-more {
    padding: 8px 18px;
    font-size: 0.82rem;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.18s ease;
}
.search-load-more:hover { background: var(--accent-mid); }

.search-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.search-empty i {
    font-size: 2rem;
    opacity: 0.3;
}

/* ── Footer ── */
.search-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

.search-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 3px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6rem;
    font-family: var(--font-ui);
    margin-right: 2px;
}

/* ── Inline Compare (正文内上下文对照) ── */

/* Sticky version bar — unified with selection-bar style */
.compare-inline-bar {
    display: inline-flex;
    align-items: center;
    height: 32px;
    box-sizing: border-box;
    gap: 5px;
    padding: 0 8px;
    margin: 0 0 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: selBarEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    flex-shrink: 0;
}

body[data-theme="dark"] .compare-inline-bar {
    background: var(--bg-panel);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.cmp-bar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    font-family: var(--font-ui);
    line-height: 1;
}

.cmp-bar-left i {
    color: var(--accent);
    font-size: 0.7rem;
}

.cmp-bar-versions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cmp-ver-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-family: var(--font-ui);
    line-height: 1;
    box-sizing: border-box;
}

.cmp-ver-btn:hover {
    border-color: var(--ver-color, var(--accent));
    background: var(--bg-hover);
}

.cmp-ver-btn.active {
    border-color: var(--ver-color, var(--accent));
    background: var(--accent-light);
    color: var(--ver-color, var(--accent));
    font-weight: 600;
}

.cmp-ver-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ver-color, var(--accent));
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.cmp-ver-btn.active .cmp-ver-dot {
    opacity: 1;
}

.cmp-bar-close {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    color: var(--text-tertiary);
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    margin-left: 2px;
}

.cmp-bar-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Compare button active state */
#compare-btn.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Inline compare block under each verse */
.cmp-inline-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 0 12px 0;
    padding-left: 8px;
    animation: cmpFadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cmp-inline-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--bg-hover);
    border-left: 3px solid var(--ver-color, var(--border));
    transition: background 0.12s;
}

.cmp-inline-row:hover {
    background: rgba(88, 101, 242, 0.05);
}

.cmp-inline-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--ver-color, var(--text-tertiary));
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    min-width: 42px;
    padding-top: 2px;
    flex-shrink: 0;
    opacity: 0.85;
}

.cmp-inline-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-secondary);
    font-family: var(--font-text);
}

/* Legacy compare overlay classes (kept for backward compat, hidden) */
.compare-modal,
.compare-modal-header,
.compare-modal-title,
.compare-ref-badge,
.compare-version-bar,
.compare-ver-chip,
.compare-scroll,
.compare-vg,
.compare-vn,
.compare-vb,
.compare-vl,
.compare-vt,
.compare-loading {
    /* Legacy — no longer rendered */
}

/* Chapter picker modal */
.chapter-picker-modal {
    position: relative;
    z-index: 1;
    width: min(700px, 94vw);
    max-height: 80vh;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.picker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.picker-header h2 {
    font-size: 1rem;
    font-weight: 600;
    flex-grow: 1;
}

.picker-books,
.picker-chapters {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
}

.picker-books::-webkit-scrollbar,
.picker-chapters::-webkit-scrollbar {
    width: 4px;
}

.picker-books::-webkit-scrollbar-thumb,
.picker-chapters::-webkit-scrollbar-thumb {
    background: var(--border);
}

.picker-testament-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin: 8px 4px 6px;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 4px;
    margin-bottom: 12px;
}

.picker-book-btn {
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid transparent;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-ui);
}

.picker-book-btn:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.picker-book-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px;
}

.picker-ch-btn {
    padding: 10px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
    font-family: var(--font-ui);
}

.picker-ch-btn:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.picker-ch-btn.selected {
    background: var(--accent);
    color: white;
}

/* Context menu */
.ctx-menu {
    position: fixed;
    z-index: 2000;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 5px;
    min-width: 170px;
    animation: menuIn 0.15s ease;
}

.ctx-menu.hidden {
    display: none;
}

@keyframes menuIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    color: var(--text-primary);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    font-family: var(--font-ui);
}

.ctx-item:hover {
    background: var(--bg-hover);
}

.ctx-item i {
    color: var(--accent);
    width: 16px;
}

.ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

.ctx-colors {
    display: flex;
    gap: 5px;
    padding: 4px 12px 6px;
    align-items: center;
}

.ctx-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctx-color:hover {
    transform: scale(1.3);
    border-color: rgba(0, 0, 0, 0.2);
}

.ctx-clear {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-tertiary);
    font-size: 0.6rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1814;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 3000;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
}

body[data-theme="dark"] .toast {
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.toast.hidden {
    display: none;
}

.toast i {
    color: #4ade80;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =========================================================
   PLAN / VIDEO / AUDIO view content
   ========================================================= */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.plan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.15s;
}

.plan-card:hover {
    border-color: var(--accent-mid);
}

.plan-card.today-card {
    border-color: var(--accent);
}

.plan-day-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-ui);
}

.plan-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.plan-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.plan-task i {
    color: var(--accent);
    font-size: 0.85rem;
}

.plan-task.done {
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.plan-task.done i {
    opacity: 0.4;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.media-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.media-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.media-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-hover);
    position: relative;
}

.media-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s;
}

.media-card:hover .media-play-btn {
    opacity: 1;
}

.media-play-btn i {
    color: white;
    font-size: 2rem;
}

.media-duration {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.media-info {
    padding: 12px 14px;
}

.media-series {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
    font-family: var(--font-ui);
}

.media-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Audio list */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
}

.audio-card:hover {
    border-color: var(--accent-mid);
    transform: translateX(4px);
}

.audio-play-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.88rem;
    transition: all 0.15s;
}

.audio-card:hover .audio-play-circle {
    background: var(--accent);
    color: white;
}

.audio-info {
    flex: 1;
}

.audio-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.audio-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.audio-dur {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-ui);
}

.media-teacher {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.media-teacher i {
    font-size: 0.65rem;
}

/* ── Media/Video Category Tabs ── */
.mv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.mv-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mv-tab {
    padding: 7px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    font-family: var(--font-ui);
}

.mv-tab:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.mv-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.mv-count {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

.mv-section {
    margin-bottom: 28px;
}

.mv-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.mv-section-title i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* ── Video Player View ── */
.vp-container {
    max-width: 900px;
}

.vp-back-row {
    margin-bottom: 16px;
}

.vp-back-btn,
.ap-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-ui);
}

.vp-back-btn:hover,
.ap-back-btn:hover {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.vp-player-wrap {
    margin-bottom: 20px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.vp-player {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vp-player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.vp-big-play {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--accent);
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.vp-big-play:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.3);
}

.vp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.vp-ctrl-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.vp-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vp-progress-wrap {
    flex: 1;
    cursor: pointer;
    padding: 6px 0;
}

.vp-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.vp-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s linear;
}

.vp-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-ui);
    white-space: nowrap;
}

.vp-info {
    margin-bottom: 24px;
}

.vp-series-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--font-ui);
}

.vp-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    line-height: 1.4;
}

.vp-meta {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.vp-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vp-meta i {
    color: var(--accent);
    font-size: 0.78rem;
}

.vp-desc {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.vp-related {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.vp-related-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vp-related-title i {
    color: var(--accent);
}

.vp-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vp-related-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
}

.vp-related-item:hover {
    background: var(--bg-hover);
}

.vp-related-thumb {
    width: 64px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.vp-related-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vp-related-dur {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
}

/* ── Audio Player View ── */
.ap-container {
    max-width: 860px;
}

.ap-back-row {
    margin-bottom: 12px;
}

.ap-player-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.ap-top-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ap-artwork {
    flex-shrink: 0;
}

.ap-artwork-bg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.3);
}

.ap-details {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.ap-category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: var(--font-ui);
}

.ap-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.ap-speaker {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ap-speaker i {
    color: var(--accent);
    font-size: 0.72rem;
}

.ap-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.45;
}

/* Waveform */
.ap-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 36px;
    margin: 8px 0;
    opacity: 0.35;
    transition: opacity 0.3s;
}

.ap-wave.animating {
    opacity: 1;
}

.ap-wave-bar {
    width: 3.5px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.3s;
}

.ap-wave.animating .ap-wave-bar {
    animation: waveAnim 0.8s ease-in-out infinite alternate;
}

.ap-wave.animating .ap-wave-bar:nth-child(odd) {
    animation-delay: 0.15s;
}

.ap-wave.animating .ap-wave-bar:nth-child(3n) {
    animation-delay: 0.3s;
}

.ap-wave.animating .ap-wave-bar:nth-child(5n) {
    animation-delay: 0.45s;
}

@keyframes waveAnim {
    0% {
        transform: scaleY(0.6);
    }

    100% {
        transform: scaleY(1.3);
    }
}

/* Seek Bar */
.ap-seek-wrap {
    margin: 4px 0 10px;
}

.ap-seek-bar {
    position: relative;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
}

.ap-seek-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 3px;
    transition: width 0.3s linear;
}

.ap-seek-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid white;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: left 0.3s linear;
    pointer-events: none;
}

.ap-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-family: var(--font-ui);
}

/* Audio Controls */
.ap-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ap-ctrl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s;
    font-family: var(--font-ui);
}

.ap-ctrl span {
    font-size: 0.65rem;
}

.ap-ctrl i {
    font-size: 1.2rem;
}

.ap-ctrl:hover {
    color: var(--accent);
}

.ap-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.ap-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

.ap-play-btn.playing {
    background: linear-gradient(135deg, var(--accent), #a78bfa);
}

/* Audio Playlist */
.ap-playlist {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.ap-playlist-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ap-playlist-title i {
    color: var(--accent);
}

.ap-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.ap-playlist-item:hover {
    background: var(--bg-hover);
}

.ap-playlist-item.active {
    background: var(--accent-light);
}

.ap-pl-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.ap-playlist-item.active .ap-pl-icon {
    background: var(--accent);
    color: white;
}

.ap-pl-info {
    flex: 1;
    min-width: 0;
}

.ap-pl-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-pl-speaker {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ap-pl-dur {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-family: var(--font-ui);
    flex-shrink: 0;
}

/* Settings */
.settings-section {
    margin-bottom: 28px;
}

.settings-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-desc {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-top: 1px;
}

/* ── Profile / My Page ── */
.profile-hero {
    margin-bottom: 28px;
    padding-top: 32px;
}

.profile-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 1rem;
    color: #fff;
}

.profile-avatar:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-subtitle {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.profile-input {
    flex: 1;
    max-width: 240px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.15s;
}

.profile-input:focus {
    border-color: var(--accent);
}

.profile-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.profile-save-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Profile logout button */
.profile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-ui);
}

.profile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

.profile-logout-btn i {
    font-size: 0.9rem;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    background: var(--border-strong);
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.toggle input:checked+.toggle-track {
    background: var(--accent);
}

.toggle input:checked+.toggle-track::after {
    transform: translateX(18px);
}

/* Font size slider */
.range-input {
    width: 120px;
    accent-color: var(--accent);
    cursor: pointer;
}

.lang-selector {
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: none;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
    font-family: var(--font-ui);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Mobile overlay */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    backdrop-filter: blur(2px);
}

.mobile-overlay.hidden {
    display: none;
}

.mobile-only {
    display: none;
}

/* =========================================================
   RESPONSIVE — Mobile-first, covers all devices
   ========================================================= */

/* ── Tablet: 768–1200px ── */
@media (max-width: 1200px) {
    :root {
        --right-panel-w: 340px;
        --left-nav-w: 230px;
    }
}

@media (max-width: 960px) {
    :root {
        --left-nav-w: 200px;
        --right-panel-w: 310px;
    }

    .brand-name {
        font-size: 0.9rem;
    }

    .bible-text {
        font-size: 1rem;
    }

    .verse {
        font-size: 1.05rem;
    }

    .view {
        padding: 0 20px 60px;
    }
}

/* ── Tablet portrait: hide right panel behind button ── */
@media (max-width: 840px) {
    .app-shell {
        grid-template-columns: var(--left-nav-w) 1fr !important;
    }

    .study-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        width: min(360px, 90vw);
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 700;
        box-shadow: var(--shadow-xl);
    }

    .study-panel.mobile-open {
        transform: translateX(0);
    }

    /* Show panel toggle button more prominently */
    #panel-toggle-btn {
        background: var(--accent-light);
        color: var(--accent);
        border: 1px solid var(--accent-mid);
    }
}

/* ── Mobile: ≤ 768px — full native app layout ── */
@media (max-width: 768px) {
    :root {
        --top-bar-h: 52px;
        --bottom-nav-h: 58px;
    }

    .mobile-only {
        display: flex !important;
    }

    /* Full single-column: hide side columns */
    .app-shell {
        grid-template-columns: 1fr !important;
        grid-template-rows: var(--top-bar-h) 1fr var(--bottom-nav-h);
        grid-template-areas:
            "topbar"
            "main"
            "bottomnav";
    }

    /* Left nav: slide-in drawer */
    .left-nav {
        display: flex !important;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(280px, 82vw);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 700;
        box-shadow: var(--shadow-xl);
        /* Hide bottom nav items — replaced by bottom nav bar */
    }

    .left-nav.mobile-open {
        transform: translateX(0);
    }

    /* Hide the sidebar nav items and bottom on mobile — bottom nav handles it */
    .nav-views,
    .nav-bottom,
    .nav-divider {
        display: none;
    }

    /* But keep bible navigator inside drawer */
    .bible-nav {
        display: flex !important;
        padding: 8px;
    }

    /* Center column: fills the grid */
    .center-col {
        grid-area: main;
        height: calc(100vh - var(--top-bar-h) - var(--bottom-nav-h));
        min-height: 0;
    }

    .top-bar {
        grid-area: topbar;
        position: sticky;
        top: 0;
        z-index: 200;
        padding: 0 10px;
        gap: 6px;
    }

    /* Study panel: bottom sheet on mobile */
    .study-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--bottom-nav-h);
        top: auto;
        height: 75vh;
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border-left: none;
        border-top: 1px solid var(--border);
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 650;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    }

    .study-panel.mobile-open {
        transform: translateY(0);
    }

    /* Bottom sheet drag handle */
    .panel-tab-bar::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--border-strong);
        border-radius: 2px;
    }

    .panel-tab-bar {
        position: relative;
        padding-top: 20px;
        height: auto;
    }

    /* Bottom navigation bar */
    .bottom-nav {
        grid-area: bottomnav;
        height: var(--bottom-nav-h);
        background: var(--bg-surface);
        border-top: 1px solid var(--border);
        display: flex !important;
        align-items: center;
        justify-content: space-around;
        padding: 0 4px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        /* iOS safe area */
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    }

    .bottom-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        height: 100%;
        background: none;
        border: none;
        color: var(--text-tertiary);
        font-size: 0.62rem;
        font-weight: 500;
        font-family: var(--font-ui);
        cursor: pointer;
        transition: color 0.15s;
        padding: 6px 4px;
        border-radius: var(--radius-sm);
        position: relative;
    }

    .bottom-nav-btn i {
        font-size: 1.2rem;
        margin-bottom: 1px;
    }

    .bottom-nav-btn.active {
        color: var(--accent);
    }

    .bottom-nav-btn .badge {
        position: absolute;
        top: 4px;
        right: 20%;
        min-width: 16px;
        height: 16px;
        background: var(--accent);
        color: white;
        font-size: 0.6rem;
        font-weight: 700;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
    }

    /* Content area: account for bottom nav */
    .content-area {
        height: 100%;
        overflow: hidden;
    }

    .view {
        padding: 0 16px calc(env(safe-area-inset-bottom) + 16px);
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Larger verse tap targets on touch */
    .verse {
        padding: 8px 10px;
        font-size: 1.08rem;
    }

    .verse-num {
        font-size: 0.65em;
    }

    /* Touch-friendly interactive elements */
    .ch-nav-btn {
        padding: 9px 14px;
        font-size: 0.82rem;
    }

    .book-btn {
        padding: 10px 10px;
        font-size: 0.88rem;
    }

    .ch-chip {
        width: 32px;
        height: 28px;
        font-size: 0.78rem;
    }

    .panel-tab {
        padding: 8px 10px;
        font-size: 0.78rem;
    }



    .sel-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }

    /* AI button: full width */
    .run-ai-btn {
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    .breadcrumb-area {
        min-width: 0;
        flex-shrink: 1;
        gap: 4px;
    }

    /* Breadcrumb compact */
    .breadcrumb-btn {
        font-size: 0.825rem;
        padding: 5px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 160px;
        display: block;
    }

    .breadcrumb-btn span {
        display: inline;
    }

    .version-pill {
        font-size: 0.76rem;
        padding: 4px 6px;
        max-width: 100px;
        text-overflow: ellipsis;
    }

    .top-actions {
        gap: 4px;
    }

    #listen-btn {
        display: none;
    }

    /* ── Hide language switcher on mobile — saves significant space ── */
    .lang-switcher-pill {
        display: none !important;
    }

    /* ── Login pill: icon-only on mobile ── */
    .auth-login-pill span {
        display: none;
    }

    .auth-login-pill {
        padding: 6px 8px;
        min-width: 34px;
        justify-content: center;
    }

    /* ── Auth user area: compact on mobile ── */
    .auth-username {
        display: none;
    }

    .auth-user-area {
        padding: 2px 4px;
        gap: 4px;
    }

    /* ── Hide breadcrumb dot/separator on mobile ── */
    .breadcrumb-dot,
    .breadcrumb-sep {
        display: none;
    }

    /* ── Breadcrumb buttons: more compact ── */
    .breadcrumb-btn {
        font-size: 0.8rem;
        padding: 4px 6px;
        max-width: 100px;
    }

    .breadcrumb-btn i {
        display: none;
    }

    /* ── Version pill: compact ── */
    .version-pill {
        font-size: 0.72rem;
        padding: 3px 5px;
        max-width: 90px;
    }

    /* ── Hide floating chapter arrows on mobile (they overlap text) ── */
    .ch-float-arrow {
        display: none !important;
    }

    /* ── Bible text: better horizontal padding on mobile ── */
    .bible-text {
        padding: 4px 16px 80px;
    }

    /* ── Chapter heading: smaller on mobile ── */
    .ch-heading {
        font-size: 1.25rem;
        margin: 14px 0 12px;
        padding-bottom: 8px;
    }

    /* Search modal: full-screen on mobile */
    .search-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .search-results,
    .search-suggestions {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: none;
    }

    .search-footer {
        padding: 10px 16px;
    }

    .search-shortcut-hint {
        display: none;
    }

    .overlay {
        align-items: flex-end;
    }

    /* Chapter picker: full-screen */
    .chapter-picker-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        align-self: flex-end;
    }

    /* Context menu: always visible area */
    .ctx-menu {
        font-size: 0.95rem;
        min-width: 190px;
    }

    .ctx-item {
        padding: 10px 14px;
    }

    /* Plan/media grids: single column */
    .plan-grid {
        grid-template-columns: 1fr;
    }

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

    /* Notes list */
    .notes-list,
    .ai-messages {
        padding: 0 12px 16px;
    }

    /* Top safe area (iOS Dynamic Island etc) */
    .top-bar {
        padding-top: max(0px, env(safe-area-inset-top));
        height: calc(var(--top-bar-h) + env(safe-area-inset-top));
    }

    /* ── Panel toggle: more prominent on mobile ── */
    #panel-toggle-btn {
        background: var(--accent-light);
        color: var(--accent);
        border-color: var(--accent-mid);
    }

    /* ── Auth modal: full width on mobile ── */
    .auth-modal-box {
        width: 100%;
        max-width: 100vw;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 28px 20px 24px;
    }

    /* ── Mobile overlay ── */
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 600;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

/* ── Small phones: ≤ 390px ── */
@media (max-width: 390px) {
    .breadcrumb-btn {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem;
        padding: 3px 5px;
    }

    .version-pill {
        max-width: 72px;
        font-size: 0.68rem;
    }

    .verse {
        font-size: 1.02rem;
    }

    .bottom-nav-btn {
        font-size: 0.58rem;
    }

    .bottom-nav-btn i {
        font-size: 1.1rem;
    }

    .panel-tab {
        padding: 7px 8px;
        font-size: 0.72rem;
    }

    .top-bar {
        padding: 0 6px;
        gap: 4px;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }
}

/* ── Landscape on short phones ── */
@media (max-height: 500px) and (max-width: 900px) {
    :root {
        --bottom-nav-h: 46px;
    }

    .verse {
        line-height: 1.9;
    }

    .study-panel {
        height: 85vh;
    }

    .panel-tab-bar {
        height: auto;
    }
}

/* ── Large tablets / iPads: 768–1024px in portrait ── */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --left-nav-w: 220px;
        --right-panel-w: 290px;
    }

    .verse {
        font-size: 1.1rem;
        line-height: 2.1;
    }

    .view {
        padding: 0 24px 60px;
    }
}

/* ── Print styles ── */
@media print {

    .left-nav,
    .top-bar,
    .study-panel,
    .selection-bar,
    .chapter-nav,
    .bottom-nav,
    .ctx-menu,
    .overlay {
        display: none !important;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .bible-text {
        font-size: 12pt;
        line-height: 1.8;
    }

    .verse {
        color: #000;
        background: none !important;
    }

    .verse-num {
        color: #555;
    }

    .ch-heading {
        font-size: 18pt;
        margin-bottom: 16pt;
    }

    .view {
        padding: 0;
        overflow: visible;
    }

    body {
        background: white;
        color: black;
    }
}

/* =========================================================
   UTILITY
   ========================================================= */
.hidden {
    display: none !important;
}

.sep {
    opacity: 0.3;
    margin: 0 4px;
}

/* Bottom nav: hidden on desktop */
.bottom-nav {
    display: none;
}

.mobile-only {
    display: none;
}

/* ── AI Analysis Trigger Button ── */
.run-ai-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(88, 101, 242, 0.35);
    letter-spacing: 0.01em;
}

.run-ai-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.45);
}

.run-ai-btn:active:not(:disabled) {
    transform: translateY(0);
}

.run-ai-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Desktop nav toggle in top bar (always visible) ── */
.desktop-nav-toggle {
    display: flex;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.15s;
}

.desktop-nav-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

/* Hide desktop toggle on mobile (mobile uses its own mobile-nav-btn) */
@media (max-width: 768px) {
    .desktop-nav-toggle {
        display: none !important;
    }
}

/* =========================================================
   AUTH MODAL
   ========================================================= */
.auth-login-pill {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-mid);
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.auth-login-pill:hover {
    background: var(--accent);
    color: white;
}

.auth-user-area {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}

.auth-user-area:hover {
    background: var(--bg-hover);
}

.auth-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-username {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.15s;
}

.auth-logout-btn:hover {
    color: #ef4444;
}

.auth-modal-box {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 36px 32px 28px;
    width: 380px;
    max-width: 92vw;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-hover);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.auth-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.auth-modal-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.auth-modal-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 24px;
    letter-spacing: -0.02em;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.auth-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: var(--font-ui);
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-error {
    color: #ef4444;
    font-size: 0.82rem;
    min-height: 16px;
    margin: -6px 0 10px;
}

.auth-submit-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, var(--accent), #6d28d9);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    margin-top: 4px;
}

.auth-submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 14px;
    font-size: 0.84rem;
    color: var(--text-tertiary);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-lang-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* =========================================================
   IN-PAGE AUDIO PLAYER BAR
   ========================================================= */
.audio-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 8px;
}

.apb-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

.apb-center {
    flex: 1;
    min-width: 120px;
}

.apb-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.apb-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-family: var(--font-ui);
    transition: all 0.15s;
}

.apb-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.apb-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 0.9rem;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.apb-play-btn:hover {
    background: var(--accent-strong, #4f55d9);
    opacity: 1;
}

.apb-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.apb-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.apb-time {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.apb-progress {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    accent-color: var(--accent);
    cursor: pointer;
}

.apb-speed {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    padding: 3px 6px;
    cursor: pointer;
}

.apb-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.apb-toggle.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.apb-close-btn {
    border-color: transparent;
    font-size: 0.9rem;
}

/* Follow-along highlighted verse — 跟读模式当前句高亮 */
.verse.follow-along-active {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.22) 0%, rgba(168, 85, 247, 0.12) 100%) !important;
    border-left: 3px solid var(--accent);
    padding-left: 8px;
    border-radius: 4px;
    scroll-margin-top: 120px;
    /* NOTE: 使用 box-shadow 而非 transition 避免 inline 元素布局抖动 */
    box-shadow: inset 3px 0 0 var(--accent);
    color: var(--text-primary);
    font-weight: 500;
}

/* 跟读按钮激活时的脉冲动画 */
.apb-toggle.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    animation: followPulse 2s ease-in-out infinite;
}

@keyframes followPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.2);
    }
}

/* 收听按钮加载中禁用状态 */
#listen-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .audio-player-bar {
        position: fixed;
        bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        z-index: 500;
        flex-wrap: nowrap;
        padding: 8px 10px;
        gap: 6px;
    }

    .apb-center {
        min-width: 80px;
    }

    .apb-label {
        display: none;
    }

    .apb-right {
        gap: 5px;
    }
}


/* =========================================================
   LANGUAGE SWITCHER PILL — (prominent in top bar)
   ========================================================= */
.lang-switcher-pill {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 2px 3px;
    gap: 1px;
    flex-shrink: 0;
}

.lang-btn {
    padding: 4px 9px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: all 0.18s;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}

.lang-btn:hover:not(.active) {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.lang-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 6px rgba(88, 101, 242, 0.3);
}

/* Inside auth modal lang switcher */
.auth-lang-row .lang-btn {
    padding: 5px 14px;
    font-size: 0.82rem;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--bg-base);
    color: var(--text-secondary);
}

.auth-lang-row .lang-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Selection bar buttons with text labels */
.sel-btn span {
    font-size: 0.75rem;
    margin-left: 3px;
}

.sel-btn-clear {
    margin-left: 4px;
    padding: 4px 8px;
    gap: 4px;
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
}

/* Mobile: hide lang switcher text labels to save space */
@media (max-width: 480px) {
    .lang-btn {
        padding: 3px 7px;
        font-size: 0.72rem;
    }

    .lang-switcher-pill {
        padding: 1px 2px;
    }
}


/* =========================================================
   UI POLISH — YouVersion/Logos inspired
   ========================================================= */

/* ── Better verse reading typography ── */
.bible-text {
    line-height: 1;
}

.verse-wrap {
    padding: 0 4px;
    font-size: var(--font-size-verse, 18px);
}

/* `.verse` typography override removed */

.verse-num {
    font-size: 0.58em;
    vertical-align: super;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.7;
    margin-right: 2px;
    user-select: none;
}

.ch-heading {
    font-family: var(--font-serif);
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 16px;
    letter-spacing: -0.02em;
    line-height: 1.3;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}




/* ── Chapter label bar (override) ── */
.chapter-label-bar {
    padding: 10px 0 4px;
}

.ch-nav-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

/* ── Top bar improvements ── */
.top-bar {
    gap: 8px;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
}

.top-actions {
    gap: 6px;
}

.breadcrumb-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s;
}

.breadcrumb-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-mid);
}

/* ── Version pill ── */
.version-pill {
    padding: 5px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-ui);
    max-width: 140px;
}

.version-pill:focus {
    outline: none;
    border-color: var(--accent);
}

/* ── Panel tabs improvement ── */
.panel-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 0 8px;
}

/* .panel-tab 的规范定义见下方唯一一处（此处原重复 base 规则已合并） */

.panel-tab:hover {
    color: var(--text-primary);
}

.panel-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ── Nav item improvements (YouVersion sidebar style) ── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.87rem;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.12s;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--accent);
}

/* ── Better book list ── */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 8px;
    overflow-y: auto;
    flex: 1;
}

.book-btn {
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-family: var(--font-ui);
    cursor: pointer;
    text-align: left;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.book-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.book-btn.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* ── Audio player responsive polish ── */
@media (max-width: 600px) {
    .apb-right {
        flex-wrap: wrap;
    }

    .apb-speed {
        max-width: 70px;
    }
}

/* ── Reading view content area scrolling ── */
.bible-text {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 4px 8px 80px;
}



[data-theme="dark"] .ch-heading {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .audio-player-bar {
    background: rgba(30, 30, 30, 0.98);
}

/* =========================================================
   MCCHEYNE READING PLAN
   ========================================================= */

/* ── Setup Wizard ── */
.plan-setup-card {
    max-width: 480px;
    margin: 32px auto;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 36px 32px 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.plan-setup-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.plan-setup-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.plan-setup-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    max-width: 380px;
}

.plan-setup-preview {
    width: 100%;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-align: left;
}

.plan-setup-preview-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.plan-setup-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 5px 0;
}

.plan-stream-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plan-stream-dot.plan-stream-1 {
    background: #5865f2;
}

.plan-stream-dot.plan-stream-2 {
    background: #22c55e;
}

.plan-stream-dot.plan-stream-3 {
    background: #f59e0b;
}

.plan-stream-dot.plan-stream-4 {
    background: #ec4899;
}

.plan-setup-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.plan-setup-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.plan-date-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    transition: border-color 0.15s;
    outline: none;
}

.plan-date-input:focus {
    border-color: var(--accent);
}

.plan-setup-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
}

.plan-setup-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Plan Card Grid (Modern) ── */
.plan-grid-hero {
    text-align: center;
    padding: 20px 16px 12px;
}

.plan-grid-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.plan-card-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 4px;
}

.plan-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(108, 92, 231, .1), 0 2px 8px rgba(0, 0, 0, .04);
    transform: translateY(-2px);
}

.plan-card-active {
    border-color: rgba(108, 92, 231, .25);
}

.plan-card-disabled {
    opacity: 0.55;
    cursor: default;
}

.plan-card-disabled:hover {
    border-color: var(--border);
    box-shadow: none;
    transform: none;
}

.plan-card-icon-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.plan-card-body {
    flex: 1;
    min-width: 0;
}

.plan-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 3px;
}

.plan-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plan-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.73rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.plan-card-days {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.plan-card-badge {
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.plan-card-go {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: transform .2s;
    box-shadow: 0 2px 8px rgba(108, 92, 231, .2);
}

.plan-card:hover .plan-card-go {
    transform: translateX(3px);
}

.plan-card-progress {
    flex: 1;
    max-width: 80px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.plan-card-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .3s;
}

.plan-card-progress-text {
    font-size: 0.68rem;
    color: var(--primary);
    font-weight: 600;
}

.plan-back-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    flex-shrink: 0;
}

.plan-back-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.plan-setup-back {
    margin-bottom: 12px;
}

.plan-setup-back a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
}

.plan-setup-back a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .plan-card {
        padding: 14px 12px;
    }

    .plan-card-icon-wrap {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 1rem;
    }
}

/* ── Plan Dashboard ── */
.plan-header {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px 20px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.plan-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.plan-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-title i {
    color: var(--accent);
}

.plan-subtitle {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-top: 3px;
}

.plan-reset-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.plan-reset-btn:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.plan-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.plan-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.plan-progress-label {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    text-align: right;
}

/* ── Plan Sections ── */
.plan-today-section,
.plan-upcoming-section {
    margin-bottom: 24px;
}

.plan-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

/* ── Reading Items ── */
.plan-reading-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plan-reading-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.plan-reading-item.plan-reading-done {
    opacity: 0.6;
    background: var(--bg-hover);
}

.plan-reading-item.plan-reading-done .plan-reading-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.plan-check-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: var(--text-tertiary);
    transition: color 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.plan-check-btn.checked {
    color: #22c55e;
}

.plan-check-btn:hover {
    transform: scale(1.15);
}

.plan-reading-info {
    flex: 1;
    min-width: 0;
}

.plan-reading-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
}

.plan-stream-1 {
    color: #5865f2;
}

.plan-stream-2 {
    color: #22c55e;
}

.plan-stream-3 {
    color: #f59e0b;
}

.plan-stream-4 {
    color: #ec4899;
}

.plan-reading-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-text);
}

.plan-nav-btn {
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    border-radius: var(--radius-sm);
    color: var(--accent);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.plan-nav-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ── Upcoming List ── */
.plan-upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plan-upcoming-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.plan-upcoming-day {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    min-width: 44px;
}

.plan-upcoming-refs {
    font-size: 0.84rem;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.4;
}

.plan-upcoming-done-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 99px;
    padding: 2px 7px;
    flex-shrink: 0;
}

/* ── Dark mode ── */
[data-theme="dark"] .plan-setup-card,
[data-theme="dark"] .plan-header,
[data-theme="dark"] .plan-reading-item,
[data-theme="dark"] .plan-upcoming-item {
    border-color: rgba(255, 255, 255, 0.08);
}

/* ── Mobile Plan ── */
@media (max-width: 768px) {
    .plan-setup-card {
        margin: 16px 0;
        padding: 28px 20px 24px;
        border-radius: var(--radius-lg);
    }

    .plan-header {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .plan-reading-item {
        padding: 10px 12px;
    }

    .plan-reading-title {
        font-size: 0.9rem;
    }
}


/* =========================================================
   UI OVERHAUL — Premium Aesthetic Layer
   ========================================================= */

/* ── View Headings: Playfair Display ── */
.view-header-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    position: relative;
}

.view-header-title::after {
    content: '';
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.ch-heading {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* ── Button Universal: Press Effect ── */
.icon-btn:active,
.pill-action-btn:active,
.breadcrumb-btn:active,
.plan-setup-btn:active,
.save-note-btn:active,
.profile-save-btn:active,
.auth-submit-btn:active,
.plan-nav-btn:active,
.plan-check-btn:active,
.sel-btn:active,
.lang-btn:active,
.book-btn:active,
.nav-item:active,
.testament-btn:active,
.ch-chip:active,
.panel-tab:active,
.ai-preset-btn:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

/* ── Nav Items: Slide & Left Accent ── */
.nav-item {
    transition: all 0.2s var(--ease-out);
    border-left: 3px solid transparent;
    padding-left: 14px;
}

.nav-item:hover {
    transform: translateX(3px);
}

.nav-item.active {
    border-left-color: var(--accent);
    transform: translateX(2px);
}

/* ── Icon Buttons: Refined Hover ── */
.icon-btn {
    transition: all 0.2s var(--ease-out);
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── Pill Action Buttons: Lift + Glow ── */
.pill-action-btn {
    transition: all 0.2s var(--ease-out);
}

.pill-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

/* ── Breadcrumb Buttons: Subtle Lift ── */
.breadcrumb-btn {
    transition: all 0.2s var(--ease-out);
}

.breadcrumb-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ── Primary Action Buttons: Gradient + Glow ── */
.auth-submit-btn {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-submit-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.auth-submit-btn:hover::before {
    opacity: 1;
}

.plan-setup-btn {
    background: var(--accent-gradient) !important;
    transition: all 0.25s var(--ease-out) !important;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.plan-setup-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.plan-setup-btn:hover {
    background: var(--accent-gradient-hover) !important;
    box-shadow: var(--shadow-accent) !important;
    transform: translateY(-2px) !important;
}

.plan-setup-btn:hover::before {
    opacity: 1;
}

.save-note-btn {
    background: var(--accent-gradient);
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.save-note-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}

.profile-save-btn {
    background: var(--accent-gradient);
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.profile-save-btn:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-accent);
}

.ai-search-submit {
    background: var(--accent-gradient);
    transition: all 0.2s var(--ease-out);
}

.ai-search-submit:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.3);
    transform: scale(1.05);
}

/* ── Form Inputs: Glow Focus Rings ── */
.auth-field input {
    transition: all 0.25s var(--ease-out) !important;
    border-width: 1.5px !important;
}

.auth-field input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-sm) !important;
    outline: none;
}

.auth-field input::placeholder {
    transition: all 0.2s var(--ease-out);
}

.auth-field input:focus::placeholder {
    opacity: 0.5;
    transform: translateX(4px);
}

.profile-input {
    transition: all 0.25s var(--ease-out);
    border-width: 1.5px;
}

.profile-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-sm);
}

.note-textarea {
    transition: all 0.25s var(--ease-out);
    border-width: 1.5px;
}

.note-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-sm);
}

.ai-search-box {
    transition: all 0.25s var(--ease-out);
}

.ai-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-md);
    transform: translateY(-1px);
}

.plan-date-input {
    transition: all 0.25s var(--ease-out) !important;
    border-width: 1.5px !important;
}

.plan-date-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-sm) !important;
}

/* ── Custom Range Slider ── */
.range-input {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    transition: background 0.2s;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(88, 101, 242, 0.3);
    transition: all 0.2s var(--ease-out);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(88, 101, 242, 0.3);
}

/* ── Toggle Switch: Spring Animation ── */
.toggle-track {
    transition: background 0.3s var(--ease-spring) !important;
}

.toggle-track::after {
    transition: transform 0.3s var(--ease-spring), box-shadow 0.2s !important;
}

.toggle input:checked+.toggle-track {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.25);
}

.toggle input:checked+.toggle-track::after {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(88, 101, 242, 0.1);
}

/* ── Language Buttons: Gradient Active ── */
.lang-btn {
    transition: all 0.2s var(--ease-out);
    font-weight: 500;
}

.lang-btn:hover:not(.active) {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-light);
}

.lang-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ── Cards: Hover Lift + Shadow Cascade ── */
.settings-card {
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.settings-card:hover {
    box-shadow: var(--shadow-md);
}

.note-card {
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
    border-width: 1.5px;
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-mid);
}

.bookmark-card {
    transition: all 0.25s var(--ease-out);
    box-shadow: var(--shadow-sm);
    border-width: 1.5px;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.media-card {
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.media-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.media-card:hover .media-thumb {
    transform: scale(1.03);
}

.media-thumb {
    transition: transform 0.4s var(--ease-out);
}

.audio-card {
    transition: all 0.2s var(--ease-out);
}

.audio-card:hover {
    transform: translateX(4px);
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

/* ── AI Preset Buttons: Enhanced ── */
.ai-preset-btn {
    transition: all 0.25s var(--ease-out);
    border-width: 1.5px;
}

.ai-preset-btn:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

/* ── Plan Reading Items: Stream Color Bar ── */
.plan-reading-item {
    border-left: 3px solid transparent;
    transition: all 0.2s var(--ease-out);
}

.plan-reading-item:nth-child(1) {
    border-left-color: #5865f2;
}

.plan-reading-item:nth-child(2) {
    border-left-color: #22c55e;
}

.plan-reading-item:nth-child(3) {
    border-left-color: #f59e0b;
}

.plan-reading-item:nth-child(4) {
    border-left-color: #ec4899;
}

.plan-reading-item:hover {
    transform: translateX(2px);
}

/* ── Plan Check Buttons: Animated ── */
.plan-check-btn {
    transition: all 0.2s var(--ease-spring);
}

.plan-check-btn.checked {
    animation: checkBounce 0.4s var(--ease-spring);
}

@keyframes checkBounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ── Auth Modal: Refined ── */
.auth-modal-box {
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-xl) !important;
    animation: modalEntrance 0.35s var(--ease-out) !important;
    position: relative;
    overflow: hidden;
}

.auth-modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Auth Modal Close Button ── */
.auth-modal-close {
    transition: all 0.2s var(--ease-out) !important;
}

.auth-modal-close:hover {
    transform: rotate(90deg) !important;
    color: var(--accent) !important;
}

/* ── Search Modal: Refined ── */
.search-modal {
    animation: searchSlideIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ── Chapter Picker: Refined ── */
.picker-book-btn {
    transition: all 0.15s var(--ease-out);
}

.picker-book-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.picker-book-btn.selected {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-accent);
}

.picker-ch-btn {
    transition: all 0.15s var(--ease-out);
}

.picker-ch-btn:hover {
    transform: scale(1.08);
}

.picker-ch-btn.selected {
    background: var(--accent-gradient);
    box-shadow: var(--shadow-accent);
}

/* ── Chapter Chips: Enhanced ── */
.ch-chip {
    transition: all 0.15s var(--ease-out);
}

.ch-chip:hover {
    transform: scale(1.08);
}

.ch-chip.active {
    background: var(--accent-gradient);
    box-shadow: 0 2px 6px rgba(88, 101, 242, 0.3);
}



/* ── Profile Hero: Enhanced ── */
.profile-avatar {
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.2);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
}

.profile-name {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* ── Progress Bar: Gradient ── */
.plan-progress-fill {
    background: var(--accent-gradient) !important;
    position: relative;
    overflow: hidden;
}

.plan-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* ── Panel Tabs: Enhanced ── */
/* ── .panel-tab 唯一规范定义（合并自原先 3 处相互覆盖的 base 规则，计算结果不变）──
   小屏下的 padding/font 仍由后面的 @media(max-width:768/390) 覆盖规则负责 */
.panel-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: none;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
    transition: all 0.2s var(--ease-out);
}

.panel-tab:hover {
    transform: translateY(-1px);
}

.panel-tab.active {
    border-bottom-color: var(--accent);
    border-bottom-width: 2.5px;
}

/* ── Verse Hover: Smoother ── */
/* Verse Hover duplicate removed */

/* ── Scrollbar Polish ── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-mid);
}

/* ── Plan Setup Card: Glass ── */
.plan-setup-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Plan Title: Display Font ── */
.plan-title {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* ── Setup Icon: Gradient ── */
.plan-setup-icon {
    background: var(--accent-gradient) !important;
    box-shadow: var(--shadow-accent);
}

/* ── Floating Chapter Arrows: Smoother ── */
.ch-float-arrow {
    transition: all 0.25s var(--ease-out);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Context Menu: Glass Effect ── */
#ctx-menu {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
}

/* ── Toast: Glass Effect ── */
.toast-msg {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── Google Sign-in Button: Polish ── */
.google-signin-btn,
#google-signin-btn {
    transition: all 0.2s var(--ease-out) !important;
    box-shadow: var(--shadow-sm);
}

.google-signin-btn:hover,
#google-signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md) !important;
}

/* ── Auth Switch Link: Animated ── */
.auth-switch a {
    transition: all 0.2s var(--ease-out);
    position: relative;
}

.auth-switch a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.25s var(--ease-out);
}

.auth-switch a:hover::after {
    width: 100%;
}

/* ── Staggered Page Load Animation ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header-title {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.plan-setup-card,
.plan-header {
    animation: fadeInUp 0.5s var(--ease-out) 0.1s both;
}

.plan-today-section {
    animation: fadeInUp 0.5s var(--ease-out) 0.2s both;
}

.plan-upcoming-section {
    animation: fadeInUp 0.5s var(--ease-out) 0.3s both;
}

.settings-section {
    animation: fadeInUp 0.4s var(--ease-out) both;
}

.settings-section:nth-child(2) {
    animation-delay: 0.1s;
}

.settings-section:nth-child(3) {
    animation-delay: 0.2s;
}

.profile-hero {
    animation: fadeInUp 0.5s var(--ease-out) both;
}

/* ── Dark Mode: Additional Polish ── */
[data-theme="dark"] .auth-submit-btn,
[data-theme="dark"] .plan-setup-btn,
[data-theme="dark"] .save-note-btn,
[data-theme="dark"] .profile-save-btn {
    box-shadow: 0 2px 12px rgba(139, 155, 255, 0.2);
}

[data-theme="dark"] .auth-modal-box {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .settings-card {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .plan-reading-item {
    border-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .note-card,
[data-theme="dark"] .bookmark-card {
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .ch-chip.active {
    box-shadow: 0 2px 8px rgba(139, 155, 255, 0.3);
}

[data-theme="dark"] .toggle input:checked+.toggle-track {
    box-shadow: 0 0 16px rgba(139, 155, 255, 0.3);
}

/* ── Cross-ref Item: Enhanced ── */
.cross-ref-item {
    transition: all 0.2s var(--ease-out);
}

.cross-ref-item:hover {
    transform: translateX(3px);
}

/* ── AI Bubble: Gradient Icon ── */
.ai-bubble-icon {
    background: var(--accent-gradient);
}

/* ── Search Results: Enhanced ── */
.search-result-item {
    transition: all 0.15s var(--ease-out);
}

.search-result-item:hover {
    transform: translateX(4px);
}

/* ── Overlay Backdrop: Enhanced Blur ── */
.overlay-backdrop {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Mobile Overlay: Enhanced ── */
.mobile-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* =========================================================
   ONBOARDING MODAL
   ========================================================= */

/* Backdrop */
.onboarding-backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body[data-theme="dark"] .onboarding-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

/* Main container */
.onboarding-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    max-width: 94vw;
    max-height: 92vh;
    background: var(--bg-surface);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 1001;
    padding: 36px 32px 28px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: obBoxEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.onboarding-box::-webkit-scrollbar {
    width: 4px;
}

.onboarding-box::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

@keyframes obBoxEnter {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.92);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

body[data-theme="dark"] .onboarding-box {
    background: #1e1d1b;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ── Progress Indicator ── */
.ob-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.ob-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    flex-shrink: 0;
}

.ob-dot span {
    position: relative;
    z-index: 1;
}

.ob-dot.active {
    background: var(--accent-gradient);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.2), var(--shadow-accent);
    transform: scale(1.1);
}

.ob-dot.done {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.ob-connector {
    width: 48px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    transition: background 0.4s ease;
    flex-shrink: 0;
}

.ob-connector.done {
    background: var(--accent);
}

/* ── Skip button ── */
.ob-skip-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    transition: all 0.15s;
    font-family: var(--font-ui);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.ob-skip-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ── Step containers ── */
.ob-step {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: obStepIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.ob-step.active-step {
    display: flex;
}

@keyframes obStepIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes obStepOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Icon wrap */
.ob-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.ob-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 24px;
    background: var(--accent-gradient);
    opacity: 0.12;
    z-index: -1;
    animation: obIconPulse 2s ease-in-out infinite;
}

@keyframes obIconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.12;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.2;
    }
}

.ob-icon-emoji {
    font-size: 1.8rem;
    line-height: 1;
}

/* Title + subtitle */
.ob-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
    font-family: var(--font-text);
}

.ob-subtitle {
    font-size: 0.88rem;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Option Cards ── */
.ob-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.ob-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--bg-app);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    font-family: var(--font-ui);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.ob-option-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.ob-option-card:hover {
    border-color: var(--accent-mid);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ob-option-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15), var(--shadow-md);
}

body[data-theme="dark"] .ob-option-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .ob-option-card:hover {
    border-color: rgba(139, 155, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .ob-option-card.selected {
    border-color: var(--accent);
    background: rgba(139, 155, 255, 0.1);
}

.ob-opt-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

body[data-theme="dark"] .ob-opt-icon {
    background: rgba(255, 255, 255, 0.06);
}

.ob-opt-body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.ob-opt-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ob-opt-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.ob-opt-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.ob-option-card.selected .ob-opt-check {
    background: var(--accent);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

/* Recommend badge */
.ob-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 0 12px 0 10px;
    z-index: 2;
    letter-spacing: 0.02em;
}

/* ── Back / Nav buttons ── */
.ob-nav-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    margin-top: 16px;
    font-family: var(--font-ui);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ob-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ── Step 3: Recommendation Card ── */
.ob-recommendation {
    width: 100%;
    margin-bottom: 16px;
}

.ob-rec-card {
    background: var(--bg-app);
    border: 2px solid var(--accent-mid);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ob-rec-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(88, 101, 242, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

body[data-theme="dark"] .ob-rec-card {
    background: rgba(139, 155, 255, 0.06);
    border-color: rgba(139, 155, 255, 0.2);
}

.ob-rec-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    position: relative;
}

.ob-rec-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-accent);
}

.ob-rec-info {
    flex: 1;
}

.ob-rec-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.ob-rec-meta {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ob-rec-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
}

.ob-rec-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-gold-light);
    color: var(--accent-gold);
    font-size: 0.72rem;
    font-weight: 600;
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ── AI Demo section ── */
.ob-ai-demo {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}

.ob-ai-header {
    padding: 10px 16px;
    background: var(--accent-light);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border);
}

body[data-theme="dark"] .ob-ai-header {
    background: rgba(139, 155, 255, 0.08);
}

.ob-ai-chat {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ob-ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ob-ai-msg.user {
    justify-content: flex-end;
}

.ob-ai-msg.user .ob-ai-bubble {
    background: var(--accent-gradient);
    color: white;
    border-radius: 14px 14px 4px 14px;
    font-size: 0.85rem;
    padding: 10px 14px;
    max-width: 85%;
}

.ob-ai-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-light);
}

.ob-ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ob-ai-msg.bot .ob-ai-bubble {
    background: var(--bg-app);
    color: var(--text-primary);
    border-radius: 14px 14px 14px 4px;
    font-size: 0.85rem;
    padding: 10px 14px;
    max-width: 85%;
    line-height: 1.6;
}

body[data-theme="dark"] .ob-ai-msg.bot .ob-ai-bubble {
    background: rgba(255, 255, 255, 0.05);
}

/* Typing dots */
.ob-typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.ob-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: obTypingBounce 1.4s ease-in-out infinite;
}

.ob-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ob-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes obTypingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── Final row ── */
.ob-final-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

/* ── Start button ── */
.ob-start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    box-shadow: var(--shadow-accent);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.ob-start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.ob-start-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 28px rgba(88, 101, 242, 0.4);
}

.ob-start-btn:hover::before {
    opacity: 1;
}

.ob-start-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ── AI answer typewriter cursor ── */
.ob-ai-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent);
    margin-left: 2px;
    animation: obCursorBlink 0.7s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes obCursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ── Responsive ── */
@media (max-width: 580px) {
    .onboarding-box {
        width: 96vw;
        padding: 28px 20px 20px;
        border-radius: 20px;
        max-height: 88vh;
    }

    .ob-title {
        font-size: 1.15rem;
    }

    .ob-subtitle {
        font-size: 0.82rem;
        margin-bottom: 18px;
    }

    .ob-icon-wrap {
        width: 52px;
        height: 52px;
        border-radius: 16px;
    }

    .ob-icon-emoji {
        font-size: 1.5rem;
    }

    .ob-option-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .ob-opt-icon {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
        border-radius: 10px;
    }

    .ob-opt-title {
        font-size: 0.88rem;
    }

    .ob-opt-desc {
        font-size: 0.72rem;
    }

    .ob-opt-check {
        width: 20px;
        height: 20px;
        font-size: 0.55rem;
    }

    .ob-connector {
        width: 32px;
    }

    .ob-dot {
        width: 28px;
        height: 28px;
        font-size: 0.68rem;
    }

    .ob-start-btn {
        padding: 12px 24px;
        font-size: 0.92rem;
    }

    .ob-final-row {
        flex-direction: column-reverse;
    }

    .ob-start-btn {
        width: 100%;
    }
}

/* =========================================================
   CHAPTER OVERVIEW & EXPLORATION (AI Default State)
   ========================================================= */

/* Override the old no-selection centering */
#ai-default-state {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px 0 8px;
    text-align: left;
}

#ai-default-state p {
    margin: 0;
}

/* ── Chapter Overview Card ── */
.ch-overview-card {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.ch-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 14px 14px 0 0;
}

body[data-theme="dark"] .ch-overview-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.ch-overview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 0;
}

.ch-overview-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

body[data-theme="dark"] .ch-overview-icon {
    background: rgba(139, 155, 255, 0.12);
}

.ch-overview-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.ch-overview-ref {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

.ch-overview-body {
    padding: 10px 14px 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.ch-overview-body .overview-text {
    animation: chOverviewFadeIn 0.5s ease both;
}

@keyframes chOverviewFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton loader */
.ch-overview-skeleton {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Theme tags */
.ch-overview-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 12px;
}

.ch-theme-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.15s;
}

body[data-theme="dark"] .ch-theme-tag {
    background: rgba(139, 155, 255, 0.1);
    color: rgba(179, 191, 255, 0.8);
}

/* ── Exploration Section ── */
.ch-explore-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ch-explore-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    padding-left: 2px;
}

.ch-explore-label i {
    color: var(--accent);
    font-size: 0.85rem;
}

.ch-explore-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-explore-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: var(--font-ui);
    width: 100%;
    line-height: 1.5;
}

.ch-explore-chip:hover {
    border-color: var(--accent-mid);
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ch-explore-chip:active {
    transform: translateY(0);
}

body[data-theme="dark"] .ch-explore-chip {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .ch-explore-chip:hover {
    background: rgba(139, 155, 255, 0.08);
    border-color: rgba(139, 155, 255, 0.2);
}

.ch-chip-emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.ch-chip-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 1;
}

/* ── Select verse hint ── */
.ch-select-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 2px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.7;
}

.ch-select-hint i {
    font-size: 0.7rem;
    animation: chHintBounce 2s ease-in-out infinite;
}

@keyframes chHintBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* ── Confirm Modal Box ── */
.confirm-modal-box {
    position: relative;
    z-index: 1;
    width: min(360px, 90vw);
    border-radius: var(--radius-xl);
    padding: 28px 24px 24px;
    text-align: center;
    border: 1px solid var(--border);
    animation: confirmModalZoom 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body[data-theme="dark"] .confirm-modal-box {
    background: rgba(28, 25, 41, 0.85);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .confirm-modal-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), var(--shadow-xl);
}

@keyframes confirmModalZoom {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(225, 29, 72, 0.06));
    color: #ef4444;
    font-size: 1.6rem;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    animation: warnIconShake 1.5s ease-in-out infinite;
}

@keyframes warnIconShake {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-8deg); }
    30% { transform: rotate(6deg); }
    45% { transform: rotate(-4deg); }
    60% { transform: rotate(2deg); }
}

.confirm-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: var(--font-ui);
    letter-spacing: -0.01em;
}

.confirm-modal-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 24px;
    padding: 0 8px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
}

.confirm-modal-btn {
    flex: 1;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-ui);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.confirm-modal-btn.cancel-btn {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.confirm-modal-btn.cancel-btn:hover {
    background: var(--border);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.confirm-modal-btn.confirm-btn {
    background: linear-gradient(135deg, #ef4444, #e11d48);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.confirm-modal-btn.confirm-btn:hover {
    background: linear-gradient(135deg, #dc2626, #be123c);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
    transform: translateY(-1.5px);
}

.confirm-modal-btn.confirm-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.2);
}

/* ── Auth Modal Brand Logo ── */
.brand-icon img {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.15);
}

.brand-icon img:hover {
    transform: scale(1.15) rotate(4deg);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

/* ── User Dropdown Panel ── */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 290px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999;
    padding: 20px 16px 16px;
    font-family: inherit;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: udFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

@keyframes udFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.user-dropdown.hidden {
    display: none !important;
}

/* User Info */
.ud-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ud-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.ud-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ud-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.ud-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ud-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.ud-plan-card {
    background: linear-gradient(135deg, var(--accent-light) 0%, rgba(237, 233, 255, 0.4) 100%);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(88, 101, 242, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ud-plan-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.08);
}

[data-theme="dark"] .ud-plan-card:hover {
    box-shadow: 0 4px 12px rgba(139, 155, 255, 0.12);
}

/* Dark mode override for Plan Card to fit aesthetic */
[data-theme="dark"] .ud-plan-card {
    background: linear-gradient(135deg, rgba(139, 155, 255, 0.12) 0%, rgba(139, 155, 255, 0.05) 100%);
    border-color: rgba(139, 155, 255, 0.25);
}

.ud-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ud-plan-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ud-support-btn {
    background: var(--accent);
    color: var(--text-on-accent, #ffffff);
    border: none;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ud-support-btn:hover {
    filter: brightness(0.9);
    transform: scale(1.03);
}

.ud-quota-box {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border);
}

.ud-quota-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.ud-quota-val {
    font-weight: 700;
    color: var(--text-primary);
}

.ud-quota-text i {
    cursor: help;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    transition: color 0.15s;
}
.ud-quota-text i:hover {
    color: var(--accent);
}

.ud-progress-bar {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.ud-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.25, 1);
}

/* Menu List */
.ud-menu-list {
    display: flex;
    flex-direction: column;
}

.ud-menu-item {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
    gap: 12px;
}

.ud-menu-item:hover {
    background: var(--bg-hover);
}

.ud-item-icon {
    font-size: 0.95rem;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
    transition: color 0.15s;
}

.ud-menu-item:hover .ud-item-icon {
    color: var(--accent);
}

.ud-item-text {
    font-weight: 500;
    flex-grow: 1;
    text-align: left;
}

.ud-notes-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.ud-arrow {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.ud-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
    opacity: 0.6;
}

.ud-menu-item.logout {
    color: #e63946;
}

.ud-menu-item.logout .ud-item-icon {
    color: #e63946;
}

.ud-menu-item.logout:hover {
    background: rgba(230, 57, 70, 0.08);
}

/* ── Support Modal Panel ── */
.support-modal-box {
    width: 90%;
    max-width: 1040px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg, 0 15px 40px rgba(0, 0, 0, 0.25));
    padding: 30px 40px 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 28px;
    z-index: 1000;
    max-height: 90vh;
    overflow-y: auto;
    font-family: inherit;
    animation: smSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes smSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.support-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.support-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Header & Toggle */
.sm-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.sm-title {
    font-size: 1.75rem;
    font-weight: 750;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sm-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.sm-toggle-container {
    background: var(--bg-hover);
    border-radius: 20px;
    padding: 4px;
    display: flex;
    margin-top: 14px;
    border: 1px solid var(--border);
    width: fit-content;
}

.sm-toggle-btn {
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sm-toggle-btn.active {
    background: #2b2b2b;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] .sm-toggle-btn.active {
    background: #ffffff;
    color: #1e1e1e;
}

/* Cards Grid */
.sm-cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

.sm-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(88, 101, 242, 0.25);
}

.sm-card-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
}

.sm-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.sm-card-price {
    display: flex;
    align-items: baseline;
    color: var(--text-primary);
    text-align: left;
}

.sm-currency {
    font-size: 1.25rem;
    font-weight: 700;
    margin-right: 2px;
}

.sm-price-val {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.sm-period {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 2px;
    font-weight: 500;
}

.sm-card-btn {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
}

.sm-card-btn:hover:not(:disabled) {
    background: var(--accent);
    color: #ffffff;
}

.sm-card-btn.disabled {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-tertiary);
    cursor: default;
}

.sm-features-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.sm-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.sm-feature-item i {
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.sm-feature-item span {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Card overrides: Popular (Card 3) */
.sm-card.popular {
    border-color: var(--accent);
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(88, 101, 242, 0.01) 100%);
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.08);
}
.sm-card.popular:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(88, 101, 242, 0.16);
}

.sm-card-badge {
    position: absolute;
    top: -12px;
    right: 18px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--accent);
}
[data-theme="dark"] .sm-card-badge {
    background: rgba(139, 155, 255, 0.2);
}

/* Card overrides: Supporter (Card 4) */
.sm-card.supporter {
    background: #242322;
    border-color: #3b3a39;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.sm-card.supporter:hover {
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(88, 101, 242, 0.2);
}
[data-theme="dark"] .sm-card.supporter:hover {
    box-shadow: 0 15px 35px rgba(139, 155, 255, 0.2);
}

.sm-card.supporter .sm-card-title,
.sm-card.supporter .sm-card-price,
.sm-card.supporter .sm-features-list .sm-feature-item span {
    color: #ffffff;
}

.sm-card.supporter .sm-currency,
.sm-card.supporter .sm-price-val {
    color: #ffffff;
}

.sm-card.supporter .sm-period {
    color: #b0afae;
}

.sm-card.supporter .sm-feature-item i {
    color: var(--accent);
}

.sm-card-btn.highlight {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.sm-card-btn.highlight:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
    transform: scale(1.02);
}

/* Footer Section */
.sm-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
    margin-top: 8px;
}

.sm-footer-note {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    max-width: 800px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.sm-footer-note i {
    color: var(--text-tertiary);
    font-size: 0.88rem;
}

.sm-footer-links {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    justify-content: center;
}

.sm-footer-links i {
    margin-right: 2px;
    color: var(--text-tertiary);
}

.sm-footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.sm-footer-links a:hover {
    text-decoration: underline;
}

.sm-footer-links .divider {
    color: var(--border);
}

/* Responsiveness */
@media (max-width: 768px) {
    .sm-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .sm-footer-links .divider {
        display: none;
    }
    .sm-footer-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* ── Subscription Management Modal Custom Styles ── */
.subscription-manage-box {
    max-width: 500px !important;
    padding: 35px 30px 25px !important;
}

.manage-sub-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 10px 0;
}

.current-plan-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 20px;
}

.current-plan-icon {
    font-size: 1.8rem;
    color: #6366f1;
    background: var(--bg-surface);
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.current-plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.current-plan-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    font-weight: 700;
}

.current-plan-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.current-plan-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.subscription-status-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-surface);
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-secondary);
}

.status-value {
    font-weight: 600;
    color: var(--text-primary);
}

.manage-sub-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manage-action-btn {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.manage-action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.manage-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.manage-action-btn.danger {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.manage-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* ── Collections & Orders Modal Styles ── */
.collections-modal-box,
.orders-modal-box {
    max-width: 520px !important;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.collections-modal-content,
.orders-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 4px;
    max-height: 420px;
}

/* Scrollbar styling for lists */
.collections-modal-content::-webkit-scrollbar,
.orders-modal-content::-webkit-scrollbar {
    width: 6px;
}
.collections-modal-content::-webkit-scrollbar-track,
.orders-modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.collections-modal-content::-webkit-scrollbar-thumb,
.orders-modal-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.collections-modal-content::-webkit-scrollbar-thumb:hover,
.orders-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* Collections card list layout */
.collections-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collections-list .bookmark-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.collections-list .bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.collections-list .bookmark-card .bookmark-ref {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.collections-list .bookmark-card .bookmark-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-right: 24px; /* avoid overlap with delete button */
}

.collections-list .bookmark-card .delete-bm-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.collections-list .bookmark-card .delete-bm-btn:hover {
    opacity: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* Orders list and cards layout */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.order-item-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.order-info-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-plan-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.order-meta-sub {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
}

.order-id-tag {
    font-family: monospace;
    background: var(--bg-hover);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

.order-right-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.order-price-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
}

.order-status-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.order-status-badge.paid {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Empty State styling */
.collections-modal-box .empty-state,
.orders-modal-box .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 2.6rem;
    color: var(--border-hover);
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    max-width: 280px;
}

.btn-go-support {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover, #4f46e5));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-go-support:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.empty-state-icon {
    animation: bounceSlow 3s infinite ease-in-out;
}

/* =========================================================
   ABOUT US & PRIVACY — premium content pages
   ========================================================= */
.cpage {
    max-width: 880px;
    margin: 0 auto;
    padding: 8px 4px 80px;
}

/* ── Hero ── */
.cpage-hero {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    overflow: hidden;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-lg), var(--shadow-accent);
}
.cpage-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(130% 130% at 50% -30%, rgba(255, 255, 255, 0.28), transparent 55%),
        radial-gradient(80% 80% at 110% 120%, rgba(255, 255, 255, 0.14), transparent 60%);
    pointer-events: none;
}
.cpage-hero > * { position: relative; }
.cpage-hero-badge {
    width: 78px;
    height: 78px;
    margin: 0 auto 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.cpage-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}
.cpage-hero p {
    margin: 12px auto 0;
    max-width: 40ch;
    opacity: 0.94;
    font-size: 1.04rem;
    line-height: 1.65;
}
.cpage-hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Section heading ── */
.cpage-section { margin-top: 44px; }
.cpage-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.cpage-section-head .bar {
    width: 4px;
    height: 24px;
    border-radius: 2px;
    background: var(--accent-gradient);
}
.cpage-section-head h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ── Timeline (About story) ── */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(var(--accent), var(--accent-mid) 70%, transparent);
}
.timeline-item { position: relative; padding-bottom: 30px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -30px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}
.timeline-era {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--accent);
    margin-bottom: 8px;
}
.timeline-body {
    color: var(--text-secondary);
    line-height: 1.95;
    font-size: 0.95rem;
}

/* ── Feature grid (About) ── */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-mid);
}
.feature-ico {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
    transition: transform 0.25s ease;
}
.feature-card:hover .feature-ico { transform: scale(1.08) rotate(-4deg); }
.feature-card h3 {
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 9px;
}
.feature-card p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Policy cards (Privacy) ── */
.policy-list { display: flex; flex-direction: column; gap: 14px; }
.policy-card {
    display: flex;
    gap: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.policy-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-mid);
    transform: translateX(3px);
}
.policy-ico {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: var(--shadow-accent);
}
.policy-card h3 {
    font-size: 1.04rem;
    font-weight: 700;
    margin: 3px 0 9px;
    color: var(--text-primary);
}
.policy-card p {
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Closing note ── */
.cpage-note {
    margin-top: 38px;
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    background: var(--accent-light);
    border: 1px solid var(--accent-mid);
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.8;
    text-align: center;
}
.cpage-note strong { color: var(--accent); font-weight: 600; }

/* ── Entrance animation ── */
@keyframes cpageIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.cpage > * { animation: cpageIn 0.5s ease both; }
.cpage > *:nth-child(2) { animation-delay: 0.06s; }
.cpage > *:nth-child(3) { animation-delay: 0.12s; }
.cpage > *:nth-child(4) { animation-delay: 0.18s; }
.feature-grid .feature-card { animation: cpageIn 0.5s ease both; }
.feature-grid .feature-card:nth-child(2) { animation-delay: 0.05s; }
.feature-grid .feature-card:nth-child(3) { animation-delay: 0.1s; }
.feature-grid .feature-card:nth-child(4) { animation-delay: 0.15s; }
.feature-grid .feature-card:nth-child(5) { animation-delay: 0.2s; }

@media (max-width: 600px) {
    .cpage-hero { padding: 44px 24px; }
    .cpage-hero h1 { font-size: 1.7rem; }
    .cpage-hero p { font-size: 0.98rem; }
    .feature-card { padding: 22px; }
    .policy-card { padding: 20px; gap: 14px; }
}