/* 引入霞鹜文楷字体 */
@font-face {
    font-family: 'LXGWWenKai';
    src: url('./assets/LXGWWenKai-Regular-CUVmuHes.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 基础样式 */
body {
    font-family: 'LXGWWenKai', 'Ma Shan Zheng', cursive;
    background-color: #020212;
    color: #e0e0e0;
    overflow: hidden;
    margin: 0;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="font-size: 24px;"><text y="24" fill="white">✨</text></svg>') 16 16, auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 彻底隐藏所有滚动条 */
html {
    overflow: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

::-webkit-scrollbar-track {
    display: none !important;
}

::-webkit-scrollbar-thumb {
    display: none !important;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none !important;
}

/* 加载界面 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #020212, #1a0b2e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 1s ease-out;
}

.loading-heart {
    width: 60px;
    height: 60px;
    position: relative;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.loading-heart:before,
.loading-heart:after {
    content: '';
    width: 32px;
    height: 50px;
    position: absolute;
    left: 30px;
    top: 0;
    background: linear-gradient(45deg, #ff69b4, #87cefa);
    border-radius: 32px 32px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.loading-heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.2); }
    28% { transform: scale(1); }
    42% { transform: scale(1.2); }
    70% { transform: scale(1); }
}

.loading-text {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #ff69b4;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 场景样式优化 */
#canvas-container { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 0; 
}

.scene {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s, transform 1.5s ease-in-out;
    z-index: 2;
    transform: scale(0.95) translateY(20px);
    box-sizing: border-box;
}

.scene.active { 
    opacity: 1; 
    visibility: visible; 
    transform: scale(1) translateY(0); 
}

h1 {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: clamp(2rem, 8vw, 3.5rem);
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.7), 0 0 20px rgba(255, 105, 180, 0.5), 0 0 40px rgba(135, 206, 250, 0.7);
    letter-spacing: 0.1em;
    animation: text-glow 2.5s ease-in-out infinite alternate;
    margin: 0 auto 2rem auto;
    text-align: center;
    width: 100%;
}

p {
    font-size: clamp(1rem, 4vw, 1.5rem);
    max-width: 80%;
    line-height: 1.8;
    margin: 1.5rem auto;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    padding: 0 1rem;
    text-align: center;
    box-sizing: border-box;
}

.typewriter-text::after { 
    content: '|'; 
    animation: blink 1s step-end infinite; 
}

@keyframes blink { 
    50% { opacity: 0; } 
}

/* 星空按钮样式 - 超酷的新样式！ */
.action-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 13rem;
    overflow: hidden;
    height: 3rem;
    background-size: 300% 300%;
    cursor: pointer;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
    transition: 0.5s;
    animation: gradient_301 5s ease infinite;
    border: double 4px transparent;
    background-image: linear-gradient(#212121, #212121),
        linear-gradient(
            137.48deg,
            #ffdb3b 10%,
            #fe53bb 45%,
            #8f51ea 67%,
            #0044ff 87%
        );
    background-origin: border-box;
    background-clip: content-box, border-box;
    position: relative;
    margin: 2rem auto;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    color: #ffffff;
    font-weight: bold;
    letter-spacing: 3px;
    text-shadow: 0 0 4px white;
    min-width: 120px;
    touch-action: manipulation;
}

.action-button strong {
    z-index: 2;
    font-family: "Ma Shan Zheng", cursive;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    letter-spacing: 3px;
    color: #ffffff;
    text-shadow: 0 0 4px white;
}

#container-stars {
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: 0.5s;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
}

#glow {
    position: absolute;
    display: flex;
    width: 12rem;
}

.circle {
    width: 100%;
    height: 30px;
    filter: blur(2rem);
    animation: pulse_3011 4s infinite;
    z-index: -1;
}

.circle:nth-of-type(1) {
    background: rgba(254, 83, 186, 0.636);
}

.circle:nth-of-type(2) {
    background: rgba(142, 81, 234, 0.704);
}

.action-button:hover #container-stars {
    z-index: 1;
    background-color: #212121;
}

.action-button:hover {
    transform: scale(1.1);
}

.action-button:active {
    border: double 4px #fe53bb;
    background-origin: border-box;
    background-clip: content-box, border-box;
    animation: none;
}

.action-button:active .circle {
    background: #fe53bb;
}

#stars {
    position: relative;
    background: transparent;
    width: 200rem;
    height: 200rem;
}

#stars::after {
    content: "";
    position: absolute;
    top: -10rem;
    left: -100rem;
    width: 100%;
    height: 100%;
    animation: animStarRotate 90s linear infinite;
}

#stars::after {
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
}

#stars::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 170%;
    height: 500%;
    animation: animStar 60s linear infinite;
}

#stars::before {
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
    opacity: 0.5;
}

@keyframes animStar {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-135rem);
    }
}

@keyframes animStarRotate {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0);
    }
}

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

@keyframes pulse_3011 {
    0% {
        transform: scale(0.75);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }
    100% {
        transform: scale(0.75);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.choice-button-container {
    display: flex;
    gap: 1rem;
    margin: 3rem auto;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

#no-button {
    position: relative;
}

/* 最简单粗暴的居中方法 - 直接钉死在屏幕中央 */
.final-message {
    animation: fadeInZoom 2s forwards;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    z-index: 10 !important;
}

.final-message h1 {
    position: absolute !important;
    top: 40% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.final-message p {
    position: absolute !important;
    top: 60% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.final-message .action-button {
    position: absolute !important;
    top: 70% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* 📸 多环节照片展示系统 */
#photo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    margin: 2rem auto;
    max-width: 95vw;
    max-height: 65vh;
    overflow-y: auto;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

/* 🌟 环节标题样式 */
.chapter-title {
    text-align: center;
    margin: 2rem 0 1rem 0;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
}

.chapter-title h3 {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    margin: 0.5rem 0;
    background: linear-gradient(45deg, #ff69b4, #87ceeb, #ffd700, #98fb98);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient_text 3s ease infinite;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.chapter-title p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-style: italic;
}

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

/* 📷 照片行布局 */
.photos-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1rem 0;
    width: 100%;
}

.photo-frame {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    padding: 8px;
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.3),
        0 0 40px rgba(255,105,180,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transform: rotate(0deg) scale(0.2);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin: 0.5rem;
}

.photo-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        rgba(255,182,193,0.1),
        rgba(173,216,230,0.1),
        rgba(255,218,185,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-frame:hover {
    transform: scale(1.15) rotate(3deg) !important;
    z-index: 10;
    box-shadow:
        0 15px 40px rgba(0,0,0,0.4),
        0 0 50px rgba(255,105,180,0.6),
        inset 0 1px 0 rgba(255,255,255,0.3);
    border-color: rgba(255,105,180,0.5);
}

.photo-frame:hover::before {
    opacity: 1;
}

.photo-frame img {
    width: clamp(100px, 18vw, 140px);
    height: clamp(100px, 18vw, 140px);
    object-fit: cover;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: none;
    display: block;
}

.photo-frame:hover img {
    transform: scale(1.05);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .scene {
        padding: 1rem;
        justify-content: center;
        align-items: center;
    }

    /* 📱 移动端照片环节优化 */
    #photo-container {
        max-height: 70vh;
        gap: 2rem;
        padding: 0.5rem;
    }

    .chapter-title h3 {
        font-size: clamp(1.2rem, 6vw, 1.8rem);
    }

    .chapter-title p {
        font-size: clamp(0.8rem, 3.5vw, 1rem);
    }

    .photos-row {
        gap: 1rem;
        margin: 0.5rem 0;
    }

    .photo-frame {
        margin: 0.3rem;
    }

    .photo-frame img {
        width: clamp(90px, 20vw, 120px);
        height: clamp(90px, 20vw, 120px);
    }

    .choice-button-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin: 2rem auto;
    }

    .action-button {
        min-width: 200px;
        margin: 1rem auto;
    }

    #photo-container {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 0.5rem;
        max-height: 55vh;
        margin: 1rem auto;
        padding: 1rem;
    }

    h1 {
        text-align: center;
        margin: 0 auto 1.5rem auto;
    }

    p {
        text-align: center;
        margin: 1rem auto;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .scene {
        padding: 0.5rem;
        justify-content: center;
        align-items: center;
    }

    h1 {
        font-size: 2rem;
        text-align: center;
        margin: 0 auto 1rem auto;
    }

    p {
        font-size: 1rem;
        line-height: 1.6;
        text-align: center;
        margin: 1rem auto;
        max-width: 95%;
    }

    .photo-frame {
        padding: 6px 6px 12px 6px;
    }

    .action-button {
        width: 11rem;
        height: 2.5rem;
        font-size: 0.9rem;
        margin: 1.5rem auto;
    }

    .choice-button-container {
        margin: 2rem auto;
        gap: 1.5rem;
    }
}

/* 性能优化类 */
.reduce-motion {
    animation: none !important;
    transition: none !important;
}

.reduce-motion * {
    animation: none !important;
    transition: none !important;
}

/* 动画关键帧 */
@keyframes fadeInZoom {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes text-glow {
    from { text-shadow: 0 0 10px #ff69b4, 0 0 20px #ff69b4, 0 0 30px #87cefa, 0 0 40px #87cefa; }
    to { text-shadow: 0 0 20px #ff69b4, 0 0 30px #ff69b4, 0 0 40px #87cefa, 0 0 50px #87cefa; }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

.fade-out {
    opacity: 0 !important;
    pointer-events: none;
}
