*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #1a5276;
    --accent:    #2980b9;
    --bg:        #f4f6f9;
    --card:      #ffffff;
    --border:    #dce3ec;
    --text:      #2c3e50;
    --muted:     #7f8c8d;
    --hover-bg:  #eaf4fb;
    --radius:    10px;
    --shadow:    0 2px 8px rgba(0,0,0,.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ── */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #154360 100%);
    color: #fff;
    padding: 18px 20px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
header h1 {
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 700;
    letter-spacing: .3px;
}
header p.tagline {
    font-size: .82rem;
    opacity: .8;
    margin-top: 4px;
}
.header-inner {
    max-width: 960px;
    margin: 0 auto;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    font-size: .85rem;
    overflow-x: auto;
    white-space: nowrap;
}
.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span.sep { margin: 0 6px; color: var(--muted); }
.breadcrumb span.current { color: var(--text); font-weight: 600; }
.breadcrumb-inner {
    max-width: 960px;
    margin: 0 auto;
}

/* ── MAIN ── */
main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
}

/* ── FILE LIST ── */
.file-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.file-list-header {
    background: var(--primary);
    color: #fff;
    padding: 10px 18px;
    font-size: .82rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
    gap: 10px;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--hover-bg); }

.file-item-up {
    background: #f0f4f8;
    border-bottom: 2px solid var(--border) !important;
    color: var(--primary);
    font-weight: 600;
    font-style: italic;
}
.file-item-up:hover { background: #e2ecf5; }

.file-item .icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.file-item .name {
    flex: 1;
    font-size: .95rem;
    word-break: break-word;
}
.file-item .meta {
    font-size: .75rem;
    color: var(--muted);
    flex-shrink: 0;
    margin-left: auto;
}

.section-label {
    padding: 8px 18px 4px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    background: #f9fbfd;
    border-bottom: 1px solid var(--border);
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    font-size: .95rem;
}
.empty-state span { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* ── FOOTER ── */
footer {
    background: #1a252f;
    color: #bdc3c7;
    padding: 28px 20px;
    font-size: .83rem;
    line-height: 1.7;
}
footer .footer-inner {
    max-width: 960px;
    margin: 0 auto;
}
footer .visitors {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f3f4;
    margin-bottom: 14px;
}
footer .visitors span {
    color: #f39c12;
}
footer p { margin-bottom: 8px; }
footer a { color: #85c1e9; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .file-item { padding: 10px 12px; }
    .file-item .meta { display: none; }
    main { margin: 14px auto; }
}

/* ── COPY LINK ── */
.copy-link-wrap {
    max-width: 960px;
    margin: 14px auto 0;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 26px;
    border-radius: 24px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(41,128,185,.35);
    transition: background .18s, transform .1s, box-shadow .18s;
    letter-spacing: .2px;
}
.copy-link-btn:hover  {
    background: #1f6fa5;
    box-shadow: 0 5px 14px rgba(41,128,185,.45);
}
.copy-link-btn:active { transform: scale(.96); }
.copy-link-msg {
    font-size: .78rem;
    color: var(--muted);
    word-break: break-all;
    max-width: 700px;
}

/* ── PWA INSTALL BANNER ── */
.pwa-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #154360 0%, #1a5276 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    animation: slideDown .35s ease;
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
.pwa-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pwa-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: .85rem;
    line-height: 1.4;
}
.pwa-banner-text strong {
    font-size: .95rem;
    font-weight: 700;
}
.pwa-banner-text span {
    opacity: .85;
    font-size: .78rem;
}
.pwa-btn-install {
    background: #f39c12;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .1s;
}
.pwa-btn-install:hover  { background: #e67e22; }
.pwa-btn-install:active { transform: scale(.96); }
.pwa-btn-dismiss {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: .7;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
    transition: opacity .2s;
}
.pwa-btn-dismiss:hover { opacity: 1; }

/* ── FOOTER INSTALL LINK ── */
.footer-install-wrap { margin-top: 16px; }
.footer-install-link {
    display: inline-block;
    background: #f39c12;
    color: #fff !important;
    text-decoration: none !important;
    padding: 9px 20px;
    border-radius: 22px;
    font-size: .88rem;
    font-weight: 700;
    transition: background .2s, transform .1s;
}
.footer-install-link:hover  { background: #e67e22 !important; }
.footer-install-link:active { transform: scale(.97); }

@media (max-width: 500px) {
    .pwa-banner-text span { display: none; }
    .pwa-btn-install { padding: 7px 12px; font-size: .8rem; }
}
