/* ==========================================================================
   个人云盘 · 设计系统
   主题：暗夜紫（取自站点图标恶魔面具的紫红配色）
   ========================================================================== */

/* ---------- 1. tokens ---------- */
:root {
    --bg: #08060f;
    --bg-glow-1: #1a0f33;
    --bg-glow-2: #0d1424;

    --surface: #120e1f;
    --surface-2: #191331;
    --surface-3: #211a3d;
    --surface-4: #2b2150;

    --line: rgba(167, 139, 250, .13);
    --line-strong: rgba(167, 139, 250, .3);

    --text: #f0ecff;
    --text-2: #b3abc9;
    --text-3: #7e7596;

    --brand: #8b5cf6;
    --brand-2: #a855f7;
    --brand-3: #d946ef;
    --brand-soft: rgba(139, 92, 246, .16);

    --danger: #f43f5e;
    --ok: #34d399;
    --warn: #fbbf24;

    --radius: 18px;
    --radius-md: 13px;
    --radius-sm: 9px;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -18px rgba(0, 0, 0, .9);
    --shadow-2: 0 24px 60px -24px rgba(0, 0, 0, .92);
    --glow: 0 0 0 1px rgba(168, 85, 247, .35), 0 14px 34px -14px rgba(168, 85, 247, .6);

    --sans: "Inter", -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 2. reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1100px 620px at 12% -8%, var(--bg-glow-1), transparent 62%),
        radial-gradient(900px 560px at 96% 0%, var(--bg-glow-2), transparent 58%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

input, select, textarea {
    font: inherit;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

table {
    border-collapse: collapse;
    width: 100%;
}

::selection {
    background: rgba(168, 85, 247, .35);
}

:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: 2px;
}

/* 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, .3) transparent;
}

*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(167, 139, 250, .26);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, .45);
    background-clip: content-box;
}

/* ---------- 3. 布局 ---------- */
.shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: linear-gradient(180deg, rgba(24, 17, 45, .92), rgba(11, 8, 20, .96));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
    z-index: 40;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content {
    flex: 1;
    padding: 22px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- 4. 品牌 ---------- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 14px;
    border-bottom: 1px solid var(--line);
}

.brand__mark {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 18%, #331f52, #120b20);
    box-shadow:
        inset 0 0 0 1px rgba(244, 114, 182, .32),
        inset 0 -8px 16px -10px rgba(217, 70, 239, .6),
        0 10px 24px -12px rgba(217, 70, 239, .8);
}

.brand__mark img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 7px rgba(217, 70, 239, .45));
}

.brand__text {
    min-width: 0;
}

.brand__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}

.brand__sub {
    font-size: 10.5px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ---------- 5. 侧栏导航 ---------- */
.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav__label {
    padding: 10px 12px 6px;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-3);
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--text-2);
    font-size: 13.5px;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}

.nav__item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--text-3);
    transition: color .18s var(--ease);
}

.nav__item:hover {
    background: rgba(167, 139, 250, .08);
    color: var(--text);
}

.nav__item:hover i {
    color: var(--brand-2);
}

.nav__item.is-active {
    background: linear-gradient(90deg, rgba(139, 92, 246, .24), rgba(139, 92, 246, .06));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .22);
}

.nav__item.is-active i {
    color: #d8b4fe;
}

.nav__item--accent {
    background: linear-gradient(135deg, rgba(139, 92, 246, .9), rgba(217, 70, 239, .72));
    color: #fff;
    box-shadow: 0 10px 26px -14px rgba(168, 85, 247, .95);
}

.nav__item--accent i {
    color: #fff;
}

.nav__item--accent:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(148, 103, 250, .98), rgba(226, 85, 245, .82));
}

.folders {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folders__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--text-2);
    font-size: 13px;
    transition: background .16s var(--ease), color .16s var(--ease);
}

.folders__item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folders__item i {
    color: #c084fc;
    font-size: 13px;
}

.folders__item:hover {
    background: rgba(167, 139, 250, .09);
    color: var(--text);
}

.folders__item.is-active {
    background: rgba(139, 92, 246, .16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .2);
}

/* ---------- 6. 存储卡片 ---------- */
.storage {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ring {
    --p: 0;
    position: relative;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--brand-2) calc(var(--p) * 1%), rgba(255, 255, 255, .07) 0);
    display: grid;
    place-items: center;
}

.ring::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: #120e1f;
    box-shadow: inset 0 0 0 1px var(--line);
}

.ring__value {
    position: relative;
    z-index: 1;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.storage__meta {
    min-width: 0;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.7;
}

.storage__meta b {
    display: block;
    font-size: 12.5px;
    color: var(--text-2);
    font-weight: 600;
}

/* ---------- 7. 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 7, 19, .72);
    backdrop-filter: blur(16px) saturate(140%);
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.burger {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    place-items: center;
    color: var(--text-2);
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--line);
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text-3);
    overflow: hidden;
}

.crumbs a,
.crumbs span {
    white-space: nowrap;
}

.crumbs a {
    color: var(--text-2);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .16s var(--ease), color .16s var(--ease);
}

.crumbs a:hover {
    background: rgba(167, 139, 250, .12);
    color: #fff;
}

.crumbs__sep {
    color: rgba(167, 139, 250, .45);
    font-size: 11px;
}

.crumbs__current {
    color: #fff;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(139, 92, 246, .16);
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.search {
    position: relative;
    width: 240px;
}

.search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12.5px;
    color: var(--text-3);
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font-size: 13px;
    transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}

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

.search input:focus {
    outline: none;
    border-color: var(--line-strong);
    background: rgba(139, 92, 246, .08);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}

/* ---------- 8. 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-2);
    background: rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 0 1px var(--line);
    transition: transform .16s var(--ease), background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}

.btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.btn:active {
    transform: translateY(1px);
}

.btn i {
    font-size: 12.5px;
}

.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    box-shadow: 0 12px 26px -14px rgba(168, 85, 247, .95), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.btn--primary:hover {
    background: linear-gradient(135deg, #9d6bff, #e256f7);
    color: #fff;
}

.btn--danger {
    color: #ffe4e9;
    background: rgba(244, 63, 94, .14);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .35);
}

.btn--danger:hover {
    color: #fff;
    background: rgba(244, 63, 94, .26);
}

.btn--ghost {
    background: transparent;
    box-shadow: none;
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, .06);
}

.btn--sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: 9px;
}

.btn--icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    color: var(--text-3);
    background: transparent;
    box-shadow: none;
}

.btn--icon:hover {
    color: #fff;
    background: rgba(167, 139, 250, .14);
}

.btn--icon.is-danger:hover {
    color: #fda4af;
    background: rgba(244, 63, 94, .16);
}

.btn:disabled,
.btn[disabled] {
    opacity: .38;
    cursor: not-allowed;
    transform: none;
}

/* ---------- 9. 卡片 ---------- */
.card {
    min-width: 0;
    background: linear-gradient(180deg, rgba(25, 19, 49, .78), rgba(16, 12, 30, .88));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

/* ---------- 10. 工具条 / 批量条 ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.toolbar__left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toolbar__title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1.35;
}

.toolbar__meta {
    font-size: 12.5px;
    color: var(--text-3);
}

.toolbar__meta b {
    color: var(--text-2);
    font-weight: 700;
}

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

.select-all {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 4px;
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

/* 自定义复选框 */
.check {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 6px;
    border: 1.5px solid rgba(167, 139, 250, .38);
    background: rgba(255, 255, 255, .03);
    transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}

.check i {
    font-size: 9px;
    color: #fff;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .15s var(--ease), transform .15s var(--ease);
}

input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

input[type="checkbox"]:checked + .check {
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    border-color: transparent;
}

input[type="checkbox"]:checked + .check i {
    opacity: 1;
    transform: scale(1);
}

input[type="checkbox"]:focus-visible + .check {
    outline: 2px solid var(--brand-2);
    outline-offset: 2px;
}

/* 批量操作条 */
.batchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border-bottom: 0 solid transparent;
    transition: max-height .28s var(--ease), opacity .2s var(--ease), padding .28s var(--ease);
}

.batchbar.is-open {
    max-height: 80px;
    opacity: 1;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(139, 92, 246, .07);
}

.batchbar__count {
    margin-right: 6px;
    font-size: 12.5px;
    color: var(--text-2);
}

.batchbar__count b {
    color: #d8b4fe;
}

/* ---------- 11. 表格 ---------- */
.table-wrap {
    overflow-x: auto;
    min-width: 0;
}

/* 表头「名称」与文件名文字对齐（让出图标位） */
.table thead th.th-name {
    padding-left: 64px;
}

.table thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-3);
    background: rgba(255, 255, 255, .02);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table thead th:last-child {
    text-align: right;
}

.table tbody tr {
    border-bottom: 1px solid rgba(167, 139, 250, .07);
    transition: background .15s var(--ease);
}

.table tbody tr:last-child {
    border-bottom: 0;
}

.table tbody tr:hover {
    background: rgba(167, 139, 250, .06);
}

.table tbody tr.is-selected {
    background: rgba(139, 92, 246, .12);
    box-shadow: inset 3px 0 0 var(--brand-2);
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.cell-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cell-check {
    display: flex;
    align-items: center;
    padding-right: 2px;
}

.cell-name__text {
    min-width: 0;
}

.cell-name__link {
    display: block;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42ch;
}

.cell-name__link:hover {
    color: #d8b4fe;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cell-name__sub {
    font-size: 11.5px;
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42ch;
}

/* 文件图标 */
.fileico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    font-size: 15px;
    color: var(--tone, var(--text-2));
    background: var(--tone-bg, rgba(255, 255, 255, .05));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.fileico--folder {
    color: #c084fc;
    background: rgba(168, 85, 247, .14);
}

/* 色调 */
.tone-violet  { --tone: #a78bfa; --tone-bg: rgba(167, 139, 250, .15); }
.tone-purple  { --tone: #c084fc; --tone-bg: rgba(192, 132, 252, .15); }
.tone-pink    { --tone: #f472b6; --tone-bg: rgba(244, 114, 182, .14); }
.tone-blue    { --tone: #60a5fa; --tone-bg: rgba(96, 165, 250, .14); }
.tone-cyan    { --tone: #22d3ee; --tone-bg: rgba(34, 211, 238, .13); }
.tone-emerald { --tone: #34d399; --tone-bg: rgba(52, 211, 153, .14); }
.tone-amber   { --tone: #fbbf24; --tone-bg: rgba(251, 191, 36, .14); }
.tone-orange  { --tone: #fb923c; --tone-bg: rgba(251, 146, 60, .14); }
.tone-red     { --tone: #fb7185; --tone-bg: rgba(251, 113, 133, .14); }
.tone-slate   { --tone: #a3a0b8; --tone-bg: rgba(163, 160, 184, .12); }

/* 类型徽标 */
.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .6px;
    font-family: var(--mono);
    color: var(--tone, var(--text-2));
    background: var(--tone-bg, rgba(255, 255, 255, .05));
}

.col-dl {
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.col-dl i {
    margin-right: 5px;
    font-size: 11px;
    color: var(--text-3);
}

.col-size,
.col-time {
    white-space: nowrap;
    font-size: 12.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.col-actions {
    text-align: right;
    white-space: nowrap;
}

.col-actions .btn--icon {
    display: inline-grid;
    place-items: center;
}

/* ---------- 12. 空状态 ---------- */
.empty {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 66px 20px;
    text-align: center;
}

.empty__mark {
    width: 78px;
    height: 78px;
    opacity: .32;
    filter: grayscale(.2);
    margin-bottom: 6px;
}

.empty__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-2);
}

.empty__sub {
    font-size: 12.5px;
    color: var(--text-3);
}

/* ---------- 13. 分页 ---------- */
.table-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 13px 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--text-3);
}

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pager__btn {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .03);
    box-shadow: inset 0 0 0 1px var(--line);
    transition: background .16s var(--ease), color .16s var(--ease);
}

.pager__btn:hover {
    background: rgba(167, 139, 250, .14);
    color: #fff;
}

.pager__btn.is-current {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    box-shadow: 0 8px 20px -12px rgba(168, 85, 247, .9);
}

.pager__btn[aria-disabled="true"] {
    opacity: .35;
    pointer-events: none;
}

/* ---------- 14. 模态框 ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 4, 12, .68);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), visibility .2s;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal__dialog {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 22px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #1b1433, #120e1f);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(10px) scale(.985);
    transition: transform .22s var(--ease);
}

.modal.is-open .modal__dialog {
    transform: translateY(0) scale(1);
}

.modal__dialog--wide {
    max-width: 620px;
}

.modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.modal__title {
    font-size: 16px;
    font-weight: 700;
}

.modal__desc {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-3);
}

.modal__close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--text-3);
    transition: background .16s var(--ease), color .16s var(--ease);
}

.modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 表单字段 */
.field {
    display: block;
    margin-bottom: 14px;
}

.field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
}

.input,
.select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font-size: 13.5px;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.select option {
    background: #191331;
    color: var(--text);
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--line-strong);
    background: rgba(139, 92, 246, .08);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}

.hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
}

.danger-list {
    max-height: 190px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(244, 63, 94, .07);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .2);
    font-size: 12.5px;
    color: #fecdd3;
    font-family: var(--mono);
}

.danger-list li {
    padding: 3px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 15. 上传 ---------- */
.dropzone {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 26px 18px;
    border-radius: 14px;
    border: 1.5px dashed rgba(167, 139, 250, .32);
    background: rgba(139, 92, 246, .05);
    text-align: center;
    cursor: pointer;
    transition: border-color .18s var(--ease), background .18s var(--ease);
}

.dropzone:hover,
.dropzone.is-drag {
    border-color: var(--brand-2);
    background: rgba(139, 92, 246, .12);
}

.dropzone i {
    font-size: 26px;
    color: #c084fc;
}

.dropzone__title {
    font-size: 13.5px;
    font-weight: 600;
}

.dropzone__sub {
    font-size: 12px;
    color: var(--text-3);
}

.filelist {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
}

.filelist__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .03);
    font-size: 12.5px;
    color: var(--text-2);
}

.filelist__item i {
    color: #c084fc;
    font-size: 12px;
}

.filelist__item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filelist__item em {
    margin-left: auto;
    font-style: normal;
    color: var(--text-3);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.progress {
    margin-top: 14px;
    display: none;
}

.progress.is-on {
    display: block;
}

.progress__bar {
    height: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.progress__fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
    transition: width .18s linear;
}

.progress__meta {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 11.5px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

/* ---------- 16. 提示 / 消息 ---------- */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 12px;
    font-size: 13px;
    animation: slide-down .3s var(--ease);
}

.flash--ok {
    color: #b9f6d8;
    background: rgba(52, 211, 153, .1);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .26);
}

.flash--err {
    color: #ffd2da;
    background: rgba(244, 63, 94, .1);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .28);
}

.flash i {
    font-size: 13px;
}

.flash__close {
    margin-left: auto;
    color: inherit;
    opacity: .55;
    padding: 2px 4px;
}

.flash__close:hover {
    opacity: 1;
}

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-width: min(380px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    color: #e9e3ff;
    background: rgba(33, 26, 61, .96);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-2);
    animation: toast-in .26s var(--ease);
}

.toast.is-out {
    animation: toast-out .22s var(--ease) forwards;
}

.toast i {
    margin-top: 2px;
    font-size: 13px;
}

.toast--ok i {
    color: var(--ok);
}

.toast--err i {
    color: var(--danger);
}

.toast--info i {
    color: var(--brand-2);
}

/* ---------- 17. 页脚 ---------- */
.page-foot {
    margin-top: auto;
    padding: 20px 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-3);
}

.page-foot kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    margin: 0 2px;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 10.5px;
    text-align: center;
    color: var(--text-2);
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 0 0 1px var(--line);
}

/* ---------- 18. 动画 ---------- */
@keyframes slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateY(6px); }
}

/* 移动端侧栏遮罩（任何屏幕尺寸下都不参与布局） */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(4, 3, 9, .6);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s var(--ease), visibility .22s;
}

.backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* ---------- 18. 响应式 ---------- */
@media (max-width: 1080px) {
    .search { width: 190px; }
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 272px;
        transform: translateX(-102%);
        transition: transform .26s var(--ease);
        box-shadow: 30px 0 60px -30px rgba(0, 0, 0, .9);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .burger {
        display: grid;
    }

    .content {
        padding: 16px 14px 34px;
    }

    .topbar {
        padding: 12px 14px;
        gap: 10px;
    }

    .topbar__actions-label {
        display: none;
    }
}

@media (max-width: 760px) {
    .search {
        flex: 1 1 140px;
        width: auto;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .topbar__right {
        width: 100%;
        order: 3;
        flex-wrap: wrap;
    }

    .col-size,
    .col-time,
    .col-type,
    .col-dl {
        display: none;
    }

    .table thead th.th-name {
        padding-left: 62px;
    }

    .cell-name__link {
        max-width: 100%;
    }

    .cell-name {
        gap: 10px;
    }

    .fileico {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 14px;
    }

    .col-actions .btn--icon {
        width: 30px;
        height: 30px;
    }

    .table thead th,
    .table td {
        padding-left: 12px;
        padding-right: 12px;
    }

    .toolbar {
        padding: 12px 14px;
    }

    .table-foot {
        padding: 12px 14px;
    }

    .toasts {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }
}

/* 超窄屏：行内操作只留最常用的三个，把宽度让给文件名 */
@media (max-width: 520px) {
    .col-actions [data-act="copy-link"],
    .col-actions [data-act="move-file"] {
        display: none;
    }

    .cell-name__sub {
        max-width: 26ch;
    }

    .toolbar__title {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- 19. 预览 / 播放页 ---------- */
body.viewer {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.vtop {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 7, 19, .8);
    backdrop-filter: blur(16px) saturate(140%);
}

.vtop__back {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-2);
    background: rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 0 1px var(--line);
    transition: background .16s var(--ease), color .16s var(--ease);
}

.vtop__back:hover {
    color: #fff;
    background: rgba(167, 139, 250, .16);
}

.vtop__brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--text-2);
    white-space: nowrap;
    transition: color .16s var(--ease);
}

.vtop__brand img {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 0 7px rgba(217, 70, 239, .45));
}

.vtop__brand:hover {
    color: #fff;
}

.vtop__file {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.vtop__name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ---------- 舞台 ---------- */
.vstage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 24px 20px;
}

/* ---------- 播放器 ---------- */
.player {
    position: relative;
    width: min(1180px, 100%);
    border-radius: 18px;
    overflow: hidden;
    background: #050409;
    border: 1px solid var(--line);
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .95), 0 0 0 1px rgba(167, 139, 250, .06);
}

.player video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 250px);
    background: #000;
    outline: none;
}

.player.is-fullscreen {
    border-radius: 0;
    border: 0;
    width: 100%;
    height: 100%;
}

.player.is-fullscreen video {
    height: 100%;
    max-height: none;
    object-fit: contain;
}

.player__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 45%, rgba(139, 92, 246, .16), rgba(5, 4, 9, .42));
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s var(--ease);
}

.player__overlay.is-on {
    opacity: 1;
    pointer-events: auto;
}

.player__big {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 25px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    box-shadow: 0 20px 46px -18px rgba(168, 85, 247, .95), inset 0 0 0 1px rgba(255, 255, 255, .16);
    transition: transform .18s var(--ease);
}

.player__big i {
    margin-left: 5px;
}

.player__big:hover {
    transform: scale(1.06);
}

.player__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 42px 14px 12px;
    background: linear-gradient(to top, rgba(4, 3, 9, .97), rgba(4, 3, 9, .62) 52%, transparent);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.player__bar.is-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.player__btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    font-size: 13px;
    color: #e9e3ff;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.player__btn:hover {
    background: rgba(255, 255, 255, .13);
    color: #fff;
}

.player__time {
    min-width: 96px;
    font-size: 12px;
    color: #cfc8e4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.player__seek {
    position: relative;
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.player__track {
    position: relative;
    width: 100%;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .16);
    overflow: hidden;
    transition: height .12s var(--ease);
}

.player__seek:hover .player__track,
.player__seek.is-drag .player__track {
    height: 7px;
}

.player__buffer,
.player__played {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
}

.player__buffer {
    background: rgba(255, 255, 255, .22);
}

.player__played {
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
}

.player__knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%) scale(0);
    transition: transform .12s var(--ease);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, .3);
    pointer-events: none;
}

.player__seek:hover .player__knob,
.player__seek.is-drag .player__knob {
    transform: translateY(-50%) scale(1);
}

.player__volume {
    width: 74px;
    height: 4px;
    flex: 0 0 74px;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 99px;
    background: rgba(255, 255, 255, .2);
    cursor: pointer;
}

.player__volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, .3);
}

.player__volume::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 50%;
    background: #fff;
}

.player__rate {
    width: auto;
    min-width: 44px;
    padding: 0 8px;
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

/* ---------- 音频 ---------- */
.player--audio {
    max-width: 640px;
    background: linear-gradient(180deg, #161028, #0c0817);
}

.player--audio audio {
    display: none;
}

.audio-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 36px 24px 28px;
    text-align: center;
}

.audio-stage__art {
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 34px;
    background: radial-gradient(circle at 32% 18%, #351f57, #100a1e);
    box-shadow: inset 0 0 0 1px rgba(244, 114, 182, .3), 0 26px 54px -26px rgba(217, 70, 239, .9);
}

.audio-stage__art img {
    width: 88px;
    height: 88px;
    filter: drop-shadow(0 0 12px rgba(217, 70, 239, .5));
}

.audio-stage__title {
    max-width: 100%;
    font-size: 15px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-stage__sub {
    font-size: 12px;
    color: var(--text-3);
}

.player--audio .player__bar {
    position: static;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .03);
    border-top: 1px solid var(--line);
}

/* ---------- 图片 ---------- */
.vimage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.vimage img {
    max-width: min(1180px, 100%);
    max-height: calc(100vh - 250px);
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #000;
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .95);
}

.vimage figcaption {
    font-size: 12px;
    color: var(--text-3);
}

.vimage figcaption a {
    color: #d8b4fe;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- PDF ---------- */
.vpdf {
    width: min(1180px, 100%);
    height: calc(100vh - 220px);
    min-height: 420px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .95);
}

.vpdf iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- 文本 ---------- */
.vtext {
    width: min(1000px, 100%);
    max-height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(18, 14, 31, .92);
    box-shadow: var(--shadow-1);
}

.vtext__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .02);
    font-size: 12px;
    color: var(--text-3);
}

.vtext__body {
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.78;
    color: #cfc8e4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- 兜底卡片 ---------- */
.vcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 460px;
    padding: 40px 34px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(25, 19, 49, .82), rgba(16, 12, 30, .92));
    box-shadow: var(--shadow-1);
    text-align: center;
}

.vcard__mark {
    width: 72px;
    height: 72px;
    opacity: .55;
    filter: drop-shadow(0 0 14px rgba(217, 70, 239, .45));
}

.vcard__title {
    font-size: 17px;
    font-weight: 700;
}

.vcard__desc {
    margin-bottom: 10px;
    font-size: 12.5px;
    color: var(--text-3);
    word-break: break-all;
}

/* ---------- 页脚 ---------- */
.vfoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 22px 18px;
    font-size: 12px;
    color: var(--text-3);
}

.vfoot__meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.vfoot__meta i {
    margin-right: 6px;
    color: rgba(167, 139, 250, .55);
}

.vfoot__hint {
    font-size: 11.5px;
    color: rgba(126, 117, 150, .95);
}

@media (max-width: 820px) {
    .vtop {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }

    .vtop__brand span {
        display: none;
    }

    .vtop__file {
        flex: 1 1 100%;
        order: 3;
        padding-left: 0;
        border-left: 0;
    }

    .vtop__btn-label {
        display: none;
    }

    .vstage {
        padding: 12px;
    }

    .player {
        border-radius: 13px;
    }

    .player video {
        max-height: calc(100vh - 280px);
    }

    .player__bar {
        gap: 6px;
        padding: 34px 10px 10px;
    }

    .player__time {
        min-width: 74px;
        font-size: 11px;
    }

    .player__volume {
        display: none;
    }

    .vfoot {
        padding: 10px 14px 16px;
    }

    .vfoot__hint {
        display: none;
    }

    .vpdf {
        height: calc(100vh - 240px);
    }

    .vimage img {
        max-height: calc(100vh - 280px);
    }
}
/* 返回按钮提高可见度 */
.vtop__back {
    color: #d9d3ec;
    font-size: 17px;
    background: rgba(255, 255, 255, .07);
}

.vtop__back:hover {
    color: #fff;
    background: rgba(167, 139, 250, .22);
}

/* 文本预览靠上排布，更像在读文档 */
.vstage--top {
    align-items: flex-start;
    padding-top: 28px;
}
