/* Media2MD Web API 样式文件 */
/* CSS重置和兼容性修复 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 确保flex布局兼容性 */
.form-row {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
}

/* 修复网格布局 */
.content-panel > div[style*="grid"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 20px !important;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    margin-top: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #667eea;
}

.header h1 {
    color: #333;
    margin: 0;
    font-size: 2.2em;
    font-weight: bold;
}

/* 折叠面板样式 */
.collapsible {
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    margin: 10px 0;
    transition: background-color 0.3s;
}

.collapsible:hover {
    background-color: #e9ecef;
}

.collapsible.active {
    background-color: #667eea;
    color: white;
}

.collapsible:after {
    content: '\002B';
    color: #333;
    font-weight: bold;
    float: right;
    margin-left: 5px;
}

.collapsible.active:after {
    content: "\2212";
    color: white;
}

.content-panel {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.content-panel.active {
    padding: 15px;
    max-height: 500px;
}

/* Tab样式 */
.tabs {
    display: flex;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    margin-top: 20px;
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.3s;
}

.tab.active {
    background-color: #667eea;
    color: white;
}

.tab:first-child {
    border-radius: 8px 0 0 0;
}

.tab:last-child {
    border-radius: 0 8px 0 0;
}

.tab-content {
    display: none;
    padding: 20px;
    background: white;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e2e8f0;
    border-top: none;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

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

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
    margin: 5px;
}

.btn:hover {
    background: #5a67d8;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: border-color 0.3s;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
}

.file-upload-area.drag-over {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

/* 结果显示区域 */
.result-area {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
    min-height: 200px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
}

.result-area.loading {
    text-align: center;
    color: #667eea;
    font-style: italic;
}

.result-area.error {
    color: #e53e3e;
    background: #fed7d7;
    border-color: #feb2b2;
}

.result-area.success {
    color: #38a169;
    background: #c6f6d5;
    border-color: #9ae6b4;
}

/* Markdown渲染样式 */
.markdown-content {
    line-height: 1.6;
    color: #333;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    color: #2d3748;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content a {
    color: #667eea;
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-info {
    background-color: #667eea;
}

.notification-success {
    background-color: #38a169;
}

.notification-error {
    background-color: #e53e3e;
}

.notification-warning {
    background-color: #d69e2e;
}

/* 进度条样式 */
.progress-container {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.progress-text {
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #667eea;
    transition: width 0.3s ease;
}

.progress-percentage {
    text-align: right;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.notification {
    animation: slideIn 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        margin: 10px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-radius: 0 !important;
    }
}
