/* file.pbzcicn.top - autoindex skin (responsive: desktop / tablet / phone) */

:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #e4e7ec;
    --text: #1a1f29;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #eff4ff;
    --hover: #f2f5fa;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
    --radius: 14px;
    --gutter: 20px;
    --tap: 44px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --panel: #171a21;
        --border: #262b36;
        --text: #e6e9ef;
        --muted: #98a1b3;
        --accent: #6ea8fe;
        --accent-soft: #1b2536;
        --hover: #1e222b;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    }
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 26px var(--gutter) 60px;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
    padding-bottom: max(60px, env(safe-area-inset-bottom));
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica,
          Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    overflow-wrap: break-word;
}

body > h1,
body > hr { display: none; }   /* replaced by the styled header */

.fs-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

/* ---------- header ---------- */

.fs-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 14px;
}

.fs-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.01em;
}

.fs-brand svg { width: 26px; height: 26px; flex: none; }

.fs-brand a { color: inherit; text-decoration: none; }

.fs-head .fs-host {
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* the sort dropdown is only needed where the table header is hidden */
.fs-sort {
    display: none;
    flex: 0 1 auto;
    min-height: 42px;
    padding: 8px 10px;
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
}

/* ---------- breadcrumbs ---------- */

.fs-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0 0 14px;
    padding: 9px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13.5px;
    box-shadow: var(--shadow);
}

.fs-crumbs a {
    color: var(--accent);
    text-decoration: none;
    padding: 3px 6px;
    border-radius: 6px;
}

.fs-crumbs a:hover { background: var(--accent-soft); }

.fs-crumbs .sep { color: var(--muted); opacity: .6; }

.fs-crumbs [aria-current] { color: var(--muted); padding: 3px 6px; }

/* ---------- toolbar ---------- */

.fs-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.fs-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 160px;
}

.fs-search input {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px 10px 36px;
    font: inherit;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s, box-shadow .15s;
}

.fs-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.fs-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.fs-stat {
    color: var(--muted);
    font-size: 13px;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---------- table ---------- */

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

table.fs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
}

.fs-table th {
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.fs-table th.no-sort { cursor: default; }

.fs-table th .arrow { opacity: .35; font-size: 11px; }

.fs-table th[data-dir="asc"] .arrow,
.fs-table th[data-dir="desc"] .arrow { opacity: 1; color: var(--accent); }

.fs-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.fs-table tbody tr:last-child td { border-bottom: none; }

@media (hover: hover) {
    .fs-table tbody tr:hover { background: var(--hover); }
}

.fs-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.fs-name a {
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fs-name a:hover { color: var(--accent); text-decoration: underline; }

.fs-table tr.is-dir .fs-name a { font-weight: 600; }

.fs-ico {
    flex: none;
    width: 22px;
    text-align: center;
    font-size: 17px;
    line-height: 1;
}

.fs-size,
.fs-date {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fs-size { text-align: right; }

.fs-col-size { width: 130px; }
.fs-col-date { width: 180px; }
.fs-col-act  { width: 68px; }

.fs-copy {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s, color .12s, border-color .12s;
}

.fs-table tbody tr:hover .fs-copy,
.fs-copy:focus { opacity: 1; }

.fs-copy:hover { color: var(--accent); border-color: var(--accent); }

.fs-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--muted);
}

.fs-foot {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
}

.fs-foot code {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* plain listing fallback keeps working if js is disabled */
body > pre {
    max-width: 1080px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
body > pre a { color: var(--accent); }

/* =========================================================================
   tablet
   ========================================================================= */

@media (max-width: 820px) {
    :root { --gutter: 16px; }

    .fs-col-date { width: 150px; }
    .fs-table th, .fs-table td { padding-left: 14px; padding-right: 14px; }
}

/* =========================================================================
   phone - the table becomes a touch friendly card list
   ========================================================================= */

@media (max-width: 640px) {
    :root { --gutter: 12px; --radius: 12px; }

    body { padding-top: 16px; font-size: 15.5px; }

    /* 16px keeps iOS Safari from zooming when the search box is focused */
    .fs-search input { font-size: 16px; min-height: var(--tap); }

    .fs-head { margin-bottom: 10px; gap: 4px 10px; }
    .fs-brand { font-size: 17px; }
    .fs-brand svg { width: 24px; height: 24px; }
    .fs-head .fs-host { font-size: 12.5px; }

    .fs-sort { display: block; min-height: var(--tap); }

    /* one scrolling row instead of wrapping into many lines */
    .fs-crumbs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 10px;
        font-size: 13px;
        padding: 7px 10px;
    }
    .fs-crumbs::-webkit-scrollbar { display: none; }
    .fs-crumbs a, .fs-crumbs [aria-current] { flex: none; }

    .fs-tools {
        position: sticky;
        top: 0;
        z-index: 5;
        gap: 8px;
        margin: 0 calc(var(--gutter) * -1) 10px;
        padding: 10px var(--gutter) 8px;
        background: color-mix(in srgb, var(--bg) 90%, transparent);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
    }

    .fs-stat { margin-left: 0; width: 100%; font-size: 12.5px; }

    table.fs-table { font-size: 15px; display: block; }
    .fs-table thead { display: none; }        /* no header row on phones */
    .fs-table tbody { display: block; }

    .fs-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 10px;
        min-height: var(--tap);
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
    }
    .fs-table tbody tr:last-child { border-bottom: none; }

    .fs-table td {
        display: block;
        padding: 0;
        border: 0;
        width: auto;
    }

    /* line 1: icon + name, line 2: size / date / copy */
    .fs-table td:nth-child(1) { flex: 1 1 100%; min-width: 0; }
    .fs-table td:nth-child(2) { flex: none; order: 2; padding-left: 32px; }
    .fs-table td:nth-child(3) { flex: 0 1 auto; order: 3; }
    .fs-table td:nth-child(4) { flex: none; order: 4; margin-left: auto; }

    .fs-name { gap: 9px; }
    .fs-name a { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }

    .fs-size, .fs-date { font-size: 12.5px; text-align: left; }

    .fs-copy {
        opacity: 1;
        min-height: 32px;
        padding: 5px 12px;
        font-size: 13px;
    }

    .fs-foot { font-size: 12px; margin-top: 14px; text-align: left; }
    .fs-empty { padding: 36px 16px; }
}

/* =========================================================================
   small phone
   ========================================================================= */

@media (max-width: 400px) {
    .fs-table td:nth-child(3) { display: none; }   /* keep size, drop date */
    .fs-name a { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
