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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 350px;
    background-color: white;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #eee;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 1.5rem;
}

h3 {
    margin-bottom: 10px;
    color: #34495e;
    font-size: 1rem;
}

.upload-section {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-bottom: 20px;
}

.upload-box {
    width: 100%;
}

.file-input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-wrapper label {
    display: block;
    background-color: #f1f1f1;
    color: #333;
    padding: 6px 12px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.file-input-wrapper:hover label {
    background-color: #e5e5e5;
}

.preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.preview img[src] {
    display: block;
}

.generate-btn-container {
    margin-bottom: 20px;
}

#generateButton {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
}

#generateButton:hover {
    background-color: #2980b9;
}

#generateButton:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.control-header label {
    font-size: 0.9rem;
    color: #555;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 0;
}

.toggle-control {
    display: flex;
    margin: 5px 0;
}

.toggle-control label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle-label {
    flex: 1;
    color: #555;
}

.preview-controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background-color: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
}

.zoom-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.stereo-output {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.output-images {
    display: flex;
    justify-content: center;
    gap: 0;
    max-height: 100%;
    max-width: 100%;
    position: relative;
}

.output-images::before {
    content: "立体图像将在生成后显示在此处";
    display: flex;
    justify-content: center;
    align-items: center;
    color: #95a5a6;
    min-height: 300px;
    position: absolute;
}

canvas {
    display: block;
}

.output-images:has(canvas:not([width="0"])) {
    min-height: auto;
}

.output-images:has(canvas:not([width="0"]))::before {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        overflow-y: visible;
    }
    
    .main-content {
        min-height: 40vh;
    }
    
    .preview {
        height: 100px;
    }
}

@media (max-width: 480px) {
    .upload-section {
        flex-direction: column;
    }
}