/* ==========================================================================
   雅思阅读生词本与全文精读样式 (Vocab Reader & Notebook)
   ========================================================================== */

/* 题库浏览卡片中的“生词本”按钮布局适配 */
.exam-actions.has-vocab-btn {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.exam-item-vocab-btn {
    border-color: rgba(37, 99, 235, 0.3) !important;
    background: rgba(239, 246, 255, 0.85) !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
}

.exam-item-vocab-btn:hover:not(:disabled) {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.2);
}

@media (max-width: 640px) {
    .exam-actions.has-vocab-btn {
        grid-template-columns: 1fr !important;
    }
}

/* 全屏沉浸式阅读器浮层 */
body.vocab-reader-open {
    overflow: hidden !important;
}

.vocab-reader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #f8fafc;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.vocab-reader-overlay.is-hidden {
    display: none !important;
}

.vocab-reader-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #f8fafc;
    position: relative;
}

/* 顶部吸顶导航栏：紧凑标题、全平铺陈列段落与题目 Tabs，永远置顶不动 */
.vocab-reader-header {
    position: sticky;
    top: 0;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.vocab-reader-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.vocab-reader-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.vocab-reader-back-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 缩小文章标题这一块，为全文与各段落按钮腾出充裕空间 */
.vocab-reader-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 220px;
}

.vocab-reader-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.vocab-reader-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.vocab-badge {
    display: inline-block;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.3;
    white-space: nowrap;
}

.vocab-badge--cat {
    background: #dbeafe;
    color: #1e40af;
}

.vocab-badge--freq {
    background: #fee2e2;
    color: #991b1b;
}

.vocab-badge--info {
    background: #f1f5f9;
    color: #475569;
}

/* 导航段落 Tabs：完全陈列平铺展开，杜绝横向滚动/滑动 */
.vocab-reader-header__center {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: visible;
}

.vocab-reader-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
    overflow: visible;
}

.vocab-tab-btn {
    padding: 4px 10px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    line-height: 1.3;
}

.vocab-tab-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.vocab-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

.vocab-tab-btn--questions {
    border-color: #fbbf24;
    color: #b45309;
    background: #fffbeb;
}

.vocab-tab-btn--questions:hover {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.vocab-tab-btn--questions.active {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
    box-shadow: 0 1px 4px rgba(217, 119, 6, 0.25);
    font-weight: 600;
}

/* 导航右侧工具 */
.vocab-reader-header__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.vocab-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.vocab-tool-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.vocab-tool-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.vocab-notebook-btn {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.vocab-notebook-btn:hover {
    background: #dbeafe;
}

.vocab-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
    background: #ef4444;
    color: #ffffff;
}

/* 顶部划词收录提示 Banner */
.vocab-reader-banner {
    flex-shrink: 0;
    background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
    border-bottom: 1px solid #bbf7d0;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #166534;
}

.vocab-banner-icon {
    font-size: 1rem;
}

/* 独立滚动主体区域（确保顶部 header 永远固定在视口顶部不动） */
.vocab-reader-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    width: 100%;
    min-height: 0;
}

/* 阅读核心主内容区 */
.vocab-reader-body {
    max-width: 920px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 20px 80px 20px;
    box-sizing: border-box;
}

/* 划词高亮样式 */
.vocab-reader-body ::selection {
    background: #fed7aa;
    color: #7c2d12;
}

/* 文章区域 */
.vocab-passage-section {
    margin-bottom: 40px;
}

.vocab-passage-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.vocab-passage-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.vocab-passage-intro {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* 前置考试题目说明指导语：独立说明卡片，绝不带段落A标签 */
.vocab-passage-instruction {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.6;
}

.vocab-instruction-icon {
    font-size: 1.15rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.vocab-instruction-text {
    flex: 1;
    font-weight: 500;
    color: #334155;
}

.vocab-instruction-text p {
    margin: 0;
}

.vocab-passage-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    font-style: italic;
    margin-top: 6px;
}

/* 段落卡片 */
.vocab-paragraph-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    scroll-margin-top: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s;
}

.vocab-paragraph-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.vocab-paragraph-tag {
    margin-bottom: 12px;
}

.vocab-para-letter {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.vocab-paragraph-text {
    font-size: 1.1rem;
    line-height: 1.85;
    color: #334155;
    user-select: text;
}

.vocab-paragraph-text p {
    margin: 0 0 12px 0;
}

.vocab-paragraph-text p:last-child {
    margin-bottom: 0;
}

/* 生词黄色高亮标记 (Yellow Highlight for Vocabulary) */
mark.vocab-highlight,
.vocab-highlight {
    background-color: #fef08a !important; /* 明亮舒适的经典纯正柔黄 */
    color: #0f172a !important;
    padding: 2px 0 !important;
    margin: 0 !important;
    border-radius: 4px !important;
    border-bottom: 2px solid #eab308 !important; /* 黄色强化底边 */
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: inline;
}

mark.vocab-highlight:hover,
.vocab-highlight:hover {
    background-color: #fde047 !important; /* 悬停交互更鲜明的明黄 */
    border-bottom-color: #ca8a04 !important;
    box-shadow: 0 2px 5px rgba(234, 179, 8, 0.35);
}

mark.vocab-highlight:active,
.vocab-highlight:active {
    transform: scale(0.97);
}

@keyframes vocabHighlightPop {
    0% {
        background-color: #fef9c3;
        transform: scale(1.05);
    }
    100% {
        background-color: #fef08a;
        transform: scale(1);
    }
}

.vocab-highlight--pulse {
    animation: vocabHighlightPop 0.4s ease-out;
}

/* 段落译文卡片 */
.vocab-translation-card {
    margin-top: 16px;
    background: #fefce8;
    border-left: 4px solid #eab308;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: #713f12;
    line-height: 1.7;
}

.vocab-trans-label {
    font-weight: 700;
    margin-bottom: 4px;
    color: #854d0e;
}

/* 题目区域 */
.vocab-questions-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    margin-top: 36px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.vocab-questions-header {
    border-bottom: 2px dashed #cbd5e1;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.vocab-questions-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.vocab-questions-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.vocab-question-group {
    margin-bottom: 30px;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #334155;
    user-select: text;
}

.vocab-question-group h4 {
    font-size: 1.15rem;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.vocab-question-group .vocab-answer-blank {
    display: inline-block;
    margin-inline: 0.2em;
    color: #64748b;
    user-select: text;
}

.vocab-question-group .vocab-question-options {
    white-space: normal;
    user-select: text;
}

.vocab-question-group .vocab-question-option,
.vocab-question-group .vocab-question-pool {
    user-select: text !important;
}

/* 划词轻提示 Toast (仿 untitled.html) */
.vocab-toast-msg {
    position: fixed;
    bottom: 90px;
    right: 28px;
    background: rgba(16, 185, 129, 0.95);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.vocab-toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}

/* 悬浮生词本 FAB 按钮 (仿 untitled.html) */
.vocab-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.vocab-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.5);
}

.vocab-fab-count {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* 生词本 Modal 弹窗 (仿 untitled.html) */
.vocab-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.vocab-modal.active {
    display: flex;
    animation: vocabFadeIn 0.2s ease-out;
}

.vocab-modal-content {
    background: #ffffff;
    width: 440px;
    max-width: 95vw;
    max-height: 82vh;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.vocab-modal-header {
    background: #1e293b;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vocab-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vocab-modal-title-wrap h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.vocab-modal-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.12);
    padding: 2px;
    border-radius: 8px;
}

.v-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.v-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
}

.vocab-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.vocab-modal-close:hover {
    color: #ffffff;
}

/* 手动添加生词 */
.vocab-modal-add-row {
    display: flex;
    padding: 10px 16px;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.vocab-modal-add-row input {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.vocab-modal-add-row input:focus {
    border-color: #2563eb;
}

.vocab-modal-add-row button {
    padding: 7px 14px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.vocab-modal-add-row button:hover {
    background: #1d4ed8;
}

/* 单词列表 */
.vocab-list {
    padding: 12px 18px;
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.vocab-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

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

.vocab-item__main {
    flex: 1;
}

.vocab-item__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vocab-item__word {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.vocab-speak-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.vocab-speak-btn:hover {
    opacity: 1;
}

.vocab-item__context {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}

.vocab-item__source {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #94a3b8;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

.vocab-delete-btn {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vocab-delete-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* 空状态 */
.vocab-empty-box {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.vocab-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.vocab-empty-title {
    font-weight: 700;
    color: #64748b;
    margin: 0 0 6px 0;
}

.vocab-empty-desc {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
}

/* 底部操作 */
.vocab-modal-footer {
    padding: 14px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.v-action-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.v-export-btn {
    background: #10b981;
    color: #ffffff;
}

.v-export-btn:hover {
    background: #059669;
}

.v-clear-btn {
    background: #ef4444;
    color: #ffffff;
}

.v-clear-btn:hover {
    background: #dc2626;
}

@keyframes vocabFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 模态框顶部操作组与书架快捷入口 */
.vocab-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Keep the contextual notebook modal legible on top of the reader while
   reusing the app's existing glass treatment. The header is intentionally a
   stronger surface so tabs and actions stay readable over any page theme. */
.vocab-modal-header {
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.vocab-modal-tabs {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.v-tab-btn {
    color: rgba(248, 250, 252, 0.84);
}

.v-tab-btn.active {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.18);
}

.vocab-modal-header .vocab-modal-bookshelf-btn,
.vocab-modal-header .vocab-modal-close {
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    background: rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.vocab-modal-header .vocab-modal-bookshelf-btn:hover,
.vocab-modal-header .vocab-modal-close:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.24) !important;
    border-color: rgba(255, 255, 255, 0.46) !important;
}

/* ==========================================================================
   阅读书架样式 (Bookshelf View)
   ========================================================================== */

#bookshelf-view {
    width: 100%;
    min-height: calc(100vh - 80px);
    background: transparent;
    padding: 24px 20px 60px;
    box-sizing: border-box;
}

.bookshelf-view-shell {
    max-width: 1160px;
    margin: 0 auto;
    width: 100%;
}

.bookshelf-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 顶部栏 */
.bookshelf-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
}

.bookshelf-topbar__left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bookshelf-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--shui-text-strong, #0f172a);
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.25));
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    cursor: pointer;
    transition: all 0.2s;
}

.bookshelf-back-btn:hover {
    background: rgba(255, 255, 255, 0.42);
    color: var(--shui-text-strong, #0f172a);
    border-color: rgba(255, 255, 255, 0.7);
}

.bookshelf-back-arrow {
    font-size: 1.1rem;
    line-height: 1;
}

.bookshelf-heading-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bookshelf-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--shui-text-strong, #0f172a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookshelf-subtitle {
    font-size: 0.85rem;
    color: var(--shui-text-muted, #64748b);
    margin: 0;
}

.bookshelf-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookshelf-export-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.24);
    color: var(--shui-text-strong, #0f172a);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    cursor: pointer;
    transition: all 0.2s;
}

.bookshelf-export-all-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.42);
    border-color: rgba(255, 255, 255, 0.7);
}

.bookshelf-export-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.12);
    color: var(--shui-text-muted, #64748b);
    border-color: var(--shui-panel-border, rgba(255, 255, 255, 0.3));
}

.bookshelf-notebook-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.24);
    color: var(--shui-text-strong, #0f172a);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    cursor: pointer;
    transition: all 0.2s;
}

.bookshelf-notebook-btn:hover {
    background: rgba(255, 255, 255, 0.42);
}

/* 统计横幅 */
.bookshelf-stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.bookshelf-stat-card {
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.25));
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shui-panel-shadow, 0 12px 26px rgba(15, 23, 42, 0.08));
}

.bookshelf-stat-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.bookshelf-stat-content {
    display: flex;
    flex-direction: column;
}

.bookshelf-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--shui-text-strong, #0f172a);
    line-height: 1.2;
}

.bookshelf-stat-label {
    font-size: 0.78rem;
    color: var(--shui-text-muted, #64748b);
    font-weight: 500;
}

/* 工具条 (搜索与筛选) */
.bookshelf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.25));
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 12px;
    padding: 10px 14px;
}

.bookshelf-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 8px;
    padding: 6px 10px;
    flex: 1;
    min-width: 240px;
    max-width: 440px;
}

.bookshelf-search-icon {
    font-size: 0.9rem;
    color: var(--shui-text-muted, #64748b);
}

.bookshelf-search-input {
    border: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--shui-text-strong, #0f172a);
    outline: none;
    width: 100%;
}

.bookshelf-search-clear {
    background: none;
    border: none;
    color: var(--shui-text-muted, #64748b);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.bookshelf-search-clear:hover {
    color: var(--shui-text-strong, #0f172a);
}

.bookshelf-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bookshelf-segmented {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.bookshelf-segment-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--shui-text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.bookshelf-segment-btn.active {
    background: rgba(255, 255, 255, 0.5);
    color: var(--shui-text-strong, #0f172a);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 6px 14px rgba(15, 23, 42, 0.06);
}

.bookshelf-sort-select {
    padding: 6px 10px;
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--shui-text-strong, #0f172a);
    outline: none;
    cursor: pointer;
}

/* 卡片网格 */
.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.bookshelf-card {
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.25));
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: var(--shui-panel-shadow, 0 12px 26px rgba(15, 23, 42, 0.08));
}

.bookshelf-card:hover {
    border-color: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shui-panel-shadow, 0 16px 32px rgba(15, 23, 42, 0.1));
    transform: translateY(-2px);
}

.bookshelf-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bookshelf-card__tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bookshelf-card__badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.bookshelf-card__badge--category {
    background: rgba(255, 255, 255, 0.34);
    color: var(--shui-text-muted, #475569);
}

.bookshelf-card__badge--vocab {
    background: color-mix(in srgb, var(--shui-warning, #f59e0b) 16%, transparent);
    color: var(--shui-text-strong, #92400e);
}

.bookshelf-card__badge--read {
    background: color-mix(in srgb, var(--shui-accent, #2563eb) 12%, transparent);
    color: var(--shui-accent, #2563eb);
}

.bookshelf-card__remove-btn {
    background: transparent;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 2px 4px;
    border-radius: 4px;
}

.bookshelf-card__remove-btn:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 14%, transparent);
}

.bookshelf-card__body {
    flex: 1;
    margin-bottom: 14px;
}

.bookshelf-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--shui-text-strong, #0f172a);
    line-height: 1.4;
    margin: 0 0 6px 0;
    cursor: pointer;
    transition: color 0.15s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bookshelf-card__title:hover {
    color: var(--shui-accent, #2563eb);
}

.bookshelf-card__meta {
    font-size: 0.76rem;
    color: var(--shui-text-muted, #64748b);
    margin-bottom: 10px;
}

/* 生词预览药丸标签 */
.bookshelf-card__vocab-preview {
    min-height: 38px;
    display: flex;
    align-items: center;
}

.bookshelf-vocab-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bookshelf-vocab-chip {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    color: var(--shui-text-strong, #334155);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bookshelf-vocab-chip:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--shui-text-strong, #1d4ed8);
    border-color: rgba(255, 255, 255, 0.76);
}

.bookshelf-chip-audio {
    font-size: 0.7rem;
    opacity: 0.6;
}

.bookshelf-vocab-chip-more {
    font-size: 0.72rem;
    color: var(--shui-text-muted, #64748b);
    font-weight: 600;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    align-self: center;
}

.bookshelf-vocab-empty-hint {
    font-size: 0.78rem;
    color: var(--shui-text-muted, #64748b);
    margin: 0;
    font-style: italic;
}

/* 卡片操作按钮 */
.bookshelf-card__footer {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.32));
}

.bookshelf-action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.bookshelf-action-btn--main {
    flex: 1;
    min-width: 100px;
    background: rgba(255, 255, 255, 0.24);
    color: var(--shui-text-strong, #0f172a);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
}

.bookshelf-action-btn--main:hover {
    background: rgba(255, 255, 255, 0.42);
}

.bookshelf-card__footer .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    color: var(--shui-text-strong, #334155);
}

.bookshelf-card__footer .btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.42);
    color: var(--shui-text-strong, #0f172a);
}

.bookshelf-card__footer .btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 空状态 */
.bookshelf-empty-state {
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.25));
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    max-width: 540px;
    margin: 20px auto;
}

.bookshelf-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.bookshelf-empty-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--shui-text-strong, #0f172a);
    margin: 0 0 8px 0;
}

.bookshelf-empty-desc {
    font-size: 0.88rem;
    color: var(--shui-text-muted, #64748b);
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.bookshelf-empty-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Toast 轻量反馈 */
.bookshelf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--shui-panel-bg, rgba(15, 23, 42, 0.72));
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.bookshelf-toast.is-hidden {
    opacity: 0;
    transform: translateY(10px);
    display: none;
}

.bookshelf-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* 响应式断点 */
@media (max-width: 768px) {
    #bookshelf-view {
        padding: 16px 12px 40px;
    }

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

    .bookshelf-topbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .bookshelf-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bookshelf-search-box {
        max-width: 100%;
    }

    .bookshelf-filter-group {
        justify-content: space-between;
    }

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

/*
 * 我的生词本是独立的工作视图，不再借用阅读器上的居中 modal。
 * 只复用主界面的 Liquid Glass 变量与按钮，不引入第二套颜色体系。
 */
#reading-notebook-view {
    width: 100%;
    min-height: calc(100vh - 80px);
    padding: 24px 20px 60px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: var(--shui-text-strong, #0f172a);
}

#reading-notebook-view .reading-notebook-view-shell {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
}

.reading-notebook-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.58));
    border-radius: var(--shui-radius-xl, 28px);
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.22));
    box-shadow: var(--shui-panel-shadow, 0 24px 54px rgba(15, 23, 42, 0.12));
    backdrop-filter: blur(var(--shui-blur, 24px)) saturate(145%);
    -webkit-backdrop-filter: blur(var(--shui-blur, 24px)) saturate(145%);
}

.reading-notebook-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.reading-notebook-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.reading-notebook-back-btn {
    flex: 0 0 auto;
    min-height: 38px;
    border-radius: 999px;
}

.reading-notebook-title {
    margin: 0;
    color: var(--shui-text-strong, #0f172a);
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.15;
    font-weight: 800;
}

.reading-notebook-subtitle {
    margin: 7px 0 0;
    color: var(--shui-text-muted, #64748b);
    font-size: 0.88rem;
    line-height: 1.5;
}

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

.reading-notebook-actions .shui-glass-btn {
    min-height: 38px;
    border-radius: 999px;
}

.reading-notebook-danger-btn {
    color: color-mix(in srgb, var(--shui-warning, #ef4444) 78%, var(--shui-text-strong, #0f172a)) !important;
    border-color: color-mix(in srgb, var(--shui-warning, #ef4444) 36%, transparent) !important;
}

.reading-notebook-danger-btn:hover:not(:disabled),
.reading-notebook-danger-btn:focus-visible {
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 14%, transparent) !important;
    border-color: color-mix(in srgb, var(--shui-warning, #ef4444) 54%, transparent) !important;
}

.reading-notebook-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.5));
    border-radius: var(--shui-radius-md, 16px);
    background: rgba(255, 255, 255, 0.2);
    color: var(--shui-text-muted, #64748b);
}

.reading-notebook-status--error {
    color: color-mix(in srgb, var(--shui-warning, #ef4444) 82%, var(--shui-text-strong, #0f172a));
}

.reading-notebook-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.reading-notebook-stat {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.58));
    border-radius: var(--shui-radius-lg, 20px);
    background: rgba(255, 255, 255, 0.24);
    box-shadow: var(--shui-panel-shadow, 0 14px 32px rgba(15, 23, 42, 0.08));
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.reading-notebook-stat__value {
    display: block;
    color: var(--shui-text-strong, #0f172a);
    font-size: clamp(1.55rem, 2.8vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
}

.reading-notebook-stat__value--date {
    font-size: clamp(1rem, 2vw, 1.35rem);
    padding-top: 5px;
}

.reading-notebook-stat__label {
    display: block;
    margin-top: 6px;
    color: var(--shui-text-muted, #64748b);
    font-size: 0.82rem;
}

.reading-notebook-surface {
    overflow: hidden;
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.58));
    border-radius: var(--shui-radius-lg, 20px);
    background: rgba(255, 255, 255, 0.24);
    box-shadow: var(--shui-panel-shadow, 0 14px 32px rgba(15, 23, 42, 0.08));
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.reading-notebook-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.reading-notebook-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 620px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--shui-text-muted, #64748b);
}

.reading-notebook-search:focus-within {
    border-color: color-mix(in srgb, var(--shui-accent, #2563eb) 48%, rgba(255, 255, 255, 0.6));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--shui-accent, #2563eb) 14%, transparent);
}

.reading-notebook-search input {
    width: 100%;
    min-height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--shui-text-strong, #0f172a);
    font: inherit;
}

.reading-notebook-search input::placeholder {
    color: var(--shui-text-muted, #64748b);
}

.reading-notebook-count {
    flex: 0 0 auto;
    color: var(--shui-text-muted, #64748b);
    font-size: 0.82rem;
    white-space: nowrap;
}

.reading-notebook-list {
    min-height: 260px;
    padding: 4px 18px;
}

.reading-notebook-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.reading-notebook-entry:last-child {
    border-bottom: 0;
}

.reading-notebook-entry__main {
    min-width: 0;
    flex: 1;
}

.reading-notebook-entry__heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reading-notebook-entry__heading h3 {
    margin: 0;
    color: var(--shui-text-strong, #0f172a);
    font-size: 1.05rem;
    font-weight: 800;
}

.reading-notebook-speak-btn {
    min-height: 30px;
    min-width: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.reading-notebook-entry__context {
    max-width: 760px;
    margin: 6px 0 0;
    color: var(--shui-text-muted, #64748b);
    font-size: 0.86rem;
    line-height: 1.55;
}

.reading-notebook-entry__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.reading-notebook-entry__meta span {
    max-width: 100%;
    padding: 4px 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: var(--shui-text-muted, #64748b);
    font-size: 0.74rem;
}

.reading-notebook-delete-btn {
    flex: 0 0 auto;
    min-height: 32px;
    border-radius: 999px;
    color: color-mix(in srgb, var(--shui-warning, #ef4444) 78%, var(--shui-text-strong, #0f172a)) !important;
    border-color: color-mix(in srgb, var(--shui-warning, #ef4444) 30%, transparent) !important;
}

.reading-notebook-delete-btn:hover:not(:disabled),
.reading-notebook-delete-btn:focus-visible {
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 13%, transparent) !important;
}

.reading-notebook-empty {
    display: grid;
    place-items: center;
    min-height: 300px;
    padding: 32px 20px;
    text-align: center;
}

.reading-notebook-empty__icon {
    font-size: 2.5rem;
    opacity: 0.75;
}

.reading-notebook-empty h3 {
    margin: 12px 0 6px;
    color: var(--shui-text-strong, #0f172a);
    font-size: 1.1rem;
}

.reading-notebook-empty p {
    max-width: 420px;
    margin: 0;
    color: var(--shui-text-muted, #64748b);
    font-size: 0.86rem;
    line-height: 1.55;
}

.reading-notebook-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 10020;
    max-width: min(90vw, 520px);
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.reading-notebook-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 768px) {
    #reading-notebook-view {
        padding: 16px 12px 40px;
    }

    .reading-notebook-layout {
        gap: 16px;
        padding: 18px 14px 28px;
    }

    .reading-notebook-topbar,
    .reading-notebook-heading {
        align-items: stretch;
        flex-direction: column;
    }

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

    .reading-notebook-stats {
        grid-template-columns: 1fr;
    }

    .reading-notebook-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .reading-notebook-search {
        max-width: none;
    }

    .reading-notebook-entry {
        gap: 10px;
    }
}

/* 书架移除安全确认模态框：复用全局 Liquid Glass .theme-modal 外壳 */
.bookshelf-confirm-overlay {
    z-index: 10002;
    padding: 16px;
}

.bookshelf-confirm-overlay.is-hidden {
    display: none !important;
}

.bookshelf-confirm-box {
    box-sizing: border-box;
}

.bookshelf-confirm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.bookshelf-confirm-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.bookshelf-confirm-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--shui-text-strong, #0f172a);
}

.bookshelf-confirm-close {
    margin-left: auto;
}

.bookshelf-confirm-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
}

.bookshelf-confirm-msg {
    margin: 0;
    font-size: 0.95rem;
    color: var(--shui-text-strong, #334155);
    line-height: 1.55;
    font-weight: 500;
    word-break: break-word;
}

.bookshelf-confirm-notice {
    background: rgba(255, 255, 255, 0.24);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.4));
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bookshelf-notice-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--shui-accent, #0284c7);
    background: color-mix(in srgb, var(--shui-accent, #0284c7) 12%, transparent);
    padding: 2px 7px;
    border-radius: 4px;
    align-self: flex-start;
}

.bookshelf-notice-text {
    margin: 0;
    font-size: 0.83rem;
    color: var(--shui-text-muted, #475569);
    line-height: 1.48;
}

.bookshelf-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.bookshelf-confirm-btn {
    padding: 7px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bookshelf-confirm-btn.btn-danger {
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 16%, transparent) !important;
    color: color-mix(in srgb, var(--shui-warning, #ef4444) 78%, var(--shui-text-strong, #0f172a)) !important;
    border: 1px solid color-mix(in srgb, var(--shui-warning, #ef4444) 42%, transparent) !important;
}

.bookshelf-confirm-btn.btn-danger:hover {
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 28%, transparent) !important;
    border-color: color-mix(in srgb, var(--shui-warning, #ef4444) 62%, transparent) !important;
}

/* Bookshelf uses the shared Liquid Glass shell. Keep the view transparent so
   the app background and theme tokens remain the single visual source. */
#bookshelf-view {
    min-height: calc(100vh - 80px);
    padding: 24px 20px 60px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-view-shell {
    max-width: 1160px;
}

#bookshelf-view .bookshelf-layout {
    gap: 20px;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.58));
    border-radius: var(--shui-radius-xl, 28px);
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.22));
    box-shadow: var(--shui-panel-shadow, 0 24px 54px rgba(15, 23, 42, 0.12));
    backdrop-filter: blur(var(--shui-blur, 24px)) saturate(145%);
    -webkit-backdrop-filter: blur(var(--shui-blur, 24px)) saturate(145%);
}

#bookshelf-view .bookshelf-topbar {
    padding-bottom: 18px;
    border-bottom-color: rgba(255, 255, 255, 0.42);
}

#bookshelf-view .bookshelf-title,
#bookshelf-view .bookshelf-card__title,
#bookshelf-view .bookshelf-empty-title {
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-subtitle,
#bookshelf-view .bookshelf-card__meta,
#bookshelf-view .bookshelf-empty-desc,
#bookshelf-view .bookshelf-vocab-empty-hint {
    color: var(--shui-text-muted, #64748b);
}

#bookshelf-view .bookshelf-topbar__right,
#bookshelf-view .bookshelf-empty-actions,
#bookshelf-view .bookshelf-card__footer {
    gap: 8px;
}

#bookshelf-view .shui-glass-btn,
#bookshelf-view .bookshelf-action-btn,
#bookshelf-view .bookshelf-back-btn,
#bookshelf-view .bookshelf-export-all-btn,
#bookshelf-view .bookshelf-notebook-btn {
    min-height: 38px;
    border-radius: 999px;
}

#bookshelf-view .bookshelf-stats-banner {
    gap: 12px;
}

#bookshelf-view .bookshelf-stat-card,
#bookshelf-view .bookshelf-toolbar,
#bookshelf-view .bookshelf-card,
#bookshelf-view .bookshelf-empty-state {
    border: 1px solid var(--shui-panel-border, rgba(255, 255, 255, 0.58));
    background: rgba(255, 255, 255, 0.24);
    box-shadow: var(--shui-panel-shadow, 0 14px 32px rgba(15, 23, 42, 0.08));
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}

#bookshelf-view .bookshelf-stat-card {
    padding: 16px 18px;
}

#bookshelf-view .bookshelf-stat-icon {
    font-size: 1.5rem;
}

#bookshelf-view .bookshelf-stat-value {
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-stat-label,
#bookshelf-view .bookshelf-card__source-state {
    color: var(--shui-text-muted, #64748b);
}

#bookshelf-view .bookshelf-toolbar {
    padding: 10px 12px;
}

#bookshelf-view .bookshelf-search-box,
#bookshelf-view .bookshelf-segmented,
#bookshelf-view .bookshelf-sort-select,
#bookshelf-view .bookshelf-vocab-chip,
#bookshelf-view .bookshelf-vocab-chip-more {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-search-input {
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-segment-btn {
    color: var(--shui-text-muted, #64748b);
}

#bookshelf-view .bookshelf-segment-btn.active,
#bookshelf-view .bookshelf-segment-btn:hover,
#bookshelf-view .bookshelf-vocab-chip:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-card {
    border-radius: var(--shui-radius-lg, 20px);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

#bookshelf-view .bookshelf-card:hover {
    border-color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.34);
    box-shadow: var(--shui-panel-shadow, 0 18px 38px rgba(15, 23, 42, 0.1));
}

#bookshelf-view .bookshelf-card__badge--category,
#bookshelf-view .bookshelf-card__badge--vocab,
#bookshelf-view .bookshelf-card__badge--read {
    background: rgba(255, 255, 255, 0.34);
    color: var(--shui-text-muted, #475569);
}

#bookshelf-view .bookshelf-card__remove-btn,
#bookshelf-view .bookshelf-search-clear {
    color: var(--shui-text-muted, #64748b);
}

#bookshelf-view .bookshelf-card__remove-btn:hover {
    background: color-mix(in srgb, var(--shui-warning, #ef4444) 14%, transparent);
    color: color-mix(in srgb, var(--shui-warning, #ef4444) 78%, var(--shui-text-strong, #0f172a));
}

#bookshelf-view .bookshelf-search-clear:hover {
    background: rgba(255, 255, 255, 0.42);
    color: var(--shui-text-strong, #0f172a);
}

#bookshelf-view .bookshelf-card__footer {
    border-top-color: rgba(255, 255, 255, 0.42);
}

#bookshelf-view .bookshelf-empty-state {
    max-width: 640px;
    margin: 12px auto;
    padding: 56px 24px;
}

#bookshelf-view .bookshelf-empty-icon {
    opacity: 0.82;
}

#bookshelf-view .bookshelf-toast {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.bookshelf-confirm-title,
.bookshelf-confirm-msg,
.bookshelf-notice-text {
    color: var(--shui-text-strong, #0f172a);
}

.bookshelf-confirm-notice {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.24);
}

.bookshelf-notice-badge {
    background: color-mix(in srgb, var(--shui-accent, #2563eb) 12%, transparent);
    color: var(--shui-accent, #2563eb);
}

.bookshelf-confirm-btn {
    min-height: 38px;
    border-radius: 999px;
}

@media (max-width: 768px) {
    #bookshelf-view { padding: 16px 12px 40px; }
    #bookshelf-view .bookshelf-layout { padding: 18px 14px 28px; }
}

.vocab-occurrence-actions,
.vocab-occurrence-undo,
.vocab-anchor-status {
    flex-shrink: 0;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #fffbea;
    color: #493b10;
    border-top: 1px solid #e5d89a;
}

.vocab-occurrence-actions:empty,
.vocab-occurrence-undo:empty,
.vocab-anchor-status:empty { display: none; }

.vocab-occurrence-undo {
    position: relative;
    z-index: 10002;
}

.vocab-occurrence-row {
    margin-top: 10px;
    padding: 10px;
    border-left: 3px solid #d6b432;
    background: #fffbea;
    color: #493b10;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.vocab-occurrence-row > span,
.vocab-occurrence-row > strong { display: block; margin-bottom: 6px; }

.vocab-occurrence-row[data-anchor-status="unresolved"] { border-color: #b45d18; }

.vocab-reader-overlay [data-action] {
    border: 1px solid #8a741d;
    border-radius: 6px;
    padding: 7px 12px;
    background: #fff;
    color: #493b10;
    cursor: pointer;
}

.vocab-highlight:focus-visible { outline: 2px solid #315ac8; outline-offset: 2px; }

/* The card keeps one ten-word page in memory; controls share the card palette. */
.bookshelf-word-pages {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--shui-text-muted, #64748b);
}
.bookshelf-word-pages button {
    border: 1px solid var(--shui-panel-border, rgba(148, 163, 184, 0.35));
    border-radius: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: var(--shui-panel-bg, rgba(255, 255, 255, 0.2));
    color: inherit;
    cursor: pointer;
}
.bookshelf-word-pages button:disabled { opacity: 0.45; cursor: default; }
