/* 迁自 style.css · 世界书（#books-page、选择与编辑模态等） */
/* 世界书页面样式 */
#books-page {
    background: #f8f8f8;
}

.books-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.books-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
    margin: 0;
}

.books-header-buttons {
    display: grid;
    grid-template-columns: repeat(3, 28px);
    align-items: center;
    justify-items: center;
    column-gap: 12px;
    position: absolute;
    right: 14px;
}

.books-header-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #4a4448;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.books-header-btn--icon-only {
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 8px;
}

/* 统一图标风格：三个按钮均为等粗线性描边图标，同色同尺寸，避免混用「手绘填色」与「纯线条」两种风格 */
.books-header-icon-svg {
    width: 22px;
    height: 22px;
    display: block;
    overflow: visible;
    color: #4a4448;
}

.books-header-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.books-header-btn:active {
    transform: scale(0.96);
    background: rgba(0, 0, 0, 0.08);
}

.books-header-btn.active {
    background: rgba(0, 0, 0, 0.08);
}

.books-header-btn.active .books-header-icon-svg {
    color: #e53935;
}

.books-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.books-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.world-book-list {
    display: none;
}

/* 世界书：勾选删除模式 */
.world-book-item {
    position: relative;
}
.world-book-item.world-book-item--selecting {
    padding-left: 44px;
}
.world-book-select-box {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid rgba(120, 120, 120, 0.55);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}
.world-book-item.world-book-item--checked .world-book-select-box {
    background: #4caf50;
    border-color: #4caf50;
}
.world-book-item.world-book-item--checked .world-book-item-title {
    color: #2e7d32;
}
.world-book-fab-delete {
    position: absolute;
    right: 16px;
    bottom: 18px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: #e53935;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 10px 22px rgba(229,57,53,0.28);
    cursor: pointer;
    z-index: 80;
}
.world-book-fab-delete:active {
    opacity: 0.9;
    transform: translateY(1px);
}

.world-book-list.has-items {
    display: block;
}

.world-book-empty.has-items {
    display: none;
}

.world-book-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.world-book-empty-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 16px;
}

.world-book-empty-text {
    font-size: 16px;
    color: #888;
    margin-bottom: 8px;
}

.world-book-empty-hint {
    font-size: 14px;
    color: #aaa;
}

.world-book-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-width: 0;
}

.world-book-item:hover {
    background: #fafafa;
}

.world-book-item-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.world-book-item-meta {
    font-size: 12px;
    color: #9a9a9a;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.world-book-item-preview {
    font-size: 13px;
    color: #888;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
}

.world-book-select-list .world-book-item {
    margin-bottom: 8px;
}

.world-book-select-list .world-book-item.selected {
    border: 2px solid #07c160;
}

/* 好友设置-选择世界书：分组折叠列表 */
.world-book-select-modal-content {
    max-width: 360px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.world-book-select-modal-content .modal-header {
    position: relative;
}

.world-book-select-modal-content .modal-close {
    display: flex;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.world-book-select-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.world-book-select-modal-content .modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}

.world-book-select-folder {
    margin-bottom: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}

.world-book-select-folder-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.world-book-select-folder-header:hover {
    background: #eee;
}

.world-book-select-folder-header::before {
    content: '▶';
    font-size: 10px;
    margin-right: 8px;
    transition: transform 0.2s;
}

.world-book-select-folder.expanded .world-book-select-folder-header::before {
    transform: rotate(90deg);
}

.world-book-select-folder-entries {
    display: none;
    padding: 0 8px 8px;
}

.world-book-select-folder.expanded .world-book-select-folder-entries {
    display: block;
}

.world-book-select-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-top: 4px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.world-book-select-item:hover {
    background: #fafafa;
}

.world-book-select-item.checked {
    border-color: #07c160;
    background: rgba(7, 193, 96, 0.06);
}

.world-book-select-item input[type="checkbox"] {
    margin-right: 10px;
    flex-shrink: 0;
}

.world-book-select-footer {
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-top: 12px;
}

.world-book-select-confirm-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.world-book-select-confirm-btn:hover {
    background: #333;
}

/* 选择世界书模态框：置于 body 下；z-index 须高于灵动岛(100130)/部分全屏层(100200)，否则从查手机打开时看不见 */
.modal-over-friend-settings,
#select-world-book-modal {
    z-index: 100210;
    position: fixed;
}

.world-book-textarea {
    min-height: 120px;
    resize: vertical;
}

.world-book-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.world-book-settings-grid label {
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.world-book-settings-grid .form-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
}

.world-book-settings-grid .form-input:disabled {
    opacity: 0.5;
}

#world-book-binding-status {
    white-space: pre-line;
    overflow-wrap: anywhere;
    margin-bottom: 12px;
}

.add-world-book-modal-content {
    max-width: 420px;
}

#world-book-folder-list-modal .add-world-book-modal-content {
    width: min(92vw, 420px);
    max-height: min(86vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#world-book-folder-list-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#world-book-folder-list-modal .modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}

#world-book-folder-list-modal .modal-footer {
    flex: 0 0 auto;
    height: auto;
    min-height: 66px;
    padding: 12px 14px 16px;
    gap: 12px;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(255, 255, 255, 0.72);
}

#world-book-folder-list-modal .modal-footer .btn-cancel,
#world-book-folder-list-modal .modal-footer .btn-save {
    width: auto;
    min-width: 128px;
    max-width: 168px;
    height: 46px;
    padding: 0 22px;
    flex: 1 1 0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(45, 52, 72, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

#world-book-folder-list-modal .modal-footer .btn-cancel {
    background: #fff;
    color: #333;
}

#world-book-folder-list-modal .modal-footer .btn-save {
    background: #fff5f5;
    color: #c44545;
    border-color: rgba(196, 69, 69, 0.18);
}

#world-book-folder-list-modal .modal-footer .btn-save:disabled {
    background: #f4f4f4;
    color: rgba(60, 60, 67, 0.36);
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

#world-book-folder-list-modal .modal-footer .btn-cancel:active,
#world-book-folder-list-modal .modal-footer .btn-save:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

html[data-appearance="dark"] #world-book-folder-list-modal .modal-footer {
    background: rgba(28, 28, 30, 0.72);
    border-top-color: rgba(255, 255, 255, 0.12);
}

html[data-appearance="dark"] #world-book-folder-list-modal .modal-footer .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
    border-color: rgba(255, 255, 255, 0.16);
}

html[data-appearance="dark"] #world-book-folder-list-modal .modal-footer .btn-save {
    background: rgba(255, 93, 93, 0.16);
    color: #ffb3b3;
    border-color: rgba(255, 93, 93, 0.22);
}

html[data-appearance="dark"] #world-book-folder-list-modal .modal-footer .btn-save:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(235, 235, 245, 0.32);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 380px) {
    #world-book-folder-list-modal .modal-footer {
        gap: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    #world-book-folder-list-modal .modal-footer .btn-cancel,
    #world-book-folder-list-modal .modal-footer .btn-save {
        min-width: 0;
        padding: 0 16px;
    }
}

/* 新建/编辑世界书：贴合 #app 小手机屏，四边 8px 内嵌 + 不透明纸色表面
 *
 * 注意：键盘弹起时勿套用 mobile-real-device-fix.css 第 13 节「居中卡片」压缩；
 * 该弹窗在同文件 13b 节有专属规则，把壳钉在 visualViewport 可视区同时保持
 * 内层卡片 absolute inset:8px + 头/身/尾 flex，避免取消/保存漂到中段。
 */
#add-world-book-modal.add-world-book-modal--phone {
    position: absolute;
    inset: 0;
    z-index: 4500;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.14);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    align-items: stretch;
    justify-content: stretch;
}

#add-world-book-modal.add-world-book-modal--phone .add-world-book-modal-content {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 20px;
    border: 1px solid #e5e1da;
    box-shadow: 0 8px 28px rgba(49, 48, 46, 0.12);
    background: #fbfaf7 !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
    animation: addWorldBookPanelIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes addWorldBookPanelIn {
    from {
        opacity: 0.88;
        transform: translateY(14px) scale(0.988);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 顶部安全区适配：真机（尤其 iPhone 灵动岛/刘海机型）无论是否「添加到主屏幕」，
   只要地址栏收起、页面铺满真实视口（本项目 viewport-fit=cover），标题栏就可能被
   状态栏/灵动岛盖住导致关闭按钮点不到。用 var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) 兜底顶部内边距，
   无安全区的机型/浏览器 env() 结果为 0，观感与之前完全一致，零副作用。 */
#add-world-book-modal.add-world-book-modal--phone .modal-header {
    flex: 0 0 auto;
    padding: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 14px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

#add-world-book-modal.add-world-book-modal--phone .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 14px 14px 10px;
}

#add-world-book-modal.add-world-book-modal--phone .modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    height: auto;
    min-height: 56px;
    padding: 12px 16px calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-cancel,
#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-save {
    width: auto;
    min-width: 132px;
    height: 46px;
    border-radius: 14px;
    flex: 0 0 auto;
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-cancel {
    background: #fff;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-save {
    background: #000;
    color: #fff;
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-cancel:hover {
    background: #f5f5f5;
}

#add-world-book-modal.add-world-book-modal--phone .modal-footer .btn-save:hover {
    background: #333;
}

html[data-appearance="dark"] #add-world-book-modal.add-world-book-modal--phone .add-world-book-modal-content {
    background: #242421 !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

.world-book-folder-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    /* ≥16px：避免 iOS 聚焦自动放大 */
    font-size: 16px;
    background: #f8f8f8;
}

.form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    line-height: 1.4;
}

/* 新建文件夹模态框 */
#new-folder-modal .modal-content.new-folder-modal-content {
    border: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.new-folder-modal-content {
    max-width: 320px;
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.new-folder-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin: 0;
}

.new-folder-input {
    padding: 14px 16px;
    border: none;
    border-radius: 12px;
    /* ≥16px：避免 iOS 聚焦自动放大 */
    font-size: 16px;
    background: #f0f0f0;
    color: #333;
}

.new-folder-input::placeholder {
    color: #999;
}

.new-folder-buttons {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.new-folder-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.new-folder-btn.cancel {
    background: #e8e8e8;
    color: #555;
}

.new-folder-btn.cancel:hover {
    background: #ddd;
}

.new-folder-btn.create {
    background: #000;
    color: #fff;
}

.new-folder-btn.create:hover {
    background: #333;
}

/* ============================================================
 * 世界书「新建 / 导入 / 导出」居中选择菜单
 * ============================================================ */
#world-book-create-menu-modal {
    z-index: 4550;
}

.world-book-create-menu-modal.show {
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.32);
    padding: 16px;
}

.world-book-create-menu-sheet {
    width: min(calc(100% - 8px), 360px);
    max-width: 360px;
    background: #fff;
    border-radius: 20px;
    padding: 16px 14px 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    animation: worldBookCreateMenuIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes worldBookCreateMenuIn {
    from { transform: scale(0.96) translateY(8px); opacity: 0.55; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.world-book-create-menu-title {
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 4px 0 10px;
    font-weight: 600;
}

.world-book-create-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.world-book-create-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 12px;
    border: none;
    background: #f6f6f8;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
}

.world-book-create-menu-item[hidden] {
    display: none;
}

.world-book-create-menu-item:active {
    transform: scale(0.98);
    background: #ececee;
}

.world-book-create-menu-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4448;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.world-book-create-menu-icon svg {
    width: 20px;
    height: 20px;
}

.world-book-create-menu-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.world-book-create-menu-name {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.world-book-create-menu-desc {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.world-book-create-menu-cancel {
    margin-top: 10px;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 14px;
    background: #f6f6f8;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.world-book-create-menu-cancel:active {
    background: #ececee;
}

/* ============================================================
 * 世界书导入：是否按小标题拆分
 * ============================================================ */
#world-book-import-split-modal {
    z-index: 4560;
}

.world-book-import-split-modal.show {
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.34);
    padding: 16px;
}

.world-book-import-split-sheet {
    width: min(calc(100% - 8px), 380px);
    max-width: 380px;
    padding: 18px 14px 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: worldBookCreateMenuIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.world-book-import-split-title {
    color: #222;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.world-book-import-split-desc {
    margin: 8px 4px 14px;
    color: #777;
    font-size: 12px;
    line-height: 1.55;
    text-align: left;
}

.world-book-import-split-actions {
    display: grid;
    gap: 8px;
}

.world-book-import-split-option {
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #e5e5e8;
    border-radius: 14px;
    background: #f7f7f9;
    color: #222;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.world-book-import-split-option.is-primary {
    border-color: rgba(112, 145, 178, 0.55);
    background: rgba(167, 190, 198, 0.18);
}

.world-book-import-split-option:active {
    transform: scale(0.985);
}

.world-book-import-split-option-name {
    font-size: 15px;
    font-weight: 700;
}

.world-book-import-split-option-desc {
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}

/* ============================================================
 * 世界书导入：预览 / 编辑弹窗
 * ============================================================ */
.world-book-import-count-badge {
    font-size: 13px;
    font-weight: 500;
    color: #999;
    margin-left: 4px;
}

.world-book-import-source-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    line-height: 1.4;
    word-break: break-all;
}

.world-book-import-review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.world-book-import-select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}

.world-book-import-toolbar-hint {
    font-size: 12px;
    color: #999;
}

.world-book-import-review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.world-book-import-review-item {
    background: #f8f8f8;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.world-book-import-review-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-book-import-item-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #07c160;
}

.world-book-import-title-input {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.world-book-import-format-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.world-book-import-format-badge.is-html {
    background: rgba(7, 193, 96, 0.12);
    color: #07a352;
}

.world-book-import-format-badge.is-text {
    background: rgba(0, 0, 0, 0.06);
    color: #777;
}

.world-book-import-review-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* 分组 / 生效方式 / 注入位置：窄屏挤 3 列会看不清，注入位置独占一行 */
.world-book-import-review-item-row .world-book-import-position-select {
    grid-column: 1 / -1;
}

.world-book-import-folder-select,
.world-book-import-activation-select,
.world-book-import-position-select {
    padding: 10px;
    font-size: 13px;
}

.world-book-import-new-folder-input {
    font-size: 13px;
}

.world-book-import-activation-hint {
    margin-top: -2px;
}

.world-book-import-unrecognized-hint {
    color: #c47a1f;
}

.world-book-import-content-textarea {
    min-height: 90px;
}

/* ============================================================
 * 世界书导入 / 导出弹窗：固定头尾 + 中间滚动，避免整页被撑开无法关闭
 * ============================================================ */
#world-book-import-review-modal,
#world-book-export-modal {
    z-index: 4600;
}

.world-book-import-review-content,
.world-book-export-content {
    width: min(92vw, 420px);
    max-height: min(86vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.world-book-import-review-content .modal-body,
.world-book-export-content .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.world-book-import-review-content .modal-body::-webkit-scrollbar,
.world-book-export-content .modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#world-book-import-review-modal .modal-footer,
#world-book-export-modal .modal-footer {
    flex: 0 0 auto;
    height: auto;
    min-height: 66px;
    padding: 12px 14px calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    gap: 12px;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(255, 255, 255, 0.72);
}

#world-book-import-review-modal .modal-footer .btn-cancel,
#world-book-import-review-modal .modal-footer .btn-save,
#world-book-export-modal .modal-footer .btn-cancel,
#world-book-export-modal .modal-footer .btn-save {
    width: auto;
    min-width: 128px;
    max-width: 168px;
    height: 46px;
    padding: 0 22px;
    flex: 1 1 0;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(45, 52, 72, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

#world-book-import-review-modal .modal-footer .btn-cancel,
#world-book-export-modal .modal-footer .btn-cancel {
    background: #fff;
    color: #333;
}

#world-book-import-review-modal .modal-footer .btn-save,
#world-book-export-modal .modal-footer .btn-save {
    background: #111;
    color: #fff;
    border-color: rgba(0, 0, 0, 0.12);
}

#world-book-import-review-modal .modal-footer .btn-cancel:active,
#world-book-import-review-modal .modal-footer .btn-save:active,
#world-book-export-modal .modal-footer .btn-cancel:active,
#world-book-export-modal .modal-footer .btn-save:active {
    transform: scale(0.98);
}

.world-book-export-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.world-book-export-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.world-book-export-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    padding: 0 2px;
}

.world-book-export-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #888;
    font-size: 11px;
    font-weight: 700;
}

.world-book-export-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.world-book-export-item:active {
    transform: scale(0.99);
}

.world-book-export-item.is-checked {
    border-color: rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.06);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.12);
}

.world-book-export-check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 5px;
    border: 2px solid rgba(120, 120, 120, 0.45);
    background: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}

.world-book-export-item.is-checked .world-book-export-check {
    background: #4caf50;
    border-color: #4caf50;
}

.world-book-export-item-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.world-book-export-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.world-book-export-item.is-checked .world-book-export-item-title {
    color: #2e7d32;
}

.world-book-export-item-preview {
    font-size: 12px;
    line-height: 1.45;
    color: #888;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.world-book-export-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    text-align: center;
}

.world-book-export-empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.45;
}

.world-book-export-empty-text {
    font-size: 14px;
    color: #888;
}

/* 夜间模式 · 世界书顶栏与图标按钮 */
html[data-appearance="dark"] .books-header h1 {
    color: var(--dark-btn-text, #f5f5f7);
}

html[data-appearance="dark"] .books-header-btn {
    color: var(--dark-btn-text, #f5f5f7);
    background: var(--dark-icon-btn-bg, rgba(72, 72, 76, 0.92));
    border: 1px solid var(--dark-icon-btn-border, rgba(255, 255, 255, 0.2));
    border-radius: 8px;
    box-shadow: var(--dark-icon-btn-shadow, 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 2px 10px rgba(0, 0, 0, 0.32));
}

html[data-appearance="dark"] .books-header-btn:hover {
    background: var(--dark-icon-btn-bg-hover, rgba(88, 88, 94, 0.96));
    opacity: 1;
}

html[data-appearance="dark"] .books-header-btn .books-header-icon-svg {
    color: var(--dark-btn-text, #f5f5f7);
}

html[data-appearance="dark"] .books-header-btn.active .books-header-icon-svg {
    color: #ff6b6b;
}

/* 夜间模式 · 新建/导入/导出菜单 */
html[data-appearance="dark"] .world-book-create-menu-sheet {
    background: #1c1c1e;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

html[data-appearance="dark"] .world-book-import-split-sheet {
    background: #1c1c1e;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

html[data-appearance="dark"] .world-book-import-split-title,
html[data-appearance="dark"] .world-book-import-split-option-name {
    color: #f5f5f7;
}

html[data-appearance="dark"] .world-book-import-split-desc,
html[data-appearance="dark"] .world-book-import-split-option-desc {
    color: rgba(235, 235, 245, 0.56);
}

html[data-appearance="dark"] .world-book-import-split-option {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

html[data-appearance="dark"] .world-book-import-split-option.is-primary {
    border-color: rgba(167, 190, 198, 0.58);
    background: rgba(167, 190, 198, 0.16);
}

html[data-appearance="dark"] .world-book-create-menu-title {
    color: rgba(235, 235, 245, 0.5);
}

html[data-appearance="dark"] .world-book-create-menu-item {
    background: rgba(255, 255, 255, 0.08);
}

html[data-appearance="dark"] .world-book-create-menu-item:active {
    background: rgba(255, 255, 255, 0.14);
}

html[data-appearance="dark"] .world-book-create-menu-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
    box-shadow: none;
}

html[data-appearance="dark"] .world-book-create-menu-name {
    color: #f5f5f7;
}

html[data-appearance="dark"] .world-book-create-menu-desc {
    color: rgba(235, 235, 245, 0.5);
}

html[data-appearance="dark"] .world-book-create-menu-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
}

html[data-appearance="dark"] .world-book-create-menu-cancel:active {
    background: rgba(255, 255, 255, 0.14);
}

/* 夜间模式 · 导入预览与导出选择弹窗 */
html[data-appearance="dark"] .world-book-import-count-badge,
html[data-appearance="dark"] .world-book-import-source-hint,
html[data-appearance="dark"] .world-book-import-toolbar-hint {
    color: rgba(235, 235, 245, 0.5);
}

html[data-appearance="dark"] .world-book-import-select-all {
    color: #f5f5f7;
}

html[data-appearance="dark"] .world-book-import-review-toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-appearance="dark"] .world-book-import-review-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-appearance="dark"] .world-book-import-format-badge.is-html {
    background: rgba(7, 193, 96, 0.22);
    color: #6fe3a8;
}

html[data-appearance="dark"] .world-book-import-format-badge.is-text {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(235, 235, 245, 0.7);
}

html[data-appearance="dark"] .world-book-import-unrecognized-hint {
    color: #e0a352;
}

html[data-appearance="dark"] #world-book-import-review-modal .modal-footer,
html[data-appearance="dark"] #world-book-export-modal .modal-footer {
    background: rgba(28, 28, 30, 0.92);
    border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-appearance="dark"] #world-book-import-review-modal .modal-footer .btn-cancel,
html[data-appearance="dark"] #world-book-export-modal .modal-footer .btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(235, 235, 245, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-appearance="dark"] #world-book-import-review-modal .modal-footer .btn-save,
html[data-appearance="dark"] #world-book-export-modal .modal-footer .btn-save {
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    border-color: rgba(255, 255, 255, 0.2);
}

html[data-appearance="dark"] .world-book-export-group-label {
    color: rgba(235, 235, 245, 0.72);
}

html[data-appearance="dark"] .world-book-export-group-count {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(235, 235, 245, 0.65);
}

html[data-appearance="dark"] .world-book-export-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

html[data-appearance="dark"] .world-book-export-item.is-checked {
    background: rgba(76, 175, 80, 0.14);
    border-color: rgba(111, 227, 168, 0.35);
}

html[data-appearance="dark"] .world-book-export-item-title {
    color: rgba(235, 235, 245, 0.92);
}

html[data-appearance="dark"] .world-book-export-item.is-checked .world-book-export-item-title {
    color: #6fe3a8;
}

html[data-appearance="dark"] .world-book-export-item-preview,
html[data-appearance="dark"] .world-book-export-empty-text {
    color: rgba(235, 235, 245, 0.55);
}

/* 世界书主界面与文件夹页：不透明暖纸色、内容列表和细分隔线。
 * 保留上方共享 books-header / world-book-item 规则给 Twitter 与选择、管理模态。
 * 主列表必须覆盖 style.css 中旧 .world-book-item 的 !important 蓝灰卡片规则。
 */
#books-page {
    --wb-canvas: #fbfaf7;
    --wb-surface: #f1efe9;
    --wb-hover: #eeece5;
    --wb-line: #e3dfd7;
    --wb-text: #31302e;
    --wb-muted: #706b64;
    --wb-global: #506451;
    --wb-keyword: #8a6245;
    --wb-selected: #e9eee6;
    --wb-danger: #a4473c;
    --wb-focus: #657a61;
    position: relative;
    min-width: 0;
    background: var(--wb-canvas) !important;
    color: var(--wb-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    color-scheme: light;
}

#books-page [hidden] {
    display: none !important;
}

#books-page ::selection {
    background: #dbe4d4;
    color: #31302e;
}

#books-page .status-bar {
    flex: 0 0 auto;
    background: var(--wb-canvas) !important;
    color: var(--wb-muted);
}

#books-page .status-bar .status-left,
#books-page .status-bar .status-icon,
#books-page .status-bar .status-icon-svg {
    color: var(--wb-muted) !important;
}

#books-page .books-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 60px;
    padding: 8px 12px;
    background: var(--wb-canvas) !important;
    border-bottom: 1px solid var(--wb-line);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#books-page .books-header .back-btn {
    position: static;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    transform: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 10px;
    color: var(--wb-text) !important;
    font-size: 24px;
    transition: background-color 140ms ease-out;
}

#books-page .books-header h1 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 0 0 2px;
    color: var(--wb-text) !important;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#books-page .books-header-buttons {
    position: static;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0;
}

#books-page .books-header-btn {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    color: var(--wb-text) !important;
    box-shadow: none !important;
    opacity: 1;
    transition: background-color 140ms ease-out;
}

#books-page .books-header-icon-svg {
    width: 21px;
    height: 21px;
    color: currentColor !important;
}

#books-page .books-header-btn.active {
    background: var(--wb-surface) !important;
    color: var(--wb-danger) !important;
}

#books-page .books-header-btn:active,
#books-page .books-header .back-btn:active {
    background: var(--wb-hover) !important;
    transform: none;
}

#books-page .books-content {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 20px calc(28px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    background: var(--wb-canvas) !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

#books-page .books-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

#books-page.is-selecting .books-content {
    padding-bottom: calc(96px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

#books-page .world-book-folders {
    margin-bottom: 24px;
}

#books-page .world-book-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    padding: 0 0 8px;
    color: var(--wb-muted);
    border-bottom: 1px solid var(--wb-line);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

#books-page .world-book-section-heading h2 {
    min-width: 0;
    margin: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

#books-page .world-book-section-heading > span {
    flex-shrink: 0;
    white-space: nowrap;
}

#books-page .world-book-folder-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

#books-page .world-book-folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--wb-surface);
    color: var(--wb-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 140ms ease-out;
}

#books-page .world-book-folder-card > svg {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: var(--wb-muted);
}

#books-page .world-book-folder-card > svg:last-child {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
}

#books-page .world-book-folder-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#books-page .world-book-folder-card-body strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--wb-text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#books-page .world-book-folder-card-body span {
    color: var(--wb-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#books-page .world-book-activation-section + .world-book-activation-section {
    margin-top: 28px;
}

#books-page .world-book-activation-section.is-global .world-book-section-heading {
    color: var(--wb-global);
}

#books-page .world-book-activation-section.is-keyword .world-book-section-heading {
    color: var(--wb-keyword);
}

#books-page .world-book-item {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 16px 0;
    border: 0 !important;
    border-bottom: 1px solid var(--wb-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--wb-text);
    box-shadow: none !important;
    font: inherit;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 140ms ease-out;
}

#books-page .world-book-item:last-child {
    border-bottom-color: transparent !important;
}

#books-page .world-book-item-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-bottom: 5px;
}

#books-page .world-book-item-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--wb-text) !important;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#books-page .world-book-item.is-global .world-book-item-title {
    color: var(--wb-global) !important;
}

#books-page .world-book-item.is-keyword .world-book-item-title {
    color: var(--wb-keyword) !important;
}

#books-page .world-book-priority {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--wb-surface);
    color: var(--wb-muted);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    white-space: nowrap;
}

#books-page .world-book-item-meta {
    display: block;
    margin: 0 0 8px;
    color: var(--wb-muted) !important;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#books-page .world-book-item-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 3.4em;
    margin: 0;
    overflow: hidden;
    color: var(--wb-muted) !important;
    font-size: 14px;
    line-height: 1.7;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#books-page .world-book-item.world-book-item--selecting {
    padding-left: 34px;
}

#books-page .world-book-select-box {
    left: 0;
    top: 23px;
    width: 18px;
    height: 18px;
    transform: none;
    border: 1.5px solid var(--wb-muted);
    border-radius: 5px;
    background: var(--wb-canvas);
    color: var(--wb-canvas);
    box-shadow: none;
}

#books-page .world-book-item.world-book-item--checked {
    background: var(--wb-selected) !important;
}

#books-page .world-book-item.world-book-item--checked .world-book-select-box {
    background: var(--wb-global);
    border-color: var(--wb-global);
}

#books-page .world-book-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin: 0 0 16px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--wb-surface);
    color: var(--wb-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}

#books-page .world-book-selection-bar button {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--wb-text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

#books-page .world-book-fab-delete {
    right: 20px;
    bottom: calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    width: auto;
    min-height: 48px;
    max-width: calc(100% - 40px);
    height: auto;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: var(--wb-danger);
    color: #fff;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 140ms ease-out;
}

#books-page .world-book-fab-delete:active {
    opacity: 0.85;
    transform: none;
}

#books-page .world-book-empty {
    padding: 48px 12px;
    gap: 12px;
    color: var(--wb-muted);
    text-align: center;
}

#books-page .world-book-empty-icon {
    margin: 0 0 4px;
    color: var(--wb-global);
    font-size: 36px;
    line-height: 1;
}

#books-page .world-book-empty-icon svg {
    display: block;
    width: 36px;
    height: 36px;
}

#books-page .world-book-empty-text {
    margin: 0;
    color: var(--wb-text) !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

#books-page .world-book-empty-hint {
    max-width: 26em;
    color: var(--wb-muted) !important;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#books-page .world-book-empty-action {
    min-height: 44px;
    margin-top: 6px;
    padding: 0 18px;
    border: 1px solid var(--wb-line);
    border-radius: 10px;
    background: var(--wb-surface);
    color: var(--wb-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
}

#books-page #world-book-loading {
    padding: 36px 12px;
    color: var(--wb-muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

#books-page button:focus-visible {
    outline: 2px solid var(--wb-focus);
    outline-offset: 3px;
}

#books-page .world-book-folder-card:active,
#books-page .world-book-empty-action:active {
    background: var(--wb-hover);
}

#books-page .world-book-item:active {
    background: var(--wb-hover) !important;
}

@media (hover: hover) and (pointer: fine) {
    #books-page .books-header-btn:hover,
    #books-page .books-header .back-btn:hover,
    #books-page .world-book-item:hover {
        background: var(--wb-hover) !important;
    }

    #books-page .world-book-folder-card:hover,
    #books-page .world-book-empty-action:hover,
    #books-page .world-book-selection-bar button:hover {
        background: var(--wb-hover);
    }
}

html[data-appearance="dark"] #books-page {
    --wb-canvas: #22221f;
    --wb-surface: #2d2d28;
    --wb-hover: #35362f;
    --wb-line: #41423b;
    --wb-text: #e6e5df;
    --wb-muted: #b9b7ad;
    --wb-global: #b8cdb0;
    --wb-keyword: #e3ba99;
    --wb-selected: #343d31;
    --wb-danger: #984c40;
    --wb-focus: #b8cdb0;
    color-scheme: dark;
}

html[data-appearance="dark"] #books-page ::selection {
    background: #526448;
    color: #f6f6ef;
}

@media (max-width: 360px) {
    #books-page .books-header {
        padding-right: 8px;
        padding-left: 8px;
    }

    #books-page .books-content {
        padding-right: 16px;
        padding-left: 16px;
    }

    #books-page .world-book-item-heading {
        gap: 8px;
    }

    #books-page .world-book-item-title {
        font-size: 16px;
    }

    #books-page .world-book-folder-card {
        gap: 10px;
        padding-right: 12px;
        padding-left: 12px;
    }

    #books-page .world-book-fab-delete {
        right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #books-page *,
    #add-world-book-modal *,
    #world-book-create-menu-modal *,
    #world-book-import-split-modal *,
    #new-folder-modal *,
    #world-book-folder-list-modal *,
    #world-book-import-review-modal *,
    #world-book-export-modal * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
