/* 用户需求输入界面样式 */

.requirement-input {
    padding: 0;
}

.requirement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.requirement-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.requirement-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.requirement-title .material-symbols-outlined {
    color: #3b82f6;
    font-size: 28px;
}

/* 需求表单 */
.requirement-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-section-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.form-section-header .material-symbols-outlined {
    color: #3b82f6;
    font-size: 24px;
}

/* 富文本编辑器 */
.rich-text-editor {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.toolbar-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.toolbar-btn .material-symbols-outlined {
    font-size: 20px;
}

.toolbar-divider {
    width: 1px;
    height: 36px;
    background: #e5e7eb;
    margin: 0 8px;
}

.editor-content {
    flex: 1;
    min-height: 200px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    font-family: "SimSun", "宋体", serif;
}

.editor-content:focus {
    outline: none;
}

.editor-content[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

/* @选项功能 */
.at-selector {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    max-height: 200px;
    overflow-y: auto;
}

.at-selector-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s ease;
}

.at-selector-item:hover {
    background-color: #f3f4f6;
}

.at-selector-item.selected {
    background-color: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.at-selector-item .item-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.at-selector-item .item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.at-selector-item .item-icon {
    font-size: 20px;
    color: #6b7280;
    flex-shrink: 0;
}

.at-selector-item .item-info {
    flex: 1;
    min-width: 0;
}

.at-selector-item .item-name {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.at-selector-item .item-size {
    font-size: 12px;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
}

.at-selector-item .item-type {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
}

/* 插入的附件引用 */
.attachment-reference {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #3b82f6;
    border: 1px solid #2563eb;
    border-radius: 8px;
    font-size: 14px;
    color: white;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.attachment-reference:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.attachment-reference .reference-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.attachment-reference .reference-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-reference .material-symbols-outlined {
    font-size: 16px;
    flex-shrink: 0;
}

.attachment-reference .reference-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-id strong {
    color: #3b82f6;
}

/* 历史需求记录 */
.history-section {
    margin-top: 32px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.history-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.history-info {
    flex: 1;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.history-meta {
    font-size: 12px;
    color: #9ca3af;
}

.history-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.history-status.received {
    background: #fef3c7;
    color: #92400e;
}

.history-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.history-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.history-status.needs-info {
    background: #fee2e2;
    color: #991b1b;
}

/* 状态反馈模态框 */
.status-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.status-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

.status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon.received {
    background: #fef3c7;
}

.status-icon.processing {
    background: #dbeafe;
}

.status-icon.completed {
    background: #d1fae5;
}

.status-icon.needs-info {
    background: #fee2e2;
}

.status-icon .material-symbols-outlined {
    font-size: 32px;
}

.status-icon.received .material-symbols-outlined {
    color: #f59e0b;
}

.status-icon.processing .material-symbols-outlined {
    color: #3b82f6;
}

.status-icon.completed .material-symbols-outlined {
    color: #10b981;
}

.status-icon.needs-info .material-symbols-outlined {
    color: #ef4444;
}

.status-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.status-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.status-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .requirement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .file-upload-section {
        grid-template-columns: 1fr;
    }
    
    .submit-section {
        flex-direction: column;
        gap: 16px;
    }
    
    .submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .editor-toolbar {
        justify-content: center;
    }
}

/* 附件功能 - 整合到富文本编辑器 */
.attachment-buttons {
    display: flex;
    gap: 4px;
}

.attachment-btn {
    position: relative;
}

.attachment-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #374151;
    color: white;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
}

.attachment-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

.hidden-upload-inputs {
    display: none;
}

.upload-input-hidden {
    display: none;
}

/* 附件区域 */
.attachment-area {
    border-top: 1px dashed #e5e7eb;
    padding: 12px 16px;
    background: #fafafa;
    display: block;
}

.attachment-area:empty {
    display: none;
}

/* 表单操作区域 */
.form-actions {
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.uploaded-files-lists {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uploaded-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uploaded-files-list:empty {
    display: none;
}

/* 已上传文件项 */
.uploaded-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
}

.uploaded-file:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.uploaded-file .file-thumbnail-small {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.uploaded-file .file-thumbnail-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-file .file-icon-small {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 4px;
    flex-shrink: 0;
}

.uploaded-file .file-icon-small .material-symbols-outlined {
    font-size: 16px;
    color: #6b7280;
}

.uploaded-file .file-info-small {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.uploaded-file .file-name-small {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
    font-weight: 500;
}

.uploaded-file .file-size-small {
    font-size: 10px;
    color: #9ca3af;
}

.uploaded-file .file-remove-small {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.uploaded-file .file-remove-small:hover {
    background: #fee2e2;
    color: #ef4444;
}

.uploaded-file .file-remove-small .material-symbols-outlined {
    font-size: 14px;
}

/* 附件摘要 */
#attachment-summary {
    color: #6b7280;
}

#attachment-summary.has-attachments {
    color: #10b981;
    font-weight: 500;
}

/* 工具栏分组 */
.editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.editor-toolbar .toolbar-divider {
    height: 24px;
    margin: 0 4px;
}