/* 页面整体布局 */
.camera-page {
    padding: 20px;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* 主容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 相机容器样式 */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center; /* 添加这行 */
}

/* 拍照按钮样式 */
#captureBtn {
    display: inline-block; /* 修改这行 */
    padding: 12px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: #e91e63;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto; /* 添加这行 */
}

/* 提示文字样式 */
.camera-container p {
    text-align: center;
    color: #666;
    margin: 15px 0;
}

/* 预览框样式 */
.preview-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

#cameraPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 预览容器样式 */
.preview-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.preview-slot {
    aspect-ratio: 1;
    background: #D3D3D3;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preview-slot.filled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-slot:hover img {
    transform: scale(1.05);
}

/* 照片计数器样式 */
.photo-counter {
    text-align: center;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #CA2170;
}

/* 按钮容器样式 */
.button-container {
    text-align: center;
    margin: 20px 0;
}

/* 滤镜部分样式 */
.filter-section {
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #CA2170;
    color: #CA2170;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #CA2170;
    color: white;
    border-color: #CA2170;
    box-shadow: 0 5px 15px rgba(202, 33, 112, 0.3);
}

/* 倒计时样式 */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.countdown-number {
    font-size: 120px;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* 结果容器样式 */
.result-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.final-photo-container {
    max-width: 50%;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#finalPhoto {
    width: 100%;
    height: auto;
    display: block;
}

/* 闪光效果 */
.camera-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    animation: flash 0.5s ease-out;
    pointer-events: none;
    z-index: 99;
}

@keyframes flash {
    0% { opacity: 0; }
    50% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* 准备消息样式 */
.preparation-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 1000;
}

.prep-countdown {
    font-size: 48px;
    font-weight: bold;
    margin-top: 10px;
}
background-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.background-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.background-btn.active {
    border-color: #e91e63;
    transform: scale(1.1);
}

.background-btn:hover {
    transform: scale(1.1);
}





/* 贴纸部分样式 - 新增和修改 */
/* 贴纸选择区域样式 */
.sticker-section {
    width: 100%;
    max-width: 100%; /* 确保占满容器宽度 */
    margin: 20px auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

/* 贴纸按钮容器样式 */
.sticker-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: flex-start; /* 改为左对齐 */
    margin-top: 15px;
    width: 100%; /* 确保占满容器宽度 */
    overflow-x: auto;
    padding: 5px 0; /* 修改内边距 */
    scrollbar-width: thin; /* 细滚动条 */
}
 
/* 贴纸按钮样式 */
.sticker-btn {
    flex: 0 0 auto;
    padding: 8px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sticker-btn:hover {
    border-color: #CA2170;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(202, 33, 112, 0.2);
}

.sticker-btn.active {
    border-color: #CA2170;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(202, 33, 112, 0.3);
}

.sticker-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 为每个背景按钮设置具体的背景色 */
.bg-option[data-bg="white"] { background-color: white; }
.bg-option[data-bg="#ffebee"] { background-color: #ffebee; }
.bg-option[data-bg="#e8f5e9"] { background-color: #e8f5e9; }
.bg-option[data-bg="#e3f2fd"] { background-color: #e3f2fd; }
.bg-option[data-bg="#fce4ec"] { background-color: #fce4ec; }

/* 按钮样式 */
.btn-primary {
    background-color: #CA2170;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #a01858;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(202, 33, 112, 0.3);
}

.btn-success {
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    .camera-page { padding: 10px; }
    .camera-container { padding: 0 10px; }
    .preview-grid { gap: 5px; }
    .countdown-number { font-size: 80px; }
    .sticker-btn { width: 60px; height: 60px; }
    .sticker-buttons { gap: 10px; }
    
     .result-container {
        padding: 10px;
    }
    
    .sticker-section,
    .background-selector {
        padding: 10px;
    }
}

/* 适配移动设备 */
@media (max-width: 576px) {
    .sticker-buttons {
        gap: 8px;
        padding: 3px;
    }
    
    .sticker-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* 超小屏幕设备 */
@media (max-width: 360px) {
    .preview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    .sticker-buttons {
        gap: 5px;
    }
    .sticker-btn {
        width: 45px;
        height: 45px;
    }
}




