/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 32px;
    text-align: center;
}

header h1 { font-size: 24px; font-weight: 600; }
header .subtitle { font-size: 14px; opacity: 0.85; margin-top: 4px; }

/* 主容器 - 左右布局 */
.container {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

.left-panel { flex: 3; min-width: 0; }
.right-panel { flex: 2; min-width: 0; }

/* 面板 */
.panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.panel h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
}

.form-group .required { color: #e74c3c; }

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    background: white;
}

.form-group textarea { resize: vertical; }

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half { flex: 1; }

/* 复选框 */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a6fd6; }
.btn-primary:disabled { background: #b0b8d1; cursor: not-allowed; }

.btn-secondary { background: #f0f0f0; color: #555; }
.btn-secondary:hover { background: #e0e0e0; }

.btn-cancel { background: #eee; color: #888; }
.btn-cancel:hover { background: #ddd; }

.btn-sm { padding: 4px 12px; font-size: 13px; margin-top: 6px; }

.btn-danger { background: #e74c3c; color: white; padding: 4px 10px; font-size: 12px; }
.btn-danger:hover { background: #c0392b; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* AI话术面板 */
.ai-styles-panel {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e0e4f5;
}

.ai-styles-panel h4 { font-size: 14px; margin-bottom: 8px; color: #667eea; }

.style-options {
    display: flex;
    gap: 10px;
}

.style-option {
    flex: 1;
    cursor: pointer;
}

.style-option input[type="radio"] { display: none; }

.style-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    border: 2px solid #e0e4f5;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.style-card strong { font-size: 13px; }
.style-card small { font-size: 11px; color: #999; }

.style-option input:checked + .style-card {
    border-color: #667eea;
    background: #eef0ff;
}

/* 任务列表 */
.list-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.task-list { max-height: 400px; overflow-y: auto; }

.task-card {
    padding: 12px 16px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafbff;
    transition: box-shadow 0.2s;
}

.task-card:hover { box-shadow: 0 2px 6px rgba(102,126,234,0.15); }

.task-card .task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.task-card .task-name { font-weight: 600; font-size: 15px; }
.task-card .task-deadline { font-size: 13px; color: #e74c3c; }

.task-card .task-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.task-card .task-actions {
    display: flex;
    gap: 8px;
}

.task-card .task-actions .btn { font-size: 12px; padding: 3px 10px; }

.task-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.task-status.active { background: #d4edda; color: #155724; }
.task-status.inactive { background: #f8d7da; color: #721c24; }

.empty-tip { text-align: center; color: #aaa; padding: 20px; font-size: 14px; }

/* 拖拽上传区 */
.tip { font-size: 13px; color: #888; margin-bottom: 12px; }

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}

.drop-content { pointer-events: none; }

.upload-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
    margin-bottom: 8px;
}

.drop-zone p { color: #888; font-size: 14px; }

/* 图片预览 */
.image-preview {
    position: relative;
    margin-bottom: 16px;
}

.image-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
}

.btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

/* OCR识别结果 */
.ocr-result {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #e0e4f5;
}

.ocr-result h4 { font-size: 14px; color: #667eea; margin-bottom: 10px; }

.result-item {
    margin-bottom: 8px;
    font-size: 13px;
}

.result-item label { font-weight: 500; color: #555; }
.result-item pre {
    background: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-top: 4px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast通知 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #667eea; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }

/* 响应式 */
@media (max-width: 768px) {
    .container { flex-direction: column; padding: 0 12px; }
    .form-row { flex-direction: column; gap: 0; }
    .style-options { flex-direction: column; }
}
