/* === TSP technical support system custom styles === */

/* 全局 */
body {
    background: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* KPI数字 */
.kpi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}
.kpi-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kpi-card {
    transition: transform 0.15s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
}

/* 状态色强化 */
.badge-status-open { background: #ffc107; color: #212529; }
.badge-status-processing { background: #0d6efd; }
.badge-status-replied { background: #6f42c1; }
.badge-status-resolved { background: #198754; }
.badge-status-closed { background: #6c757d; }

/* 消息时间线 */
.timeline {
    position: relative;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}
.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}
.timeline-avatar {
    position: absolute;
    left: -40px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 1;
}
.timeline-avatar.dealer { background: #0d6efd; color: white; }
.timeline-avatar.support { background: #198754; color: white; }
.timeline-avatar.system { background: #6c757d; color: white; }

/* 内部备注 */
.internal-note {
    background: #fff9c4;
    border-left: 4px solid #ffc107;
}

/* 文件预览网格 */
.file-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.file-preview-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8f9fa;
}
.file-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}
.file-preview-item .file-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #6c757d;
}
.file-preview-item .file-name {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* 表格行悬停 */
.table-hover tbody tr {
    cursor: pointer;
}
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* 移动端表格替代 */
.ticket-mobile-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    transition: box-shadow 0.15s ease;
}
.ticket-mobile-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ticket-mobile-card a {
    text-decoration: none;
    color: inherit;
}

/* 上传区 */
.upload-zone {
    border: 2px dashed #0d6efd;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: #f0f7ff;
    cursor: pointer;
    transition: all 0.2s ease;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: #0a58ca;
    background: #d9eeff;
}
.upload-zone i {
    font-size: 2.5rem;
    color: #0d6efd;
}
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.preview-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}
.preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}
.preview-item .file-icon {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 2rem;
    color: #6c757d;
}
.preview-item .file-info {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-item .btn-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.upload-progress {
    margin-top: 0.75rem;
}

/* 响应式表格 */
@media (max-width: 767px) {
    .kpi-number {
        font-size: 1.5rem;
    }
    .card-body {
        padding: 0.75rem;
    }
    .table-responsive-stack td {
        display: block;
        border: none;
    }
    .upload-zone {
        padding: 1.25rem;
    }
    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    .timeline-line::before {
        display: none;
    }
    .message-item {
        gap: 0.75rem !important;
    }
}

/* 打印样式 */
@media print {
    .navbar, .btn, .alert, footer { display: none !important; }
    body { background: white; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6; }
}
