/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: #667eea;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: 95vh;
}

/* 控制面板样式 */
.control-panel {
    width: 320px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.control-panel h1 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

/* 控制组样式 */
.control-group {
    margin-bottom: 30px;
}

.control-group h2 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f0f7ff;
    transform: translateX(3px);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
    background: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-text {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    flex: 1;
}

.radio-desc {
    font-size: 0.85rem;
    color: #718096;
    font-weight: normal;
}

/* 按钮样式 */
.control-actions {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    flex: 1;
}

.btn-primary {
    background: #667eea;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
    border: 2px solid #cbd5e0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 参数信息 */
.parameter-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    margin-top: 20px;
}

.parameter-info h3 {
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #718096;
    font-weight: 500;
    font-size: 0.95rem;
}

.info-value {
    color: #2d3748;
    font-weight: 600;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

/* 图片面板样式 */
.image-panel {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.image-header {
    padding: 20px 25px;
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-header h2 {
    color: #2c3e50;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-actions {
    display: flex;
    gap: 8px;
}

/* 图片容器 */
.image-container {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.image-wrapper {
    flex: 1;
    position: relative;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 400px;
    margin-bottom: 20px;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* 加载和错误状态 */
.loading-overlay, .error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-overlay {
    color: #e53e3e;
    text-align: center;
}

.error-overlay i {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

/* 试验信息 */
.experiment-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 18px;
    border: 2px solid #e2e8f0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.info-row:last-child {
    border-bottom: none;
}

/* 试验说明 */
.experiment-description {
    padding: 20px 25px;
    border-top: 2px solid #f0f2f5;
    background: #f8fafc;
}

.experiment-description h3 {
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

#descriptionText {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

#descriptionText strong {
    color: #667eea;
    font-weight: 600;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    width: 800px;
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoomed-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #718096;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.close-btn:hover {
    color: #2d3748;
}

/* 消息提示 */
.message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.message.show {
    transform: translateY(0);
    opacity: 1;
}

.message i {
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
    }

    .control-panel {
        width: 100%;
    }

    .image-wrapper {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .control-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .image-actions {
        flex-direction: column;
    }
}