/* ============================================================
   星河赞助图鉴 (Galaxy Sponsor Atlas) - 前台样式 2.0
   每一位赞助者都是点亮本站的一颗星
   四阶星河：恒星之座 / 行星带 / 星云带 / 星尘墙
   - 动态深空背景与 3D 视差
   - 恒星日冕脉冲与光晕呼吸
   - 全息玻璃质感与科幻悬浮名片
   ============================================================ */

/* ===== 深空配色与变量 ===== */
.galaxy-atlas {
    --gx-core-1: #fbbf24;
    --gx-core-2: #cbd5e1;
    --gx-core-3: #f59e0b;
    --gx-orbit:   #818cf8;
    --gx-nebula:  #38bdf8;
    --gx-dust:    #94a3b8;
    --gx-text:    #e8edf6;
    --gx-muted:   #8b95ad;
    --gx-line:    rgba(129,140,248,0.35);
    --gx-panel:   rgba(15,21,48,0.92);
    --gx-border:  rgba(99,102,241,0.18);
    position: relative;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    color: #1e293b;
    overflow: hidden;
}

.io-black-mode .galaxy-atlas {
    --gx-panel:   rgba(15,21,48,0.88);
    --gx-border:  rgba(129,140,248,0.22);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(99,102,241,0.2), transparent 60%),
        radial-gradient(900px 500px at 85% 30%, rgba(245,158,11,0.12), transparent 60%),
        linear-gradient(180deg, #0a0e1f 0%, #05060f 100%);
    color: var(--gx-text);
}

/* ===== 控制台 ===== */
.galaxy-controls {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--gx-border);
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.io-black-mode .galaxy-controls {
    background: linear-gradient(180deg, rgba(10,14,31,0.92), rgba(10,14,31,0.5));
}
.galaxy-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}
.galaxy-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 14px 9px 36px;
    border-radius: 999px;
    border: 1px solid var(--gx-border);
    background: rgba(99,102,241,0.06);
    color: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .25s, background .25s, box-shadow .25s;
}
.galaxy-search input::placeholder { color: #94a3b8; }
.galaxy-search input:focus {
    border-color: var(--gx-orbit);
    background: rgba(99,102,241,0.12);
    box-shadow: 0 0 12px rgba(129,140,248,0.3);
}
.io-black-mode .galaxy-search input { background: rgba(255,255,255,0.05); color: var(--gx-text); }
.io-black-mode .galaxy-search input::placeholder { color: var(--gx-muted); }
.io-black-mode .galaxy-search input:focus { background: rgba(129,140,248,0.1); }
.galaxy-search .gs-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; pointer-events: none;
}
.io-black-mode .galaxy-search .gs-icon { color: var(--gx-muted); }

.galaxy-timeline {
    display: flex; align-items: center; gap: 10px;
    flex: 1 1 260px; min-width: 0;
}
.galaxy-timeline .gt-label { font-size: 12px; color: #64748b; white-space: nowrap; }
.io-black-mode .galaxy-timeline .gt-label { color: var(--gx-muted); }
.galaxy-timeline input[type=range] {
    flex: 1; min-width: 60px;
    -webkit-appearance: none; appearance: none;
    height: 4px; border-radius: 999px;
    background: linear-gradient(90deg, var(--gx-orbit), var(--gx-core-1));
    outline: none; cursor: pointer;
}
.galaxy-timeline input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff;
    border: 2px solid var(--gx-core-1);
    box-shadow: 0 0 8px rgba(251,191,36,0.8);
    cursor: pointer;
    transition: transform .15s;
}
.galaxy-timeline input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}
.galaxy-timeline .gt-date { font-size: 12px; color: #1e293b; white-space: nowrap; min-width: 80px; text-align: right; }
.io-black-mode .galaxy-timeline .gt-date { color: var(--gx-text); }

.galaxy-legend {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px; color: #64748b;
    white-space: nowrap;
}
.io-black-mode .galaxy-legend { color: var(--gx-muted); }
.galaxy-legend .lg-item { display: inline-flex; align-items: center; gap: 5px; }
.galaxy-legend .lg-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.galaxy-legend .lg-dot.c1 { background: var(--gx-core-1); box-shadow: 0 0 6px var(--gx-core-1); }
.galaxy-legend .lg-dot.c2 { background: var(--gx-orbit);  box-shadow: 0 0 6px var(--gx-orbit); }
.galaxy-legend .lg-dot.c3 { background: var(--gx-nebula); box-shadow: 0 0 6px var(--gx-nebula); }
.galaxy-legend .lg-dot.c4 { background: var(--gx-dust); }

/* ===== 3D 星河舞台（全景深空视界） ===== */
.galaxy-stage {
    position: relative;
    width: 100%;
    min-height: 560px;
    overflow: hidden;
    margin: 14px 0 0;
    border-radius: 20px;
    border: 1px solid rgba(129,140,248,0.25);
    background:
        radial-gradient(1000px 500px at 50% 25%, rgba(99,102,241,0.22), transparent 70%),
        radial-gradient(800px 400px at 80% 40%, rgba(245,158,11,0.14), transparent 60%),
        linear-gradient(180deg, #090d1f 0%, #03040a 100%);
    box-shadow: 0 12px 36px rgba(10,14,31,0.3);
    transform-style: preserve-3d;
    transition: box-shadow .3s ease;
}
.io-black-mode .galaxy-stage {
    border-color: rgba(129,140,248,0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

#galaxy-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 宇宙星层容器：铺满整个星河舞台 */
#galaxy-core,
#galaxy-orbit,
#galaxy-nebula {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
#galaxy-core .gstar,
#galaxy-orbit .gstar,
#galaxy-nebula .gstar {
    pointer-events: auto;
}

/* ===== 动态星点核心 (DOM) ===== */
.gstar {
    position: absolute;
    z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
    transition: transform .35s cubic-bezier(0.2,0.8,0.2,1), opacity .3s ease, filter .3s ease;
    will-change: transform;
}
.gstar-core {
    position: relative;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* 日冕光晕脉动 */
.gstar-glow {
    position: absolute; inset: -50%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--star-color, var(--gx-orbit)) 0%, rgba(99,102,241,0.2) 45%, transparent 70%);
    opacity: 0.6;
    z-index: -1;
    animation: gx-corona-pulse 3.5s ease-in-out infinite;
}

/* 轨道微光外环 */
.gstar-ring {
    position: absolute; inset: -14px;
    border-radius: 50%;
    border: 1px dashed var(--star-color, var(--gx-orbit));
    opacity: 0.35;
    animation: gx-orbit-spin 18s linear infinite;
    pointer-events: none;
}

.gstar-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--star-color, var(--gx-orbit));
    box-shadow: 0 0 14px var(--star-color, var(--gx-orbit));
    background: rgba(15,21,48,0.9);
}
.gstar-avatar.placeholder {
    display: flex; align-items: center; justify-content: center;
    font-size: 65%; color: var(--gx-muted);
    background: rgba(255,255,255,0.08);
}
.gstar-rank {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px;
    background: var(--gx-panel);
    border: 1px solid var(--star-color, var(--gx-orbit));
    color: var(--gx-text);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.gstar-label {
    margin-top: 6px;
    font-size: 11px; font-weight: 600;
    color: #f1f5f9;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 10px rgba(99,102,241,0.4);
    max-width: 100px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: center;
}

.gstar:hover {
    transform: translate(-50%,-50%) scale(1.15) !important;
    z-index: 20;
}
.gstar:hover .gstar-glow {
    opacity: 0.95;
    inset: -65%;
}
.gstar:hover .gstar-ring {
    opacity: 0.8;
    animation-duration: 6s;
}

/* 恒星之座 (Top 1-3) 耀阳特效 */
.gstar.tier-core { animation: gx-float-slow 5s ease-in-out infinite; }
.gstar.tier-core.rank-1 {
    --star-color: var(--gx-core-1);
    animation-duration: 4s;
}
.gstar.tier-core.rank-1 .gstar-avatar {
    border-width: 3.5px;
    box-shadow: 0 0 28px rgba(251,191,36,0.85), 0 0 60px rgba(245,158,11,0.4);
}
.gstar.tier-core.rank-1 .gstar-glow {
    inset: -75%;
    opacity: 0.9;
    animation-duration: 2.8s;
}
.gstar.tier-core.rank-1::before {
    content: "👑";
    position: absolute; top: -34px;
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(251,191,36,0.9));
    animation: gx-crown-float 3s ease-in-out infinite;
}
.gstar.tier-core.rank-2 { --star-color: var(--gx-core-2); animation-delay: -1.5s; }
.gstar.tier-core.rank-3 { --star-color: var(--gx-core-3); animation-delay: -3s; }
.gstar.tier-core .gstar-label { font-size: 13px; font-weight: 700; }

/* 行星带 (Top 4-10) */
.gstar.tier-orbit {
    --star-color: var(--gx-orbit);
    animation: gx-float-slow 6.5s ease-in-out infinite;
}
.gstar.tier-orbit:nth-child(even) { animation-delay: -2s; }

/* 星云带 (Top 11-50) */
.gstar.tier-nebula {
    --star-color: var(--gx-nebula);
    animation: gx-float-slow 8s ease-in-out infinite;
}
.gstar.tier-nebula .gstar-ring { display: none; }
.gstar.tier-nebula .gstar-label { display: none; }
.gstar.tier-nebula:hover .gstar-label { display: block; }

/* 星尘墙 (51+) */
.galaxy-dust {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    display: flex; flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    padding: 22px 24px 28px;
    background: linear-gradient(180deg, transparent 0%, rgba(5,6,15,0.7) 30%, rgba(3,4,10,0.95) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.galaxy-dust-title {
    position: absolute; top: -2px; left: 0; right: 0;
    text-align: center; font-size: 11px; color: var(--gx-muted);
    letter-spacing: 2px; text-transform: uppercase;
    padding-top: 6px;
}
.gstar.tier-dust {
    position: static;
    --star-color: var(--gx-dust);
    transform: none !important;
}
.gstar.tier-dust .gstar-glow { opacity: 0.35; }
.gstar.tier-dust .gstar-ring { display: none; }
.gstar.tier-dust .gstar-rank { display: none; }
.gstar.tier-dust .gstar-label { display: none; }
.gstar.tier-dust:hover { transform: scale(1.3) !important; }
.gstar.tier-dust:hover .gstar-glow { opacity: 0.9; }

/* 状态样式 */
.gstar.star-match {
    z-index: 25;
    animation: gx-match-pulse 1s ease-in-out infinite;
}
.gstar.star-match .gstar-avatar {
    box-shadow: 0 0 20px #fff, 0 0 36px var(--star-color);
}
.gstar.star-dim { opacity: 0.15; filter: grayscale(0.85); }
.gstar.star-future { opacity: 0.08; filter: grayscale(1); pointer-events: none; }

/* ===== 全息玻璃悬浮名片 ===== */
.galaxy-tooltip {
    position: fixed;
    z-index: 999;
    max-width: 260px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(10, 14, 35, 0.92);
    border: 1px solid rgba(129, 140, 248, 0.35);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 16px rgba(99,102,241,0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #f1f5f9;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
}
.galaxy-tooltip.show { opacity: 1; transform: translateY(0); }
.galaxy-tooltip .tt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.galaxy-tooltip .tt-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    object-fit: cover; border: 1.5px solid var(--gx-orbit);
}
.galaxy-tooltip .tt-avatar.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1); font-size: 16px;
}
.galaxy-tooltip .tt-title { font-size: 14px; font-weight: 700; color: #fff; }
.galaxy-tooltip .tt-rank { font-size: 11px; color: var(--gx-muted); margin-top: 2px; }
.galaxy-tooltip .tt-slogan {
    font-size: 12px; color: #cbd5e1; margin-bottom: 8px;
    line-height: 1.4; word-break: break-word;
}
.galaxy-tooltip .tt-amount { font-size: 15px; font-weight: 800; color: var(--gx-core-1); }
.galaxy-tooltip .tt-meta { font-size: 11px; color: var(--gx-muted); margin-top: 2px; }

/* ===== 全息详情弹窗 ===== */
.galaxy-detail {
    position: fixed; inset: 0;
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(3, 4, 12, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    padding: 16px;
}
.galaxy-detail.show { opacity: 1; visibility: visible; }
.galaxy-detail-card {
    position: relative;
    width: 100%; max-width: 420px;
    padding: 28px 24px 24px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(15,23,55,0.96) 0%, rgba(8,11,28,0.98) 100%);
    border: 1px solid var(--gd-color, var(--gx-orbit));
    box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 32px var(--gd-color, rgba(99,102,241,0.3));
    color: #f1f5f9;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform .3s cubic-bezier(0.2,0.8,0.2,1);
}
.galaxy-detail.show .galaxy-detail-card { transform: scale(1) translateY(0); }
.galaxy-detail-close {
    position: absolute; top: 12px; right: 14px;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: rgba(255,255,255,0.08);
    color: #94a3b8; font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.galaxy-detail-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.galaxy-detail .gd-avatar-wrap {
    width: 80px; height: 80px; margin: 0 auto 14px;
    border-radius: 50%; padding: 3px;
    background: linear-gradient(135deg, var(--gd-color, var(--gx-orbit)), transparent);
}
.galaxy-detail .gd-avatar {
    width: 100%; height: 100%; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--gd-color, var(--gx-orbit));
}
.galaxy-detail .gd-avatar.placeholder {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); font-size: 36px;
}
.galaxy-detail .gd-rank-tag {
    display: inline-block; padding: 3px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--gd-color, var(--gx-orbit));
    color: var(--gd-color, #fff);
    margin-bottom: 10px;
}
.galaxy-detail .gd-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.galaxy-detail .gd-slogan {
    font-size: 13px; color: #cbd5e1; line-height: 1.5;
    margin-bottom: 16px; padding: 0 12px;
}
.galaxy-detail .gd-amount { font-size: 24px; font-weight: 800; color: var(--gd-color, var(--gx-core-1)); margin-bottom: 4px; }
.galaxy-detail .gd-meta { font-size: 12px; color: var(--gx-muted); margin-bottom: 18px; }
.galaxy-detail .gd-visit {
    display: inline-block; padding: 10px 24px; border-radius: 999px;
    background: linear-gradient(135deg, var(--gd-color, var(--gx-orbit)), rgba(99,102,241,0.8));
    color: #fff !important; font-size: 13px; font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: transform .2s, box-shadow .2s;
}
.galaxy-detail .gd-visit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px var(--gd-color, rgba(99,102,241,0.6));
}

/* ===== 核心关键帧动画 ===== */
@keyframes gx-corona-pulse {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

@keyframes gx-orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gx-float-slow {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-6px); }
}

@keyframes gx-crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px) scale(1.08); }
}

@keyframes gx-match-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1.1); filter: brightness(1); }
    50% { transform: translate(-50%, -50%) scale(1.28); filter: brightness(1.4); }
}

/* ===== 移动端响应式 (≤767px) ===== */
@media (max-width: 767px) {
    .galaxy-stage {
        min-height: 440px;
        border-radius: 16px;
        margin: 10px 0 0;
    }
    .galaxy-controls {
        padding: 10px 12px;
        gap: 8px;
    }
    .galaxy-timeline, .galaxy-legend {
        font-size: 11px;
    }
    .galaxy-dust {
        padding: 16px 14px 20px;
        gap: 8px 10px;
    }
    .galaxy-detail-card {
        padding: 22px 18px 20px;
        max-width: 320px;
    }
}