/* ============================================================
   易云储 v32 · Aurora 主题层
   在 app.css / mobile.css 之后加载，只覆盖视觉，不改布局骨架。
   配色：靛蓝 #4F46E5 → 紫罗兰 #7C3AED → 品红 #A855F7，点缀青 #22D3EE
   ============================================================ */

:root {
    --xy-p1: #4F46E5;
    --xy-p2: #7C3AED;
    --xy-p3: #A855F7;
    --xy-cyan: #22D3EE;
    --xy-ink: #171A2B;
    --xy-sub: #7A8199;
    --xy-line: rgba(23, 26, 43, .08);
    --xy-card: #FFFFFF;
    --xy-bg: #F5F6FB;
    --xy-radius: 20px;
    --xy-shadow-1: 0 1px 2px rgba(18, 24, 60, .04), 0 6px 18px rgba(18, 24, 60, .06);
    --xy-shadow-2: 0 18px 44px rgba(18, 24, 60, .14);
}

/* ---------- 画布：柔和光晕背景 ---------- */
body {
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(79, 70, 229, .10), transparent 62%),
        radial-gradient(760px 460px at 96% 4%, rgba(168, 85, 247, .10), transparent 60%),
        radial-gradient(700px 500px at 50% 108%, rgba(34, 211, 238, .07), transparent 62%),
        var(--xy-bg);
    background-attachment: fixed;
    color: var(--xy-ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    letter-spacing: .1px;
}

::selection { background: rgba(79, 70, 229, .22); }

/* ---------- 顶栏：白色玻璃 + 细腻阴影（紫色留给欢迎横幅，避免整屏过重） ---------- */
.topbar {
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid rgba(23, 26, 43, .06);
    box-shadow: 0 8px 28px rgba(18, 24, 60, .06);
    color: var(--xy-ink);
}
.brand { font-weight: 800; letter-spacing: .4px; color: var(--xy-ink); }
.icon-btn {
    border-radius: 12px;
    background: #F2F3FA;
    border: 1px solid #E8EAF4;
    color: #4C5270;
}
.icon-btn:hover { background: #E9EBF8; }
.avatar {
    background: linear-gradient(135deg, var(--xy-p1), var(--xy-p2));
    color: #FFFFFF;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .28);
    font-weight: 800;
}
.topbar-row2 input {
    border-radius: 12px;
    padding: 10px 16px;
    background: #F4F6FC;
    border: 1px solid #E9EBF5;
    box-shadow: none;
    color: var(--xy-ink);
}
.topbar-row2 input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); border-color: rgba(79, 70, 229, .35); }

/* 工具抽屉：浅色卡片风 */
.tools-drawer {
    background: #FFFFFF;
    border: 1px solid var(--xy-line);
    box-shadow: 0 18px 40px rgba(18, 24, 60, .12);
    border-radius: 18px;
}
.tools-drawer button, .tools-drawer label, .tools-drawer a {
    border-radius: 12px;
    background: #F6F7FC;
    border: 1px solid #EDEFF7;
    color: #3A4056;
}
.tools-drawer button:hover, .tools-drawer label:hover, .tools-drawer a:hover { background: #EEF0FF; color: var(--xy-p1); }

/* ---------- 主区 ---------- */
.main { max-width: min(1140px, 100%); }
.notice {
    border-radius: 14px;
    background: linear-gradient(180deg, #FFFAEC, #FFF6DF);
    color: #7A5A12;
    border: 1px solid rgba(214, 170, 60, .22);
}

/* ---------- 欢迎横幅 ---------- */
.hero-welcome {
    border-radius: 24px;
    padding: 26px 28px;
    background:
        radial-gradient(420px 260px at 88% 12%, rgba(255, 255, 255, .20), transparent 60%),
        linear-gradient(118deg, #4F46E5 0%, #7C3AED 52%, #A855F7 100%);
    box-shadow: 0 18px 40px rgba(79, 70, 229, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .14);
}
.hw-greet { font-size: 23px; font-weight: 800; letter-spacing: .4px; }
.hw-date { margin-top: 8px; font-size: 13px; opacity: .92; letter-spacing: .2px; }
.hw-btn { padding: 10px 20px; font-weight: 600; }
.hw-btn.primary { color: var(--xy-p1); box-shadow: 0 8px 22px rgba(10, 10, 50, .26); }
.hw-btn.ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); }
.hw-storage { margin-top: 14px; width: 240px; max-width: 100%; }
.hw-track { height: 7px; background: rgba(255, 255, 255, .26); }
.hw-track i { background: linear-gradient(90deg, #FFFFFF, #B9E9FF); }

/* ---------- 最近文件 ---------- */
.rs-head b { font-size: 16px; color: var(--xy-ink); font-weight: 700; }
.rs-more { color: var(--xy-p1); font-weight: 600; border-radius: 8px; }
.rs-more:hover { background: rgba(79, 70, 229, .08); }
.rs-card {
    flex: 0 0 138px;
    border-radius: 16px;
    padding: 10px;
    background: var(--xy-card);
    border: 1px solid var(--xy-line);
    box-shadow: var(--xy-shadow-1);
}
.rs-thumb { width: 118px; height: 78px; border-radius: 11px; }
.rs-name { margin-top: 9px; font-size: 12.5px; }
.rs-meta { margin-top: 3px; }

/* ---------- 工具栏 / 标签 ---------- */
.toolbar-c { margin-bottom: 10px; }
.page-tabs {
    gap: 26px;
    padding: 4px 18px 0;
    border-bottom: 1px solid var(--xy-line);
}
.page-tabs button {
    font-size: 15px;
    font-weight: 500;
    color: #8A90A6;
    padding: 10px 2px 12px;
    border-bottom-width: 3px;
    border-radius: 0;
}
.page-tabs button.active {
    color: var(--xy-ink);
    font-weight: 700;
    border-bottom-color: var(--xy-p1);
    background: linear-gradient(180deg, transparent 62%, rgba(79, 70, 229, .10) 100%);
    border-radius: 6px 6px 0 0;
}
.type-chips button {
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid var(--xy-line);
    box-shadow: 0 1px 2px rgba(18, 24, 60, .04);
    padding: 6px 14px;
    color: #4C5268;
}
.type-chips button:hover { border-color: rgba(79, 70, 229, .35); color: var(--xy-p1); }
.type-chips button.active {
    background: linear-gradient(135deg, var(--xy-p1), var(--xy-p2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, .30);
}

/* ---------- 列表头 ---------- */
.list-head { margin-top: 4px; }
.crumbs { color: var(--xy-sub); font-weight: 500; }
.sort-btn {
    background: #fff;
    border: 1px solid var(--xy-line);
    border-radius: 999px;
    color: #4C5268;
    padding: 7px 14px;
    box-shadow: 0 1px 2px rgba(18, 24, 60, .04);
}
.sort-btn:hover { color: var(--xy-p1); border-color: rgba(79, 70, 229, .35); }
.sort-btn.danger-btn { color: #D93A4A; border-color: rgba(217, 58, 74, .22); background: #FFF6F7; }

/* ---------- 文件卡片（桌面） ---------- */
/* 只约束桌面：手机端单行列表的 52px 缩略图必须由 mobile.css 决定 */
@media (min-width: 921px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(clamp(210px, 23vw, 288px), 1fr)); gap: clamp(12px, 1.6vw, 18px); }
    .fcard {
        position: relative;
        border-radius: var(--xy-radius);
        padding: 18px;
        background: var(--xy-card);
        border: 1px solid var(--xy-line);
        box-shadow: var(--xy-shadow-1);
        overflow: hidden;
        transition: transform .28s cubic-bezier(.22, .9, .36, 1), box-shadow .28s ease, border-color .2s ease;
    }
    .fcard::after {
        content: "";
        position: absolute; inset: 0;
        background: linear-gradient(135deg, rgba(79, 70, 229, .08), transparent 42%);
        opacity: 0; transition: opacity .25s ease; pointer-events: none;
    }
    @media (hover: hover) {
        .fcard:hover { transform: translateY(-5px); box-shadow: var(--xy-shadow-2); border-color: rgba(79, 70, 229, .22); }
        .fcard:hover::after { opacity: 1; }
    }
    .fcard .thumb {
        border-radius: 0;
        height: 132px;
        aspect-ratio: auto;
        align-self: stretch;
        width: auto;
        display: flex; align-items: center; justify-content: center;
    }
    .fcard .thumb svg { margin: auto; display: block; width: 46px; height: 46px; }
    .fcard .name { font-size: 15px; font-weight: 650; margin-top: 12px; color: var(--xy-ink); }
    .fcard .meta { margin-top: 4px; color: #8E94A8; }
    .fcard .ops { gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(23, 26, 43, .08); }
    .fcard .ops button, .fcard .ops a {
        border: none;
        background: #F2F3FA;
        color: #4C5270;
        border-radius: 10px;
        padding: 6px 11px;
        font-weight: 500;
    }
    .fcard .ops button:hover, .fcard .ops a:hover {
        background: linear-gradient(135deg, var(--xy-p1), var(--xy-p2));
        color: #fff;
        box-shadow: 0 6px 14px rgba(79, 70, 229, .25);
    }
    .fcard .star-badge {
        position: absolute; top: 26px; right: 26px; z-index: 2;
        background: rgba(255, 255, 255, .92); color: #F0A500;
        border-radius: 999px; padding: 3px 8px; font-size: 12px;
        box-shadow: 0 2px 8px rgba(20, 25, 60, .14);
    }

    /* 桌面列表视图：单行横向卡片（原版此处会退化成整宽大图，已修正） */
    .grid.list-mode { gap: 8px; }
    .grid.list-mode .fcard {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) auto;
        grid-template-areas: "thumb name ops" "thumb meta ops";
        align-items: center;
        column-gap: 14px; row-gap: 2px;
        padding: 12px 18px;
        border-radius: 16px;
        background: var(--xy-card);
        border: 1px solid var(--xy-line);
        box-shadow: var(--xy-shadow-1);
        overflow: hidden;
    }
    .grid.list-mode .fcard::after { display: none; }
    .grid.list-mode .fcard .thumb {
        grid-area: thumb; width: 56px; height: 56px; margin: 0;
        border-radius: 14px; align-self: center;
    }
    .grid.list-mode .fcard .thumb svg { width: 26px; height: 26px; }
    .grid.list-mode .fcard .name { grid-area: name; margin: 0; align-self: end; font-size: 15px; }
    .grid.list-mode .fcard .meta { grid-area: meta; margin: 0; align-self: start; }
    .grid.list-mode .fcard .ops { grid-area: ops; margin: 0; padding: 0; border-top: none; flex-wrap: nowrap; }
    .grid.list-mode .fcard .star-badge { display: none; }
}

/* 空状态 */
.empty { padding: 64px 0 48px; }
.empty-ico {
    width: 84px; height: 84px; margin: 0 auto 18px;
    border-radius: 26px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, .10), rgba(168, 85, 247, .12));
    color: var(--xy-p1);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .12);
}
.empty-ico svg { width: 38px; height: 38px; }
.empty-text { color: #8A90A6; font-size: 14px; }

/* ---------- 输入 / 选择 ---------- */
input[type="text"], input[type="search"], input[type="password"], input[type="email"], textarea, select {
    outline: none;
}
button:focus-visible, a:focus-visible, input:focus-visible, .fcard:focus-visible {
    outline: 2px solid rgba(79, 70, 229, .55);
    outline-offset: 2px;
}

/* ---------- 上传进度 / 提示 ---------- */
.upload-progress {
    border-radius: 18px;
    border: 1px solid var(--xy-line);
    box-shadow: 0 22px 50px rgba(18, 24, 60, .18);
}
.upload-progress .up-fill { background: linear-gradient(90deg, var(--xy-p1), var(--xy-cyan)); }
.toast {
    border-radius: 14px;
    background: rgba(23, 26, 43, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px rgba(18, 24, 60, .26);
}

/* ---------- 底部导航（手机悬浮胶囊） ---------- */
@media (max-width: 920px) {
    body { background: var(--xy-bg); }

    .topbar { border-radius: 0 0 22px 22px; }
    .bottom-nav {
        left: 12px; right: 12px; bottom: 10px;
        border-radius: 22px;
        background: rgba(255, 255, 255, .92);
        -webkit-backdrop-filter: saturate(1.5) blur(16px);
        backdrop-filter: saturate(1.5) blur(16px);
        border: 1px solid rgba(23, 26, 43, .07);
        box-shadow: 0 12px 34px rgba(18, 24, 60, .16);
        padding-bottom: env(safe-area-inset-bottom);
        overflow: hidden;
    }
    .bottom-nav .active { background: transparent; }
    .bottom-nav .active .bn-txt { font-weight: 700; }

    .fcard { border-radius: 16px; }
    .fcard:active { background: #F8F8FF; }

    /* 手机端列表行：52px 缩略图 + 右側标题/副标题两行，压掉多余留白 */
    .grid.list-mode .fcard {
        display: grid;
        grid-template-columns: 52px 1fr;
        grid-template-areas: "thumb name" "thumb meta";
        align-items: center;
        column-gap: 12px;
        row-gap: 2px;
        padding: 12px 14px;
        min-height: 0;
    }
    .grid.list-mode .fcard .thumb { grid-area: thumb; width: 52px; height: 52px; margin: 0; border-radius: 14px; }
    .grid.list-mode .fcard .name { grid-area: name; margin: 0; font-size: 15px; align-self: end; }
    .grid.list-mode .fcard .meta { grid-area: meta; margin: 0; align-self: start; }
    .grid.list-mode .fcard .ops { display: none; }
    /* v1.4.4：修复手机列表模式下点「⋯」后操作按钮仍被隐藏，导致文件夹无法删除 */
    .grid.list-mode .fcard.ops-open .ops {
        display: flex; grid-area: auto; grid-column: 1 / -1;
        margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(23, 26, 43, .08);
        flex-wrap: wrap;
    }

    .hero-welcome { border-radius: 20px; padding: 20px; }
    .hw-greet { font-size: 19px; }
    .hw-btn { padding: 9px 16px; font-size: 13px; }
    .rs-card { flex: 0 0 124px; }
    .rs-thumb { width: 104px; height: 70px; }
    .empty-ico { width: 72px; height: 72px; border-radius: 22px; }

    /* 认证页：更柔的玻璃卡 */
    .auth-card { border-radius: 26px; }
}

@media (max-width: 639px) {
    .page-tabs { gap: 18px; padding: 2px 12px 0; }
    .page-tabs button { font-size: 14px; }
    .hero-welcome { padding: 18px; }
    .hw-actions { width: 100%; }
}

/* ---------- 深色模式 ---------- */
html[data-theme="dark"] {
    --xy-ink: #E9EBF5;
    --xy-sub: #8A93A8;
    --xy-line: rgba(255, 255, 255, .08);
    --xy-card: #191C27;
    --xy-bg: #0F1117;
    --xy-shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px rgba(0, 0, 0, .32);
    --xy-shadow-2: 0 20px 46px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] body {
    background:
        radial-gradient(900px 520px at 12% -10%, rgba(79, 70, 229, .22), transparent 62%),
        radial-gradient(760px 460px at 96% 4%, rgba(168, 85, 247, .18), transparent 60%),
        var(--xy-bg);
    background-attachment: fixed;
}
html[data-theme="dark"] .topbar {
    background: linear-gradient(125deg, rgba(38, 33, 88, .94), rgba(56, 30, 92, .94) 60%, rgba(70, 32, 96, .92));
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .fcard,
html[data-theme="dark"] .rs-card,
html[data-theme="dark"] .sort-btn,
html[data-theme="dark"] .type-chips button { background: var(--xy-card); border-color: var(--xy-line); }
html[data-theme="dark"] .fcard .name { color: var(--xy-ink); }
html[data-theme="dark"] .fcard .ops { border-top-color: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .fcard .ops button,
html[data-theme="dark"] .fcard .ops a { background: #232838; color: #C7CDE2; }
html[data-theme="dark"] .page-tabs { border-bottom-color: var(--xy-line); }
html[data-theme="dark"] .page-tabs button.active { color: #fff; }
html[data-theme="dark"] .hero-welcome {
    background:
        radial-gradient(420px 260px at 88% 12%, rgba(255, 255, 255, .10), transparent 60%),
        linear-gradient(118deg, #2A2560 0%, #3B2470 52%, #4A2170 100%);
    border-color: rgba(255, 255, 255, .10);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .40);
}
html[data-theme="dark"] .notice {
    background: linear-gradient(180deg, #2A2413, #241F12);
    border-color: rgba(214, 170, 60, .18);
    color: #E8C67A;
}
html[data-theme="dark"] .bottom-nav {
    background: rgba(22, 25, 35, .92);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] .toast { background: rgba(35, 39, 54, .96); }
