.workcase-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f8fafc;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.header-left {
    flex: 1;
}

.workcase-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workcase-id {
    font-size: 24px;
    font-weight: 700;
    color: #4b87ff;
}

.status-badge,
.urgency-badge {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

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

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

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

.urgency-normal {
    background: #fed7aa;
    color: #9a3412;
}

.urgency-emergency {
    background: #fecaca;
    color: #991b1b;
}

.header-right {
    display: flex;
    gap: 12px;
}

.view-chat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #4b87ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;

    &:hover {
        background: #3b77ef;
    }
}

.detail-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.info-table {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 32px;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr) minmax(0, 3fr);
    border-bottom: 1px solid #e5e7eb;

    &:last-child {
        border-bottom: none;
    }
}

.table-label {
    padding: 12px;
    background: #f9fafb;
    color: #4b5563;
    font-weight: 500;
    font-size: 14px;
    border-right: 1px solid #e5e7eb;
}

.table-value {
    padding: 12px;
    color: #111827;
    font-size: 14px;
    border-right: 1px solid #e5e7eb;
    
    &:last-child {
        border-right: none;
    }
    
    span {
        display: block;
        line-height: 1.5;
    }
}

.table-value-full {
    grid-column: 2 / 5;
}

// 铭牌照片
.nameplate-photo {
    max-width: 400px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s;

    &:hover {
        transform: scale(1.02);
    }

    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #f9fafb;
    }
}

.photos-section,
.timeline-section {
    margin-bottom: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    color: #111827;
    font-weight: 700;
    font-size: 16px;
    
    .title-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

.title-icon {
    color: #a855f7;
}

.title-bar {
    width: 4px;
    height: 16px;
    background: #a855f7;
    border-radius: 2px;
}

.photos-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.photo-item {
    width: 128px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    
    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.photo-upload {
    width: 128px;
    height: 96px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.2s;

    &:hover {
        border-color: #4b87ff;
        color: #4b87ff;
    }
}

.timeline-content {
    position: relative;
    padding-left: 8px;
}

.timeline-line {
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 16px;
    width: 2px;
    background: #f3f4f6;
}

.timeline-item {
    position: relative;
    padding-left: 32px;
    padding-bottom: 32px;

    &:last-child {
        padding-bottom: 0;
    }
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.timeline-dot-system {
    background: #60a5fa;
}

.timeline-dot-manager {
    background: #fb923c;
}

.timeline-dot-engineer {
    background: #34d399;
}

.timeline-body {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.timeline-actor {
    font-weight: 700;
    color: #111827;
}

.timeline-action {
    color: #4b5563;
}

.timeline-desc {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.timeline-files {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    
    .files-label {
        font-size: 12px;
        color: #9ca3af;
        margin-bottom: 4px;
    }
    
    .files-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .file-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        background: #f3f4f6;
        border-radius: 4px;
        font-size: 12px;
        color: #4b87ff;
        text-decoration: none;
        transition: background 0.2s;
        
        &:hover {
            background: #e5e7eb;
        }
        
        .file-icon {
            font-size: 14px;
        }
        
        .file-name {
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }
}

.timeline-time {
    font-size: 12px;
    color: #9ca3af;
}

.detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chat-dialog {
    :deep(.el-dialog__body) {
        padding: 0;
    }
}
