/* ============================================
   520 妈妈生日快乐 - 样式表
   粉金配色主题
   ============================================ */

/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #fff5e6 50%, #f8e8ff 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   飘落彩带和花瓣容器
   ============================================ */
#falling-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.falling-item {
    position: absolute;
    top: -50px;
    animation: fall linear infinite;
    opacity: 0.8;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* 彩带样式 */
.ribbon {
    width: 10px;
    height: 20px;
    border-radius: 2px;
}

.ribbon.pink {
    background: linear-gradient(45deg, #ff6b9d, #ff8fab);
}

.ribbon.gold {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
}

.ribbon.purple {
    background: linear-gradient(45deg, #d8b4fe, #e8d5f2);
}

/* 花瓣样式 */
.petal {
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, #ffb6c1, #ff69b4);
    border-radius: 50% 0 50% 50%;
    transform: rotate(45deg);
}

/* ============================================
   爱心飘浮效果
   ============================================ */
#floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    font-size: 20px;
    animation: floatUp linear infinite;
    opacity: 0.6;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) scale(0.5) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) scale(1) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   星星闪烁效果
   ============================================ */
#twinkling-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
        box-shadow: 0 0 10px 4px rgba(255, 215, 0, 0.8);
    }
}

/* ============================================
   烟花画布
   ============================================ */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* ============================================
   主内容区
   ============================================ */
.main-container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   开场引导语
   ============================================ */
.intro-hint {
    text-align: center;
    padding: 40px 20px 20px;
    animation: fadeInDown 1s ease-out;
}

.intro-text {
    font-size: 18px;
    color: #ff6b9d;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.scroll-arrow {
    font-size: 24px;
    color: #ff6b9d;
    animation: bounceDown 1.5s ease-in-out infinite;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* ============================================
   开场动画 - 气球
   ============================================ */
.opening-section {
    height: 150px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.balloons {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 50px;
}

.balloon {
    width: 50px;
    height: 60px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    animation: float 3s ease-in-out infinite;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1);
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    width: 1px;
    height: 30px;
    background: #999;
    transform: translateX(-50%);
}

.balloon.pink {
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
    animation-delay: 0s;
}

.balloon.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    animation-delay: 0.5s;
}

.balloon:nth-child(3) { animation-delay: 1s; }
.balloon:nth-child(4) { animation-delay: 1.5s; }
.balloon:nth-child(5) { animation-delay: 2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* ============================================
   主标题区域
   ============================================ */
.title-section {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out;
}

.main-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.number-520 {
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.heart {
    font-size: 3rem;
    animation: heartbeat 1.5s ease-in-out infinite;
    display: inline-block;
}

.birthday-text {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle {
    font-size: 1.3rem;
    color: #888;
    animation: fadeInUp 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   祝福卡片区域
   ============================================ */
.cards-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    perspective: 1000px;
}

.card {
    width: 280px;
    height: 350px;
    cursor: pointer;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* 520卡片正面 */
.love-card .card-front {
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
    color: white;
}

/* 生日卡片正面 */
.birthday-card .card-front {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.card-front h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 卡片背面 */
.card-back {
    transform: rotateY(180deg);
    background: white;
    color: #333;
}

.love-card .card-back {
    border: 3px solid #ff6b9d;
}

.birthday-card .card-back {
    border: 3px solid #ffd700;
}

.card-back h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #ff6b9d;
}

.birthday-card .card-back h3 {
    color: #ff8c00;
}

.card-back .message {
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
    color: #555;
}

/* ============================================
   互动蛋糕区域 - 新版精美蛋糕
   ============================================ */
.cake-section {
    text-align: center;
    margin-bottom: 50px;
}

.cake-section h2 {
    font-size: 1.8rem;
    color: #ff6b9d;
    margin-bottom: 30px;
}

.cake-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 20px;
}

.cake-container:hover {
    transform: scale(1.05);
}

/* 蜡烛行 - 在最上面 */
.candles-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
    z-index: 10;
}

/* 新蜡烛样式 */
.candle-new {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.candle-body {
    width: 14px;
    height: 40px;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff8e8e 50%, #ff6b6b 100%);
    border-radius: 3px;
    position: relative;
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.1);
}

.candle-body::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

/* 新火焰样式 */
.flame-new {
    width: 16px;
    height: 24px;
    background: radial-gradient(ellipse at center, #ffff00 0%, #ffaa00 40%, #ff6600 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-bottom: 2px;
    box-shadow: 0 0 10px #ffaa00, 0 0 20px #ff6600;
}

.flame-new.lit {
    opacity: 1;
    animation: flickerNew 0.5s ease-in-out infinite alternate;
}

@keyframes flickerNew {
    0% { transform: scale(1) rotate(-3deg); filter: brightness(1); }
    100% { transform: scale(1.15) rotate(3deg); filter: brightness(1.2); }
}

/* 蛋糕主体 */
.cake-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 蛋糕顶层 */
.cake-top {
    width: 160px;
    height: 50px;
    background: linear-gradient(180deg, #fff5f5 0%, #ffe0e0 100%);
    border-radius: 80px / 25px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #ffd0d0;
}

/* 奶油点缀 */
.cream-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
}

.cream-dots span {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ffb6c1, #ff69b4);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 蛋糕中层 */
.cake-middle {
    width: 180px;
    height: 45px;
    background: linear-gradient(180deg, #ffe4e1 0%, #ffc0cb 100%);
    border-radius: 90px / 22px;
    margin-top: -15px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #ffb6c1;
}

.cream-layer {
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        #fff 0px,
        #fff 8px,
        transparent 8px,
        transparent 16px
    );
    border-radius: 4px;
}

/* 蛋糕底层 */
.cake-bottom {
    width: 200px;
    height: 50px;
    background: linear-gradient(180deg, #ffd5d5 0%, #ffaaaa 100%);
    border-radius: 100px / 25px;
    margin-top: -15px;
    position: relative;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    border: 2px solid #ff9999;
}

/* 蛋糕托盘 */
.cake-plate {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 20px;
    background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
    border-radius: 110px / 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cake-hint {
    margin-top: 30px;
    color: #888;
    font-size: 0.9rem;
}

/* ============================================
   祝福语展示区
   ============================================ */
.blessing-section {
    text-align: center;
    margin-bottom: 40px;
    min-height: 100px;
}

.blessing-text {
    font-size: 1.5rem;
    color: #ff6b9d;
    line-height: 2;
    font-weight: 500;
}

.blessing-text .line {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInLine 0.8s ease forwards;
}

@keyframes fadeInLine {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   唱片机音乐控制
   ============================================ */
.record-player {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease;
}

.record-player:hover {
    transform: scale(1.1);
}

/* 唱片 */
.record {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 25%, #1a1a1a 50%, #333 75%, #1a1a1a 100%);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 5px;
    animation: spin 2s linear infinite;
    animation-play-state: paused;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 唱片纹路 */
.record::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
}

.record::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
}

/* 唱片标签 */
.record-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b9d, #ff8fab);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-label span {
    font-size: 10px;
    color: white;
}

/* 唱针臂 */
.tonearm {
    position: absolute;
    top: 5px;
    right: 0;
    width: 15px;
    height: 35px;
    background: linear-gradient(90deg, #c0c0c0, #e0e0e0);
    border-radius: 2px;
    transform-origin: top center;
    transform: rotate(-30deg);
    transition: transform 0.5s ease;
}

.tonearm::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 8px;
    background: #333;
    border-radius: 1px;
}

/* 播放状态 */
.record-player.playing .record {
    animation-play-state: running;
}

.record-player.playing .tonearm {
    transform: rotate(10deg);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   响应式设计 - 优化移动端体验
   ============================================ */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.8rem;
    }
    
    .number-520 {
        font-size: 2.2rem;
    }
    
    .heart {
        font-size: 1.8rem;
    }
    
    .birthday-text {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .cards-section {
        gap: 15px;
    }
    
    .card {
        width: 220px;
        height: 280px;
    }
    
    .card-front h3 {
        font-size: 1.5rem;
    }
    
    .card-back h3 {
        font-size: 1.3rem;
    }
    
    .balloons {
        gap: 12px;
    }
    
    .balloon {
        width: 30px;
        height: 40px;
    }
    
    .cake-section h2 {
        font-size: 1.4rem;
    }
    
    .blessing-text {
        font-size: 1.2rem;
    }
    
    /* 调整唱片机大小 */
    .record-player {
        width: 50px;
        height: 50px;
        top: 10px;
        right: 10px;
    }
    
    .record {
        width: 40px;
        height: 40px;
    }
    
    .record-label {
        width: 14px;
        height: 14px;
    }
    
    .record-label span {
        font-size: 8px;
    }
    
    .tonearm {
        width: 12px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .number-520 {
        font-size: 1.8rem;
    }
    
    .heart {
        font-size: 1.5rem;
    }
    
    .birthday-text {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .opening-section {
        height: 100px;
    }
    
    .balloons {
        gap: 8px;
        padding-top: 30px;
    }
    
    .balloon {
        width: 25px;
        height: 35px;
    }
    
    .cards-section {
        gap: 10px;
    }
    
    .card {
        width: 160px;
        height: 220px;
    }
    
    .card-front {
        padding: 20px;
    }
    
    .card-front h3 {
        font-size: 1.1rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-back {
        padding: 15px;
    }
    
    .card-back h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .card-back .message {
        font-size: 0.75rem;
        line-height: 1.6;
    }
    
    .cake-section h2 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    /* 缩小蛋糕 */
    .cake-top {
        width: 120px;
        height: 40px;
    }
    
    .cake-middle {
        width: 140px;
        height: 35px;
    }
    
    .cake-bottom {
        width: 160px;
        height: 40px;
    }
    
    .candles-row {
        gap: 20px;
    }
    
    .candle-body {
        width: 10px;
        height: 30px;
    }
    
    .flame-new {
        width: 12px;
        height: 18px;
    }
    
    .cake-plate {
        width: 180px;
        height: 15px;
    }
    
    .cake-hint {
        font-size: 0.8rem;
        margin-top: 20px;
    }
    
    .blessing-text {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    /* 缩小唱片机 */
    .record-player {
        width: 40px;
        height: 40px;
        top: 8px;
        right: 8px;
    }
    
    .record {
        width: 32px;
        height: 32px;
    }
    
    .record-label {
        width: 12px;
        height: 12px;
    }
    
    .record-label span {
        font-size: 7px;
    }
    
    .tonearm {
        width: 10px;
        height: 22px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
    .main-title {
        font-size: 1.1rem;
    }
    
    .card {
        width: 140px;
        height: 190px;
    }
    
    .cake-top {
        width: 100px;
        height: 35px;
    }
    
    .cake-middle {
        width: 120px;
        height: 30px;
    }
    
    .cake-bottom {
        width: 140px;
        height: 35px;
    }
}
