/* ===== 基础重置与变量 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --bg: #FFF9F0;
    --text: #2D3436;
    --text-light: #636E72;
    --white: #FFFFFF;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== 背景装饰形状 ===== */
.background-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    top: 40%;
    right: -80px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    bottom: 20%;
    left: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 350px;
    height: 350px;
    background: #FF9F43;
    bottom: -150px;
    right: 20%;
    animation-delay: -15s;
}

.shape-5 {
    width: 180px;
    height: 180px;
    background: #A8E6CF;
    top: 20%;
    left: 30%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

/* ===== 头部 ===== */
header {
    text-align: center;
    padding: 80px 20px 40px;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bounce-char {
    display: inline-block;
    animation: letterBounce 2s infinite ease-in-out;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bounce-char:nth-child(1) { animation-delay: 0s; }
.bounce-char:nth-child(2) { animation-delay: 0.15s; }
.bounce-char:nth-child(3) { animation-delay: 0.3s; }
.bounce-char:nth-child(4) { animation-delay: 0.45s; }

@keyframes letterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    letter-spacing: 2px;
}

/* ===== 主内容 ===== */
main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero 区域 ===== */
.hero {
    text-align: center;
    padding: 40px 0 60px;
}

.bouncer-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    min-height: 160px;
    align-items: flex-end;
}

.bouncer {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: attr(data-color);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    animation: bounce 1.8s infinite ease-in-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.bouncer:nth-child(1) { animation-delay: 0s; background: #FF6B6B; }
.bouncer:nth-child(2) { animation-delay: 0.3s; background: #4ECDC4; }
.bouncer:nth-child(3) { animation-delay: 0.6s; background: #FFE66D; }
.bouncer:nth-child(4) { animation-delay: 0.9s; background: #95E1D3; }

.bouncer:hover {
    transform: scale(1.1);
}

.bouncer.jumping {
    animation: highJump 0.6s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    40% { transform: translateY(-60px) scale(0.95, 1.05); }
    50% { transform: translateY(-60px) scale(1, 1); }
    90% { transform: translateY(0) scale(1.05, 0.95); }
}

@keyframes highJump {
    0% { transform: translateY(0) scale(1, 1); }
    30% { transform: translateY(-120px) scale(0.9, 1.1); }
    50% { transform: translateY(-120px) scale(1, 1); }
    100% { transform: translateY(0) scale(1, 1); }
}

/* 小球表情 */
.face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.eyes {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.eye {
    width: 14px;
    height: 18px;
    background: var(--text);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.pupil {
    width: 6px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 4px;
}

.mouth {
    width: 20px;
    height: 8px;
    border: 3px solid var(--text);
    border-top: none;
    border-radius: 0 0 20px 20px;
}

.mouth.smile {
    width: 24px;
    height: 12px;
}

.mouth.big-smile {
    width: 28px;
    height: 14px;
    background: var(--text);
}

.hint {
    color: var(--text-light);
    font-size: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ===== 特色卡片 ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.feature-card {
    background: var(--white);
    border-radius: 24px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out backwards;
    animation-delay: var(--delay);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    animation: wiggle 3s infinite ease-in-out;
}

.feature-card:nth-child(1) .icon { animation-delay: 0s; }
.feature-card:nth-child(2) .icon { animation-delay: 1s; }
.feature-card:nth-child(3) .icon { animation-delay: 2s; }

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 游乐场 ===== */
.playground {
    padding: 60px 0 80px;
    text-align: center;
}

.playground h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text);
}

.ground {
    background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 20px;
    height: 250px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    border: 3px solid #A5D6A7;
}

.ground::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #81C784;
    border-radius: 0 0 17px 17px;
}

.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ball-color, var(--primary));
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
    cursor: pointer;
}

.ball::after {
    content: "";
    position: absolute;
    top: 10%;
    left: 20%;
    width: 25%;
    height: 15%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.ball.jumping {
    animation: ballJump 0.7s ease-out;
}

@keyframes ballJump {
    0% { transform: translateX(-50%) translateY(0) scale(1, 1); }
    30% { transform: translateX(-50%) translateY(-140px) scale(0.9, 1.1); }
    50% { transform: translateX(-50%) translateY(-140px) scale(1, 1); }
    75% { transform: translateX(-50%) translateY(0) scale(1.05, 0.95); }
    100% { transform: translateX(-50%) translateY(0) scale(1, 1); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.controls button {
    padding: 14px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--white);
    font-family: inherit;
}

.btn-jump {
    background: linear-gradient(135deg, var(--primary), #EE5A5A);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-color {
    background: linear-gradient(135deg, var(--secondary), #3DBDB4);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.btn-party {
    background: linear-gradient(135deg, #FF9F43, #FF6B6B, #4ECDC4, #FFE66D);
    background-size: 300% 300%;
    animation: rainbow 3s ease infinite;
    box-shadow: 0 4px 15px rgba(255, 159, 67, 0.4);
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.controls button:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

.controls button:active {
    transform: translateY(0) scale(0.98);
}

/* 派对模式 */
body.party-mode .background-shapes .shape {
    animation-duration: 5s;
    opacity: 0.7;
}

body.party-mode .bouncer {
    animation-duration: 0.6s;
}

body.party-mode .feature-card .icon {
    animation-duration: 0.5s;
}

/* ===== 页脚 ===== */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .bouncer-container {
        gap: 16px;
    }
    
    .bouncer {
        width: 70px;
        height: 70px;
    }
    
    .eyes {
        gap: 8px;
    }
    
    .eye {
        width: 10px;
        height: 14px;
    }
    
    .pupil {
        width: 4px;
        height: 6px;
    }
    
    .mouth {
        width: 16px;
        height: 6px;
        border-width: 2px;
    }
    
    .controls button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}
