* {
    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, #ffd700, #ff8c00, #ff6347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.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;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

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

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

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

/* 全屏按钮 */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.video-wrapper:fullscreen {
    background: #000;
    padding: 20px;
}

.video-wrapper:fullscreen .fullscreen-btn {
    top: 20px;
    right: 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.8);
    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, 215, 0, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.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 select {
    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 {
    border-color: #64ffda;
}

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

.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, #ffd700, #ff8c00);
    color: #1a1a2e;
}

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

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

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

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(255, 99, 71, 0.4);
}

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

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

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

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

.param-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.param-section h4 {
    color: #64ffda;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.param-row label {
    flex: 0 0 150px;
    font-size: 0.85rem;
    color: #8892b0;
}

.param-row label span {
    color: #ffd700;
    font-weight: 600;
}

.param-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    appearance: none;
    cursor: pointer;
}

.param-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    cursor: pointer;
    transition: transform 0.2s;
}

.param-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.param-actions {
    text-align: center;
    margin-top: 15px;
}

.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 #ffd700;
}

.info-card h4 {
    color: #64ffda;
    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%;
    }
    
    .param-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .param-row label {
        flex: none;
    }
    
    .param-row input[type="range"] {
        width: 100%;
    }
}
