:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Microsoft YaHei", sans-serif;
    color: #243247;
    background: #f5f7fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

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

.container {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 28px;
}

.header {
    margin-bottom: 28px;
}

.brand {
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -0.8px;
    color: #2563eb;
}

.header p,
.muted {
    color: #8994a5;
    font-size: 14px;
}

.panel {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgb(30 55 90 / 4%);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid #edf0f5;
}

.panel-heading h1 {
    margin: 0;
    font-size: 20px;
}

.panel-heading p {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
}

.count {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
}

.item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 68px;
    padding: 14px 24px;
    border-bottom: 1px solid #f0f2f6;
    transition: background 0.15s ease;
}

.item:last-child {
    border-bottom: 0;
}

a.item:hover {
    background: #f8faff;
}

.item-icon {
    flex-shrink: 0;
    font-size: 23px;
}

.item-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 550;
}

.file-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.file-sub,
.item-meta {
    color: #929caf;
    font-size: 12px;
}

.item-meta {
    margin-left: auto;
    flex-shrink: 0;
}

/* 文件类型标识 */
.file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 3px;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: -0.4px;
    border: 1px solid transparent;
    overflow: hidden;
}

.folder-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff7e6;
    color: #d97706;
}

/* PDF */
.file-icon-pdf {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fee2e2;
}

/* Word */
.file-icon-word {
    color: #2563eb;
    background: #eff6ff;
    border-color: #dbeafe;
}

/* Excel */
.file-icon-excel {
    color: #16834a;
    background: #ecfdf3;
    border-color: #d1fae5;
}

/* PowerPoint */
.file-icon-ppt {
    color: #c2410c;
    background: #fff7ed;
    border-color: #fed7aa;
}

/* 压缩文件 */
.file-icon-archive {
    color: #7c3aed;
    background: #f5f3ff;
    border-color: #ddd6fe;
}

/* 图片 */
.file-icon-image {
    color: #db2777;
    background: #fdf2f8;
    border-color: #fbcfe8;
}

/* 视频 */
.file-icon-video {
    color: #ea580c;
    background: #fff7ed;
    border-color: #fed7aa;
}

/* 音频 */
.file-icon-audio {
    color: #9333ea;
    background: #faf5ff;
    border-color: #e9d5ff;
}

/* 源代码 */
.file-icon-code {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

/* 文本 */
.file-icon-text {
    color: #64748b;
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* 安装程序 */
.file-icon-app {
    color: #0f766e;
    background: #f0fdfa;
    border-color: #ccfbf1;
}

/* 字体 */
.file-icon-font {
    color: #4338ca;
    background: #eef2ff;
    border-color: #e0e7ff;
}

/* 数据库 */
.file-icon-database {
    color: #047857;
    background: #ecfdf5;
    border-color: #d1fae5;
}

/* 未知文件 */
.file-icon-other {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.download {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    color: #2563eb;
    background: #eff6ff;
    font-size: 13px;
    transition: 0.15s ease;
}

.download:hover {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}

.empty {
    padding: 48px 16px;
    color: #929caf;
    text-align: center;
    font-size: 14px;
}

/* 加载动画：只显示圆环 */
.status:not(.error) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: transparent;
}

.status:not(.error)::before {
    content: "";
    width: 17px;
    height: 17px;
    border: 2px solid #dbeafe;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: loading-spin 0.7s linear infinite;
}

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

.status.error {
    padding: 16px 24px;
    color: #b91c1c;
    background: #fef2f2;
    font-size: 13px;
    overflow-wrap: anywhere;
}

[hidden] {
    display: none !important;
}

.footer {
    padding: 22px 0;
    color: #929caf;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 560px) {
    .container {
        padding-top: 28px;
    }

    .brand {
        font-size: 25px;
    }

    .panel-heading,
    .item {
        padding-right: 16px;
        padding-left: 16px;
    }

    .item {
        gap: 10px;
    }

    .file-icon,
    .folder-icon {
        width: 38px;
        height: 38px;
        font-size: 9px;
    }

    .download {
        padding: 7px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .status:not(.error)::before {
        animation: none;
    }

    .item,
    .download {
        transition: none;
    }
}