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

html,
body {
    min-height: 100%;
    background: #020712;
    color: #edf3ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* 3D WebGL Canvas Scene Container */
.home-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.home-scene canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Secret Entry Hidden on the Moon */
.secret-entry {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10;
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, opacity 0.2s ease;
    text-decoration: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.secret-entry:hover,
.secret-entry:focus-visible {
    transform: translate(-50%, -50%) scale(1.06);
    opacity: 0.12; /* Subtle feedback when hovering/clicking */
}

.secret-entry img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    opacity: 0;
    border: 0;
}

/* 被"揪出来"的幽灵图 (拖拽时跟随光标) */
.secret-entry-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    border-radius: 999px;
    object-fit: cover;
    opacity: 0.8;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 14px 30px rgba(2, 6, 23, 0.55));
    animation: secret-ghost-in 0.18s ease-out;
}

@keyframes secret-ghost-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.72);
    }
    to {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }
}

body.secret-dragging,
body.secret-dragging * {
    cursor: grabbing !important;
}

/* Main UI Shell */
.home-shell {
    position: relative;
    z-index: 1;
    width: min(1260px, calc(100vw - 28px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 20px 0 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Navigation Card Showcase Section */
.home-preview {
    position: absolute;
    left: clamp(128px, 11vw, 184px);
    bottom: clamp(34px, 5dvh, 58px);
    width: min(calc(100% - clamp(128px, 11vw, 184px)), 948px);
    margin: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 220px));
    gap: 18px;
    justify-content: start;
}

/* Soft Light Glassmorphism Card Link (纯粉蓝柔光玻璃) */
.card-item {
    position: relative;
    display: block;
    padding: 9px;
    aspect-ratio: 6 / 4;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 36px;
    background: linear-gradient(
        135deg,
        rgba(186, 230, 253, 0.14) 0%,
        rgba(255, 255, 255, 0.07) 45%,
        rgba(56, 189, 248, 0.12) 100%
    );
    box-shadow:
        0 12px 28px rgba(2, 6, 23, 0.35),
        0 0 14px rgba(56, 189, 248, 0.1),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.6),
        inset 0 0 8px rgba(186, 230, 253, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    transition: opacity 0.28s ease,
                visibility 0.28s ease,
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                background 0.3s ease;
}

/* 卡片默认隐藏，点击月亮切换显示 */
.home-grid.is-cards-hidden .card-item {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.96);
}

/* 鼠标悬停：温润明亮的粉蓝柔光泛起与微升 */
.card-item:hover,
.card-item:focus-visible {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(224, 242, 254, 0.65);
    background: linear-gradient(
        135deg,
        rgba(186, 230, 253, 0.24) 0%,
        rgba(255, 255, 255, 0.14) 45%,
        rgba(56, 189, 248, 0.22) 100%
    );
    box-shadow:
        0 20px 42px rgba(2, 6, 23, 0.48),
        0 0 28px rgba(56, 189, 248, 0.36),
        0 0 14px rgba(186, 230, 253, 0.45),
        inset 0 1px 1.5px rgba(255, 255, 255, 0.85),
        inset 0 0 12px rgba(186, 230, 253, 0.16);
}

.card-item:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.8);
    outline-offset: 4px;
}

/* 背部微弱粉蓝环境光晕 (微扩范围) */
.card-item::before {
    content: "";
    position: absolute;
    inset: -8px;
    z-index: -1;
    border-radius: 46px;
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.18), transparent 65%);
    filter: blur(14px);
    opacity: 0.55;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.card-item:hover::before,
.card-item:focus-visible::before {
    opacity: 0.9;
    filter: blur(20px);
    transform: scale(1.07);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(56, 189, 248, 0.42),
        rgba(186, 230, 253, 0.2) 48%,
        transparent 72%
    );
}

.card-media {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* 覆盖在图片上层的清透粉蓝柔光玻璃薄膜 */
.card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(186, 230, 253, 0.04) 35%,
        transparent 55%,
        rgba(56, 189, 248, 0.08) 100%
    );
    transition: opacity 0.3s ease, background 0.3s ease;
}

.card-item:hover .card-media::after {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(186, 230, 253, 0.1) 35%,
        transparent 55%,
        rgba(56, 189, 248, 0.15) 100%
    );
}

.card-cover {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 28px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-item:hover .card-cover {
    transform: scale(1.03);
}
/* Empty state */
.home-empty {
    padding: 28px 0;
    text-align: center;
    color: #d4def3;
}

/* Responsive Media Queries */
@media (max-width: 980px) {
    .home-preview {
        left: clamp(24px, 7vw, 48px);
        bottom: clamp(28px, 4.5dvh, 48px);
        width: min(calc(100% - clamp(24px, 7vw, 48px)), 948px);
    }

    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 220px));
        gap: 16px;
    }
}

@media (max-width: 640px) {
    .home-shell {
        width: min(100vw - 18px, 1260px);
        padding-top: 16px;
    }

    .home-preview {
        position: fixed;
        left: 10px;
        right: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
        width: min(calc(100vw - 20px), 340px);
        transform: none;
        z-index: 4;
    }

    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 158px));
        gap: 12px;
        justify-content: center;
        width: 100%;
    }

    .card-item {
        border-radius: 30px;
        padding: 8px;
    }

    .card-media,
    .card-cover {
        border-radius: 22px;
    }
}
