@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;600&display=swap');

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

body {
    min-width: 320px;
    color: #2d3436;
    background: #f0f0f0;
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

#wrap {
    max-width: 960px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden;
}

header {
    padding: 1.5rem 2rem 1.2rem;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3436;
    letter-spacing: -0.01em;
}

header p {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

main {
    padding: 0 2rem;
}

/* autoindex 產出的 h1 "Index of /path/" */
main h1 {
    font-size: 0.85rem;
    font-weight: 400;
    color: #999;
    padding: 1rem 0 0.4rem;
    font-family: 'IBM Plex Mono', monospace;
}

main hr {
    border: none;
    border-top: 1px solid #eee;
}

main pre {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88rem;
    line-height: 2;
    overflow-x: auto;
    padding: 0.3rem 0;
    color: #555;
}

main pre a {
    color: #1a5276;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 2px;
}

main pre a:hover {
    color: #000;
    background: #f5f5f5;
}

/* 資料夾圖示 */
main pre a[href$="/"]::before {
    content: "\1F4C1 ";
    font-style: normal;
}

/* 檔案圖示 — 依副檔名 */
main pre a:not([href$="/"])::before {
    content: "\1F4C4 ";
    font-style: normal;
}
main pre a[href$=".md"]::before { content: "\1F4DD "; }
main pre a[href$=".json"]::before { content: "\1F4CA "; }
main pre a[href$=".geojson"]::before { content: "\1F30D "; }
main pre a[href$=".csv"]::before { content: "\1F4CA "; }
main pre a[href$=".png"]::before,
main pre a[href$=".jpg"]::before,
main pre a[href$=".jpeg"]::before,
main pre a[href$=".webp"]::before { content: "\1F5BC "; }
main pre a[href$=".html"]::before { content: "\1F310 "; }
main pre a[href$=".txt"]::before { content: "\1F4C3 "; }
main pre a[href$=".zip"]::before { content: "\1F4E6 "; }
main pre a[href$=".xml"]::before { content: "\1F4C4 "; }
main pre a[href$=".js"]::before { content: "\26A1 "; }
main pre a[href$=".css"]::before { content: "\1F3A8 "; }
main pre a[href="../"]::before { content: "\2B06 "; }

footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #aaa;
}

footer a {
    color: #888;
    text-decoration: none;
}

footer a:hover {
    color: #555;
    text-decoration: underline;
}

@media (max-width: 640px) {
    #wrap { margin: 0; border-radius: 0; }
    header, main, footer { padding-left: 1rem; padding-right: 1rem; }
    main pre { font-size: 0.78rem; line-height: 1.8; }
}
