/* ================= 基础变量 ================= */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #ff8e8e;
    --star-base-color: rgba(255, 255, 255, 0.9);
    --star-glow-primary: rgba(135, 206, 235, 0.6);
    --star-glow-secondary: rgba(65, 105, 225, 0.4);
    --popup-bg: rgba(255, 255, 255, 0.1);
    --main-font: 'ZCOOL KuaiLe', sans-serif;
}

/* ================= 基础样式 ================= */
body {
    font-family: var(--main-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.heart {
    position: absolute;
    background: var(--primary-color);
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
    animation: heartbeat 1.4s linear infinite;
}

@keyframes heartbeat {
    0% { transform: rotate(45deg) scale(1); }
    14% { transform: rotate(45deg) scale(1.3); }
    28% { transform: rotate(45deg) scale(1); }
    42% { transform: rotate(45deg) scale(1.3); }
    70% { transform: rotate(45deg) scale(1); }
}

/* ================= 星空动画 ================= */
.star-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    animation: starFade 5s forwards;
}

@keyframes starFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.star-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

.new-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

@keyframes haloBreath {
    0%, 100% { box-shadow: 0 0 15px 8px rgba(255,255,255,0.4); }
    50% { box-shadow: 0 0 25px 12px rgba(255,255,255,0.9); }
}

@keyframes starBreath {
    0%, 100% {
        opacity: 0.6;
        filter: brightness(1.2) hue-rotate(-5deg);
        box-shadow: 0 0 15px 6px rgba(135,206,235,0.4);
    }
    50% {
        opacity: 1;
        filter: brightness(1.5) hue-rotate(5deg);
        box-shadow: 0 0 25px 12px rgba(65,105,225,0.6);
    }
}

.star {
    animation: starBreath var(--duration, 2s) ease-in-out infinite;
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--star-base-color);
    border-radius: 50%;
    box-shadow: 0 0 15px 6px var(--star-glow-primary);
    transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
    opacity: 0.9;
    cursor: pointer;
    will-change: transform, filter, box-shadow;
    transform: translateZ(0);
}

.star.active,
.star:hover {
    transform: scale(1.5);
    filter: brightness(1.2);
    box-shadow: 0 0 15px 6px var(--star-glow-primary), 0 0 20px 10px var(--star-glow-secondary);
    background: rgba(176,224,230,0.95);
}

.star-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
    transform-origin: 0% 50%;
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 0 8px rgba(255,255,255,0.3);
    filter: drop-shadow(0 0 2px rgba(255,182,193,0.5));
    will-change: transform, opacity;
    opacity: 0.8;
}

@keyframes lineAppear {
    from { opacity: 0; transform: scaleX(0);}
    to { opacity: 1; transform: scaleX(1);}
}

/* ================= 弹出框 ================= */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    transform: translateZ(0);
    overflow-y: auto; /* 添加垂直滚动条 */
}

.popup-container.show {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
}

.popup-content {
    background: var(--popup-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    max-width: 800px;
    width: 90%;
    color: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.2);
    opacity: 0;
    transform: scale(0.9) translateZ(0);
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
    transition-delay: 0.3s;

    max-height: 80vh; /* 设置最大高度为视口的80% */
    overflow-y: auto; /* 添加垂直滚动条 */
}

.popup-container.show .popup-content {
    opacity: 1;
    transform: scale(1);
}

.popup-container.hiding {
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0px);
}

.popup-container.hiding .popup-content {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s ease-out;
}

.popup-title {
    font-size: 24px;
    margin-bottom: 5px;
    color: #fff;
    text-align: center;
}

.popup-subtitle {
    text-align: center;
    font-style: italic;
    font-size: 1.2em;
    color: #888;
}

.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
}

@keyframes popupFade {
    from { opacity: 0; transform: scale(0.9);}
    to { opacity: 1; transform: scale(1);}
}

.popup-animating {
    pointer-events: none;
}

/* ================= 时钟与纪念日 ================= */
.time-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    z-index: 1001;
}

.anniversary {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px) saturate(180%);
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(41,98,255,0.2), inset 0 0 30px rgba(0,78,146,0.1);
    border: 1px solid rgba(72,147,255,0.1);
    min-width: 400px;
    opacity: 0.9;
}

.title {
    font-family: var(--main-font);
    font-size: 32px;
    margin-bottom: 20px;
    color: rgba(220,240,255,0.9);
    text-shadow: 0 0 1px rgba(255,255,255,0.9), 0 0 2px var(--star-glow-primary), 0 0 3px var(--star-glow-secondary);
    letter-spacing: 2px;
    text-align: left;
}

.count {
    font-size: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.time-unit {
    color: rgba(65, 105, 225, 1);
    /* 柔和发光：降低白色和蓝色光晕透明度 */
    text-shadow: 
        0 0 1px rgba(255,255,255,0.5),
        0 0 2px rgba(135,206,235,0.3),
        0 0 3px rgba(65,105,225,0.2),
        0 0 10px rgba(41,98,255,0.15),
        0 0 20px rgba(0,78,146,0.10);
    animation: textGlow 2s ease-in-out infinite;
    position: relative;
    background: linear-gradient(to right,rgba(30,144,255,0.15) 0%,rgba(15,61,89,0.1) 100%);
    font-weight: bold;
    min-width: 40px;
    display: inline-block;
    text-align: center;
    background: rgba(15,61,89,0.2);
    border-radius: 8px;
    padding: 5px 10px;
}

@keyframes textGlow {
    0%,100% {
        text-shadow: 
            0 0 1px rgba(255,255,255,0.5),
            0 0 2px rgba(135,206,235,0.3);
    }
    50% {
        text-shadow: 
            0 0 2px rgba(255,255,255,0.6),
            0 0 3px rgba(135,206,235,0.4),
            0 0 5px rgba(65,105,225,0.2);
    }
}
.time-unit[data-unit="days"] {
    animation: textGlow 1.8s ease-in-out infinite;
}

.colon {
    margin: 0 5px;
    animation: colonBlink 1s infinite;
}

@keyframes colonBlink {
    0%,100% { opacity: 1;}
    50% { opacity: 0.3;}
}

@keyframes textGlow {
    0%,100% {
        text-shadow: 0 0 1px rgba(255,255,255,0.9), 0 0 2px var(--star-glow-primary);
    }
    50% {
        text-shadow: 0 0 2px rgba(255,255,255,0.95), 0 0 3px var(--star-glow-primary), 0 0 5px var(--star-glow-secondary);
    }
}

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

