body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    overflow: hidden; /* 防止拖拽出滚动条 */
    font-family: sans-serif;
}

#photo-wall {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    /* 软木板质感背景 */
    background: #d4b58e url('https://www.transparenttextures.com/patterns/cork-wallet.png'); 
    z-index: 1;
}

.camera-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000; /* 确保相机在最顶层 */
}

.camera-body {
    width: 260px;
    height: 200px;
    background-color: #f5f5f0;
    border: 2px solid #ccc;
    border-radius: 15px;
    box-shadow: 10px 10px 20px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
    position: relative;
}

.camera-top {
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1002;
}

.photo-slot {
    width: 140px;
    height: 8px;
    background-color: #222;
    border-radius: 4px;
    position: absolute;
    top: -4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.camera-lens {
    width: 160px;
    height: 110px;
    background-color: #000;
    border: 6px solid #444;
    border-radius: 8px;
    margin-top: 15px;
    overflow: hidden;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* 镜像翻转，符合自拍直觉 */
}

.camera-shutter {
    margin-top: 15px;
}

#capture-btn {
    width: 45px;
    height: 45px;
    background-color: #e74c3c;
    border: 3px solid #c0392b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px #902a1f;
    outline: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

#capture-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0px #902a1f;
}

/* 拍立得照片样式 */
.polaroid-photo {
    width: 130px;
    height: 155px;
    background-color: #fff;
    padding: 12px 12px 35px 12px; /* 底部留白 */
    box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
    position: absolute;
    cursor: grab;
    z-index: 1001; /* 从相机后方/插槽弹出 */
}

.polaroid-photo:active {
    cursor: grabbing;
}

.polaroid-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #2c3e50; /* 未显影前的底色 */
    filter: blur(20px) brightness(0.5); /* 初始状态：模糊且暗 */
    transition: filter 10s ease-out, brightness 10s ease-out; /* 缓慢清晰：10秒显影 */
}

/* 显影完成的类 */
.polaroid-photo.developing img {
    filter: blur(0px) brightness(1);
}

/* 弹出动画 */
@keyframes eject-photo {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    20% { opacity: 1; }
    100% {
        transform: translateY(-160px); /* 向上滑出 */
    }
}

.polaroid-photo.ejecting {
    animation: eject-photo 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
