/* Global */
body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    height: 100%;
}

/* 背景 */
.background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('bg.jpg?v=3') center/cover no-repeat;
    filter: none;
    z-index: -2;
}

.background::after {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: -1;
}

/* 烟花/星星叠加层 */
.sparkles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: twinkle 4s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework 3s infinite ease-out;
}

.firework::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: firework-glow 3s infinite ease-out;
}

@keyframes firework {
    0% { transform: scale(0); opacity: 0; }
    20% { transform: scale(1); opacity: 1; }
    80% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes firework-glow {
    0% { box-shadow: 0 0 4px 2px rgba(255, 182, 193, 0.8); }
    50% { box-shadow: 0 0 12px 6px rgba(255, 215, 0, 0.6); }
    100% { box-shadow: 0 0 4px 2px rgba(255, 182, 193, 0); }
}

/* 右上角 Photos 按钮 */
.top-right {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
}

.photos-btn {
    padding: 10px 20px;
    font-size: 14px;
    background: rgba(255,182,193,0.2);
}

.photos-btn:hover {
    background: rgba(255,182,193,0.35);
}

/* 居中 */
.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.center h1 {
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Glass button */
.glass-button {
    padding: 14px 36px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow:
        0 8px 30px rgba(0,0,0,0.25),
        inset 0 0 10px rgba(255,255,255,0.35);
}

.glass-button:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

.glass-button:active {
    transform: scale(0.92);
}

.wall-btn {
    padding: 10px 24px;
    font-size: 14px;
    background: rgba(255,182,193,0.2);
}

.wall-btn:hover {
    background: rgba(255,182,193,0.35);
}

/* Danmu container - 修复 z-index */
#danmu-container {
    z-index: 10;
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.danmu {
    z-index: 20;
    position: absolute;
    white-space: nowrap;
    font-size: 20px;
    font-weight: 500;
    opacity: 0;
    animation: danmuMove linear forwards;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

@keyframes danmuMove {
    0% {
        transform: translateX(100vw);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.modal-content {
    width: 340px;
    padding: 25px;
    border-radius: 25px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wall-content {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 25px;
    background: rgba(20,20,40,0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.wall-header h2 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 500;
}

.close-btn {
    padding: 8px 14px;
    font-size: 14px;
    background: rgba(255,100,100,0.2);
}

.close-btn:hover {
    background: rgba(255,100,100,0.4);
}

.wall-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.wall-messages::-webkit-scrollbar {
    width: 4px;
}

.wall-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.wall-msg {
    padding: 12px 15px;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.wall-msg .time {
    font-size: 11px;
    opacity: 0.5;
    margin-top: 5px;
}

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

.wall-empty {
    text-align: center;
    color: rgba(255,255,255,0.5);
    padding: 30px;
}

textarea {
    resize: none;
    border: none;
    border-radius: 15px;
    padding: 12px;
    font-size: 14px;
    outline: none;
    background: rgba(255,255,255,0.2);
    color: white;
    transition: height 0.2s ease, background 0.2s ease;
    backdrop-filter: blur(10px);
    font-family: inherit;
}

textarea::placeholder {
    color: rgba(255,255,255,0.7);
}

.button-group {
    display: flex;
    justify-content: space-between;
}

.cancel-button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.cancel-button:hover {
    background: rgba(255, 80, 80, 0.3);
}

@media (max-width: 600px) {
    .modal-content {
        width: 85%;
    }
    
    .wall-content {
        width: 90%;
        max-height: 75vh;
    }

    .glass-button {
        padding: 12px 28px;
        font-size: 14px;
    }

    .center h1 {
        font-size: 20px;
    }
    
    .wall-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
}