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

:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --border: #e7e7e9;
    --text: #17171a;
    --text-soft: #6b6b70;
    --accent: #17171a;
    --accent-soft: #f2f2f3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 6px 20px rgba(0,0,0,0.08);
}

html[data-theme="dark"] {
    --bg: #121214;
    --surface: #1b1b1e;
    --border: #2c2c30;
    --text: #f5f5f6;
    --text-soft: #9a9aa0;
    --accent: #f5f5f6;
    --accent-soft: #27272b;
    --shadow: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-hover: 0 6px 24px rgba(0,0,0,0.45);
}

html[data-theme="dark"] .brand-icon svg,
html[data-theme="dark"] .card:hover .card-icon svg,
html[data-theme="dark"] .file-row:hover .dl-btn svg {
    color: #121214;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    transition: background 0.25s ease, color 0.25s ease;
}

.wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

header.top {
    padding: 40px 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeDown 0.5s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}

.brand .brand-icon {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand .brand-icon svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.searchbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 14px;
    width: 240px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.25s ease;
}

.theme-toggle {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.25s ease, transform 0.15s ease;
}

.theme-toggle:hover {
    border-color: #d8d8db;
    transform: translateY(-1px);
}

.theme-toggle:active {
    transform: translateY(0) scale(0.94);
}

.theme-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: opacity 0.25s ease, transform 0.35s ease;
}

.theme-icon svg {
    width: 18px;
    height: 18px;
}

.theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon-moon {
    opacity: 0;
    transform: rotate(-60deg) scale(0.6);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
    transform: rotate(60deg) scale(0.6);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.searchbox:focus-within {
    border-color: #c9c9cc;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.searchbox svg {
    width: 16px;
    height: 16px;
    color: var(--text-soft);
    flex-shrink: 0;
}

.searchbox input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    color: var(--text);
    font-family: inherit;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    animation: fadeUp 0.5s ease;
}

.page-subtitle {
    color: var(--text-soft);
    font-size: 14px;
    margin-bottom: 28px;
    animation: fadeUp 0.5s ease;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-soft);
    animation: fadeUp 0.5s ease;
}

.breadcrumbs a {
    color: var(--text-soft);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.breadcrumbs a:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.breadcrumbs svg {
    width: 14px;
    height: 14px;
}

.breadcrumbs .sep svg {
    width: 12px;
    height: 12px;
    color: #c7c7ca;
}

.breadcrumbs .current {
    padding: 4px 8px;
    color: var(--text);
    font-weight: 600;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.25s ease;
    opacity: 0;
    animation: cardIn 0.45s ease forwards;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #d8d8db;
}

.card:active {
    transform: translateY(-1px) scale(0.99);
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.card:hover .card-icon {
    background: var(--accent);
}

.card:hover .card-icon svg {
    color: #fff;
}

.card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--text);
    transition: color 0.2s ease;
}

.card-name {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    line-height: 1.3;
    word-break: break-word;
}

.card-meta {
    font-size: 12.5px;
    color: var(--text-soft);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.25s ease;
    opacity: 0;
    animation: rowIn 0.4s ease forwards;
}

.file-row:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-hover);
    border-color: #d8d8db;
}

.file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 2px;
}

.dl-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease;
}

.file-row:hover .dl-btn {
    background: var(--accent);
    transform: scale(1.06);
}

.file-row:hover .dl-btn svg {
    color: #fff;
}

.dl-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text);
    transition: color 0.18s ease;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 20px;
    color: var(--text-soft);
    text-align: center;
    animation: fadeUp 0.5s ease;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: #d3d3d6;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
}

footer.foot {
    text-align: center;
    color: var(--text-soft);
    font-size: 12.5px;
    padding-top: 50px;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rowIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
    header.top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-controls {
        width: 100%;
    }
    .searchbox {
        width: 100%;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
