:root {
    color-scheme: dark;

    --background: #0d1117;
    --surface: #161b22;
    --surface-hover: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
    color: var(--text);
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

/* Header */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 36px 0 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
}

.header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.lang {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
}

.lang button {
    min-width: 38px;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang button:hover {
    color: var(--text);
}

.lang button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--background);
}

.lang button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Card */

.card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    color: var(--accent);
}

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

/* FancyIndex table */

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    height: 42px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
}

th a {
    color: inherit;
}

td {
    height: 52px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.65);
}

tr:last-child td {
    border-bottom: 0;
}

tr:hover td {
    background: var(--surface-hover);
}

td:first-child {
    word-break: break-all;
}

td:first-child a {
    font-weight: 500;
}

td a[href$="/"] {
    color: var(--accent);
}

td a[href$="/"]:hover {
    color: var(--accent-hover);
}

td a[href="../"] {
    color: var(--muted);
}

/* Footer */

footer {
    display: flex;
    justify-content: space-between;
    padding: 22px 4px 32px;
    color: var(--muted);
    font-size: 12px;
}

/* Mobile */

@media (max-width: 700px) {
    .container {
        width: calc(100% - 20px);
    }

    .header {
        padding: 24px 0 18px;
    }

    .header h1 {
        font-size: 18px;
    }

    .logo {
        width: 42px;
        height: 42px;
    }

    th,
    td {
        padding: 0 12px;
    }

    /* Hide the size column */
    th:nth-child(2),
    td:nth-child(2) {
        display: none;
    }

    footer {
        flex-direction: column;
        gap: 6px;
    }
}