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

/* ── Fonts ── */
/* 网络字体已移除：与 App 一致使用系统字体栈（见 --font-ui） */

/* ── Color Tokens ── */
:root {
    /* 色值与 App 端（mobile-app/src/index.css）保持同一套语义色系统：
       暖金 = 阅读，紫 = AI/交互，蓝灰 = 注释。
       只替换变量取值，选择器和结构一律不动。 */

    /* Backgrounds */
    --bg-app: #f6f7f8;          /* App --surface */
    --bg-surface: #fffefc;      /* App --white */
    --bg-hover: #eef0f3;        /* App --surface-2 */
    --bg-active: var(--accent-light);       /* App --purple-soft 叠在白底上的等效值 */
    --bg-panel: #fffefc;
    --glass-bg: rgba(255, 254, 252, 0.72);
    --glass-border: rgba(255, 255, 255, 0.45);

    /* Text */
    --text-primary: #202229;    /* App --ink */
    --text-secondary: #545b66;  /* App --body */
    --text-tertiary: #6f7681;   /* App --muted */
    --text-on-accent: #ffffff;

    /* Accent / Brand — 取自 logo 的琥珀色系
       logo 亮橙 #E89A2C 作文字/按钮底只有 2.3:1，远低于可读线，
       因此功能色用同色相的深琥珀（5.2:1，与原紫的 5.7:1 相当），
       亮橙保留给 logo 本身与装饰性强调。
       如需回退到紫：var(--accent) / var(--accent-hover) / var(--accent-light) / var(--accent-mid) */
    --accent: #8250ab;          /* App --purple */
    --accent-hover: #663b8b;    /* App --purple-deep */
    --accent-light: #f2ecf6;
    --accent-mid: #cdb4de;
    --brand-orange: #e89a2c;    /* logo 亮橙，仅用于品牌标识 */
    --accent-gold: #f4c75f;     /* App --yellow */
    --accent-gold-light: #fff3d2; /* App --yellow-soft */
    /* App 按钮是纯色，不用渐变；变量名保留避免大面积改引用 */
    --accent-gradient: #8250ab;
    --accent-gradient-hover: #663b8b;

    /* Borders */
    --border: #e0e3e8;          /* App --line */
    --border-strong: #c8ccd4;

    /* Shadows：与 App 同两档质感——卡片影 --shadow-card、弹层影 --shadow-overlay */
    --shadow-sm: 0 1px 3px rgba(35, 38, 45, 0.06);
    --shadow-md: 0 3px 10px rgba(35, 38, 45, 0.08);
    --shadow-lg: 0 12px 32px rgba(48, 49, 51, 0.16);
    --shadow-xl: 0 18px 48px rgba(27, 29, 35, 0.2);
    --shadow-accent: 0 4px 12px rgba(111, 60, 157, 0.18);
    --shadow-gold: 0 5px 15px rgba(172, 126, 25, 0.12);

    /* Layout */
    --left-nav-w: 144px;
    --right-panel-w: 340px;
    --top-bar-h: 58px;
    /* App 圆角只有 8 / 12 / 16 / 999 四档 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 16px;
    --radius-full: 999px;

    /* Typography */
    /* 与 App 一致的系统字体栈，不加载网络字体 */
    --font-ui: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    --font-display: 'Songti SC', 'STSong', 'Noto Serif SC', Georgia, serif;
    /* 章标题与段落小标题引用的是这个名字；此前从未定义，一直静默回落成黑体 */
    --font-serif: 'Songti SC', 'STSong', 'Noto Serif SC', Georgia, serif;
    --font-text: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans 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"] {
    /* 深色同样取 App 的 body.dark 值 */
    --bg-app: #101116;          /* App --surface */
    --bg-surface: #17191f;      /* App --white */
    --bg-hover: #1e2027;        /* App --surface-2 */
    --bg-active: rgba(183, 137, 218, 0.14); /* App --purple-soft */
    --bg-panel: #17191f;
    --glass-bg: rgba(23, 25, 31, 0.78);
    --glass-border: rgba(255, 255, 255, 0.06);
    --text-primary: #f2f0eb;    /* App --ink */
    --text-secondary: #c0beb8;  /* App --body */
    --text-tertiary: #9297a2;   /* App --muted */
    --border: #343740;          /* App --line */
    --border-strong: #4a4e59;
    --accent: #b789da;          /* 深色下的紫 */
    --accent-hover: #c5a0df;
    --accent-light: rgba(183, 137, 218, 0.14);
    --accent-mid: rgba(183, 137, 218, 0.28);
    --brand-orange: #e89a2c;
    --accent-gold: #f1c662;     /* App --yellow（深色） */
    --accent-gold-light: rgba(241, 198, 98, 0.14);
    --accent-gradient: #b789da;
    --accent-gradient-hover: #c5a0df;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.48);
    --shadow-xl: 0 18px 48px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 4px 12px rgba(183, 137, 218, 0.25);
}

/* ── 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(130, 80, 171, 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: 600;
    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;
}

/* 书卷列表已移除：占位元素撑开中部，把底部按钮组固定在底 */
.nav-spacer { flex: 1; }

/* 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: 600;
    background: none;
    border: none;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.testament-btn.active {
    background: var(--accent-gold-light);
    color: var(--gold-ink);
    font-weight: 700;
    box-shadow: none;
}

.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-gold-light);
    color: var(--gold-ink);
    font-weight: 700;
}

.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: 600;
    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);
}

/* 书卷/章选择在顶栏始终显示（侧栏已不含书卷列表） */
/* 「我的」导航项的头像态：登录后替代图标，尺寸与图标区一致 */
.nav-avatar {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 800;
    overflow: hidden;
    line-height: 1;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
/* 右栏「我的」标签里的头像：与标签图标同尺寸 */
.panel-tab .nav-avatar { width: 17px; height: 17px; font-size: 0.6rem; vertical-align: -3px; }

/* ── 奉献页 ── 布局参考微读圣经；配色遵循本站令牌（金=温暖致辞，紫=交互） */
.donate-hero {
    margin-bottom: 16px;
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, var(--accent-gold-light), #fff8e8 60%, var(--bg-card, #fff));
    border: 1px solid var(--accent-gold);
}
.donate-hero h2 {
    margin-bottom: 10px;
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--gold-ink);
}
.donate-hero p { margin: 6px 0; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.75; }

.donate-card {
    padding: 18px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card, #fff);
    box-shadow: var(--shadow-md);
}
.donate-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.donate-amt {
    padding: 12px 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.donate-amt:hover { border-color: var(--accent-mid); }
.donate-amt.selected { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.donate-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card, #fff);
}
.donate-custom input {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}
.donate-custom span { color: var(--text-secondary); font-weight: 700; }
.donate-custom:focus-within { border-color: var(--accent); }
.donate-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.donate-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.donate-method:hover { border-color: var(--accent-mid); }
.donate-method.selected { border-color: var(--accent); background: var(--accent-light); }
/* 奇数个支付方式时，最后一项跨满整行；两项时保持并排 */
.donate-method:nth-child(odd):last-child { grid-column: 1 / -1; }
.donate-submit { width: 100%; margin-top: 16px; padding: 12px 0; font-size: 1rem; border-radius: var(--radius-md); }
.donate-note { margin-top: 10px; color: var(--text-tertiary); font-size: 0.75rem; text-align: center; }

/* 登录入口已移入左侧「我的」（未登录时该页给出登录按钮）。
   顶栏的登录钮与头像区只做隐藏不删节点：auth.js 的 updateTopBar
   仍要靠这两个节点走完并派发 authchange 事件 */
#auth-login-btn, #auth-user-area { display: none !important; }

/* 主操作按钮：模板里大量使用但此前从未定义过样式（一直是浏览器默认灰钮）。
   紫=交互 的标准实心按钮：登录、发布、加入计划、完成阅读等主操作统一用它 */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 18px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    box-shadow: var(--shadow-accent);
    transition: background 0.15s, transform 0.1s;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-hover); }
.primary-btn:active:not(:disabled) { transform: scale(0.97); }
.primary-btn:disabled { opacity: 0.55; cursor: default; }

/* 章翻页浮钮：悬浮在正文两侧、垂直居中，不随正文滚动。
   只在阅读视图出现；半透明常驻，悬停实色，避免遮挡文字的压迫感 */
.content-area { position: relative; }
.ch-float {
    position: absolute;
    top: 50%;
    z-index: 30;
    display: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card, #fff);
    color: var(--text-secondary);
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0.65;
    transform: translateY(-50%);
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.content-area:has(#view-reading.active-view) .ch-float { display: grid; }
.ch-float:hover:not(:disabled) { opacity: 1; color: var(--gold-ink); border-color: var(--accent-gold); }
.ch-float:disabled { opacity: 0.2; cursor: default; }
.ch-float-left { left: 10px; }
.ch-float-right { right: 10px; }
@media (max-width: 768px) { .ch-float { display: none !important; } }

/* 慧读标签的迷你 logo：描边随文字色，星与书页保持品牌色 */
.tab-logo-mark { width: 15px; height: 15px; vertical-align: -2px; }

/* 正文字体切换：设置里的「黑体/宋体」。宋体行高微升，笔画细需要更多呼吸 */
body.serif-body .verse {
    font-family: var(--font-serif);
    line-height: 1.85;
    letter-spacing: 0;
}

/* 拼音版：ruby 注音排版 */
.is-pinyin .verse { line-height: 2.35; }
.is-pinyin ruby { ruby-align: center; }
.is-pinyin rt {
    color: var(--text-tertiary);
    font-size: 0.56em;
    font-weight: 400;
    letter-spacing: 0;
}
.is-pinyin .verse.selected rt,
.is-pinyin .verse:hover rt { color: inherit; opacity: 0.75; }

/* 侧栏为图标栏：宽度只保留 logo，一切文字隐藏（悬停有 title 提示）。
   移动端抽屉（≤768px）不在此列，仍是带文字的完整菜单。 */
@media (min-width: 769px) {
    /* 窄栏：logo 与字标左右排列，导航项图标在上、小字在下 */
    .left-nav .nav-brand { justify-content: center; padding: 6px 0; gap: 0; }
    .left-nav .nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 56px;
        padding: 8px 0;
        border-radius: 10px;
        /* 覆盖横排菜单的「左条 + 右移」动效：竖排居中版一切以对称为先 */
        border-left: 0;
        transform: none;
    }
    .left-nav .nav-item:hover { transform: none; background: var(--bg-hover); }
    /* 激活态用金族：与正上方 logo、顶栏的金色芯片同一语系（金=阅读） */
    .left-nav .nav-item.active {
        background: var(--accent-gold-light);
        color: var(--gold-ink);
        border-left: 0;
        transform: none;
        font-weight: 700;
    }
    .left-nav .nav-item.active i { color: var(--gold-ink); }
    .left-nav .nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    .left-nav .nav-item span { display: block; font-size: 0.68rem; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }
    .left-nav .nav-item.active span { font-weight: 700; }
    .left-nav .nav-item i { font-size: 1.1rem; width: auto; text-align: center; }
    .left-nav .nav-views, .left-nav .nav-bottom { padding: 10px 8px; gap: 4px; }
    .left-nav .nav-divider { margin: 2px 14px; }
}
/* 顶栏空间不足时逐级收缩：书卷/章芯片的优先级最高，永不隐藏。
   ≤1280：上一章/下一章箭头隐藏（章芯片浮层里也能翻）、收听只留图标；
   ≤1080：版本选择隐藏（宽屏可见）、语言切换与登录收紧。 */
@media (max-width: 1280px) {
    #listen-btn span { display: none; }
    .breadcrumb-btn { padding: 5px 8px; }
}
@media (max-width: 1080px) {
    #version-select { display: none; }
    /* 对照是低频入口，窄屏让位给书卷/章芯片；宽屏仍在 */
    #compare-btn { display: none; }
    .lang-switcher-pill button { padding: 3px 6px; font-size: 0.75rem; }
    #auth-login-btn { padding: 4px 9px; font-size: 0.8rem; }
    .top-actions { gap: 4px; }
    #top-bar { padding-left: 8px; padding-right: 8px; }
    .breadcrumb-area { gap: 4px; }
}

.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: 600;
    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: 600;
    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(130, 80, 171, 0.3);
}

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

.sel-btn-pill.btn-ai:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(130, 80, 171, 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: var(--danger-soft);
    color: var(--danger);
}

body[data-theme="dark"] .sel-close-btn:hover {
    background: rgba(201, 56, 112, 0.15);
    color: var(--danger);
}

/* 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;
    /* 底色/高亮/阴影只包住文本：节框按内容收缩，不铺满整栏 */
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    border-radius: 8px;
    padding: 4px 14px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    line-height: 1.7;
    letter-spacing: -0.02em;
    /* 避头尾：标点不落行首（与注释一致） */
    line-break: strict;
    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-heading {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.06rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin: 20px 0 8px;
    padding: 0 14px;
}
.verse-wrap > .verse-heading:first-child {
    margin-top: 4px;
}
body[data-theme="dark"] .verse-heading {
    color: var(--text-secondary);
}

.verse:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

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: none;
    box-shadow: none;
}

.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;
}

/* 区间节号(如「13-14」)：略缩小字号，使其宽度≈两位数，
   既让该节正文左缘与上下经文(12、15 等)对齐，号码又能完整显示、不被正文遮住 */
.verse-num.range,
.verse[data-verse*="-"] .verse-num {
    font-size: 0.36em;
    white-space: nowrap;
}

.verse:hover .verse-num {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(130, 80, 171, 0.45);
}

body[data-theme="dark"] .verse:hover .verse-num {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(130, 80, 171, 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: #fbe59a !important;
}

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

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

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

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

body[data-theme="dark"] .verse[data-highlight="#FEF08A"] {
    background: rgba(244, 199, 95, 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;
}

/* 经文中的人名/地名标注 <mark class="pn">：由默认的黄色背景改为下划线 */
mark.pn {
    background: transparent;
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--accent-gold);
    text-underline-offset: 2px;
}
body[data-theme="dark"] mark.pn {
    text-decoration-color: var(--accent-gold);
}

/* 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: #714a08;
    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: #714a08;
    background: rgba(217, 119, 6, 0.12);
    transform: scale(1.2);
}

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

body[data-theme="dark"] .verse-note-icon:hover {
    color: #f4c75f;
    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(--text-tertiary);
}

.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(--text-tertiary);
}

/* ── AI tab ── */
.ai-search-box {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.ai-search-box:focus-within { box-shadow: none; }

.ai-search-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0;
    border: none;
    background: none;
    outline: none;
    font-size: 0.84rem;
    color: var(--text-primary);
}

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

.ai-search-submit {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.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(130, 80, 171, 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: var(--accent);
    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: var(--accent);
    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 */
/* ── 「我的」面板（右栏）：概览 + 子页两级结构，与 App 端 MePage 同构 ── */
.profile-panel { padding: 6px 2px 14px; display: flex; flex-direction: column; gap: 14px; }

/* 未登录 */
.mep-guest { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 12px; text-align: center; }
.mep-guest b { font-size: 0.95rem; }
.mep-guest p { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.6; }
.mep-guest .primary-btn { margin-top: 6px; }

/* 身份区 */
.mep-hero { display: flex; align-items: center; gap: 10px; padding: 2px; }
.mep-avatar {
    display: grid; place-items: center;
    width: 46px; height: 46px; flex: none;
    /* 头像是身份标识，不是可操作元素——用中性面，把紫留给真正的交互 */
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-hover); color: var(--text-primary);
    font-size: 1.1rem; font-weight: 800; overflow: hidden; cursor: pointer;
}
.mep-avatar.is-guest { background: var(--bg-hover); color: var(--text-tertiary); cursor: default; }
.mep-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mep-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mep-id b { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mep-id small { color: var(--text-tertiary); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 我的记录 */
.mep-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mep-stat {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 4px; border-radius: var(--radius-md); background: var(--bg-hover);
}
.mep-stat { border: none; cursor: pointer; transition: background 0.15s; font-family: inherit; }
.mep-stat:hover:not(:disabled) { background: var(--accent-light); }
.mep-stat:disabled { cursor: default; opacity: 0.55; }
.mep-stat b { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.mep-stat small { color: var(--text-secondary); font-size: 0.72rem; }

/* 菜单组 */
.mep-menu {
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-card, #fff); overflow: hidden;
}
.mep-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border: none; background: none;
    color: var(--text-primary); font-size: 0.85rem; text-align: left; cursor: pointer;
}
.mep-item + .mep-item { border-top: 1px solid var(--border); }
.mep-item:hover { background: var(--bg-hover); }
.mep-item > i:first-child { width: 16px; color: var(--text-tertiary); font-size: 0.85rem; }
.mep-item > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mep-item > span small { color: var(--text-tertiary); font-size: 0.72rem; }
.mep-item > i:last-child { color: var(--text-tertiary); font-size: 0.7rem; }

/* 高亮列表条目：左侧色点标明高亮颜色 */
.mep-hl-dot { flex: none; width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); }

.mep-logout {
    padding: 10px 0; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: none; color: var(--danger); font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.mep-logout:hover { background: var(--danger-soft); }

/* 子页 */
.mep-subhead { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.mep-back { display: grid; place-items: center; width: 26px; height: 26px; border: none; border-radius: 8px; background: var(--bg-hover); color: var(--text-secondary); cursor: pointer; }
.mep-subhead b { font-size: 0.9rem; }
.mep-loading { color: var(--text-tertiary); font-size: 0.8rem; padding: 12px 2px; }

/* 子页：表单（纵向堆叠，窄栏才放得下） */
.mep-form { display: flex; flex-direction: column; gap: 12px; }
.mep-form label { display: flex; flex-direction: column; gap: 5px; }
.mep-form label span { color: var(--text-secondary); font-size: 0.78rem; font-weight: 600; }
.mep-form input, .mep-form select {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg-app); color: var(--text-primary); font-size: 0.85rem;
}
.mep-form input:focus, .mep-form select:focus { border-color: var(--accent); outline: none; }
.mep-form input:disabled { color: var(--text-tertiary); }
.mep-form .primary-btn { width: 100%; margin-top: 2px; }

/* 子页：开关（说明左、开关右——这个横排适合窄栏） */
.mep-switches { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card, #fff); overflow: hidden; }
.mep-switch { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.mep-switch + .mep-switch { border-top: 1px solid var(--border); }
.mep-switch > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mep-switch b { font-size: 0.84rem; font-weight: 600; }
.mep-switch small { color: var(--text-tertiary); font-size: 0.72rem; }
.mep-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mep-switch i {
    flex: none; width: 38px; height: 22px; border-radius: 999px;
    background: var(--border-strong); position: relative; transition: background 0.18s;
}
.mep-switch i::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 999px; background: #fff;
    transition: transform 0.18s;
}
.mep-switch input:checked + i { background: var(--accent); }
.mep-switch input:checked + i::after { transform: translateX(16px); }

/* 从正文笔记图标跳转过来时的定位闪烁 */
@keyframes noteCardFlash {
    0%, 60% { border-color: var(--accent-gold); box-shadow: 0 0 0 3px var(--accent-gold-light); }
    100% { border-color: var(--border); box-shadow: none; }
}
.note-card-flash { animation: noteCardFlash 1.8s ease-out; }

/* 注释卡片：一条一卡，节段徽章 + 可折叠长文 */
.commentary-item {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card, #fff);
}
.commentary-count {
    margin-bottom: 8px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}
.commentary-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
/* 节段徽章走金族（阅读语境）；多节段用实底金，一眼看出覆盖范围更广 */
.commentary-range {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--accent-gold-light);
    color: var(--gold-ink);
    font-size: 0.75rem;
    font-weight: 800;
    font-family: var(--font-ui);
}
.commentary-range.is-multi {
    background: var(--accent-gold);
    color: #23262d;
}
.commentary-source {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 600;
}
.commentary-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    /* 中文标准排版：两端对齐 + 避头尾（标点不出现在行首） */
    text-align: justify;
    text-justify: inter-ideograph;
    line-break: strict;
    hanging-punctuation: allow-end;
}
/* 段落首行缩进两字符，段间距压小——缩进已承担分段职能 */
.commentary-text p { margin: 0 0 4px; text-indent: 2em; }
.commentary-text p:last-child { margin-bottom: 0; }
/* 西文片段（如 The Source）保持不缩进不对齐拉伸 */
.commentary-text span { text-indent: 0; }

/* 长文折叠：收起态限高 + 渐隐遮罩，展开全文交给用户 */
.commentary-item.is-collapsed .commentary-text {
    max-height: 340px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
    mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.commentary-expand {
    display: block;
    margin-top: 6px;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.commentary-expand:hover { text-decoration: underline; }
.commentary-expand.hidden { display: none; }

/* 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(130, 80, 171, 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: 800;
    font-size: 0.6rem;
    margin-right: 4px;
    opacity: 0.7;
}

.ai-preset-btn.contextual:hover {
    background: linear-gradient(135deg, rgba(111, 60, 157, 0.18), rgba(130, 80, 171, 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: 16px;
    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: var(--accent-hover);
    padding: 24px 24px 32px;
    position: relative;
    text-align: left;
}

.tag-explain-subtitle {
    color: var(--accent-mid);
    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: var(--accent-mid);
    font-size: 0.75rem;
}

.tag-explain-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-mid);
    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: 16px 16px 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: 600;
    margin-top: 12px;
    color: var(--text-secondary);
}

.tag-explain-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--danger-soft);
    border: 1px solid rgba(201, 56, 112, 0.24);
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
    color: var(--danger);
    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: var(--accent-mid);
    background-color: var(--accent-light);
}

.tag-explain-s1 .tag-explain-section-header {
    background: var(--accent);
}

.tag-explain-s1 .tag-explain-section-body {
    color: #522f70;
}

.tag-explain-s2 {
    border-color: var(--border);
    background-color: var(--bg-hover);
}

.tag-explain-s2 .tag-explain-section-header {
    background: var(--accent);
}

.tag-explain-s2 .tag-explain-section-body {
    color: var(--text-secondary);
}

.tag-explain-s3 {
    border-color: var(--border);
    background-color: var(--bg-hover);
}

.tag-explain-s3 .tag-explain-section-header {
    background: var(--accent);
}

.tag-explain-s3 .tag-explain-section-body {
    color: var(--text-secondary);
}

/* ── 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(130, 80, 171, 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(111, 60, 157, 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(130, 80, 171, 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(130, 80, 171, 0.4);
    transform: translateY(-1.5px);
}

.share-actions button.primary:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(130, 80, 171, 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: var(--danger);
}

.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, #2f1d40, #4a2a63);
    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: #f4c75f;
    -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: #f4c75f;
    font-size: 0.7rem;
}

.vip-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: var(--radius-full);
    background: #f4c75f;
    color: #2f1d40;
    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(--border-strong);
}

.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;
}

/* 笔记列表约束到可读宽度：卡片内容短，铺满千余像素只会显得空 */
#notes-list, .notes-toolbar { max-width: 720px; }

/* ── 笔记卡片：元信息一行 + 正文为主，操作悬停显现 ── */
.note-card {
    position: relative;
    padding: 10px 14px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card, #fff);
    transition: border-color 0.15s;
}
.note-card:hover { border-color: var(--border-strong); }
.note-card + .note-card { margin-top: 8px; }

.note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.74rem;
    color: var(--text-tertiary);
}
/* 经文引用归金族（阅读语境），与顶栏芯片、注释徽章一致 */
.note-ref {
    padding: 0;
    border: none;
    background: none;
    color: var(--gold-ink);
    font-size: 0.76rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.note-ref:disabled { cursor: default; opacity: 0.75; }
.note-ref:hover:not(:disabled) { text-decoration: underline; }
.note-kind {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
}
.note-meta time { margin-left: auto; flex: none; }

/* 操作：默认隐形，悬停/键盘聚焦时出现，不打扰阅读 */
.note-acts { display: flex; gap: 2px; flex: none; opacity: 0; transition: opacity 0.15s; }
.note-card:hover .note-acts,
.note-card:focus-within .note-acts { opacity: 1; }
.note-act {
    display: grid;
    place-items: center;
    width: 24px; height: 24px;
    border: none; border-radius: 7px;
    background: none;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    cursor: pointer;
}
.note-act:hover { background: var(--bg-hover); color: var(--text-primary); }
.note-act.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

.note-body, .note-a {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-primary);
    overflow-wrap: break-word;
}
.note-a { color: var(--text-secondary); }
.note-a p { margin: 0 0 6px; }
.note-a p:last-child { margin-bottom: 0; }
/* 慧读卡的问句是标题级信息 */
.note-q {
    margin-bottom: 4px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.55;
    color: var(--text-primary);
}
/* 超过三行折起，点击展开 */
.clampable {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
}
.clampable.is-open { -webkit-line-clamp: unset; }


.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: 600;
}

/* 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(--border-strong);
}

.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: 600;
    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-light);
    border-color: var(--accent-mid);
    color: var(--accent);
}

.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(--border-strong);
}

.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: 600;
    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(130, 80, 171, 0.28);
    color: var(--accent-mid);
}



/* =========================================================
   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(--border-strong);
}

.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: var(--accent);
}

.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: 600;
    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: 16px;
    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: 12px;
    padding: 10px 14px;
    transition: box-shadow 0.25s ease, background 0.2s;
}

.search-input-wrap:focus-within {
    background: var(--bg-surface);
    box-shadow: none;
    border-color: var(--border-strong);
}

.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(--text-secondary);
}

.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: 600;
    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: 12px;
    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(130, 80, 171, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

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

/* History items */
.search-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    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: 12px;
    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: 12px;
    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(244, 199, 95, 0.5) 40%);
    color: var(--text-primary);
    font-weight: 600;
    border-radius: 0;
}

[data-theme="dark"] .search-highlight {
    background: linear-gradient(to bottom, transparent 40%, rgba(244, 199, 95, 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: 600;
    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: 600;
    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: var(--danger-soft);
    color: var(--danger);
}

/* 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(130, 80, 171, 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-surface);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-primary);
    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-gold);
    background: var(--accent-gold-light);
    color: var(--gold-ink);
}

.picker-book-btn.selected {
    background: var(--text-primary);
    color: var(--accent-gold);
    border-color: var(--text-primary);
    font-weight: 700;
}

.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-surface);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.12s;
    text-align: center;
    font-family: var(--font-ui);
}

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

.picker-ch-btn.selected {
    background: var(--text-primary);
    color: var(--accent-gold);
    border-color: var(--text-primary);
}

/* 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: var(--text-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.86rem;
    font-weight: 600;
    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: var(--success);
}

@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(--text-primary);
    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(--bg-hover);
    color: var(--text-secondary);
    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: 600;
    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: 8px;
    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: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 6px 24px rgba(130, 80, 171, 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: var(--accent);
    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(130, 80, 171, 0.35);
}

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

.ap-play-btn.playing {
    background: var(--accent);
}

/* 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(--border-strong);
}

.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: var(--danger);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-ui);
}

.profile-logout-btn:hover {
    background: rgba(201, 56, 112, 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-gold);
    color: #23262d;
    border-color: var(--accent-gold);
}

/* 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: 144px;
    }
}

@media (max-width: 960px) {
    :root {
        --left-nav-w: 144px;
        --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: 600;
        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: 144px;
        --right-panel-w: 290px;
    }

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

    .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: var(--accent);
    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(130, 80, 171, 0.35);
    letter-spacing: 0.01em;
}

.run-ai-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(130, 80, 171, 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: var(--accent);
    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: var(--danger);
}

.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(--border-strong);
}

.auth-error {
    color: var(--danger);
    font-size: 0.82rem;
    min-height: 16px;
    margin: -6px 0 10px;
}

.auth-submit-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    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: 600;
}

.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, var(--accent-hover));
    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(130, 80, 171, 0.22) 0%, rgba(130, 80, 171, 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: 600;
}

/* 跟读按钮激活时的脉冲动画 */
.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(130, 80, 171, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(130, 80, 171, 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: 16px;
    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-gold);
    color: #23262d;
    box-shadow: var(--shadow-gold);
}

/* 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: 16px;
    background: var(--bg-base);
    color: var(--text-secondary);
}

.auth-lang-row .lang-btn.active {
    background: var(--accent-gold);
    color: #23262d;
    border-color: var(--accent-gold);
}

/* 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(--border-strong);
}

/* ── 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: 600;
    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-gold-light);
    color: var(--gold-ink);
    font-weight: 700;
}

/* ── 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: var(--accent);
}

.plan-stream-dot.plan-stream-2 {
    background: var(--accent);
    opacity: 0.75;
}

.plan-stream-dot.plan-stream-3 {
    background: var(--accent);
    opacity: 0.5;
}

.plan-stream-dot.plan-stream-4 {
    background: var(--accent);
    opacity: 0.3;
}

.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(--border-strong);
}

.plan-setup-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    background: var(--accent);
    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(130, 80, 171, 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(130, 80, 171, .1), 0 2px 8px rgba(0, 0, 0, .04);
    transform: translateY(-2px);
}

.plan-card-active {
    border-color: rgba(130, 80, 171, .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: 12px;
    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: 600;
}

.plan-card-badge {
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 2px 10px;
    border-radius: 12px;
    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(130, 80, 171, .2);
}

.plan-card:hover .plan-card-go {
    transform: translateX(3px);
}

/* 服务端计划卡（新版计划页：社群共读/公共/我创建的） */
.plan-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.plan-section-title { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.85rem; font-weight: 800; }
.plan-section-title i { color: var(--accent); }
.plan-scard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    box-shadow: var(--shadow-card, 0 3px 10px rgba(35, 38, 45, 0.08));
}
.plan-scard.is-finished { opacity: 0.75; }
.plan-scard-head { display: flex; align-items: center; gap: 8px; }
.plan-scard-head b { font-size: 0.92rem; }
.plan-scard-head small { margin-left: auto; flex: 0 0 auto; color: var(--text-tertiary); }
.plan-card-badge.is-community {
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(130, 80, 171, 0.1);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
}
.plan-scard-desc { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.5; }
.plan-today {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px dashed var(--accent);
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}
.plan-today:hover { background: var(--accent); color: #fff; }
/* 计划日程展开：逐日可点，点哪天跳哪段经文 */
.plan-days-toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.plan-days-toggle:hover { text-decoration: underline; }
.plan-day-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 4px 0 2px;
    padding: 0;
    list-style: none;
}
.plan-day {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}
.plan-day:hover { background: var(--bg-hover); }
.plan-day > i { margin-left: auto; color: var(--text-tertiary); font-size: 0.7rem; }
.plan-day-no {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
}
/* 已完成的天用金色对勾——与共读进度、侧栏激活同族 */
.plan-day-no.is-done { background: var(--accent-gold-light); color: var(--gold-ink); }
.plan-day-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plan-day-text b { font-size: 0.82rem; font-weight: 700; }
.plan-day-text small { color: var(--text-secondary); font-size: 0.75rem; }

.plan-scard-actions { display: flex; justify-content: flex-end; }
.plan-complete-btn, .plan-enroll-btn { padding: 6px 16px; font-size: 0.8rem; }
.plan-card-done { color: var(--success, #2f7a50); font-size: 0.82rem; font-weight: 800; }

.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: 600;
}

.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: var(--danger);
    border-color: rgba(201, 56, 112, 0.3);
    background: rgba(201, 56, 112, 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: var(--accent);
    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: var(--success);
}

.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: var(--accent);
}

.plan-stream-2,
.plan-stream-3,
.plan-stream-4 {
    color: var(--accent);
}

.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: var(--success);
    background: rgba(34, 197, 94, 0.12);
    border-radius: 999px;
    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: 衬线标题（系统宋体栈） ── */
.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 {
    transition: background 0.2s var(--ease-out);
}

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

/* ── 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) !import
    border-color: var(--border-strong) !important;
    outline: none;
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(--border-strong);
}

.note-textarea {
    transition: all 0.25s var(--ease-out);
    border-width: 1.5px;
}

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

.ai-search-box {
    transition: all 0.25s var(--ease-out);
}

.ai-search-box:focus-within {
    box-shadow: none;
}

.plan-date-input {
    transition: all 0.25s var(--ease-out) !important;
    border-width: 1.5px !important;
}

.plan-date-input:focus {
    border-color: var(--border-strong) !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(130, 80, 171, 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(130, 80, 171, 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(130, 80, 171, 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(130, 80, 171, 0.25);
}

.toggle input:checked+.toggle-track::after {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(130, 80, 171, 0.1);
}

/* ── Language Buttons: Gradient Active ── */
.lang-btn {
    transition: all 0.2s var(--ease-out);
    font-weight: 600;
}

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

.lang-btn.active {
    background: var(--accent-gold);
    color: #23262d;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

/* ── 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: var(--accent);
}

.plan-reading-item:nth-child(2),
.plan-reading-item:nth-child(3) {
    border-left-color: var(--accent);
}

.plan-reading-item:nth-child(4) {
    border-left-color: var(--accent);
}

.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(--text-primary);
    color: var(--accent-gold);
    border-color: var(--text-primary);
    box-shadow: none;
}

.picker-ch-btn {
    transition: all 0.15s var(--ease-out);
}

.picker-ch-btn:hover {
    transform: scale(1.08);
}

.picker-ch-btn.selected {
    background: var(--text-primary);
    color: var(--accent-gold);
    border-color: var(--text-primary);
    box-shadow: none;
}

/* ── 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(130, 80, 171, 0.3);
}



/* ── Profile Hero: Enhanced ── */
.profile-avatar {
    transition: all 0.25s var(--ease-out);
    box-shadow: 0 2px 10px rgba(130, 80, 171, 0.2);
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(130, 80, 171, 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: 600;
    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(130, 80, 171, 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(130, 80, 171, 0.3);
}

[data-theme="dark"] .toggle input:checked+.toggle-track {
    box-shadow: 0 0 16px rgba(130, 80, 171, 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: 16px;
    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: #17191f;
    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(130, 80, 171, 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: 600;
    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: 16px;
    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: 16px;
    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: 12px;
    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(130, 80, 171, 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(130, 80, 171, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .ob-option-card.selected {
    border-color: var(--accent);
    background: rgba(130, 80, 171, 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(130, 80, 171, 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 12px;
    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(130, 80, 171, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

body[data-theme="dark"] .ob-rec-card {
    background: rgba(130, 80, 171, 0.06);
    border-color: rgba(130, 80, 171, 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: 12px;
    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: 12px;
    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(130, 80, 171, 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: 12px 12px 4px 12px;
    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: 12px 12px 12px 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(130, 80, 171, 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: 16px;
        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: 12px;
    }

    .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-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.ch-overview-card::before {
    content: none;
}

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(--bg-hover);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

body[data-theme="dark"] .ch-overview-icon {
    background: var(--bg-hover);
}

.ch-overview-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.ch-overview-ref {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    font-weight: 600;
    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: 8px;
    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(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.15s;
}

body[data-theme="dark"] .ch-theme-tag {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* ── 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-surface);
    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(--border-strong);
    background: var(--bg-hover);
    box-shadow: none;
}

.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: var(--bg-hover);
    border-color: var(--border-strong);
}

.ch-chip-emoji {
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent);
    width: 18px;
    text-align: center;
}

.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(201, 56, 112, 0.18), rgba(201, 56, 112, 0.06));
    color: var(--danger);
    font-size: 1.6rem;
    margin-bottom: 20px;
    border: 1px solid rgba(201, 56, 112, 0.25);
    box-shadow: 0 8px 20px rgba(201, 56, 112, 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: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(201, 56, 112, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.confirm-modal-btn.confirm-btn:hover {
    background: var(--danger);
    box-shadow: 0 6px 18px rgba(201, 56, 112, 0.45);
    transform: translateY(-1.5px);
}

.confirm-modal-btn.confirm-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(201, 56, 112, 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: 600;
}

.ud-plan-card {
    background: linear-gradient(135deg, var(--accent-light) 0%, rgba(242, 236, 246, 0.4) 100%);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(130, 80, 171, 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(130, 80, 171, 0.08);
}

[data-theme="dark"] .ud-plan-card:hover {
    box-shadow: 0 4px 12px rgba(130, 80, 171, 0.12);
}

/* Dark mode override for Plan Card to fit aesthetic */
[data-theme="dark"] .ud-plan-card {
    background: linear-gradient(135deg, rgba(130, 80, 171, 0.12) 0%, rgba(130, 80, 171, 0.05) 100%);
    border-color: rgba(130, 80, 171, 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: 8px;
    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: 600;
    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: 12px;
    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: var(--danger);
}

.ud-menu-item.logout .ud-item-icon {
    color: var(--danger);
}

.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: 16px;
    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: 700;
    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: 16px;
    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: #1e2027;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] .sm-toggle-btn.active {
    background: #ffffff;
    color: #17191f;
}

/* 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(130, 80, 171, 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: 600;
}

.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(130, 80, 171, 0.01) 100%);
    box-shadow: 0 6px 18px rgba(130, 80, 171, 0.08);
}
.sm-card.popular:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(130, 80, 171, 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(130, 80, 171, 0.2);
}

/* Card overrides: Supporter (Card 4) */
.sm-card.supporter {
    background: #1e2027;
    border-color: #343740;
    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(130, 80, 171, 0.2);
}
[data-theme="dark"] .sm-card.supporter:hover {
    box-shadow: 0 15px 35px rgba(130, 80, 171, 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: #9297a2;
}

.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(130, 80, 171, 0.08) 0%, rgba(130, 80, 171, 0.08) 100%);
    border: 1px solid rgba(130, 80, 171, 0.2);
    border-radius: 16px;
    padding: 20px;
}

.current-plan-icon {
    font-size: 1.8rem;
    color: var(--accent);
    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: var(--accent);
    color: #fff;
    box-shadow: 0 4px 15px rgba(130, 80, 171, 0.25);
}

.manage-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(130, 80, 171, 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(201, 56, 112, 0.08);
    color: var(--danger);
    border-color: rgba(201, 56, 112, 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: var(--danger);
    background: rgba(201, 56, 112, 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: var(--success);
    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: var(--accent);
    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(130, 80, 171, 0.2);
}

.btn-go-support:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(130, 80, 171, 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: 600;
}

/* ── 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; }
}

/* ══ 极简配色系统 ═══════════════════════════════════════════════════
   全站只有四个角色，不再有第三、第四个装饰色相：
     1. 紫 --accent      唯一强调色：交互、AI、激活态、链接
     2. 金 --accent-gold 阅读语境：收听、书卷胶囊、高亮（文字用 --gold-ink 保对比）
     3. 中性灰阶          文字、边框、背景、次要信息
     4. --success/--danger 仅用于状态反馈（成功/危险），不做装饰
   注释（精读）原本的蓝灰已并入中性与紫，读经计划与标签解读的多色分段
   改为同色系深浅。经文高亮色是存量数据键，单独保留。 */
:root {
    --gold-ink: #714a08;        /* 金色文字，浅底上保证对比 */
    /* 旧令牌名别名：历史样式仍引用这些名字，不接上会静默失效（继承或透明） */
    --bg-main: var(--bg-surface);
    --bg-base: var(--bg-app);
    --text-muted: var(--text-tertiary);
    --primary: var(--accent);
    --text: var(--text-primary);
    --border-hover: var(--border-strong);
    --success: #2f7a50;
    --danger: #c93870;
    --danger-soft: #f9e3ec;
    /* 兼容旧引用：注释语义并入唯一强调色与中性面 */
    --commentary: var(--accent);
    --commentary-soft: var(--bg-hover);
}

body[data-theme="dark"] {
    --gold-ink: #efc96d;
    --success: #75c493;
    --danger: #e0759f;
    --danger-soft: rgba(224, 117, 159, 0.15);
    --commentary: var(--accent);
    --commentary-soft: var(--bg-hover);
}

/* 1. 顶栏阅读选择器（书卷 / 章 / 译本）→ App 顶栏的金色胶囊 */
.breadcrumb-btn,
.version-pill {
    background: var(--accent-gold-light);
    color: var(--gold-ink);
}

/* 2. 收听按钮：朗读属于阅读，跟随金色 */
#listen-btn {
    background: var(--accent-gold-light);
    /* 边框与悬停一并归入金族：基类 pill-action-btn 是紫系，不覆盖会露出紫边 */
    border-color: var(--accent-gold);
    color: var(--gold-ink);
}
#listen-btn:hover:not(:disabled) {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #23262d;
}

/* 3. 左侧导航活跃态：阅读视图切换，对应 App 底部导航的金色活跃块 */
.nav-item.active {
    background: var(--accent-gold-light);
    color: var(--gold-ink);
}

/* 4. 精读（注释）语义归蓝灰：面板页签活跃态与注释条目 */
.panel-tab[data-tab="study"].active {
    color: var(--commentary);
    border-bottom-color: var(--commentary);
}

.study-ref-pill {
    background: var(--commentary-soft);
    border-color: var(--commentary);
    color: var(--commentary);
}


/* 新建高亮存 App 色值，与旧 Tailwind 色值的键并存，存量数据不受影响 */
.verse[data-highlight="#FBE59A"] { background: #fbe59a !important; }
.verse[data-highlight="#BFE6CF"] { background: #bfe6cf !important; }
.verse[data-highlight="#C7DCF4"] { background: #c7dcf4 !important; }
.verse[data-highlight="#F3CAD8"] { background: #f3cad8 !important; }
.verse[data-highlight="#DDCCF1"] { background: #ddccf1 !important; }
body[data-theme="dark"] .verse[data-highlight="#FBE59A"] { background: rgba(251, 229, 154, 0.25) !important; }
body[data-theme="dark"] .verse[data-highlight="#BFE6CF"] { background: rgba(191, 230, 207, 0.2) !important; }
body[data-theme="dark"] .verse[data-highlight="#C7DCF4"] { background: rgba(199, 220, 244, 0.2) !important; }
body[data-theme="dark"] .verse[data-highlight="#F3CAD8"] { background: rgba(243, 202, 216, 0.2) !important; }
body[data-theme="dark"] .verse[data-highlight="#DDCCF1"] { background: rgba(221, 204, 241, 0.2) !important; }

/* 小写高亮键兼容（历史本地数据） */
.verse[data-highlight="#fef08a"] {
    background: #fbe59a !important;
}
.verse[data-highlight="#bbf7d0"] {
    background: #bfe6cf !important;
}
.verse[data-highlight="#bae6fd"] {
    background: #c7dcf4 !important;
}
.verse[data-highlight="#fbcfe8"] {
    background: #f3cad8 !important;
}
.verse[data-highlight="#ddd6fe"] {
    background: #ddccf1 !important;
}
.verse[data-highlight="#fef08a"] {
    background: rgba(244, 199, 95, 0.25) !important;
}
.verse[data-highlight="#bbf7d0"] {
    background: rgba(187, 247, 208, 0.2) !important;
}
.verse[data-highlight="#bae6fd"] {
    background: rgba(186, 230, 253, 0.2) !important;
}
.verse[data-highlight="#fbcfe8"] {
    background: rgba(251, 207, 232, 0.2) !important;
}
.verse[data-highlight="#ddd6fe"] {
    background: rgba(221, 214, 254, 0.2) !important;
}
.verse[data-highlight="#fbe59a"] { background: #fbe59a !important; }
.verse[data-highlight="#bfe6cf"] { background: #bfe6cf !important; }
.verse[data-highlight="#c7dcf4"] { background: #c7dcf4 !important; }
.verse[data-highlight="#f3cad8"] { background: #f3cad8 !important; }
.verse[data-highlight="#ddccf1"] { background: #ddccf1 !important; }
.verse[data-highlight="#fbe59a"] { background: rgba(251, 229, 154, 0.25) !important; }
.verse[data-highlight="#bfe6cf"] { background: rgba(191, 230, 207, 0.2) !important; }
.verse[data-highlight="#c7dcf4"] { background: rgba(199, 220, 244, 0.2) !important; }
.verse[data-highlight="#f3cad8"] { background: rgba(243, 202, 216, 0.2) !important; }
.verse[data-highlight="#ddccf1"] { background: rgba(221, 204, 241, 0.2) !important; }

/* ── 无障碍：键盘焦点可见环（App 紫），鼠标点击不显示 ── */
/* 键盘焦点环只给没有文本光标的控件；输入框靠光标指示焦点，
   再套一圈紫环既多余又难看。 */
:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[contenteditable]:focus-visible {
    outline: none !important;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* ══ 社群面板（右栏）══════════════════════════════════════════════
   与 App 同一份数据，面板宽度有限只承载核心闭环。
   配色沿用全站极简系统：紫=强调，中性灰=骨架，玫红仅用于状态。 */
.community-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    gap: 10px;
}

/* 群动态视图：标题固定在顶、助手输入栏固定在底，只有中间的动态区滚动。
   面板整体不再滚动，否则输入栏会跟着内容跑。 */
.community-panel.is-feed { overflow: hidden; }
.community-panel.is-feed .cmty-feed-scroll {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    /* flex 子项默认 min-height:auto，不置 0 的话内容撑高容器、滚不起来 */
    min-height: 0;
    overflow-y: auto;
    /* 给滚动条留出空隙，避免压住动态卡片右边 */
    margin-right: -4px;
    padding-right: 4px;
}

.cmty-loading,
.cmty-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 16px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}

.cmty-empty i { font-size: 1.6rem; opacity: 0.5; }
.cmty-empty .cmty-hint { font-size: 0.78rem; opacity: 0.8; }
.cmty-login-btn,
.cmty-retry-btn { padding: 8px 22px; border-radius: 999px; font-size: 0.85rem; }

.cmty-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* ── 社群列表 ── */
.cmty-list { display: flex; flex-direction: column; gap: 8px; }

.cmty-list-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s var(--ease-out);
}

.cmty-list-row:hover { background: var(--bg-hover); }
.cmty-list-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.cmty-list-copy b { overflow: hidden; font-size: 0.88rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cmty-list-copy small { color: var(--text-tertiary); font-size: 0.74rem; }
.cmty-list-row > i { color: var(--text-tertiary); font-size: 0.72rem; }

/* ── 动态流 ── */
.cmty-feed-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.cmty-feed-head b { overflow: hidden; font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.cmty-back,
.cmty-new {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}
.cmty-back:hover,
.cmty-new:hover { background: var(--bg-hover); color: var(--accent); }

.cmty-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--accent-mid);
    border-radius: 12px;
    background: var(--bg-surface);
}

.cmty-composer textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    resize: vertical;
}

.cmty-composer-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
}

.cmty-composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.cmty-composer-actions button { padding: 6px 16px; border-radius: 8px; font-size: 0.8rem; cursor: pointer; }
.cmty-composer-cancel { border: 1px solid var(--border); background: none; color: var(--text-secondary); }

.cmty-posts { display: flex; flex-direction: column; gap: 10px; }

.cmty-post {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
}

.cmty-post-head { display: flex; align-items: center; gap: 8px; }
.cmty-post-meta { display: flex; min-width: 0; flex-direction: column; }
.cmty-post-meta b { font-size: 0.82rem; font-weight: 700; }
.cmty-post-meta small { color: var(--text-tertiary); font-size: 0.72rem; }
.cmty-post-title { font-size: 0.88rem; font-weight: 700; }

.cmty-post-ref {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}
/* 可点的经文引用：能跳转阅读器时才渲染成按钮态 */
.cmty-post-ref.is-link { border: none; cursor: pointer; }
.cmty-post-ref.is-link:hover { background: var(--accent); color: #fff; }

/* 代祷卡：淡紫底 + 「我为你祷告」 */
.cmty-post.is-prayer {
    border-color: rgba(130, 80, 171, 0.3);
    background: linear-gradient(150deg, rgba(130, 80, 171, 0.04), rgba(130, 80, 171, 0.09));
}
.cmty-post-kind {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(130, 80, 171, 0.1);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
}
.cmty-pray { font-weight: 700; }
.cmty-pray.is-on { color: var(--accent); }

/* 共读进度卡：置于动态流顶部，整卡可点去计划页 */
.cmty-plan-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow-card, 0 3px 10px rgba(35, 38, 45, 0.08));
}
.cmty-plan-card:hover { border-color: var(--accent); }
.cmty-plan-head { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.cmty-plan-head i { color: var(--accent); }
.cmty-plan-head b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmty-plan-head small { flex: 0 0 auto; margin-left: auto; color: var(--text-tertiary); }
.cmty-plan-stats { display: flex; flex-direction: column; gap: 4px; }
.cmty-plan-bar {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-hover);
    overflow: hidden;
}
.cmty-plan-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.3s;
}
.cmty-plan-stats small { color: var(--text-secondary); font-size: 0.72rem; }
.cmty-plan-mine { align-self: flex-start; color: var(--accent); font-size: 0.75rem; font-weight: 700; }
.cmty-plan-mine.is-done { color: var(--success, #2f7a50); }

.cmty-post-body { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.6; }

.cmty-post-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 4px;
    color: var(--text-tertiary);
    font-size: 0.76rem;
}

.cmty-like { display: flex; align-items: center; gap: 4px; color: inherit; cursor: pointer; }
.cmty-like.is-on { color: var(--danger); }
.cmty-count { display: flex; align-items: center; gap: 4px; }

.cmty-comments {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 8px;
    background: var(--bg-hover);
    font-size: 0.78rem;
}
.cmty-comment { color: var(--text-secondary); line-height: 1.5; }
.cmty-comment b { margin-right: 4px; color: var(--text-primary); font-weight: 700; }

/* ── 社群助手 ──
   动态流是主界面，助手停靠底部。对话与确认卡片浮在输入栏上方，
   高度受限并可滚动，避免长对话把动态流挤没。 */
.cmty-asst {
    display: flex;
    /* 固定页脚：不参与滚动，也不被动态区压缩 */
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.cmty-asst-thread {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* 对话再长也不喧宾夺主：动态流始终保住面板一半以上 */
    max-height: 30vh;
    overflow-y: auto;
    padding: 8px;
    border-radius: 12px;
    background: var(--bg-hover);
    font-size: 0.78rem;
}
.cmty-asst-msg { padding: 6px 10px; border-radius: 10px; line-height: 1.55; }
.cmty-asst-msg.is-user { align-self: flex-end; max-width: 85%; background: var(--accent); color: #fff; }
.cmty-asst-msg.is-assistant { align-self: flex-start; max-width: 92%; background: var(--bg-app); color: var(--text-primary); }
.cmty-asst-msg.is-thinking { color: var(--text-tertiary); }
.cmty-asst-error { padding: 6px 10px; border-radius: 8px; background: var(--danger-soft, rgba(201,56,112,0.1)); color: var(--danger); font-size: 0.75rem; }
.cmty-asst-status { color: var(--text-tertiary); font-size: 0.75rem; }
.cmty-asst-clear { align-self: center; padding: 2px 0; border: none; background: none; color: var(--text-tertiary); font-size: 0.72rem; cursor: pointer; }
.cmty-asst-clear:hover { color: var(--accent); }

/* 确认卡片：执行前把改动摊开，视觉上要明显区别于普通回复 */
.cmty-asst-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--bg-app);
}
.cmty-asst-kicker {
    align-self: flex-start;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--accent-soft, var(--bg-hover));
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
}
.cmty-asst-card b { font-size: 0.82rem; font-weight: 700; }
.cmty-asst-card p { color: var(--text-secondary); line-height: 1.55; }
.cmty-asst-fields { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 0.75rem; }
.cmty-asst-fields > div { display: flex; gap: 6px; }
.cmty-asst-fields dt { flex: 0 0 auto; color: var(--text-tertiary); }
.cmty-asst-fields dd { margin: 0; min-width: 0; color: var(--text-primary); word-break: break-word; }
.cmty-asst-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.cmty-asst-cancel { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--text-secondary); font-size: 0.75rem; cursor: pointer; }
.cmty-asst-ok { padding: 4px 12px; font-size: 0.75rem; }

.cmty-asst-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.72rem;
}
.cmty-asst-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmty-asst-chip small { flex: 0 0 auto; color: var(--text-tertiary); }
.cmty-asst-chip-x { margin-left: auto; border: none; background: none; color: var(--text-tertiary); cursor: pointer; }

.cmty-asst-bar { display: flex; align-items: center; gap: 6px; }
.cmty-asst-attach,
.cmty-asst-voice {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
}
.cmty-asst-attach:hover,
.cmty-asst-voice:hover { color: var(--accent); background: var(--bg-hover); }
.cmty-asst-voice.is-listening { color: #fff; background: var(--danger); }
.cmty-asst-input {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.78rem;
}
.cmty-asst-send {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
}
.cmty-asst-send:disabled,
.cmty-asst-attach:disabled,
.cmty-asst-voice:disabled { opacity: 0.5; cursor: default; }
.cmty-asst-note { color: var(--text-tertiary); font-size: 0.68rem; line-height: 1.4; }

/* ── 社群工作台（App 端 GroupPage 的同构移植） ── */

/* 顶栏副标题：在线数 / 成员数 */
.cmty-head-sub { margin-left: auto; color: var(--text-tertiary); font-size: 0.72rem; white-space: nowrap; }

/* 栏目标签：助手/动态/活动（/成员/小组/资料） */
.cmty-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
    border-bottom: 1px solid var(--border);
}
.cmty-tabs button {
    flex: 1;
    padding: 7px 2px 8px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cmty-tabs button:hover { color: var(--text-primary); }
.cmty-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }

/* 列表页：徽章与分区 */
.cmty-list-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cmty-list-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmty-badge {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
}
.cmty-badge.is-official { background: var(--gold-soft, rgba(244, 199, 95, 0.28)); color: var(--gold-deep, #8a6212); }
.cmty-badge.is-role { background: var(--accent-soft, rgba(130, 80, 171, 0.12)); color: var(--accent); }
.cmty-badge.is-alert { background: rgba(201, 56, 112, 0.12); color: var(--danger, #c93870); }
.cmty-list-row.is-official {
    background: var(--gold-soft, rgba(244, 199, 95, 0.18));
    border: 1px solid transparent;
}
.cmty-list-row.is-official:hover { border-color: var(--gold-deep, #c9992e); background: var(--gold-soft, rgba(244, 199, 95, 0.28)); }
.cmty-sect {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.8rem;
}
.cmty-sect b { font-weight: 700; }
.cmty-sect span { color: var(--text-tertiary); font-size: 0.74rem; }
.cmty-note { color: var(--text-tertiary); font-size: 0.74rem; line-height: 1.5; }
.cmty-status { padding: 8px 2px; color: var(--text-tertiary); font-size: 0.78rem; line-height: 1.5; }

/* 发现社群 */
.cmty-discover-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    border: none;
    border-radius: 10px;
    background: var(--bg-app);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.cmty-discover-toggle:hover { background: var(--bg-hover); color: var(--accent); }
.cmty-discover { display: flex; flex-direction: column; gap: 8px; }
.cmty-discover-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card, var(--bg-app));
    color: var(--text-tertiary);
}
.cmty-discover-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.78rem;
    outline: none;
}
.cmty-discover-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--bg-card, var(--bg-app));
    border: 1px solid var(--border);
}
.cmty-discover-row .cmty-list-copy b { font-size: 0.82rem; }
.cmty-join-btn {
    flex: 0 0 auto;
    padding: 4px 14px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}
.cmty-join-btn:disabled { opacity: 0.6; cursor: default; }

/* 各栏目通用：新建入口与用量行 */
.cmty-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: none;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.cmty-create-btn:hover { border-color: var(--accent); background: var(--bg-hover); }
.cmty-usage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

/* 活动卡片 */
.cmty-event {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, var(--bg-app));
}
.cmty-event.is-ended { opacity: 0.65; }
.cmty-event-kicker { color: var(--accent); font-size: 0.68rem; font-weight: 700; }
.cmty-event.is-ended .cmty-event-kicker { color: var(--text-tertiary); }
.cmty-event b { font-size: 0.86rem; font-weight: 700; }
.cmty-event p { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.55; }
.cmty-event small { color: var(--text-tertiary); font-size: 0.72rem; }
.cmty-event-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }
.cmty-ev-signup {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}
.cmty-ev-signup.is-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.cmty-ev-signup:disabled { opacity: 0.6; cursor: default; }
.cmty-past summary {
    padding: 6px 0;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.cmty-past[open] summary { margin-bottom: 8px; }
.cmty-past summary span { margin-left: 4px; }

/* 成员栏目 */
.cmty-reqs { display: flex; flex-direction: column; gap: 8px; }
.cmty-req,
.cmty-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card, var(--bg-app));
}
.cmty-req-actions,
.cmty-member-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.cmty-req-actions button,
.cmty-member-actions button {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cmty-req-ok { border-color: var(--accent) !important; background: var(--accent) !important; color: #fff !important; }
.cmty-remove-btn:hover { border-color: var(--danger, #c93870); color: var(--danger, #c93870); }
.cmty-invite { display: flex; gap: 6px; }
.cmty-invite-input {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.76rem;
}
.cmty-invite-btn {
    flex: 0 0 auto;
    padding: 4px 16px;
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

/* 资料栏目 */
.cmty-res-filters { display: flex; gap: 6px; }
.cmty-res-filters button {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}
.cmty-res-filters button.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.cmty-res {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, var(--bg-app));
}
.cmty-res-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--bg-app);
    color: var(--text-tertiary);
}
.cmty-res .cmty-list-copy b { font-size: 0.82rem; }
.cmty-res-status {
    align-self: flex-start;
    margin-top: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
}
.cmty-res-status.is-indexed { background: rgba(39, 174, 96, 0.12); color: #1f7a46; }
.cmty-res-status.is-parsing { background: var(--bg-hover); color: var(--text-secondary); }
.cmty-res-status.is-failed,
.cmty-res-status.is-reindex { background: rgba(201, 56, 112, 0.1); color: var(--danger, #c93870); }
.cmty-res-actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; }
.cmty-res-actions button,
.cmty-res-actions a {
    padding: 2px 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.cmty-res-actions .cmty-res-hide { color: var(--text-tertiary); }
.cmty-res-actions .cmty-res-hide:hover { color: var(--danger, #c93870); }

/* 助手首页：身份卡 + 建议芯片 */
.cmty-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 12px 10px;
    text-align: center;
}
.cmty-hero-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-soft, rgba(130, 80, 171, 0.12));
    color: var(--accent);
    font-size: 1rem;
    font-weight: 800;
}
.cmty-hero:not(.is-official) .cmty-hero-mark { color: #fff; }
.cmty-hero h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.98rem;
    font-weight: 800;
}
.cmty-hero-type {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft, rgba(130, 80, 171, 0.12));
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}
.cmty-hero p { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.6; }
.cmty-hero-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-top: 8px;
}
.cmty-hero-chip {
    padding: 9px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, var(--bg-app));
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmty-hero-chip:hover { border-color: var(--accent); color: var(--accent); }
.cmty-hero-note { margin-top: 6px; color: var(--text-tertiary); font-size: 0.7rem; line-height: 1.5; }

/* 举报：动作行末尾的弱化旗标；点开出现原因行，选原因即提交 */
.cmty-report-btn {
  margin-left: auto;
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  cursor: pointer;
}
.cmty-report-btn:hover { color: var(--danger, #c93870); }
.cmty-report-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--bg-app);
}
.cmty-report-row small { color: var(--text-tertiary); font-size: 0.72rem; }
.cmty-report-row button {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.cmty-report-row button:hover { border-color: var(--danger, #c93870); color: var(--danger, #c93870); }
.cmty-report-row .cmty-report-cancel { border: none; color: var(--text-tertiary); }

/* 「查看全部评论」/「加载更多动态」——次要动作，用文字按钮而非实心按钮，
   避免和发布、发送这些主操作抢视觉权重。 */
.cmty-more {
    align-self: flex-start;
    padding: 4px 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.cmty-more:hover { text-decoration: underline; }
.cmty-more:disabled { color: var(--text-tertiary); cursor: default; text-decoration: none; }
.cmty-more-posts { align-self: center; padding: 8px 0; }

.cmty-comment-box { display: flex; align-items: center; gap: 6px; }
.cmty-comment-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 0.78rem;
}
.cmty-comment-send {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
}

.cmty-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 4px;
}
.cmty-list-head b { font-size: 0.82rem; font-weight: 700; }
.cmty-refresh {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 0.76rem;
    cursor: pointer;
}
.cmty-refresh:hover { background: var(--bg-hover); color: var(--accent); }

/* ══ 登录弹窗：与 App 端 LoginPage 同一套布局与尺寸 ═══════════════════
   输入行 48px 高、12px 圆角；获取验证码用暖金，主按钮用紫；
   倒计时期间按钮变灰显示剩余秒数。 */
.auth-modal-box.auth-app {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 380px;
    max-width: 92vw;
    padding: 26px 24px 22px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.auth-brand-name { font-size: 20px; font-weight: 800; }
.auth-brand-accent { color: var(--brand-orange); }
.auth-brand-tagline { color: var(--text-secondary); font-size: 12px; font-weight: 600; }

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.auth-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-app);
}

/* 输入框聚焦不加紫色描边：光标已经指明焦点所在 */
.auth-input-row > i { flex: none; color: var(--text-tertiary); font-size: 0.86rem; }
.auth-input-row input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }

.auth-code-btn {
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--accent-gold);
    color: var(--gold-ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}

.auth-code-btn.is-cooling,
.auth-code-btn:disabled { background: var(--bg-hover); color: var(--text-secondary); cursor: default; }

.auth-primary-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}
.auth-primary-btn:hover:not(:disabled) { background: var(--accent-hover); }
.auth-primary-btn:disabled { opacity: 0.65; cursor: default; }

.auth-app .auth-error { margin: 0; min-height: 0; font-size: 12px; font-weight: 700; }
.auth-notice { margin: 0; color: var(--text-secondary); font-size: 12px; font-weight: 600; line-height: 1.6; }
.auth-error.hidden, .auth-notice.hidden { display: none; }
.auth-hint { color: var(--text-secondary); font-size: 12px; font-weight: 600; text-align: center; }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.auth-divider::before,
.auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-oauth { display: flex; flex-direction: column; gap: 10px; }

.auth-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}
.auth-oauth-btn:hover { background: var(--bg-hover); }
.auth-google-slot { display: flex; justify-content: center; min-height: 44px; }

.auth-terms { color: var(--text-tertiary); font-size: 12px; line-height: 1.7; text-align: center; }
.auth-term-link { color: var(--accent); text-decoration: underline; cursor: pointer; }

.auth-app .auth-lang-row { margin-top: 0; padding-top: 14px; }

/* ══ 书卷 / 章选择器：与 App 端同一套配色 ═══════════════════════════
   浅色：未选=白底墨字细边，选中=墨底金字
   深色：选中改为暖金底金字（墨底在深色下与背景难以区分）
   与 App 的 .bible-book-option / .annotation-chapter-grid button 对齐。 */
body[data-theme="dark"] .picker-book-btn.selected,
body[data-theme="dark"] .picker-ch-btn.selected {
    border-color: #655329;
    background: var(--accent-gold-light);
    color: var(--accent-gold);
}


/* ══ 慧读输入框：移植自 App 端 .huidu-chat-composer ═══════════════════
   灰底胶囊内含输入框与语音键，外置圆形发送键；
   空输入时发送键置灰不可点（与 App 的 disabled 态一致）。 */
.ai-composer-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ai-chat-field {
    display: flex;
    flex: 1;
    min-width: 0;
    height: 42px;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-hover);
    transition: border-color 0.2s var(--ease-out);
}

/* 聚焦时不加重边框，保持与未聚焦一致 */

.ai-voice-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--accent-hover);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s var(--ease-out);
}

.ai-voice-btn:hover:not(:disabled) { background: var(--accent-light); }

.ai-voice-btn.is-listening {
    background: var(--accent);
    color: #fff;
    animation: ai-voice-pulse 1.25s ease-in-out infinite;
}

@keyframes ai-voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(130, 80, 171, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(130, 80, 171, 0); }
}

.ai-search-submit:disabled {
    background: var(--bg-hover);
    color: var(--text-tertiary);
    cursor: default;
}

.ai-composer-status {
    margin: 0 3px 7px;
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 700;
}

.ai-attach-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.ai-attach-btn:hover { background: var(--bg-app); color: var(--accent-hover); }

/* 已选附件：胶囊上方一行可移除的芯片 */
.ai-attach-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    margin: 0 3px 7px;
    padding: 5px 8px 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.ai-attach-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-attach-chip small { flex: none; color: var(--text-tertiary); font-weight: 600; }

.ai-attach-remove {
    display: grid;
    flex: none;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
}

.ai-attach-remove:hover { background: var(--bg-hover); color: var(--danger); }

/* ══ 品牌标识：矢量图标 + 文字 ══════════════════════════════════════
   图标用 currentColor 描边，深浅主题自动适配；文字走 i18n。 */
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text-primary);
    text-decoration: none;
}

/* 图标外套圆角边框，做成 App 图标的样子 */
.brand-mark-box {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-surface);
}

.brand-mark {
    width: 32px;
    height: 32px;
    flex: none;
    overflow: visible;
}

.brand-wordmark {
    display: flex;
    align-items: baseline;
    gap: 1px;
    overflow: hidden;
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-wordmark b { color: var(--brand-orange); font-weight: 800; }
.brand-wordmark > span { color: var(--text-primary); }

/* 登录弹窗的品牌图标同样加圆角边框 */
.auth-brand-box {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-surface);
}

/* 防复制机制 */
.commentary-item,
.commentary-text,
.commentary-range,
.commentary-source {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}
