/* ===== Variables ===== */
:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-primary: #0dbd8b;
    --color-primary-hover: #0a9e75;
    --color-border: #e5e7eb;
    --color-row-hover: #f0fdf4;
    --color-row-alt: #fafbfc;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --max-width: 1200px;
    --radius: 6px;
}

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

/* ===== Base ===== */
html {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* ===== Header ===== */
header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 16px;
}

.logo:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.logo img {
    display: block;
}

nav {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

/* ===== Main ===== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    width: 100%;
    flex: 1;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

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

.breadcrumb .sep {
    margin: 0 4px;
    color: var(--color-text-muted);
}

h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-text);
}

/* ===== Table ===== */
.table-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: var(--color-bg);
    text-align: left;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

td {
    padding: 8px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

tbody tr:nth-child(even) {
    background: var(--color-row-alt);
}

tbody tr:hover {
    background: var(--color-row-hover);
}

/* Column widths */
.col-name { width: auto; }
.col-size { width: 110px; }
.col-date { width: 170px; }
.col-hash { width: 220px; }

/* File name column */
td.name {
    word-break: break-all;
}

td.name a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

td.name .icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    font-size: 15px;
    line-height: 1;
}

/* Size & date columns */
td.size,
td.date {
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
    color: var(--color-text-muted);
}

td.size {
    text-align: right;
}

/* Hash column */
td.hash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
    position: relative;
}

td.hash .hash-text {
    cursor: default;
}

td.hash .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity 0.15s;
    vertical-align: middle;
}

td.hash .copy-btn::before {
    content: '\2398';
    font-size: 14px;
}

td.hash .copy-btn.copied::before {
    content: '\2713';
    color: var(--color-primary);
}

td.hash .copy-btn.copied {
    opacity: 1;
}

tr:hover td.hash .copy-btn {
    opacity: 1;
}

td.hash .copy-btn:hover {
    background: var(--color-border);
}

/* Empty/placeholder cells */
td.empty {
    color: var(--color-border);
    font-family: var(--font-mono);
    font-size: 13px;
}

/* Parent directory row */
tr.parent td.name a {
    font-weight: 500;
}

/* Directory rows */
tr.dir td.name a {
    font-weight: 500;
}

/* ===== Summary ===== */
.summary {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ===== Footer ===== */
footer {
    border-top: 1px solid var(--color-border);
    padding: 20px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
    }

    main {
        padding: 16px;
    }

    nav {
        gap: 16px;
    }

    .col-hash,
    td.hash,
    th:nth-child(4) {
        display: none;
    }

    .col-date,
    td.date,
    th:nth-child(3) {
        display: none;
    }

    td, th {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .logo span {
        display: none;
    }

    nav {
        gap: 12px;
        font-size: 13px;
    }
}
