/* ==========================================================================
   淘宝风格模块化分块布局与卡片系统 (Taobao Card Grid Layout)
   特性：
   1. “一小块一小块”独立分隔的圆角白底悬浮卡片；
   2. 细腻阴影、轻微边框、悬停微动效；
   3. 模块化栅格（统计小块、内容小块、操作小块）；
   4. 顺滑的骨架屏与极速加载支持。
   ========================================================================== */

:root {
    --tb-bg: #f4f6fa;
    --tb-card-bg: #ffffff;
    --tb-card-border: #e2e8f0;
    --tb-card-radius: 10px;
    --tb-card-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.04);
    --tb-card-hover-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.1), 0 3px 6px -1px rgba(15, 23, 42, 0.06);
    --tb-primary: #1677ff;
    --tb-text-main: #1e293b;
    --tb-text-muted: #64748b;
}

/* 页面背景适配 */
body {
    background-color: var(--tb-bg) !important;
}

/* 核心模块卡片：一小块一小块独立卡片 */
.tb-card,
.card {
    background: var(--tb-card-bg) !important;
    border: 1px solid var(--tb-card-border) !important;
    border-radius: var(--tb-card-radius) !important;
    box-shadow: var(--tb-card-shadow) !important;
    margin-bottom: 16px !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.tb-card:hover,
.card:hover {
    box-shadow: var(--tb-card-hover-shadow) !important;
}

/* 卡片头部 */
.tb-card-header,
.card-header {
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 14px 18px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: var(--tb-text-main);
}

.tb-card-header .tb-card-title,
.card-header strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--tb-text-main);
}

.tb-card-header .tb-card-title::before,
.card-header strong::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #1677ff, #38bdf8);
    border-radius: 2px;
}

/* 卡片主体 */
.tb-card-body,
.card-body {
    padding: 16px 18px !important;
}

/* 淘宝风格分块栅格流 (Grid) */
.tb-grid-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* 4列统计指标小卡片（待发货、待打印、待审批、快捷功能） */
.tb-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 1200px) {
    .tb-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .tb-stat-grid {
        grid-template-columns: 1fr;
    }
}

.tb-stat-card {
    background: #ffffff;
    border: 1px solid var(--tb-card-border);
    border-radius: var(--tb-card-radius);
    padding: 16px 18px;
    box-shadow: var(--tb-card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.tb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--tb-card-hover-shadow);
    border-color: #cbd5e1;
}

.tb-stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tb-stat-title {
    font-size: 13px;
    color: var(--tb-text-muted);
    font-weight: 500;
}

.tb-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tb-text-main);
    line-height: 1.2;
}

.tb-stat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.tb-icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.tb-icon-amber {
    background: #fffbeb;
    color: #d97706;
}

.tb-icon-purple {
    background: #faf5ff;
    color: #9333ea;
}

.tb-icon-emerald {
    background: #f0fdf4;
    color: #059669;
}

/* 表格在小卡片内部的优化 */
.tb-card .table-responsive,
.card .table-responsive {
    border-radius: 0 0 var(--tb-card-radius) var(--tb-card-radius);
}

.tb-card .table,
.card .table {
    margin-bottom: 0;
}

.tb-card .table thead th,
.card .table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
}

.tb-card .table tbody td,
.card .table tbody td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.tb-card .table tbody tr:hover,
.card .table tbody tr:hover {
    background-color: #f8fafc;
}

/* 顺滑淡入与秒开骨架过渡 */
@keyframes tbFadeIn {
    from {
        opacity: 0.85;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-wrap,
.tb-card,
.card {
    animation: tbFadeIn 0.25s ease-out;
}
