/* 智能总结生成辅助平台 - 主样式文件 */

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

body {
    font-family: 'Microsoft YaHei', 'Arial', sans-serif;
    background: #f5f6fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

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

/* ==== 任务网格 ==== */
.tasks-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ==== 消息提示 ==== */
.error {
    color: #f44336;
    background: #ffebee;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.success {
    color: #4CAF50;
    background: #e8f5e8;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.loading {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ==== 处理中任务提醒 ==== */
.processing-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: none;
    animation: slideDown 0.3s ease;
}

.processing-warning.show {
    display: block;
}

.processing-warning .icon {
    display: inline-block;
    margin-right: 8px;
    animation: spin 2s linear infinite;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* 当有处理中任务时，给body添加上边距 */
body.has-processing-tasks {
    padding-top: 48px;
}

/* ==== 全局消息提示 ==== */
.global-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.global-message.success {
    background: #4CAF50;
    color: white;
}

.global-message.error {
    background: #f44336;
    color: white;
}

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

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

.modal.show {
    display: block;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.close-btn {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #666;
}

.modal-body {
    padding: 24px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.modal-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
    line-height: 1.5;
}

.modal-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    background: #f8f9fa;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #6c757d;
    color: white;
}

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

.save-btn {
    background: #28a745;
    color: white;
}

.save-btn:hover {
    background: #218838;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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