* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('static/imgs/group.jpg');
    background-size: cover;
    background-position: center;
    font-family: Arial, sans-serif;
    color: white;
    position: relative;
    overflow: hidden;
}

.container {
    text-align: center;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    margin-top: 5vh;
    background-color: transparent;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s;
}

.display {
    font-size: 4rem;
    font-weight: bold;
    height: 5rem;
    margin: 2rem 0;
    color: #ffcc00;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    border: none;
    border-radius: 50px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 1rem;
}

.btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.btn.stop {
    background-color: #f44336;
}

.btn.stop:hover {
    background-color: #d32f2f;
}

.result-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: fall 5s ease-out forwards;
    z-index: 100;
    top: 0;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 功能按钮样式 */
.function-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 10;
}

.function-btn {
    padding: 12px 20px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.function-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 音乐控制按钮 */
.bgm-control {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.bgm-control:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.bgm-icon {
    font-size: 22px;
    color: white;
}

/* 模态窗口样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    color: #333;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}

.close-btn:hover {
    color: #000;
}

/* 图像选项样式 */
.image-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.bg-image-option {
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin-bottom: 20px;
}

.singers-title {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    font-size: 1.5rem;
    color: #555;
    position: relative;
}

.singers-title::before,
.singers-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background-color: #ddd;
}

.singers-title::before {
    left: 5%;
}

.singers-title::after {
    right: 5%;
}

.singers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

.preview-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.preview-img:hover {
    transform: scale(1.03);
}

.singer-name {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

/* BGM选项样式 */
.bgm-options {
    margin-top: 30px;
    text-align: center;
}

/* 文件上传按钮样式 */
input[type="file"] {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.upload-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* 完成按钮 */
.done-btn {
    padding: 12px 30px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.done-btn:hover {
    background-color: #0b7dda;
    transform: translateY(-2px);
}

/* 响应式设计，适应不同设备 */
@media screen and (max-width: 768px) {
    .singers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .display {
        font-size: 2.5rem;
    }
    
    .function-buttons {
        top: 10px;
        right: 10px;
    }
}

@media screen and (max-width: 480px) {
    .singers-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
    }
    
    .function-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    .display {
        font-size: 3.5rem;
        height: 4.5rem;
    }
}

/* 新增错误提示样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 1000;
    max-width: 90%;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -10px);
}

.toast-content {
    text-align: center;
}

/* 移动设备横屏适配 */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .container {
        margin-top: 0;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .display {
        font-size: 3rem;
        height: 3.5rem;
    }
    
    .btn {
        padding: 0.7rem 2rem;
        font-size: 1.2rem;
    }
    
    .function-buttons {
        top: 5px;
        right: 5px;
    }
    
    .function-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .bgm-control {
        width: 40px;
        height: 40px;
        bottom: 10px;
        right: 10px;
    }
    
    .name-control {
        bottom: 60px;
    }
}

/* 避免iOS中的元素溢出 */
@supports (-webkit-touch-callout: none) {
    body {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

/* 名字控制按钮 */
.name-control {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.name-control:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.name-icon {
    font-size: 22px;
    color: white;
} 