/* ============================================================
   生日快乐祝福页样式
   结构：通用基础 → 蛋糕页 → 蜡烛火焰动画 → 文字页 → 音乐按钮
   ============================================================ */

/* ---------- 通用基础 ---------- */
* {
    padding: 0;
    margin: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
body {
    background-color: white;
}
a {
    color: white;
    text-decoration: none;
}

/* 最外层容器：500px 宽居中，兼容 PC 和移动端 */
#div_container {
    width: 500px;
    margin: 0 auto;
    position: relative;
    font-size: 1em;
}

/* 片头白色遮罩，初始化完成后淡出 */
#div_start_bg {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 44;
    background-color: white;
}

/* ============================================================
   第 1 页：蛋糕页
   ============================================================ */
#div_dbcake {
    position: relative;
    width: 100%;
    z-index: 666;
    background: #808080 fixed;
    display: none;            /* 初始化时隐藏，JS 显示 */
    background-repeat: repeat;
    background-size: 100%;
    overflow: hidden;
}
#div_dbcake_inner {
    position: absolute;
    top: 0; right: 0; left: 0; bottom: 0;
    width: 100%;
    height: 400px;
    padding: 30% 10% 10% 10%;
    text-align: center;
    color: white;
}

/* ---------- 入口：点击输入框 ---------- */
#div_dbacke_access {
    width: 100%;
    height: 100%;
}
#div_dbacke_access h1 {
    color: #FFF5EE;
    font-size: 5rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgb(245, 245, 245);
}
#div_dbacke_access input {
    width: 80%;
    height: 12%;
    border-radius: 5px;
    border: 1px solid rgba(185, 185, 185, 0.8);
    background-color: rgba(235, 235, 235, 0.8);
    margin: 20px auto 10px auto;
    text-align: center;
    font-family: "Microsoft YaHei";
    font-size: 1.2rem;
    font-weight: 300;
    color: gray;
}
#div_dbacke_access #input_award_btn {
    display: none;
}
input::-webkit-input-placeholder { font-size: 1em; color: gray; }
input:-moz-placeholder { font-size: 1em; color: gray; }
input:-ms-input-placeholder { font-size: 1em; color: gray; }

/* ---------- 蛋糕 SVG ---------- */
#div_dbcake_cake {
    width: 100%;
    display: none;            /* 点击"查看惊喜"后淡入 */
}
#svg_dbcake {
    display: block;
    position: relative;
    margin: -20em auto 0 auto;
}

/* ---------- 祝福语 ---------- */
#div_dbcake_wish {
    display: none;            /* 蛋糕动画完成后淡入 */
    padding: 0 5%;
}
#div_dbcake .div_dbcake_text {
    color: black;
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-style: italic;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.5em;
}
#div_dbcake .div_dbcake_text h1 {
    font-size: 1.8em;
    line-height: 1.8em;
}
#div_dbcake_wish ul {
    list-style: none;
    margin: 30px;
}
#div_dbcake_wish ul li {
    background-color: rgba(155,155,155,0.5);
    display: inline;
    margin: 20px 20px;
    padding: 10px 15px;
    font-size: 1.4em;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
}

/* "不喜欢"弹窗：捂脸表情 */
#div_wish_note {
    position: relative;
    margin: -80px auto;
    padding: 5% 0;
    width: 100%;
    height: 180px;
    text-align: center;
    background-color: white;
    border-radius: 5px;
    display: none;
    color: gray;
    font-size: 1.4em;
    cursor: pointer;
}
#div_wish_note_close {
    width: 40px;
    height: 40px;
    position: absolute;
    right: 20px;
    top: 20px;
}

/* ============================================================
   蜡烛与火焰动画（时间线与蛋糕 SVG 动画配合：
   5s 蜡烛落下 → 5.5s 火焰点亮闪烁 → 6s 祝福语淡入）
   ============================================================ */
.velas {
    background: #ffffff;
    border-radius: 10px;
    position: absolute;
    top: 220px;
    left: 50%;
    margin-left: -2.5px;
    margin-top: -8.33333333px;
    width: 5px;
    height: 35px;
    -webkit-transform: translateY(-300px);
    -ms-transform: translateY(-300px);
    transform: translateY(-300px);
    -webkit-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-animation: in 500ms 5s ease-out forwards;
    animation: in 500ms 5s ease-out forwards;
}
.velas:after,
.velas:before {
    background: rgba(255, 0, 0, 0.4);
    content: "";
    position: absolute;
    width: 100%;
    height: 2.22222222px;
}
.velas:after { top: 25%; left: 0; }
.velas:before { top: 45%; left: 0; }

.fuego {
    border-radius: 100%;
    position: absolute;
    top: -20px;
    left: 50%;
    margin-left: -2.2px;
    width: 6.66666667px;
    height: 18px;
}
.fuego:nth-child(1) { -webkit-animation: fuego 2s 5.5s infinite; animation: fuego 2s 5.5s infinite; }
.fuego:nth-child(2) { -webkit-animation: fuego 1.5s 5.5s infinite; animation: fuego 1.5s 5.5s infinite; }
.fuego:nth-child(3) { -webkit-animation: fuego 1s 5.5s infinite; animation: fuego 1s 5.5s infinite; }
.fuego:nth-child(4) { -webkit-animation: fuego 0.5s 5.5s infinite; animation: fuego 0.5s 5.5s infinite; }
.fuego:nth-child(5) { -webkit-animation: fuego 0.2s 5.5s infinite; animation: fuego 0.2s 5.5s infinite; }

@-webkit-keyframes fuego {
    0%, 100% {
        background: rgba(254, 248, 97, 0.5);
        -webkit-box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
        box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
        -webkit-transform: translateY(0) scale(1);
        transform: translateY(0) scale(1);
    }
    50% {
        background: rgba(255, 50, 0, 0.1);
        -webkit-box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
        box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
        -webkit-transform: translateY(-20px) scale(0);
        transform: translateY(-20px) scale(0);
    }
}
@keyframes fuego {
    0%, 100% {
        background: rgba(254, 248, 97, 0.5);
        -webkit-box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
        box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
        -webkit-transform: translateY(0) scale(1);
        transform: translateY(0) scale(1);
    }
    50% {
        background: rgba(255, 50, 0, 0.1);
        -webkit-box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
        box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
        -webkit-transform: translateY(-20px) scale(0);
        transform: translateY(-20px) scale(0);
    }
}
@-webkit-keyframes in {
    to { -webkit-transform: translateY(0); transform: translateY(0); }
}
@keyframes in {
    to { -webkit-transform: translateY(0); transform: translateY(0); }
}

/* ============================================================
   第 2 页：打字机祝福文字页
   ============================================================ */
.div_pure_words {
    position: relative;
    display: none;            /* 点"我喜欢"后淡入 */
}
.div_pure_words_bg {
    background-repeat: repeat;
    background-size: 100%;
    background-attachment: fixed;
    width: 500px;
    min-height: 500px;
}
/* 隐藏的占位层：用来撑开页面高度，让文字能滚动完整显示 */
.div_pure_words_height {
    visibility: hidden;
    padding: 30px;
    text-align: justify;
    white-space: pre-wrap;    /* 保留换行 */
    font-size: 1.1em;
    font-family: "Microsoft YaHei","Arial";
    color: white;
}
/* 实际显示打字文字的半透明层 */
.div_pw_typed {
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 500px;
    background: rgba(255,255,255,0.8);
    padding: 30px;
    padding-right: 100px;
    padding-top: 30px !important;
    text-align: justify;
}
#span_pw_typed {
    width: 100%;
    white-space: pre-wrap;    /* 保留换行 */
    font-size: 1.1em;
    font-family: "Microsoft YaHei","Arial";
}

/* 打字机光标（红色爱心） */
.typed-cursor {
    opacity: 1;
    color: red;
    -webkit-animation: typedjsBlink 0.7s infinite;
    animation: typedjsBlink 0.7s infinite;
}
@keyframes typedjsBlink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
@-webkit-keyframes typedjsBlink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* ============================================================
   悬浮音乐按钮
   ============================================================ */
.div_music_tips {
    position: fixed;
    top: 70px;
    left: 50%;
    z-index: 999;
    transform: translateX(190px);
    color: #333;
    font-size: 0.9em;
    white-space: nowrap;
}
.div_btn {
    position: fixed;
    cursor: pointer;
    width: 43px;
    height: 43px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    font-size: 1.05em;
    line-height: 39px;
    text-align: center;
    z-index: 999;
    background-color: rgba(0,0,0,.3);
    color: #fff;
    text-shadow: 1px 1px 1px #000;
    bottom: 45px;
    right: 34px;
}
/* 音乐播放时旋转动画 */
@-webkit-keyframes music_play_rotate {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}
@keyframes music_play_rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#div_music.playing {
    -webkit-animation: music_play_rotate 1s linear infinite;
    animation: music_play_rotate 1s linear infinite;
}
