:root {
    --mario-red: #E60012;
    --mario-blue: #0047BB;
    --mario-brown: #B85C38;
    --mario-gold: #FFD700;
    --mario-green: #43B047;
    --mario-sky: #5C94FC;
    --text-dark: #1A1A1A;
    --text-light: #FFFFFF;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'ZCOOL KuaiLe', cursive, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(180deg, #5C94FC 0%, #87CEEB 60%, #B8E6F0 100%);
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.loading, .error-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 18px;
    text-align: center;
    max-width: 80vw;
}

.loading {
    background: var(--mario-gold);
    color: var(--text-dark);
    border: 3px solid var(--text-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.error-box {
    display: none;
    background: var(--mario-red);
    color: white;
    border: 3px solid white;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
}

.error-box.show {
    display: block;
}

/* 个人信息卡片 */
.profile-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    z-index: 10;
    width: min(420px, 90vw);
    padding: 36px 32px;
    text-align: center;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 4px solid var(--mario-red);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 0 4px rgba(255, 255, 255, 0.6),
        0 0 0 6px var(--mario-gold);
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.profile-card.show {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mario-red) 50%, var(--mario-blue) 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    border: 4px solid var(--mario-gold);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.coin-badge {
    position: absolute;
    bottom: -4px;
    right: -8px;
    background: var(--mario-gold);
    color: var(--text-dark);
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 2px solid var(--text-dark);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.name {
    font-size: 36px;
    margin-bottom: 6px;
    color: var(--mario-red);
    text-shadow: 2px 2px 0px var(--mario-gold);
}

.title {
    font-size: 18px;
    color: var(--mario-blue);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mario-gold);
    color: var(--text-dark);
    font-size: 13px;
    border-radius: 16px;
    border: 2px solid var(--text-dark);
    box-shadow: 0 3px 0 #C58E00;
    transition: transform 0.15s ease;
}

.tag:hover {
    transform: translateY(-2px) scale(1.05);
}

.bio {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 24px;
    padding: 0 8px;
}

/* 掘金链接按钮 */
.juejin-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(180deg, var(--mario-gold) 0%, #F4B400 100%);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 50px;
    border: 3px solid var(--text-dark);
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 6px 0 #C58E00, 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.juejin-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 9px 0 #C58E00, 0 14px 28px rgba(0, 0, 0, 0.25);
}

.juejin-link:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #C58E00, 0 4px 8px rgba(0, 0, 0, 0.2);
}

.coin-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #FFED4A, var(--mario-gold));
    border: 2px solid #C58E00;
    display: inline-block;
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* HUD */
.hud {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 20;
    display: flex;
    gap: 24px;
    color: var(--text-light);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hud-label {
    font-size: 12px;
    opacity: 0.9;
}

.hud-value {
    font-size: 22px;
    font-weight: bold;
}

/* 技能标签彩蛋 */
.skill-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    padding: 16px 28px;
    background: var(--mario-gold);
    color: var(--text-dark);
    font-size: 24px;
    border-radius: 12px;
    border: 4px solid var(--text-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.skill-popup.show {
    opacity: 1;
    transform: translate(-50%, -120%);
    animation: popupBounce 0.6s ease;
}

@keyframes popupBounce {
    0% { transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -130%) scale(1.1); }
    100% { transform: translate(-50%, -120%) scale(1); }
}

/* 响应式 */
@media (max-width: 640px) {
    .profile-card {
        padding: 28px 22px;
    }
    .name {
        font-size: 28px;
    }
    .title {
        font-size: 15px;
    }
    .bio {
        font-size: 13px;
    }
    .juejin-link {
        font-size: 16px;
        padding: 12px 22px;
    }
    .hud {
        top: 16px;
        left: 16px;
        gap: 16px;
    }
    .hud-value {
        font-size: 18px;
    }
}
