:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-strong: #eef4ff;
    --text: #172033;
    --muted: #657287;
    --line: #dbe3ef;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #dbeafe;
    --success: #0f766e;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #edf5ff 0%, rgba(237, 245, 255, 0) 360px),
        var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
}

.qr-widget {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 20;
    width: 150px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
    backdrop-filter: blur(8px);
}

.qr-code {
    display: grid;
    place-items: center;
    width: 128px;
    height: 128px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.qr-code canvas {
    display: block;
    width: 116px;
    height: 116px;
    image-rendering: pixelated;
}

.qr-info {
    display: grid;
    gap: 7px;
    margin-top: 9px;
}

.qr-title {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 9px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.qr-download:hover {
    background: var(--accent-dark);
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 56px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.12;
    letter-spacing: 0;
}

.subtitle {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.7;
}

.summary {
    min-width: 166px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.summary strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.summary span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.tab:hover,
.tab.active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.groups {
    display: grid;
    gap: 18px;
}

.group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.group-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 22px;
    background: var(--panel-strong);
    border-bottom: 1px solid var(--line);
}

.group-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: 0;
}

.group-desc {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.group-link {
    align-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}

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

.file-name {
    display: block;
    overflow-wrap: anywhere;
    font-weight: 700;
    line-height: 1.45;
}

.file-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.18s ease, transform 0.18s ease;
}

.download:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.empty {
    padding: 34px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 760px) {
    .qr-widget {
        position: static;
        width: min(100% - 24px, 360px);
        margin: 12px auto 0;
    }

    .qr-info {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .qr-title {
        text-align: left;
    }

    .page {
        width: min(100% - 24px, 1120px);
        padding-top: 28px;
    }

    .topbar,
    .group-header,
    .file-item {
        grid-template-columns: 1fr;
    }

    .topbar {
        display: grid;
    }

    .summary {
        min-width: 0;
    }

    .group-link,
    .download {
        width: 100%;
    }
}
