:root {
    color-scheme: dark;
    --bg: #0F111A;
    --card-bg: #171a26;
    --card-border: #262a3a;
    --text: #ffffff;
    --text-dim: #9aa0b4;
    --accent: #FFB74D;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding: 40px 20px 60px;
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 2rem;
}

.page-header p {
    margin: 0;
    color: var(--text-dim);
}

.toolbar {
    max-width: 480px;
    margin: 0 auto 32px;
}

#search {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 1rem;
}

#search:focus {
    outline: none;
    border-color: var(--accent);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.empty {
    text-align: center;
    color: var(--text-dim);
    grid-column: 1 / -1;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: 999px;
    background: #333;
    color: #fff;
}

.badge.type-android { background: #1b3d2f; color: #7CDB9C; }
.badge.type-windows { background: #14304d; color: #6FB1FF; }
.badge.type-mac     { background: #3a3540; color: #C9B8FF; }
.badge.type-archive { background: #3d3115; color: var(--accent); }
.badge.type-doc     { background: #402a2a; color: #FF9E9E; }
.badge.type-default { background: #2a2d3d; color: var(--text-dim); }

.version {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.card h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.desc {
    margin: 0 0 16px;
    color: var(--text-dim);
    font-size: 0.9rem;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.download-btn {
    display: block;
    text-align: center;
    background: var(--accent);
    color: #000;
    text-decoration: none;
    font-weight: 700;
    padding: 12px;
    border-radius: 10px;
    transition: opacity 0.15s;
}

.download-btn:hover {
    opacity: 0.85;
}

.page-footer {
    text-align: center;
    margin-top: 50px;
    color: var(--text-dim);
    font-size: 0.85rem;
}
