* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 返回主页按钮 */
.home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e4e4e4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: rainbow 3s ease infinite;
    background-size: 300% 300%;
}

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

.subtitle {
    color: #8892b0;
    font-size: 1rem;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item .label {
    color: #8892b0;
}

.status-item .value {
    font-weight: 600;
    color: #64ffda;
}

.status-item .value.webgpu {
    color: #64ffda;
}

.status-item .value.webgl {
    color: #ffd700;
}

.main-content {
    position: relative;
    margin-bottom: 20px;
}

.video-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .video-wrapper {
        grid-template-columns: 1fr;
    }
}

.video-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.video-box h4 {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccd6f6;
    font-size: 0.9rem;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
}

.video-container video,
.video-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 10;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 107, 107, 0.3);
    border-top-color: #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    color: #ccd6f6;
    margin-bottom: 15px;
}

.progress-container {
    width: 200px;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #feca57);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.85rem;
    color: #8892b0;
}

.style-selector {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.style-selector h3 {
    color: #ccd6f6;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.style-card {
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid transparent;
}

.style-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.style-card.active {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.style-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 auto 8px;
    background-size: cover;
    background-position: center;
}

/* 风格预览颜色 */
.style-preview.candy {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb);
}
.style-preview.mosaic {
    background: linear-gradient(45deg, #2c3e50 25%, #3498db 25%, #3498db 50%, #2c3e50 50%, #2c3e50 75%, #3498db 75%);
    background-size: 20px 20px;
}
.style-preview.udnie {
    background: linear-gradient(135deg, #8e44ad, #3498db, #1abc9c);
}
.style-preview.rain-princess {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
}
.style-preview.pointilism {
    background: radial-gradient(circle at 20% 20%, #e74c3c 2px, transparent 2px),
                radial-gradient(circle at 50% 50%, #3498db 2px, transparent 2px),
                radial-gradient(circle at 80% 30%, #f1c40f 2px, transparent 2px),
                radial-gradient(circle at 30% 70%, #2ecc71 2px, transparent 2px),
                linear-gradient(#ecf0f1, #ecf0f1);
    background-size: 15px 15px;
}
.style-preview.scream {
    background: linear-gradient(135deg, #e74c3c, #f39c12, #2980b9);
}

.style-card span {
    font-size: 0.8rem;
    color: #8892b0;
}

.style-card.active span {
    color: #ff6b6b;
    font-weight: 600;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.control-group label {
    font-size: 0.85rem;
    color: #8892b0;
}

.control-group label span {
    color: #ff6b6b;
    font-weight: 600;
}

.control-group select,
.control-group input[type="range"] {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #e4e4e4;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.control-group select:hover,
.control-group input[type="range"]:hover {
    border-color: #ff6b6b;
}

.control-group select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.control-group input[type="range"] {
    padding: 0;
    height: 6px;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: #1a1a2e;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6347, #dc143c);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e4e4e4;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.instructions {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.instructions h3 {
    color: #ccd6f6;
    margin-bottom: 15px;
}

.model-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.info-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #ff6b6b;
}

.info-card h4 {
    color: #feca57;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.info-card p {
    color: #8892b0;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .control-group {
        width: 100%;
    }
    
    .style-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .style-preview {
        width: 60px;
        height: 60px;
    }
}
