/* 轻云盘 · 全站样式 */
:root {
    --bg: #f5f8fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e5eaf1;
    --accent: #0e9c8a;
    --accent-dark: #0b7a6e;
    --accent-soft: #e6fbf5;
    --danger: #d94f4f;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -18px rgba(15, 23, 42, .25);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(900px 480px at 8% -8%, #d9f7f0 0%, rgba(217, 247, 240, 0) 62%),
        radial-gradient(760px 420px at 100% 0%, #e7efff 0%, rgba(231, 239, 255, 0) 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

.wrap {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

/* ---------------- 顶部 ---------------- */
.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

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

.brand .mark {
    width: 42px; height: 42px;
    border-radius: 13px;
    display: grid; place-items: center;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #12b3a0, #0b7a6e);
    box-shadow: 0 8px 18px -8px rgba(14, 156, 138, .9);
    flex: 0 0 auto;
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: .2px;
    font-weight: 700;
}

.brand p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.stats {
    font-size: 12.5px;
    color: var(--muted);
    text-align: right;
    line-height: 1.6;
    white-space: nowrap;
}

/* ---------------- 上传区 ---------------- */
.uploader {
    position: relative;
    border: 2px dashed #cdd8e3;
    border-radius: 20px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(6px);
    padding: 34px 22px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .18s;
    box-shadow: var(--shadow);
}

.uploader:hover { border-color: #9fd9cd; background: #fff; }

.uploader.active {
    border-color: var(--accent);
    background: #f0fdf9;
    transform: translateY(-1px);
}

.up-icon {
    width: 52px; height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 26px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-weight: 300;
}

.up-title { margin: 0; font-size: 15.5px; font-weight: 600; }

.up-title button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--accent);
    font-size: inherit;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.up-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------------- 上传队列 ---------------- */
#queue { margin-top: 14px; display: grid; gap: 8px; }

.qrow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13px;
}

.qname {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.qbar {
    flex: 0 0 110px;
    height: 6px;
    border-radius: 99px;
    background: #eef2f6;
    overflow: hidden;
}

.qbar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #12b3a0, #0b7a6e);
    transition: width .2s ease;
}

.qstate { flex: 0 0 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.qrow.err { border-color: #f6d3d3; background: #fff6f6; }
.qrow.err .qstate { color: var(--danger); }

/* ---------------- 列表 ---------------- */
.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 30px 0 14px;
    flex-wrap: wrap;
}

.list-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-head h2 span {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 2px 9px;
}

.search {
    height: 34px;
    width: 200px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.search:focus { border-color: #a9ded4; box-shadow: 0 0 0 3px rgba(14, 156, 138, .1); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -16px rgba(15, 23, 42, .35); }

.card-head { display: flex; align-items: center; gap: 11px; min-width: 0; }

.tile {
    width: 42px; height: 42px;
    flex: 0 0 auto;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--accent-dark);
    background: linear-gradient(135deg, #ecfdf8, #d8f6ee);
}

.info { min-width: 0; flex: 1 1 auto; }

.fname {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
}

.fmeta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.6;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}

.btn:hover { background: #f7fafc; border-color: #d5dde6; }

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn.danger { color: var(--danger); border-color: #f2d5d5; }
.btn.danger:hover { background: #fff5f5; border-color: #e9b8b8; }

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 46px 16px;
    border: 2px dashed #dfe7ef;
    border-radius: 18px;
    color: var(--muted);
    font-size: 13.5px;
    background: rgba(255, 255, 255, .6);
}

.empty b { display: block; font-size: 15px; color: var(--text); margin-bottom: 6px; font-weight: 600; }

.foot {
    margin-top: 34px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.8;
}

/* ---------------- 分享页 ---------------- */
.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

.back:hover { color: var(--accent); }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 26px;
}

.file-hero { display: flex; align-items: center; gap: 16px; min-width: 0; }

.file-hero .tile { width: 58px; height: 58px; border-radius: 15px; font-size: 13px; }

.file-hero h2 {
    margin: 0 0 5px;
    font-size: 19px;
    line-height: 1.35;
    word-break: break-word;
}

.file-hero .sub { font-size: 12.5px; color: var(--muted); }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 22px 0;
}

.meta-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 13px;
    background: #fbfdff;
}

.meta-item dt { font-size: 11.5px; color: var(--muted); margin: 0 0 4px; }
.meta-item dd { margin: 0; font-size: 13.5px; font-weight: 600; word-break: break-word; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.actions .btn { padding: 10px 20px; font-size: 13.5px; border-radius: 11px; }

.preview {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background:
        linear-gradient(45deg, #f4f6f9 25%, transparent 25%) 0 0/18px 18px,
        linear-gradient(-45deg, #f4f6f9 25%, transparent 25%) 0 9px/18px 18px,
        linear-gradient(45deg, transparent 75%, #f4f6f9 75%) 9px -9px/18px 18px,
        linear-gradient(-45deg, transparent 75%, #f4f6f9 75%) -9px 0/18px 18px,
        #fff;
    text-align: center;
    padding: 14px;
}

.preview img, .preview video { max-width: 100%; max-height: 62vh; border-radius: 8px; display: block; margin: 0 auto; }
.preview audio { width: 100%; max-width: 480px; }

.notice {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #f7fafc;
    border: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.7;
}

/* ---------------- 提示条 ---------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 14px);
    max-width: min(92vw, 460px);
    padding: 11px 18px;
    border-radius: 12px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 12px 30px -12px rgba(15, 23, 42, .7);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 20;
    text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b93b3b; }

/* ---------------- 错误页 ---------------- */
.err-page { text-align: center; padding: 60px 20px; }
.err-page .code { font-size: 46px; font-weight: 800; color: #cbd5e1; letter-spacing: 2px; }
.err-page h2 { margin: 10px 0 8px; font-size: 18px; }
.err-page p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 640px) {
    .wrap { padding: 18px 14px 40px; }
    .top { align-items: flex-start; flex-direction: column; gap: 8px; }
    .stats { text-align: left; }
    .uploader { padding: 26px 16px; }
    .grid { grid-template-columns: 1fr; }
    .search { width: 100%; }
    .panel { padding: 18px; }
    .qbar { flex-basis: 70px; }
}
