/* 组件样式文件 */

/* 数据表格组件 */
.data-table {
    background-color: #fff;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.data-table .table {
    margin-bottom: 0;
}

.data-table .table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #212529;
    padding: 1rem 0.75rem;
}

.data-table .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.data-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background-color: #198754;
}

.status-dot.inactive {
    background-color: #6c757d;
}

.status-dot.processing {
    background-color: #ffc107;
}

.status-dot.error {
    background-color: #dc3545;
}

/* 进度指示器 */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-indicator .progress {
    flex: 1;
    height: 0.5rem;
}

.progress-indicator .progress-text {
    font-size: 0.875rem;
    color: #6c757d;
    min-width: 3rem;
    text-align: right;
}

/* 统计卡片组件 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 0.375rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.15s ease-in-out;
}

.stat-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stat-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-card .label {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 过滤器组件 */
.filter-bar {
    background: #fff;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.filter-bar .filter-group {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-bar .filter-item {
    flex: 1;
    min-width: 150px;
}

.filter-bar .filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* 分页组件 */
.pagination-wrapper {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem 0;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.875rem;
}

/* 空状态组件 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state .title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.empty-state .description {
    margin-bottom: 1.5rem;
}

/* 加载状态组件 */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-state .spinner {
    width: 3rem;
    height: 3rem;
    border: 0.3rem solid #f3f3f3;
    border-top: 0.3rem solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-state .text {
    color: #6c757d;
    font-size: 0.875rem;
}

/* 错误状态组件 */
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #dc3545;
}

.error-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.error-state .title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-state .description {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

/* 标签组件 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    background-color: #e9ecef;
    color: #495057;
}

.tag.primary {
    background-color: #cfe2ff;
    color: #084298;
}

.tag.success {
    background-color: #d1e7dd;
    color: #0a3622;
}

.tag.warning {
    background-color: #fff3cd;
    color: #664d03;
}

.tag.danger {
    background-color: #f8d7da;
    color: #58151c;
}

/* 时间显示组件 */
.time-display {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 内容预览组件 */
.content-preview {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, #fff);
}

.content-preview.expanded {
    max-height: none;
}

.content-preview.expanded::after {
    display: none;
}

/* 旋转动画 */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast 提示 */
.toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 99999 !important;
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
}

.toast {
    min-width: 300px !important;
    margin-bottom: 10px !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    background-color: #fff !important;
    color: #212529 !important;
    opacity: 1 !important;
    transform: none !important;
    transition: all 0.3s ease-in-out !important;
    display: block !important;
    visibility: visible !important;
}

.toast.show {
    opacity: 1 !important;
    transform: none !important;
}

.toast.showing {
    opacity: 1 !important;
    transform: none !important;
}

.toast-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 0.5rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
}

.toast-body {
    padding: 0.75rem !important;
    color: #212529 !important;
}

.toast-success .toast-header {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.toast-success .toast-body {
    background-color: #d4edda !important;
    color: #155724 !important;
}

.toast-error .toast-header {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.toast-error .toast-body {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.toast-info .toast-header {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

.toast-info .toast-body {
    background-color: #d1ecf1 !important;
    color: #0c5460 !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar .filter-item {
        min-width: auto;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
    }
}

/* 强制隐藏loadingToast */
#loadingToast {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}
