:root {
    --bg-deep: #05070f;
    --card-bg: rgba(13, 18, 36, 0.55);
    --card-border: rgba(120, 150, 255, 0.14);
    --text-main: #e6ecff;
    --text-dim: #8a93b8;
    --accent: #7aa2ff;
    --accent-2: #b48cff;
}

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

html {
    scrollbar-width: none;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
    display: none;
}

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 20% -10%, #16204a 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, #231543 0%, transparent 50%),
        var(--bg-deep);
    color: var(--text-main);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    overflow-x: hidden;
}

/* ---------- 星空 ---------- */
#stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ---------- 顶部 ---------- */
header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 8px;
}

.avatar-link {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(122, 162, 255, 0.45);
    box-shadow: 0 0 18px rgba(122, 162, 255, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.avatar-link:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 0 26px rgba(180, 140, 255, 0.6);
}

.avatar-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-info h1 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(90deg, #cfe0ff, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-info p {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 3px;
}

/* ---------- 搜索 ---------- */
.search-wrap {
    position: relative;
    z-index: 2;
    max-width: 520px;
    margin: 22px auto 0;
    padding: 0 24px;
}

#search {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(10, 14, 30, 0.65);
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    backdrop-filter: blur(8px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#search:focus {
    border-color: rgba(122, 162, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.12);
}

#search::placeholder {
    color: #5a6488;
}

.search-wrap .icon {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a6488;
    pointer-events: none;
}

/* ---------- 分类与卡片 ---------- */
main {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 24px 80px;
}

.category {
    margin-top: 38px;
}

.category h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}

.category h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--card-border), transparent);
}

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

.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 8px 14px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-main);
    backdrop-filter: blur(6px);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(122, 162, 255, 0.55);
    box-shadow: 0 10px 28px -8px rgba(80, 120, 255, 0.4);
}

.card img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.06);
    padding: 5px;
}

.card .name {
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.3;
    word-break: break-all;
}

.card.hidden,
.category.hidden {
    display: none;
}

.empty {
    text-align: center;
    color: var(--text-dim);
    padding: 80px 0;
    display: none;
}

.empty.show {
    display: block;
}
