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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* 容器和布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    gap: 2rem;
}

section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

section h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 配置状态卡片 */
.config-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.status-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.status-icon {
    font-size: 1.2rem;
}

.status-hint {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

.input-section-hint {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    color: #1565c0;
    font-size: 0.9rem;
}

.status-unknown { color: #f39c12; }
.status-valid { color: #27ae60; }
.status-invalid { color: #e74c3c; }
.status-loading { color: #3498db; }

/* 输入区域样式 */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

#imageInput {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

#imageInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-hint {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 选项样式 */
.options {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #495057;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border: 2px solid transparent;
}

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

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

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* 状态显示区域 */
.status-container, .history-container {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

.placeholder {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.placeholder-hint {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease-in-out;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: white;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.4;
}

.form-hint a {
    color: #667eea;
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

/* 信息框样式 */
.info-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
}

.info-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-content {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
    animation: slideInRight 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-success {
    border-left-color: #27ae60;
}

.notification-error {
    border-left-color: #e74c3c;
}

.notification-warning {
    border-left-color: #f39c12;
}

.notification-large {
    max-width: 450px;
    padding: 1.25rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
}

.notification-message a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.notification-message a:hover {
    text-decoration: underline;
}

/* 工作流状态显示 */
.workflow-item {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.workflow-title {
    font-weight: 500;
    color: #2c3e50;
}

.workflow-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background: #e3f2fd;
    color: #1976d2;
}

.workflow-status.running {
    background: #fff3e0;
    color: #f57c00;
}

.workflow-status.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.workflow-status.failed {
    background: #ffebee;
    color: #c62828;
}

.workflow-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 验证结果显示 */
.validation-results {
    max-height: 300px;
    overflow-y: auto;
}

.image-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

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

.image-status {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.image-info {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.image-valid {
    color: #27ae60;
}

.image-invalid {
    color: #e74c3c;
}

.image-warning {
    color: #f39c12;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .options {
        flex-direction: column;
        gap: 1rem;
    }

    .actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .notification-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    section {
        padding: 1.5rem;
    }

    .actions {
        gap: 0.75rem;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }
}