/* ===== 数据网盘样式（从 drive.php 抽离，可被浏览器缓存） ===== */
:root {
    --pri: #1D5BFF; --pri-d: #0E4BC9; --pri-l: #4C86FF; --pri-h: #4C86FF;
    --pri-bg: rgba(29,91,255,0.08);
    --bg: #f2f2f7; --card: #ffffff; --line: #e5e5ea; --line-l: #f2f2f7;
    --t1: #1c1c1e; --t2: #3a3a3c; --t3: #8e8e93; --t4: #c7c7cc;
    --row-alt: #ffffff;
    --ok: #34c759; --warn: #ff9500; --warn-bg: rgba(255,149,0,0.08);
    --err: #ff3b30;
    --r: 16px; --r-sm: 8px;
    --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
    --ring: 0 0 0 3px rgba(29,91,255,0.14);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 2px 6px rgba(0,0,0,0.04), 0 10px 24px -8px rgba(0,0,0,0.10);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.06), 0 24px 54px -16px rgba(0,0,0,0.20);
}
:root.dark-mode {
    --pri: #818cf8; --pri-d: #6366f1; --pri-l: #a5b4fc; --pri-h: #a5b4fc;
    --pri-bg: rgba(99,102,241,0.15);
    --bg: #0f172a; --card: #1e293b; --line: #334155; --line-l: #1e293b;
    --t1: #f1f5f9; --t2: #cbd5e1; --t3: #64748b; --t4: #475569;
    --row-alt: #1a2332;
    --ok: #34d399; --warn: #fbbf24; --warn-bg: rgba(251,191,36,0.12);
    --err: #f87171;
    --ring: 0 0 0 3px rgba(129,140,248,0.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: var(--bg); color: var(--t1); transition: background 0.2s, color 0.2s; font-size: 15px;
}
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; background: none; font-family: inherit; }

/* ===== HEADER ===== */
.drive-header {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--line);
    padding: 0 24px; height: 52px; display: flex; align-items: center;
    gap: 16px; position: sticky; top: 0; z-index: 200;
}
.drive-logo {
    font-size: 18px; font-weight: 800; color: var(--pri);
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.drive-logo svg { width: 24px; height: 24px; }
.drive-search-wrap { flex: 1; max-width: 480px; position: relative; }
.drive-search-wrap svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--t3); pointer-events: none;
}
.drive-search {
    width: 100%; height: 40px; padding: 0 14px 0 40px;
    border: 1.5px solid var(--line); border-radius: 10px;
    background: var(--bg); color: var(--t1); font-size: 15px;
    outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.drive-search:focus { border-color: var(--pri); background: var(--card); box-shadow: 0 0 0 3px var(--pri-bg); }
.drive-search::placeholder { color: var(--t3); }
/* 搜索结果高亮 */
mark.search-hl {
    background: rgba(29,91,255,0.16);
    color: var(--pri);
    border-radius: 3px;
    padding: 0 1px;
    font-weight: 600;
}
:root.dark-mode mark.search-hl {
    background: rgba(129,140,248,0.24);
    color: #c7d2fe;
}
/* 搜索建议/历史下拉 */
.drive-search-suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; box-shadow: var(--shadow); z-index: 300;
    max-height: 300px; overflow-y: auto; padding: 6px;
}
.drive-search-suggest[hidden] { display: none; }
.drive-suggest-head {
    font-size: 12px; color: var(--t3); font-weight: 700;
    padding: 6px 10px 4px; letter-spacing: .3px;
}
.drive-suggest-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px; cursor: pointer;
    font-size: 13.5px; color: var(--t2); transition: background .12s;
}
.drive-suggest-item:hover, .drive-suggest-item.active { background: var(--pri-bg); color: var(--t1); }
/* 覆盖 .drive-search-wrap svg 的绝对定位，保证图标与文字同行 */
.drive-search-suggest .drive-suggest-item svg {
    width: 14px; height: 14px; color: var(--t3); flex-shrink: 0;
    position: static; left: auto; top: auto; transform: none; pointer-events: auto;
}
.drive-suggest-del {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--t3); padding: 2px 4px; border-radius: 5px; display: none;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.drive-search-suggest .drive-suggest-del svg {
    width: 12px; height: 12px; display: block;
    position: static; left: auto; top: auto; transform: none; pointer-events: none;
}
.drive-suggest-item:hover .drive-suggest-del { display: inline-flex; }
.drive-suggest-del:hover { color: var(--err); background: var(--warn-bg); }
.drive-suggest-tip { font-size: 12px; color: var(--t3); padding: 4px 10px 8px; line-height: 1.6; }
.drive-suggest-tip b { color: var(--t2); font-weight: 700; }
.drive-header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.drive-header-actions a.btn-back {
    color: var(--t3); font-size: 15px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px; transition: all .15s;
}
.drive-header-actions a.btn-back:hover { color: var(--pri); background: var(--pri-bg); }
.theme-btn {
    width: 36px; height: 36px; border: 1.5px solid var(--line);
    border-radius: 8px; color: var(--t2); display: flex;
    align-items: center; justify-content: center; transition: all .15s;
}
.theme-btn:hover { border-color: var(--pri); color: var(--pri); }
.theme-btn svg { width: 18px; height: 18px; }

/* ===== TOOLBAR ===== */
.drive-toolbar {
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 5px 24px; display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; min-height: 44px;
}
.sort-group { display: flex; align-items: center; gap: 6px; }
.sort-label { font-size: 13px; color: var(--t3); font-weight: 700; margin-right: 2px; text-transform: uppercase; letter-spacing: .3px; }
.sort-select {
    height: 32px; padding: 0 26px 0 10px; border: 1px solid var(--line);
    border-radius: 7px; background: var(--card); color: var(--t2);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: border-color .15s, color .15s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 8px center;
}
.sort-select:hover { border-color: var(--pri); color: var(--pri); }
.sort-select:focus { outline: none; border-color: var(--pri); }
.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-left: 4px; }
.view-btn {
    width: 32px; height: 32px; border: none; background: var(--card);
    color: var(--t3); display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.view-btn:hover { color: var(--pri); }
.view-btn.active { background: var(--pri); color: #fff; }
.view-btn svg { width: 15px; height: 15px; }
.item-count { font-size: 13px; color: var(--t3); margin-left: auto; font-weight: 500; }
.batch-bar {
    display: none; align-items: center; gap: 8px;
    background: transparent; border: none;
    border-radius: 0; padding: 0; height: 32px;
}
.batch-bar.show { display: flex; }
.batch-bar span { font-size: 13px; color: var(--pri); font-weight: 600; }
.batch-btn {
    height: 32px; padding: 0 12px; border-radius: 7px;
    background: var(--pri); color: #fff; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 6px; transition: background .15s;
}
.batch-btn:hover { background: var(--pri-d); }
.batch-btn svg { width: 15px; height: 15px; }
.batch-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.batch-btn:disabled:hover { background: var(--pri); }
.row-dl { width: 26px; height: 26px; }
.drive-card-download { width: 30px; height: 30px; }
.drive-card-batch-cb { width: 20px; height: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sort-label { display: none; }
    .drive-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
@media (max-width: 768px) {
    .drive-header { padding: 0 12px; height: 48px; gap: 6px; }
    .drive-logo { flex-shrink: 0; }
    .drive-logo span { display: none; }
    .drive-search-wrap { max-width: none; flex: 1; min-width: 0; }
    .drive-search { height: 36px; font-size: 14px; }
    .drive-header-actions { flex-shrink: 0; }
    .drive-header-actions a.btn-back { padding: 5px 8px; font-size: 13px; }
    .drive-header-actions a.btn-back span { display: none; }
    .drive-header-actions a.btn-back svg { width: 15px; height: 15px; }
    .drive-toolbar { padding: 6px 12px; gap: 8px; flex-wrap: wrap; min-height: auto; align-content: flex-start; }
    .sort-group { order: 1; flex-shrink: 0; }
    .sort-select { height: 32px; font-size: 12px; min-width: 90px; }
    .view-toggle { order: 2; margin-left: 0; }
    .view-btn { width: 32px; height: 32px; }
    .col-batch-btn { order: 3; height: 32px; padding: 0 10px; font-size: 12px; }
    .col-batch-btn span { display: inline; }
    .item-count { order: 4; margin-left: 0; width: 100%; font-size: 12px; padding: 2px 0 0; }
    .batch-bar { order: 5; margin-left: 0; width: 100%; justify-content: space-between; padding: 4px 0 0; height: auto; flex-wrap: wrap; gap: 6px; }
    .batch-btn { height: 32px; padding: 0 10px; font-size: 12px; }
    .drive-breadcrumb {
        padding: 6px 12px; font-size: 13px;
        overflow-x: auto; overflow-y: hidden;
        white-space: nowrap; flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .drive-breadcrumb::-webkit-scrollbar { display: none; }
    .bc-item { flex-shrink: 0; white-space: nowrap; }
    .drive-main { padding: 6px 8px 16px; }
    .drive-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
    .drive-card { padding: 10px 8px 8px; border-radius: 10px; }
    .drive-card-img-thumb { height: 60px; }
    .drive-card-icon { width: 40px; height: 40px; }
    .drive-card-icon svg { width: 24px; height: 24px; }
    .drive-card-name { font-size: 12px; line-height: 1.3; max-width: 100%; }
    .drive-card-meta { font-size: 11px; margin-top: 3px; }
    .drive-card-batch-cb { width: 20px; height: 20px; top: 4px; left: 4px; }
    .drive-card-download { width: 26px; height: 26px; top: 4px; right: 4px; }
    .drive-card-download svg { width: 13px; height: 13px; }
    /* ========== 列表视图 768px：两行卡片式布局（文件名 + 下方副信息） ========== */
    /* ---- 表头：精简为「序号 图标 文件名 操作」4列 ---- */
    .drive-list-header {
        display: grid;
        grid-template-columns: 24px 36px 1fr 36px;
        padding: 4px 6px; font-size: 11px; gap: 6px 8px;
    }
    .drive-main.batch-mode .drive-list-header {
        grid-template-columns: 24px 36px 1fr 36px 28px;
    }
    .drive-list-header::after { left: 6px; right: 6px; }
    /* 隐藏多余的表头文字（类型/大小/添加时间/修改时间） */
    .drive-list-header > :nth-child(4),
    .drive-list-header > :nth-child(5),
    .drive-list-header > :nth-child(6),
    .drive-list-header > :nth-child(7),
    .drive-list-header > :nth-child(8) { display: none; }
    .drive-list-header > span {
        display: flex; align-items: center; padding: 4px 6px;
        min-height: 18px; border-radius: 6px; white-space: nowrap;
    }
    .drive-list-header .col-name { grid-column: 3; padding-left: 4px; }
    .drive-list-header .col-check {
        grid-column: 4;
        justify-content: center; width: auto;
    }
    .drive-main.batch-mode .drive-list-header .col-check { grid-column: 5; }
    .drive-main:not(.batch-mode) .drive-list-header .col-check,
    .drive-main:not(.batch-mode) .drive-list-row .row-check {
        display: none;
    }
    /* ---- 列表行：卡片式 — 图标列 + 中间信息块(row-info) + 操作 ---- */
    .drive-list-row {
        display: grid !important;
        grid-template-columns: 24px 36px 1fr 36px;
        grid-template-rows: auto;
        padding: 8px 6px;
        gap: 4px 8px;
        align-items: flex-start;
        min-height: 58px;
        position: relative;
    }
    .drive-main.batch-mode .drive-list-row {
        grid-template-columns: 24px 36px 1fr 36px 28px;
    }
    /* 序号和图标：垂直居中 */
    .drive-list-row .row-index {
        grid-column: 1; grid-row: 1;
        align-self: center;
        font-size: 12px; padding: 0 2px; color: var(--t3); text-align: left;
    }
    .drive-list-row .row-icon {
        grid-column: 2; grid-row: 1;
        align-self: center; justify-self: center;
        width: 36px; height: 36px; border-radius: 8px;
    }
    .drive-list-row .row-icon svg { width: 22px; height: 22px; }
    /* 【关键】移动端：隐藏桌面版的独立 .row-name（第3列），只显示 .row-info 容器内的版本 */
    .drive-list-row > .row-name {
        display: none !important;
    }
    /* ---- 核心：中间信息块(row-info)改为上下两行 ---- */
    .drive-list-row .row-info {
        grid-column: 3; grid-row: 1;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: 40px;
        align-self: center;
    }
    .drive-list-row .row-info .row-name-m {
        font-size: 14px; font-weight: 600; line-height: 1.3;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: break-all;
        color: var(--t1);
        margin: 0; padding: 0;
    }
    .drive-list-row .row-info .row-sub {
        display: inline-flex !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 2px 4px;
        font-size: 11.5px;
        line-height: 1.2;
        color: var(--t3);
        min-height: 14px;
    }
    .drive-list-row .row-info .row-sub .row-sub-type {
        font-weight: 500;
    }
    .drive-list-row .row-info .row-sub .row-sub-sep {
        opacity: 0.6;
        margin: 0 1px;
    }
    .drive-list-row .row-info .row-sub .row-sub-size {
        font-variant-numeric: tabular-nums;
    }
    /* 隐藏原来的独立列（类型/大小/添加时间/修改时间）——信息已在 .row-sub 里展示 */
    .drive-list-row > .row-type,
    .drive-list-row > .row-meta-size,
    .drive-list-row > .row-meta-created,
    .drive-list-row > .row-meta-updated,
    .drive-list-row > .row-meta {
        display: none !important;
    }
    /* 列8（下载按钮）：垂直居中 */
    .drive-list-row > :nth-child(8) {
        grid-column: 4; grid-row: 1;
        display: flex; align-items: center; justify-content: flex-end;
        align-self: center;
    }
    .row-dl { width: 32px; height: 32px; border-radius: 7px; flex-shrink: 0; }
    .row-dl svg { width: 15px; height: 15px; }
    /* 列9（勾选）：批量模式下显示 */
    .drive-list-row .row-check {
        grid-column: 5; grid-row: 1;
        display: flex; align-items: center; justify-content: center;
        align-self: center;
        min-width: 28px;
    }
    .drive-main:not(.batch-mode) .drive-list-row .row-check {
        display: none !important;
    }
    /* 分页优化 */
    .drive-pagination { padding: 8px 12px; }
    .drive-pager { gap: 3px; }
    .drive-pager-info { font-size: 11px; margin: 0 2px; }
    .drive-pager-btn,
    .drive-pager-num {
        min-width: 28px; height: 30px; padding: 0 5px;
        font-size: 12px; border-radius: 6px;
    }
    .drive-pager-btn svg { width: 11px; height: 11px; }
    .drive-pager-ellipsis { padding: 0; font-size: 12px; }
}
@media (max-width: 480px) {
    .drive-header { padding: 0 8px; height: 44px; gap: 4px; }
    .drive-logo { flex-shrink: 0; }
    .drive-logo svg { width: 20px; height: 20px; }
    .drive-search-wrap { flex: 1; min-width: 0; }
    .drive-search { height: 34px; font-size: 13px; padding: 0 10px 0 32px; }
    .drive-search-wrap svg { width: 14px; height: 14px; left: 10px; }
    .drive-header-actions a.btn-back { padding: 4px 6px; }
    .theme-btn { width: 30px; height: 30px; }
    .theme-btn svg { width: 14px; height: 14px; }
    .drive-toolbar { padding: 6px 8px; gap: 6px; }
    .sort-select { height: 30px; font-size: 11px; min-width: 80px; padding: 0 22px 0 8px; background-position: right 6px center; }
    .view-btn { width: 30px; height: 30px; }
    .view-btn svg { width: 13px; height: 13px; }
    .col-batch-btn { height: 30px; padding: 0 8px; font-size: 11px; gap: 4px; }
    .col-batch-btn span { display: none; }
    .col-batch-btn svg { width: 13px; height: 13px; }
    .item-count { font-size: 11px; }
    .batch-bar span { font-size: 12px; }
    .batch-btn { height: 30px; padding: 0 8px; font-size: 11px; gap: 4px; }
    .batch-btn svg { width: 13px; height: 13px; }
    .drive-breadcrumb {
        padding: 5px 8px; font-size: 12px;
        overflow-x: auto; overflow-y: hidden;
        white-space: nowrap; flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .drive-breadcrumb::-webkit-scrollbar { display: none; }
    .bc-item { padding: 3px 8px; font-size: 12px; flex-shrink: 0; }
    .bc-sep { flex-shrink: 0; }
    .drive-main { padding: 4px 4px 16px; }
    /* 网格视图：改为2列更清晰，避免3列太挤 */
    .drive-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .drive-card { padding: 10px 6px 8px; border-radius: 10px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
    .drive-card-img-thumb { height: 60px; width: 100%; border-radius: 8px; }
    .drive-card-icon { width: 36px; height: 36px; border-radius: 10px; margin: 2px auto 6px; }
    .drive-card-icon svg { width: 22px; height: 22px; }
    .drive-card-name {
        font-size: 12px; line-height: 1.3;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        width: 100%;
        word-break: break-all;
        min-height: 2.6em;
    }
    .drive-card-meta { font-size: 10.5px; margin-top: 4px; }
    .drive-card-batch-cb { width: 18px; height: 18px; top: 4px; left: 4px; }
    .drive-card-download { width: 24px; height: 24px; top: 4px; right: 4px; border-radius: 6px; }
    .drive-card-download svg { width: 12px; height: 12px; }
    /* ========== 列表视图 480px：卡片式布局（沿用 768px 结构，仅缩小尺寸） ========== */
    .drive-list-header {
        grid-template-columns: 22px 32px 1fr 32px !important;
        padding: 3px 4px !important;
        gap: 3px 6px !important;
        font-size: 10px;
    }
    .drive-main.batch-mode .drive-list-header {
        grid-template-columns: 22px 32px 1fr 32px 24px !important;
    }
    .drive-list-header::after { left: 4px; right: 4px; }
    .drive-list-header > span {
        padding: 3px 4px; min-height: 16px; border-radius: 5px;
    }
    .drive-list-header .col-name { padding-left: 2px; }
    /* ---- 列表行：尺寸更紧凑 ---- */
    .drive-list-row {
        grid-template-columns: 22px 32px 1fr 32px !important;
        padding: 7px 4px !important;
        gap: 3px 6px !important;
        min-height: 54px;
    }
    .drive-main.batch-mode .drive-list-row {
        grid-template-columns: 22px 32px 1fr 32px 24px !important;
    }
    .drive-list-row .row-index {
        font-size: 11px; padding: 0;
    }
    .drive-list-row .row-icon {
        width: 32px; height: 32px; border-radius: 7px;
    }
    .drive-list-row .row-icon svg { width: 19px; height: 19px; }
    /* 中间信息块更紧凑 */
    .drive-list-row .row-info {
        gap: 2px;
        min-height: 36px;
    }
    .drive-list-row .row-info .row-name-m {
        font-size: 13.5px;
        line-height: 1.3;
    }
    .drive-list-row .row-info .row-sub {
        font-size: 10.5px;
        line-height: 1.15;
        gap: 2px 3px;
    }
    /* 下载按钮 */
    .row-dl {
        width: 28px !important; height: 28px !important;
        border-radius: 6px !important;
    }
    .row-dl svg { width: 13px !important; height: 13px !important; }
    /* 勾选 */
    .row-check input { width: 16px; height: 16px; }
    /* 预览弹窗优化 */
    .drive-preview-box { width: 96vw; max-height: 86vh; border-radius: 12px; height: auto; min-height: 60vh; }
    .drive-preview-header { padding: 10px 12px; gap: 6px; }
    .drive-preview-title { font-size: 13px; max-width: calc(100% - 90px); }
    .drive-preview-actions { gap: 4px; }
    .drive-preview-btn { width: 30px; height: 30px; border-radius: 7px; }
    .drive-preview-btn svg { width: 14px; height: 14px; }
    .drive-preview-body { min-height: 50vh; }
    /* 视频播放器窗口优化 */
    .drive-player { width: 96vw; max-width: none; height: min(82vh, 520px); border-radius: 10px; }
    .drive-player-btn { width: 30px; height: 30px; border-radius: 7px; }
    /* 分页极致精简：水平排列，【共N项和页码同排一行】 */
    .drive-pagination { padding: 8px 8px 12px; border-top: none; }
    .drive-pager {
        display: flex;
        flex-direction: row;           /* 横向排列 */
        flex-wrap: nowrap;             /* 【关键】不换行，强行塞入一行 */
        justify-content: center;
        align-items: center;
        gap: 3px;
        width: 100%;
        min-width: 0;
        overflow: hidden;              /* 空间实在不够时隐藏溢出，不出现竖排 */
    }
    /* 信息文字：和按钮同排，左加一点间距，字号更小 */
    .drive-pager-info {
        width: auto;                   /* 取消 width:100%，不再独占一行 */
        text-align: left;
        font-size: 10.5px;
        color: var(--t3);
        order: 40;                     /* 放在按钮/数字后面 */
        margin-left: 6px;              /* 和前面的页码分开 */
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 35%;                /* 信息文字不要占太多空间，给页码留位 */
    }
    .drive-pager-info:last-of-type { display: none; }
    /* 按钮和数字 — 尺寸统一紧凑横排，flex-shrink:0 防挤压变竖条 */
    .drive-pager-btn,
    .drive-pager-num,
    .drive-pager-ellipsis {
        min-width: 0;                  /* 允许收缩 */
        width: 26px;                   /* 固定宽度，保证同排 */
        height: 28px;
        padding: 0;
        font-size: 11px;
        border-radius: 6px;
        order: 1;
        flex-shrink: 0;
        white-space: nowrap;
    }
    /* 当前页数字稍微宽一点 */
    .drive-pager-num.current { min-width: 28px; padding: 0 5px; width: auto; }
    .drive-pager-btn svg { width: 11px; height: 11px; }
    .drive-pager-ellipsis { width: 14px; min-width: 0; flex-shrink: 1; }
    /* 隐藏首页/末页大按钮节省空间 */
    .drive-pager-btn:first-of-type,
    .drive-pager-btn:last-of-type { display: none; }
}
@media (hover: none) {
    /* 触摸设备：批量勾选和下载按钮始终可见，不依赖 hover */
    .drive-card-batch-cb { opacity: 1; pointer-events: auto; }
    .drive-card .drive-card-download { display: flex; opacity: 0.95; }
    .drive-list-row:hover { background: transparent; }
    .drive-list-row:active { background: var(--pri-bg); }
}
.drive-breadcrumb {
    padding: 4px 24px; display: flex; align-items: center; gap: 3px;
    flex-wrap: wrap; font-size: 14px; background: var(--card);
    border-bottom: 1px solid var(--line);
}
.bc-item {
    color: var(--pri); font-weight: 600; padding: 3px 8px;
    border-radius: 6px; transition: background .15s;
}
.bc-item:hover { background: var(--pri-bg); }
.bc-item.current { color: var(--t1); cursor: default; font-weight: 700; }
.bc-item.current:hover { background: transparent; }
.bc-sep { color: var(--t3); font-size: 10px; margin: 0 1px; }

/* ===== MAIN ===== */
.drive-main { padding: 6px 6px 10px; background: var(--bg); }
.drive-main.view-list .drive-grid { display: none; }
.drive-main.view-list .drive-list-wrap { display: block; }
.drive-list-wrap { display: none; }

/* ===== GRID ===== */
.drive-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.drive-grid .drive-empty { grid-column: 1 / -1; }
.drive-card {
    background: var(--card); border: 1.5px solid var(--line);
    border-radius: var(--r); padding: 12px 12px 10px;
    text-align: center; transition: border-color .15s, transform .15s, box-shadow .15s;
    position: relative; overflow: hidden; display: block;
}
.drive-card:hover {
    border-color: var(--pri); transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.drive-card-folder:hover { border-color: var(--warn); }
.drive-card-icon {
    width: 52px; height: 52px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
}
.drive-card-folder .drive-card-icon { background: var(--warn-bg); color: var(--warn); }
.drive-card-file  .drive-card-icon  { background: var(--pri-bg); color: var(--pri); }
.drive-card-icon svg { width: 30px; height: 30px; }
.drive-card-img-thumb {
    width: 100%; height: 90px; margin-bottom: 8px;
    border-radius: 10px; object-fit: cover;
    background: var(--pri-bg); display: block;
}
.drive-card-name {
    font-size: 13px; font-weight: 600; color: var(--t1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4;
}
.drive-card-meta { font-size: 11.5px; color: var(--t3); margin-top: 4px; }
.drive-card-download {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--pri); color: #fff;
    display: none; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.drive-card-download:hover { background: var(--pri-d); transform: scale(1.1); }
.drive-card-download svg { width: 15px; height: 15px; }
.drive-card:hover .drive-card-download { display: flex; }
.drive-card-folder { text-decoration: none; color: inherit; cursor: pointer; }
.drive-card-file { cursor: pointer; }
.drive-card-file:hover { border-color: var(--pri); transform: translateY(-2px); box-shadow: var(--shadow); }
.drive-card-batch-cb {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    width: 18px; height: 18px; cursor: pointer; accent-color: var(--pri);
    opacity: 0; transition: opacity .15s; pointer-events: none;
}
.drive-main.batch-mode .drive-card-batch-cb { opacity: 1; pointer-events: auto; }

/* ===== PREVIEW OVERLAY ===== */
.drive-preview-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center;
    opacity: 0; animation: drivePreviewIn .2s forwards;
}
@keyframes drivePreviewIn { to { opacity: 1; } }
.drive-preview-overlay.fade-out { animation: drivePreviewOut .15s forwards; }
@keyframes drivePreviewOut { to { opacity: 0; } }
.drive-preview-box {
    background: var(--card); border-radius: 16px;
    width: 90vw; max-width: 960px; height: 85vh; max-height: 800px;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: drivePreviewBoxIn .25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes drivePreviewBoxIn {
    from { transform: scale(0.92) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
/* 网页全屏：预览框占满整个全屏视口 */
.drive-preview-box:fullscreen,
.drive-preview-box:-webkit-full-screen {
    width: 100vw; height: 100vh; max-width: none; max-height: none;
    border-radius: 0; box-shadow: none; animation: none;
}
.drive-preview-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.drive-preview-title {
    flex: 1; font-size: 14px; font-weight: 700; color: var(--t1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drive-preview-actions { display: flex; gap: 6px; flex-shrink: 0; }
.drive-preview-btn {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1.5px solid var(--line); background: var(--card);
    color: var(--t2); display: flex; align-items: center; justify-content: center;
    transition: all .15s; text-decoration: none;
}
.drive-preview-btn:hover { border-color: var(--pri); color: var(--pri); background: var(--pri-bg); }
.drive-preview-btn svg { width: 15px; height: 15px; }
.drive-preview-body {
    flex: 1; overflow: hidden; position: relative; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.drive-preview-body.drive-preview-office { align-items: stretch; justify-content: stretch; }
.drive-preview-img img.drive-preview-image {
    max-width: 100%; max-height: 100%; object-fit: contain;
    display: block;
}
.drive-preview-pdf iframe {
    width: 100%; height: 100%; border: none;
}
.drive-preview-video { padding: 0; }
.drive-preview-video video.drive-preview-video-el {
    width: 100%; height: 100%; max-height: 100%; object-fit: contain;
    background: #000;
}
.drive-preview-office { padding: 0; overflow: auto; }
.drive-preview-office-content { height: 100%; display: flex; flex-direction: column; }
.drive-preview-office-content .excel-preview-sheet table { border-collapse: collapse; width: 100%; font-size: 14px; }
.drive-preview-office-content .excel-preview-sheet table td, .drive-preview-office-content .excel-preview-sheet table th { border: 1px solid var(--line); padding: 5px 10px; min-width: 72px; white-space: nowrap; }
.drive-preview-office-content .excel-preview-sheet table th { background: var(--pri-bg); font-weight: 600; }
.drive-preview-office-content img { max-width: 100%; height: auto; border-radius: 4px; }
.drive-preview-office-content pre { white-space: pre-wrap; word-break: break-word; font-family: 'Cascadia Code','Fira Code',monospace; font-size: 13px; line-height: 1.6; }
.drive-preview-office-content code { font-family: 'Cascadia Code','Fira Code',monospace; background: var(--pri-bg); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.drive-preview-office-content .xlsx-table td { cursor: default; }
.drive-preview-office-content .xlsx-table td:hover { background: var(--pri-bg) !important; }
.drive-preview-loading {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    font-size: 14px; color: var(--t3); font-weight: 500; z-index: 5;
}
.drive-preview-spinner {
    width: 32px; height: 32px; border: 3px solid var(--line);
    border-top-color: var(--pri); border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 专用视频播放器窗口（ART Player） ===== */
.drive-player-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center;
    animation: drivePlayerIn .2s ease;
}
@keyframes drivePlayerIn { from { opacity: 0; } to { opacity: 1; } }
.drive-player-overlay.drive-player-out { animation: drivePlayerOut .15s forwards; }
@keyframes drivePlayerOut { to { opacity: 0; } }
.drive-player {
    position: relative; box-sizing: border-box;
    display: flex; flex-direction: column;
    width: min(92vw, 1000px);
    height: min(84vh, 600px);
    border-radius: 14px; overflow: hidden; background: #000;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    animation: drivePlayerBoxIn .25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes drivePlayerBoxIn {
    from { transform: scale(0.94) translateY(16px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.drive-player-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 12px; flex-shrink: 0;
    background: rgba(0,0,0,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.drive-player-name {
    font-size: 13px; font-weight: 600; color: #fff;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drive-player-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.drive-player-btn {
    width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.12);
    color: #fff; display: flex; align-items: center; justify-content: center;
    transition: background-color .15s, border-color .15s, transform .15s;
}
.drive-player-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); }
.drive-player-btn:active { transform: scale(0.94); }
.drive-player-btn svg { width: 16px; height: 16px; }
a.drive-player-btn { text-decoration: none; }
.drive-player-art { position: relative; flex: 1; min-height: 0; width: 100%; }
.drive-player-art .artplayer-app { width: 100%; height: 100%; }
.drive-player-loading {
    position: absolute; inset: 0; z-index: 6;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    color: #fff; font-size: 14px; background: #000;
}

/* ===== LIST ===== */
.drive-list-header {
    display: grid; grid-template-columns: 16px 24px 2.6fr 0.6fr 0.7fr 1fr 1fr 46px 28px;
    gap: 4px; padding: 4px 2px;
    font-size: 13px; font-weight: 600;
    color: var(--t3); letter-spacing: 0.4px; text-transform: uppercase;
    border-bottom: none; align-items: center;
    background: linear-gradient(180deg, var(--card) 0%, rgba(29,91,255,0.03) 100%);
    position: relative;
}
.drive-list-header::after {
    content: '';
    position: absolute; bottom: 0; left: 2px; right: 2px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.drive-list-header > span {
    display: flex; align-items: center; justify-content: flex-start;
    padding: 3px 8px; border-radius: 7px;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.drive-list-header > span:hover {
    color: var(--pri); background: var(--pri-bg);
}
.drive-list-header .col-name { padding-left: 0; }
.drive-list-header .col-check,
.drive-list-row .row-check {
    visibility: hidden; width: 0; overflow: hidden; min-width: 0;
    grid-column: 9;
}
.drive-main.batch-mode .drive-list-header .col-check,
.drive-main.batch-mode .drive-list-row .row-check {
    visibility: visible; width: 36px; overflow: visible; min-width: 36px;
}
.col-batch-btn {
    height: 32px; padding: 0 10px; border-radius: 7px;
    border: none; background: transparent;
    color: var(--t2); font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s; cursor: pointer; white-space: nowrap;
    vertical-align: middle;
}
.col-batch-btn:hover { color: var(--pri); background: var(--pri-bg); }
.col-batch-btn.active { background: var(--pri); color: #fff; }
.col-batch-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.drive-list-row {
    display: grid; grid-template-columns: 16px 24px 2.6fr 0.6fr 0.7fr 1fr 1fr 46px 28px;
    gap: 4px; padding: 5px 2px; align-items: center;
    border-bottom: 1px solid var(--line);
    transition: background .12s; cursor: default;
}
.drive-list-row.clickable { cursor: pointer; }
.drive-list-row:last-child { border-bottom: none; margin-bottom: 0; }
.drive-list-row:hover { background: var(--pri-bg); }
.drive-list-row.selected { background: var(--pri-bg); }
.row-check { display: flex; align-items: center; justify-content: center; width: 24px; flex-shrink: 0; }
.row-check input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--pri); }
.row-index {
    font-size: 13px; color: var(--t3); font-weight: 500;
    text-align: center; min-width: 20px; padding: 0 4px;
}
.row-icon {
    width: 32px; height: 32px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.row-icon.folder { background: var(--warn-bg); color: var(--warn); }
.row-icon.file  { background: var(--pri-bg); color: var(--pri); }
.row-icon svg  { width: 18px; height: 18px; }
.row-name {
    font-size: 15px; font-weight: 600; color: var(--t1);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    cursor: default;
}
.drive-list-row:not(.clickable) .row-name { cursor: pointer; }
.drive-list-row:not(.clickable) .row-name:hover { color: var(--pri); text-decoration: underline; }
.row-meta { font-size: 13px; color: var(--t3); }
.row-type { font-size: 12.5px; color: var(--t3); font-weight: 500; }
.row-dl {
    width: 30px; height: 30px; border-radius: 7px;
    border: none; background: transparent;
    color: var(--t3); display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.row-dl:hover { background: var(--pri-bg); }
.row-dl svg { width: 13px; height: 13px; }

/* 手机端卡片式列表：桌面端隐藏包装块，保持9列独立布局 */
.row-info { display: none; }
.row-sub { display: none; }
.row-name-m { display: none; }

/* ===== PAGINATION ===== */
.drive-pagination {
    padding: 6px 24px 2px;
    border-top: 1px solid var(--line);
}
.drive-pager {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 5px; flex-wrap: wrap;
}
.drive-pager-info {
    font-size: 13px; color: var(--t3); margin: 0 4px;
}
.drive-pager-ellipsis {
    font-size: 13px; color: var(--t3); padding: 0 2px;
}
.drive-pager-btn:disabled,
.drive-pager-num:disabled {
    opacity: 0.4; cursor: not-allowed;
}
.drive-pager-btn,
.drive-pager-num {
    min-width: 30px; height: 32px; padding: 0 6px;
    border: 1px solid var(--line); background: var(--card);
    color: var(--t2); font-size: 13px; border-radius: 7px;
    cursor: pointer; transition: all .15s;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit;
}
.drive-pager-btn:hover:not(:disabled),
.drive-pager-num:hover:not(:disabled) {
    border-color: var(--pri); color: var(--pri);
}
.drive-pager-num.cur {
    background: var(--pri); border-color: var(--pri); color: #fff;
}
.drive-pager-num.cur:hover { background: var(--pri); border-color: var(--pri); color: #fff; }
.drive-pager-btn svg { width: 12px; height: 12px; }
/* 暗色模式 */
:root.dark-mode .drive-pagination { background: #1a2332; }
:root.dark-mode .drive-pager-btn,
:root.dark-mode .drive-pager-num { background: #334155; border-color: var(--line); color: var(--t2); }
:root.dark-mode .drive-pager-btn:hover:not(:disabled),
:root.dark-mode .drive-pager-num:hover:not(:disabled) { border-color: var(--pri); color: var(--pri-l); background: #475569; }
:root.dark-mode .drive-pager-num.cur { background: linear-gradient(135deg, var(--pri-h), var(--pri)); color: #fff; border-color: var(--pri); }
/* ===== DARK MODE OVERLAYS FOR OFFICE PREVIEW ===== */
:root.dark-mode .drive-preview-office-content { color: var(--t1); }
:root.dark-mode .drive-preview-office-content [style*="background:#f0f4ff"],
:root.dark-mode .drive-preview-office-content [style*="background: #f0f4ff"] { background: #1e293b !important; }
:root.dark-mode .drive-preview-office-content [style*="background:#fafbfc"],
:root.dark-mode .drive-preview-office-content [style*="background: #fafbfc"] { background: var(--card) !important; }
:root.dark-mode .drive-preview-office-content [style*="background:#ffffff"],
:root.dark-mode .drive-preview-office-content [style*="background: #ffffff"] { background: var(--bg) !important; }
:root.dark-mode .drive-preview-office-content [style*="background:#fafafa"],
:root.dark-mode .drive-preview-office-content [style*="background: #fafafa"] { background: var(--card) !important; }
:root.dark-mode .drive-preview-office-content [style*="background:#f5f5f5"],
:root.dark-mode .drive-preview-office-content [style*="background: #f5f5f5"] { background: var(--card) !important; }
:root.dark-mode .drive-preview-office-content [style*="#1a1a1a"],
:root.dark-mode .drive-preview-office-content [style*="#1a1a1a"] { color: var(--t1) !important; }
:root.dark-mode .drive-preview-office-content [style*="border:1px solid #e0e0e0"] { border-color: var(--line) !important; }
/* ===== EMPTY ===== */
.drive-empty {
    text-align: center; padding: 56px 20px; color: var(--t3);
}
.drive-empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.35; }
.drive-empty p  { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--t2); }
.drive-empty small { font-size: 12px; }

/* ========== 网盘预览：Word / EPUB 渲染内容（mammoth 输出） ========== */
.docx-preview-content h1, .docx-preview-content h2, .docx-preview-content h3,
.docx-preview-content h4, .docx-preview-content h5, .docx-preview-content h6 {
    color: var(--t1); margin: 1.2em 0 0.5em; line-height: 1.4;
}
.docx-preview-content h1 { font-size: 24px; } .docx-preview-content h2 { font-size: 20px; }
.docx-preview-content h3 { font-size: 17px; } .docx-preview-content h4 { font-size: 15px; }
.docx-preview-content p  { margin: 0.6em 0; }
.docx-preview-content ul, .docx-preview-content ol { margin: 0.6em 0; padding-left: 1.6em; }
.docx-preview-content table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 14px; }
.docx-preview-content table td, .docx-preview-content table th {
    border: 1px solid var(--line); padding: 6px 10px; text-align: left;
}
.docx-preview-content table th { background: var(--pri-bg); font-weight: 600; }
.docx-preview-content a { color: var(--pri); }
.epub-chapter-content h1, .epub-chapter-content h2, .epub-chapter-content h3 {
    color: var(--t1); margin: 1em 0 0.5em;
}
.epub-chapter-content p  { margin: 0.6em 0; }
.epub-chapter-content img { max-width: 100%; height: auto; border-radius: 6px; }
.epub-chapter-content table { border-collapse: collapse; width: 100%; font-size: 14px; }
.epub-chapter-content table td, .epub-chapter-content table th { border: 1px solid var(--line); padding: 5px 8px; }

/* 预览内容区撑满弹窗（Word/PPT/EPUB/Excel 渲染容器在 flex 行内默认收缩） */
.drive-preview-body.drive-preview-office > .drive-preview-office-content { flex: 1; width: 100%; min-width: 0; }

/* ========== 网盘预览：docx-preview 高保真 Word 渲染 ========== */
.docx-preview-scroll { overflow: auto; flex: 1; min-height: 0; }
.docx-preview-scroll .docx-wrapper { background: var(--bg) !important; padding: 0 !important; }
.docx-preview-scroll .docx-wrapper > section.docx {
    box-shadow: 0 2px 14px rgba(0,0,0,0.12) !important;
    margin: 0 auto 16px !important;
    border-radius: 4px;
}
.docx-preview-scroll .docx-wrapper:last-child > section.docx { margin-bottom: 0 !important; }

/* ===== 精修：顶栏毛玻璃（暗色） ===== */
:root.dark-mode .drive-header {
    background: rgba(30, 41, 59, 0.82);
    box-shadow: var(--shadow-sm);
}
