/* ================================
   Super Directors - 样式文件
   ================================ */

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

/* 主体样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部区域 */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    font-weight: 400;
}

/* 功能卡片区域 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 工作区域 */
.workspace {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 标签页容器 */
.tab-container {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* 标签页内容 */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单组件 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #edf2f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* 输出区域 */
.output-area {
    background: #f8fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #718096;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.output-area.has-content {
    background: white;
    border: 2px solid #e2e8f0;
    color: #4a5568;
}

.output-area h3 {
    margin-bottom: 15px;
    color: inherit;
}

/* 视频预览 */
.video-preview {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 故事建议卡片 */
.story-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.story-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-card:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.story-card h4 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.story-card p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* API 配置区域 */
.api-config {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.api-config h4 {
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* 状态指示器 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background-color 0.3s ease;
}

.status-indicator.connected {
    background: #48bb78;
    box-shadow: 0 0 6px rgba(72, 187, 120, 0.4);
}

.status-indicator.error {
    background: #e53e3e;
    box-shadow: 0 0 6px rgba(229, 62, 62, 0.4);
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
    border-width: 1px;
    border-style: solid;
}

.alert-warning {
    background: #fef5e7;
    color: #744210;
    border-color: #f6e05e;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-color: #fc8181;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #68d391;
}

.alert-info {
    background: #bee3f8;
    color: #2a4365;
    border-color: #63b3ed;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 导出区域 */
.export-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.export-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-weight: 600;
}

.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 复选框样式 */
input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px;
    transform: scale(1.1);
}

/* 链接样式 */
a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .workspace {
        padding: 20px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tab-container {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .export-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .export-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .output-area {
        padding: 20px;
        min-height: 200px;
    }
    
    .story-suggestions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .workspace {
        padding: 15px;
        border-radius: 15px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white !important;
    }
    
    .header {
        background: white !important;
        color: black !important;
    }
    
    .workspace {
        background: white !important;
        box-shadow: none !important;
    }
    
    .btn {
        display: none !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .feature-card {
        background: rgba(255, 255, 255, 0.9);
    }
    
    .workspace {
        background: rgba(255, 255, 255, 0.95);
    }
}