

.zib-pv-size {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.zib-pv-loading {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.zib-pv-error {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.zib-pv-error {
    color: #e74c3c;
}

.zib-dl-files-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.zib-dl-files-panel {
    flex: 1;
}

.zib-dl-size {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.zib-dl-file-list {
    padding: 8px 6px;
    overflow-y: auto;
    flex: 1;
}

.zib-dl-list-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.zib-dl-list-item:hover {
    background: #fafafa;
}

.zib-dl-list-item .zib-dl-icon {
    color: #999;
    flex-shrink: 0;
}

.zib-dl-list-item .zib-dl-name {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zib-dl-download-btn {
    padding: 5px 14px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
}

.zib-dl-download-btn:hover {
    background: #155cb0;
}

.zib-dl-loading {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.zib-dl-empty,
.zib-dl-error {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.zib-dl-error {
    color: #e74c3c;
}

/* 右侧文件列表分页条 */
.zib-dl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 6px;
}

.zib-dl-page-btn {
    padding: 4px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
}

.zib-dl-page-btn:hover:not(:disabled) {
    border-color: #1a73e8;
    color: #1a73e8;
}

.zib-dl-page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.zib-dl-page-info {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

/* ========== 搜索框容器（2026-09-27 改版：输入框与按钮合成一体） ==========
   旧样式是「灰底大盒子（#e2e8f0 + 20px 内边距）里放一个白输入框和一个蓝按钮」——
   三块各自有边框/底色，读起来像三个独立控件，而不是「一个搜索框」。
   现在：容器透明（那层灰底不表达任何信息，是纯视觉噪音），
   白底 + 细描边的**长方形（小圆角）**只画在 .zib-*-search-box 上，
   输入框无边框、按钮嵌在右端。
   宽度：外面那层容器上限 960px，这里再收到 **480px（一半）并居中** ——
   搜索框只需要够输入的长度，撑满整行会把「输入 + 按钮」这对关系拉散。
   ★ 只缩这一层、不缩 .zib-*-search-container：搜索结果列表要照旧占满 960px，
     一起缩窄会让结果行的表头/文件名/按钮挤在一起。
   ★ 深色模式的对应规则在文件下方的「夜间模式支持」一节，两处要一起改。 */
.zib-search-form-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 480px;          /* 容器上限 960px 的一半 */
    margin: 0 auto 16px;       /* 居中；16px 是原来的下间距 */
    box-shadow: none;
    transition: none;
}

.zib-search-form-wrap:hover {
    box-shadow: none;
}

/* ========== 预览搜索 ========== */
.zib-pv-search-container {
    max-width: 960px;
    margin: 0 auto;
}

/* 输入 + 按钮合成一体：外壳负责描边与圆角，里面两件都不画边框。
   ★ 用 :focus-within 让「点进输入框」时高亮的是**整个搜索框** ——
     焦点环画在输入框自己身上，看起来会像只有左半边被选中。
   ★ 形状是「长方形带一点圆角」：外壳 8px，内部两件 4px。
     内部圆角 = 外壳圆角 − padding（8 − 4）—— 给大了按钮的角会从外壳的弧里
     探出来，给小了按钮四角会出现一圈白缝。 */
.zib-pv-search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    padding: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zib-pv-search-box:hover {
    border-color: #c9d2dc;
}

.zib-pv-search-box:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.zib-pv-search-input {
    flex: 1;
    min-width: 0;
    padding: 9px 16px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.4;
    outline: none;
    background: transparent;
    color: #1a1a1a;
    box-shadow: none;
    transition: none;
    -webkit-appearance: none;
    appearance: none;
}

.zib-pv-search-input::placeholder {
    color: #9aa0a6;
}

/* ★ 输入框自己不再有任何边框/阴影 —— 高亮交给上面的 :focus-within 外壳。
   少了这两条，旧的 :hover/:focus 会把边框画回输入框上，把胶囊切断。 */
.zib-pv-search-input:hover,
.zib-pv-search-input:focus {
    border: none;
    box-shadow: none;
}

.zib-pv-search-btn {
    flex-shrink: 0;
    padding: 9px 22px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: background 0.2s ease;
    min-width: 84px;
    white-space: nowrap;
}

.zib-pv-search-btn:hover {
    background: #1557b0;
}

.zib-pv-search-btn:active {
    background: #0f4a99;
}

.zib-pv-search-results,
.zib-dl-search-results {
    min-height: 60px;
}

.zib-pv-search-placeholder,
.zib-dl-search-placeholder {
    padding: 24px;
    text-align: center;
    color: #999;
    font-size: 13px;
    background: #fafafa;
    border-radius: 6px;
}

/* ========== 搜索结果列表（参考 zib-123pan 网盘风格） ========== */
.zib-search-list {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 列表头部 */
.zib-search-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    min-height: 40px;
}

.zib-search-header-icon {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    flex-shrink: 0;
}

.zib-search-header-name {
    flex: 1 1 0%;
    min-width: 0;
}

.zib-search-header-size {
    flex: 0 0 10%;
    min-width: 80px;
    text-align: right;
    margin-right: 12px;
}

.zib-search-header-action {
    flex: 0 0 12%;
    min-width: 92px;
    text-align: right;
}

/* 列表项 */
.zib-pv-search-item,
.zib-dl-search-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 48px;
    animation: zibSearchFadeIn 0.3s ease-out both;
}

.zib-pv-search-item:hover,
.zib-dl-search-item:hover {
    background: #e6f4ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.zib-pv-search-item:last-child,
.zib-dl-search-item:last-child {
    border-bottom: none;
}

/* ★ 下载搜索结果行**不再是可点区域**（2026-09-27 用户要求：点文件名不再下载，
   必须点右侧「下载」按钮）。所以把「可点」的三个视觉承诺一起去掉 ——
   cursor: pointer / 上浮 / 投影，留着它们等于告诉用户「这一行能点」，
   点下去却没反应，比原来更糟。悬停底色保留但调淡，只为横向读行时不串行。
   ★ 预览搜索行（.zib-pv-search-item）仍然可点（点文件名进预览），
     所以这里**只针对下载侧**写，不能把共用的那条选择器一起改掉。 */
.zib-dl-search-item {
    cursor: default;
}

.zib-dl-search-item:hover {
    background: #f8fafc;
    transform: none;
    box-shadow: none;
}

.zib-dl-search-item:hover .zib-search-name {
    color: #212529;
}

/* 图标 */
.zib-search-icon {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.zib-pv-search-dir .zib-search-icon,
.zib-dl-search-dir .zib-search-icon {
    color: #f0c040;
}

.zib-pv-search-file .zib-search-icon,
.zib-dl-search-file .zib-search-icon {
    color: #1976d2;
}

.zib-pv-search-file.zib-pv-pdf .zib-search-icon {
    color: #e74c3c;
}

/* 文件名 */
.zib-search-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0%;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.zib-search-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.zib-pv-search-item:hover .zib-search-name,
.zib-dl-search-item:hover .zib-search-name {
    color: #1976d2;
}

/* 文件权限标签（普通 / 特殊） */
.zib-file-tag {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
    border-radius: 4px;
    border: 1px solid #dcdcdc;
    vertical-align: middle;
}

.zib-file-tag-normal {
    color: #3fb950;
    background: transparent;
}

.zib-file-tag-special {
    color: #d29922;
    background: transparent;
}

/* 文件大小 */
.zib-search-size {
    flex: 0 0 10%;
    min-width: 80px;
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 操作按钮 / 标记 */
.zib-search-badge {
    flex: 0 0 12%;
    min-width: 92px;
    text-align: right;
}

.zib-pv-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.zib-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 12%;
    min-width: 92px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    height: 28px;
    border-radius: 4px;
    background: #1976d2;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.zib-search-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

/* 搜索关键词高亮 */
.zib-pv-search-item mark,
.zib-dl-search-item mark {
    background: none;
    color: #dc2626;
    font-weight: bold;
    padding: 0;
}

/* 搜索统计信息
   ★ 2026-09-27：这一条（以及下面的 .zib-search-stats-count、夜间模式里的对应两条）
   当前**没有元素使用** —— 用户要求去掉搜索结果顶部的「本页找到 N 个文件」，
   functions.php 里已不再输出。**故意保留样式**，理由与后台 CSS 的旧类名一致：
   历史缓存页面（CDN/浏览器里带旧 hash 的 HTML）仍可能渲染出这个元素，
   删掉样式会让它变成一块裸文本。以后要恢复只需把 PHP 那一行加回来。 */
.zib-search-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    color: #495057;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
}

/* 空状态 / 无结果 */
.zib-pv-search-empty,
.zib-dl-search-empty {
    text-align: center;
    padding: 2rem 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin: 1rem 0;
}

.zib-pv-search-empty::before,
.zib-dl-search-empty::before {
    content: '\1F50D';
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.zib-search-empty-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.zib-search-empty-tip {
    font-size: 0.875rem;
    color: #666;
}

/* 占位状态（未搜索时） */
.zib-pv-search-placeholder,
.zib-dl-search-placeholder {
    text-align: center;
    padding: 2rem 1rem;
    color: #9aa0a6;
    font-size: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.zib-search-placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.zib-search-placeholder-text {
    font-size: 14px;
    color: #9aa0a6;
}

/* loading 旋转动画 */
.zib-pv-loading,
.zib-dl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.zib-pv-loading::before,
.zib-dl-loading::before {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid #e8eaed;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: zibSearchSpin 0.8s linear infinite;
}

@keyframes zibSearchSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 淡入动画 */
@keyframes zibSearchFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zib-pv-search-item:nth-child(1),
.zib-dl-search-item:nth-child(1) { animation-delay: 0.05s; }
.zib-pv-search-item:nth-child(2),
.zib-dl-search-item:nth-child(2) { animation-delay: 0.1s; }
.zib-pv-search-item:nth-child(3),
.zib-dl-search-item:nth-child(3) { animation-delay: 0.15s; }
.zib-pv-search-item:nth-child(4),
.zib-dl-search-item:nth-child(4) { animation-delay: 0.2s; }
.zib-pv-search-item:nth-child(5),
.zib-dl-search-item:nth-child(5) { animation-delay: 0.25s; }
.zib-pv-search-item:nth-child(n+6),
.zib-dl-search-item:nth-child(n+6) { animation-delay: 0.3s; }

/* ========== 下载搜索容器 ========== */
.zib-dl-search-container {
    max-width: 960px;
    margin: 0 auto;
}

/* 与预览侧逐条对称（见上面 .zib-pv-search-box 的说明：外壳 8px / 内部 4px）。 */
.zib-dl-search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    padding: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zib-dl-search-box:hover {
    border-color: #c9d2dc;
}

.zib-dl-search-box:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.zib-dl-search-input {
    flex: 1;
    min-width: 0;
    padding: 9px 16px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.4;
    outline: none;
    background: transparent;
    color: #1a1a1a;
    box-shadow: none;
    transition: none;
    -webkit-appearance: none;
    appearance: none;
}

.zib-dl-search-input::placeholder {
    color: #9aa0a6;
}

.zib-dl-search-input:hover,
.zib-dl-search-input:focus {
    border: none;
    box-shadow: none;
}

.zib-dl-search-btn {
    flex-shrink: 0;
    padding: 9px 22px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: background 0.2s ease;
    min-width: 84px;
    white-space: nowrap;
}

.zib-dl-search-btn:hover {
    background: #1557b0;
}

.zib-dl-search-btn:active {
    background: #0f4a99;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .zib-search-header {
        display: none;
    }

    .zib-pv-search-item,
    .zib-dl-search-item {
        display: grid;
        grid-template-columns: 20px 1fr;
        grid-template-rows: auto auto;
        gap: 4px 12px;
        padding: 12px 16px;
        min-height: auto;
        align-items: start;
    }

    .zib-search-icon {
        grid-column: 1;
        grid-row: 1;
        margin-right: 0;
        align-self: start;
    }

    .zib-search-name {
        grid-column: 2;
        grid-row: 1;
        line-height: 1.3;
        font-size: 13px;
    }

    .zib-search-name-text {
        white-space: normal;
        word-break: break-word;
    }

    .zib-search-size {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        margin-right: 0;
        font-size: 11px;
        color: #868e96;
    }

    .zib-search-badge,
    .zib-search-btn {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        align-self: center;
    }

    .zib-search-btn {
        min-width: 50px;
        padding: 3px 10px;
        font-size: 11px;
        height: 24px;
    }
}

/* ========== 分页 ========== */
.zib-pv-pagination,
.zib-dl-pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.zib-pv-page-btn,
.zib-dl-page-btn {
    padding: 6px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.zib-pv-page-btn:hover,
.zib-dl-page-btn:hover {
    border-color: #1a73e8;
    color: #1a73e8;
}

.zib-pv-page-btn[disabled],
.zib-dl-page-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.zib-pv-page-info,
.zib-dl-page-info {
    font-size: 13px;
    color: #666;
}

/* ========== 搜索模式 ========== */
.zib-pv-search-options,
.zib-dl-search-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
}

.zib-pv-search-mode,
.zib-dl-search-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    accent-color: #1a73e8;
}

.zib-pv-search-mode-tip,
.zib-dl-search-mode-tip {
    color: #999;
    font-size: 12px;
}

/* ========== 弹窗 ========== */
.zib-pv-modal-overlay,
.zib-dl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1030;
}

.zib-pv-modal,
.zib-dl-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    padding: 24px;
}

.zib-pv-modal-body,
.zib-dl-modal-body {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.zib-pv-modal-actions,
.zib-dl-modal-actions {
    margin-top: 20px;
    text-align: right;
}

.zib-pv-modal-btn,
.zib-dl-modal-btn {
    padding: 8px 20px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* ===== 次数用完专用弹窗（zol-quota-modal）=====
   简洁风格：标题 + 副文案居中 + 一行两个胶囊按钮 */
.zol-quota-modal {
    padding: 28px 26px 22px;
    text-align: center;
    border-radius: 12px;
    max-width: 380px;
}

/* 标题 / 副文案 */
.zol-quota-modal .zib-pv-modal-title,
.zol-quota-modal .zib-dl-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    text-align: center;
}

.zol-quota-modal .zib-pv-modal-sub,
.zol-quota-modal .zib-dl-modal-sub {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 22px;
    text-align: center;
}

/* 操作区：两个按钮并排一行、等宽居中；颜色套用站点「下载按钮」样式 */
.zol-quota-modal .zib-pv-modal-actions,
.zol-quota-modal .zib-dl-modal-actions {
    margin-top: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
}

.zol-quota-modal .zol-quota-btn {
    box-sizing: border-box;
    flex: 1;
    text-align: center;
    padding: 6px 14px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.5;
}

.zol-quota-modal .zol-quota-btn:hover {
    background: #155cb0;
    color: #fff;
    opacity: 1;
}

/* 「明天再来」灰色次按钮：弱化视觉，与蓝色主按钮（开通会员）形成主次 */
.zol-quota-modal .zol-quota-btn--ghost {
    background: #f0f1f2;
    color: #666;
}

.zol-quota-modal .zol-quota-btn--ghost:hover {
    background: #e3e5e7;
    color: #444;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {

    .zib-dl-files-panel {
        min-height: 60vh;
    }

    /* 搜索模式紧凑排布 */
    .zib-pv-search-options,
    .zib-dl-search-options {
        gap: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {

    /* 窄屏给次数弹窗更多可用宽度：压缩横向内边距 + 标题字号，保证
       「您当前身份（订阅者）没有特殊文件下载权限」这类长标题一行放得下 */
    .zol-quota-modal {
        padding: 24px 14px 18px;
    }

    .zol-quota-modal .zib-pv-modal-title,
    .zol-quota-modal .zib-dl-modal-title {
        font-size: 14px;
    }
}

/* ========== 夜间模式支持 ========== */
/* 容器现在是透明的，深色模式也不需要给它底色 —— 只留「输入+按钮」那层胶囊。
   原来的 #2d3748 灰卡在深色下会变成一块多余的深色方块。 */
body.dark-theme .zib-search-form-wrap,
body[data-theme="dark"] .zib-search-form-wrap,
html[data-theme="dark"] .zib-search-form-wrap,
html.dark .zib-search-form-wrap,
body.dark .zib-search-form-wrap {
    background: transparent !important;
    border-color: transparent !important;
}

body.dark-theme .zib-pv-search-box,
body[data-theme="dark"] .zib-pv-search-box,
html[data-theme="dark"] .zib-pv-search-box,
html.dark .zib-pv-search-box,
body.dark .zib-pv-search-box,
body.dark-theme .zib-dl-search-box,
body[data-theme="dark"] .zib-dl-search-box,
html[data-theme="dark"] .zib-dl-search-box,
html.dark .zib-dl-search-box,
body.dark .zib-dl-search-box {
    background: #1f2430 !important;
    border-color: #3d4657 !important;
}

body.dark-theme .zib-pv-search-box:focus-within,
body[data-theme="dark"] .zib-pv-search-box:focus-within,
html[data-theme="dark"] .zib-pv-search-box:focus-within,
html.dark .zib-pv-search-box:focus-within,
body.dark .zib-pv-search-box:focus-within,
body.dark-theme .zib-dl-search-box:focus-within,
body[data-theme="dark"] .zib-dl-search-box:focus-within,
html[data-theme="dark"] .zib-dl-search-box:focus-within,
html.dark .zib-dl-search-box:focus-within,
body.dark .zib-dl-search-box:focus-within {
    border-color: #63b3ed !important;
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.18) !important;
}

/* 输入框自己已经透明无边框（底色由上面那层胶囊给），这里只改文字色。 */
body.dark-theme .zib-pv-search-input,
body[data-theme="dark"] .zib-pv-search-input,
html[data-theme="dark"] .zib-pv-search-input,
html.dark .zib-pv-search-input,
body.dark .zib-pv-search-input,
body.dark-theme .zib-dl-search-input,
body[data-theme="dark"] .zib-dl-search-input,
html[data-theme="dark"] .zib-dl-search-input,
html.dark .zib-dl-search-input,
body.dark .zib-dl-search-input {
    background: transparent !important;
    border-color: transparent !important;
    color: #f0f0f0 !important;
}

body.dark-theme .zib-pv-search-input::placeholder,
body[data-theme="dark"] .zib-pv-search-input::placeholder,
html[data-theme="dark"] .zib-pv-search-input::placeholder,
html.dark .zib-pv-search-input::placeholder,
body.dark .zib-pv-search-input::placeholder,
body.dark-theme .zib-dl-search-input::placeholder,
body[data-theme="dark"] .zib-dl-search-input::placeholder,
html[data-theme="dark"] .zib-dl-search-input::placeholder,
html.dark .zib-dl-search-input::placeholder,
body.dark .zib-dl-search-input::placeholder {
    color: #999999 !important;
    opacity: 1 !important;
}

body.dark-theme .zib-search-list,
body[data-theme="dark"] .zib-search-list,
html[data-theme="dark"] .zib-search-list,
html.dark .zib-search-list,
body.dark .zib-search-list {
    background: #1a202c !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

body.dark-theme .zib-search-header,
body[data-theme="dark"] .zib-search-header,
html[data-theme="dark"] .zib-search-header,
html.dark .zib-search-header,
body.dark .zib-search-header {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%) !important;
    border-bottom: 2px solid #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .zib-search-stats,
body[data-theme="dark"] .zib-search-stats,
html[data-theme="dark"] .zib-search-stats,
html.dark .zib-search-stats,
body.dark .zib-search-stats {
    background: #2d3748 !important;
    border-bottom: 1px solid #4a5568 !important;
    color: #a0aec0 !important;
}

body.dark-theme .zib-pv-search-item,
body[data-theme="dark"] .zib-pv-search-item,
html[data-theme="dark"] .zib-pv-search-item,
html.dark .zib-pv-search-item,
body.dark .zib-pv-search-item,
body.dark-theme .zib-dl-search-item,
body[data-theme="dark"] .zib-dl-search-item,
html[data-theme="dark"] .zib-dl-search-item,
html.dark .zib-dl-search-item,
body.dark .zib-dl-search-item {
    background: #1a202c !important;
    border-bottom: 1px solid #4a5568 !important;
}

body.dark-theme .zib-pv-search-item:hover,
body[data-theme="dark"] .zib-pv-search-item:hover,
html[data-theme="dark"] .zib-pv-search-item:hover,
html.dark .zib-pv-search-item:hover,
body.dark .zib-pv-search-item:hover,
body.dark-theme .zib-dl-search-item:hover,
body[data-theme="dark"] .zib-dl-search-item:hover,
html[data-theme="dark"] .zib-dl-search-item:hover,
html.dark .zib-dl-search-item:hover,
body.dark .zib-dl-search-item:hover {
    background: rgba(99, 179, 237, 0.18) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4) !important;
}

body.dark-theme .zib-search-name,
body[data-theme="dark"] .zib-search-name,
html[data-theme="dark"] .zib-search-name,
html.dark .zib-search-name,
body.dark .zib-search-name {
    color: #e2e8f0 !important;
}

body.dark-theme .zib-search-name:hover,
body[data-theme="dark"] .zib-search-name:hover,
html[data-theme="dark"] .zib-search-name:hover,
html.dark .zib-search-name:hover,
body.dark .zib-search-name:hover {
    color: #63b3ed !important;
}

body.dark-theme .zib-search-size,
body[data-theme="dark"] .zib-search-size,
html[data-theme="dark"] .zib-search-size,
html.dark .zib-search-size,
body.dark .zib-search-size {
    color: #a0aec0 !important;
}

body.dark-theme .zib-pv-search-empty,
body[data-theme="dark"] .zib-pv-search-empty,
html[data-theme="dark"] .zib-pv-search-empty,
html.dark .zib-pv-search-empty,
body.dark .zib-pv-search-empty,
body.dark-theme .zib-dl-search-empty,
body[data-theme="dark"] .zib-dl-search-empty,
html[data-theme="dark"] .zib-dl-search-empty,
html.dark .zib-dl-search-empty,
body.dark .zib-dl-search-empty {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}

body.dark-theme .zib-search-empty-title,
body[data-theme="dark"] .zib-search-empty-title,
html[data-theme="dark"] .zib-search-empty-title,
html.dark .zib-search-empty-title,
body.dark .zib-search-empty-title {
    color: #e2e8f0 !important;
}

body.dark-theme .zib-search-empty-tip,
body[data-theme="dark"] .zib-search-empty-tip,
html[data-theme="dark"] .zib-search-empty-tip,
html.dark .zib-search-empty-tip,
body.dark .zib-search-empty-tip {
    color: #a0aec0 !important;
}

body.dark-theme .zib-pv-search-placeholder,
body[data-theme="dark"] .zib-pv-search-placeholder,
html[data-theme="dark"] .zib-pv-search-placeholder,
html.dark .zib-pv-search-placeholder,
body.dark .zib-pv-search-placeholder,
body.dark-theme .zib-dl-search-placeholder,
body[data-theme="dark"] .zib-dl-search-placeholder,
html[data-theme="dark"] .zib-dl-search-placeholder,
html.dark .zib-dl-search-placeholder,
body.dark .zib-dl-search-placeholder {
    background: #2d3748 !important;
    color: #718096 !important;
}

body.dark-theme .zib-search-placeholder-text,
body[data-theme="dark"] .zib-search-placeholder-text,
html[data-theme="dark"] .zib-search-placeholder-text,
html.dark .zib-search-placeholder-text,
body.dark .zib-search-placeholder-text {
    color: #a0aec0 !important;
}

body.dark-theme .zib-pv-search-item mark,
body[data-theme="dark"] .zib-pv-search-item mark,
html[data-theme="dark"] .zib-pv-search-item mark,
html.dark .zib-pv-search-item mark,
body.dark .zib-pv-search-item mark,
body.dark-theme .zib-dl-search-item mark,
body[data-theme="dark"] .zib-dl-search-item mark,
html[data-theme="dark"] .zib-dl-search-item mark,
html.dark .zib-dl-search-item mark,
body.dark .zib-dl-search-item mark {
    color: #f87171 !important;
    background: none !important;
}

body.dark-theme .zib-pv-loading::before,
body[data-theme="dark"] .zib-pv-loading::before,
html[data-theme="dark"] .zib-pv-loading::before,
html.dark .zib-pv-loading::before,
body.dark .zib-pv-loading::before,
body.dark-theme .zib-dl-loading::before,
body[data-theme="dark"] .zib-dl-loading::before,
html[data-theme="dark"] .zib-dl-loading::before,
html.dark .zib-dl-loading::before,
body.dark .zib-dl-loading::before {
    border-color: #4a5568 !important;
    border-top-color: #63b3ed !important;
}

body.dark-theme .zib-pv-page-btn,
body[data-theme="dark"] .zib-pv-page-btn,
html[data-theme="dark"] .zib-pv-page-btn,
html.dark .zib-pv-page-btn,
body.dark .zib-pv-page-btn,
body.dark-theme .zib-dl-page-btn,
body[data-theme="dark"] .zib-dl-page-btn,
html[data-theme="dark"] .zib-dl-page-btn,
html.dark .zib-dl-page-btn,
body.dark .zib-dl-page-btn {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

body.dark-theme .zib-pv-page-btn:hover,
body[data-theme="dark"] .zib-pv-page-btn:hover,
html[data-theme="dark"] .zib-pv-page-btn:hover,
html.dark .zib-pv-page-btn:hover,
body.dark .zib-pv-page-btn:hover,
body.dark-theme .zib-dl-page-btn:hover,
body[data-theme="dark"] .zib-dl-page-btn:hover,
html[data-theme="dark"] .zib-dl-page-btn:hover,
html.dark .zib-dl-page-btn:hover,
body.dark .zib-dl-page-btn:hover {
    border-color: #63b3ed !important;
    color: #63b3ed !important;
}

body.dark-theme .zib-pv-page-info,
body[data-theme="dark"] .zib-pv-page-info,
html[data-theme="dark"] .zib-pv-page-info,
html.dark .zib-pv-page-info,
body.dark .zib-pv-page-info,
body.dark-theme .zib-dl-page-info,
body[data-theme="dark"] .zib-dl-page-info,
html[data-theme="dark"] .zib-dl-page-info,
html.dark .zib-dl-page-info,
body.dark .zib-dl-page-info {
    color: #a0aec0 !important;
}

/* 夜间模式标签 */
body.dark-theme .zib-file-tag,
body[data-theme="dark"] .zib-file-tag,
html[data-theme="dark"] .zib-file-tag,
html.dark .zib-file-tag,
body.dark .zib-file-tag {
    border-color: #4a5568 !important;
}

body.dark-theme .zib-file-tag-normal,
body[data-theme="dark"] .zib-file-tag-normal,
html[data-theme="dark"] .zib-file-tag-normal,
html.dark .zib-file-tag-normal,
body.dark .zib-file-tag-normal {
    color: #68d391 !important;
}

body.dark-theme .zib-file-tag-special,
body[data-theme="dark"] .zib-file-tag-special,
html[data-theme="dark"] .zib-file-tag-special,
html.dark .zib-file-tag-special,
body.dark .zib-file-tag-special {
    color: #f6ad55 !important;
}

/* ========== 搜索：不闪屏加载态 + 慢搜索提示（2026-09-27 新增） ==========
   为什么需要这一节：OpenList 未建索引时，一次 fs/search 是一次真实的目录遍历，
   动辄十几秒。原实现每次搜索都先把结果区整块换成「正在搜索...」——
   用户看到的是「内容消失 → 一片空白 → 内容出现」，比慢本身更难受，
   而且页面高度剧烈跳动，正在看的那一行会跑掉。
   现在：有旧结果可留时只压暗 + 禁止点击（容器上的 .is-searching），
   只有首次搜索（还没有结果）才显示转圈块。

   放在文件末尾是为了不被上面 1400+ 行里的同名规则意外覆盖；
   深色主题的覆盖紧跟在同一处，避免以后加主题时漏掉这一节。 */
.zib-pv-search-container.is-searching .zib-pv-search-results,
.zib-dl-search-container.is-searching .zib-dl-search-results {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* 按钮同步压暗，让「现在不能点」这件事一眼可见（同时 JS 会置 disabled） */
.zib-pv-search-container.is-searching .zib-pv-search-btn,
.zib-dl-search-container.is-searching .zib-dl-search-btn {
    opacity: 0.65;
}

.zib-pv-search-slow,
.zib-dl-search-slow {
    margin: 10px 0 0;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
    background: #fff8e5;
    border: 1px solid #ffe08a;
    border-radius: 6px;
}

body.dark-theme .zib-pv-search-slow,
body[data-theme="dark"] .zib-pv-search-slow,
html[data-theme="dark"] .zib-pv-search-slow,
html.dark .zib-pv-search-slow,
body.dark .zib-pv-search-slow,
body.dark-theme .zib-dl-search-slow,
body[data-theme="dark"] .zib-dl-search-slow,
html[data-theme="dark"] .zib-dl-search-slow,
html.dark .zib-dl-search-slow,
body.dark .zib-dl-search-slow {
    color: #f6d365;
    background: rgba(246, 211, 101, 0.12);
    border-color: rgba(246, 211, 101, 0.35);
}

/* ==========================================================================
   点击后的即时反馈：「获取中…」
   --------------------------------------------------------------------------
   为什么非要有这一层：点一次下载（或预览），后端最坏要串 3 次上游
   （fs/link → fs/get → admin/setting/get），慢的时候好几秒。
   期间界面**毫无变化**，用户的结论必然是「点了没反应」，于是再点一次 ——
   而第二次会被管理器里的 downloading / previewing 锁直接吞掉，
   表现成「点了两次都没反应」，看起来更像坏了。
   所以：点击后立刻在被点的那一项上盖一层「获取中…」。

   ★★ 目录树（.zib-file）**故意不在名单里** —— 这是用户明确要求的
      （「点击目录树 pdf 文件名不要显示加载中」）。
      理由不只是「不想要」：树里的行是紧凑型（padding 3px 8px /
      min-height 22px / font-size 13px），铺满整行的纱会**把文件名整个盖掉**，
      而文件名正是用户刚点过、要用来确认「我点的是哪个文件」的东西。
      预览侧另有面板级的反馈（右侧查看器本身在加载），
      所以树这一行不给反馈并不会让人以为「点了没反应」。
      ★ 以后要加回来，先把这段读完 —— 这是取舍，不是漏写。
      JS 侧对应的是 main.js 里「树文件点击故意不传 el」那处注释。

   ★ 文案走 ::after，绝不用 JS 改 text()：被点的是**整行**，
     里面有文件名、图标、大小、按钮，改文字会把它们全抹掉。
   ★ 用「铺满整行的纱」而不是角落小徽标：角落徽标会和右侧的
     大小列 / 下载按钮打架（徽标比按钮宽），只能靠隐藏按钮 + 加
     padding 去躲，反而把行宽搞跳。铺满整行则完全不依赖子元素布局。
   ★ 纱的颜色走 CSS 变量，深浅主题只改两个变量值 —— 否则这里要写
     7 种主题根 × 3 个元素选择器 = 21 条规则。
   ========================================================================== */

.zib-pv-search-item.is-loading,
.zib-dl-search-item.is-loading,
.zib-dl-list-item.is-loading {
    position: relative;
}

.zib-pv-search-item.is-loading::after,
.zib-dl-search-item.is-loading::after,
.zib-dl-list-item.is-loading::after {
    content: "获取中…";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--zol-loading-fg, #1a73e8);
    background: var(--zol-loading-bg, rgba(255, 255, 255, 0.84));
    pointer-events: none;
    z-index: 3;
}

/* 纱的颜色变量：默认浅色，深色主题下改这两个值即可 */
body.dark-theme,
body[data-theme="dark"],
html[data-theme="dark"],
html.dark,
body.dark {
    --zol-loading-fg: #8ab8ff;
    --zol-loading-bg: rgba(28, 30, 34, 0.84);
}

/* ★ 下载进行中的加载状态，放在「下载」按钮里（用户要求：变成「下载中」即可）。
   JS 把 .is-loading 加在 .zib-dl-download-btn 上，视觉上按钮文案原地切换。
   其余更复杂的反馈（滑动进度条、toast 等）已按用户要求移除 ——
   全局「正在生成下载链接」的说明交给居中的全屏遮罩做。 */
.zib-dl-download-btn.is-loading {
    position: relative;
    color: transparent;          /* 隐藏原「下载」文案 */
    background: #155cb0;         /* 加载态稍加深，区分可点状态 */
    pointer-events: none;        /* 加载中不可再点 */
    cursor: default;
}

.zib-dl-download-btn.is-loading::after {
    content: "下载中…";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #fff;
}

/* ★ 下载中加载反馈 —— 两部分分离：
   ① 容器加 .is-downloading：搜索结果/文件列表区域压暗、禁用（只盖这里）。
   ② .zib-openlist-overlay：position:fixed 固定在**视口正中央**的转圈+文案，
      无论滚动到哪都在屏幕中间，不会因容器高而上飘/下沉。 */
.zib-dl-search-container.is-downloading,
.zib-dl-container.is-downloading {
    pointer-events: none;      /* 该区域下载期间不可操作 */
    opacity: 0.55;             /* 压暗直观呈现「正在处理」 */
}

.zib-openlist-overlay {
    position: fixed;
    top: 50vh;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 26px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
body.dark-theme .zib-openlist-overlay,
body[data-theme="dark"] .zib-openlist-overlay,
html[data-theme="dark"] .zib-openlist-overlay,
html.dark .zib-openlist-overlay,
body.dark .zib-openlist-overlay {
    background: rgba(38, 40, 47, 0.96);
}

.zib-openlist-overlay-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(26, 115, 232, 0.25);
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: zol-overlay-spin 0.8s linear infinite;
}

.zib-openlist-overlay-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
body.dark-theme .zib-openlist-overlay-text,
body[data-theme="dark"] .zib-openlist-overlay-text,
html[data-theme="dark"] .zib-openlist-overlay-text,
html.dark .zib-openlist-overlay-text,
body.dark .zib-openlist-overlay-text {
    color: #eee;
}

@keyframes zol-overlay-spin {
    to { transform: rotate(360deg); }
}

