/* ===== 批量操作工具栏 ===== */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--primary-light, #E6F4FF);
    border: 1px solid #A3CFFD;
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
}
.batch-toolbar .select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.batch-toolbar .batch-count {
    color: var(--text-secondary, #4E5969);
}
.batch-toolbar .batch-count b {
    color: var(--primary, #1677FF);
}
.batch-toolbar .batch-sep {
    width: 1px;
    height: 18px;
    background: #FFCCC7;
    margin: 0 4px;
}

/* 仪表盘可点击指标卡片 */
.stat-card[data-tab] {
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.stat-card[data-tab]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}
.stat-card[data-tab]::after {
    content: '→';
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    color: var(--text-muted, #999);
    opacity: 0.6;
    transition: opacity 0.2s;
}
.stat-card[data-tab]:hover::after {
    opacity: 1;
}

/* 趋势图时间范围选择器 */
.range-selector {
    display: inline-flex;
    background: var(--bg-light, #F5F5F5);
    border-radius: 6px;
    padding: 3px;
    gap: 3px;
}
.range-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary, #666);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.range-btn:hover {
    color: var(--primary, #1677FF);
}
.range-btn.active {
    background: #fff;
    color: var(--primary, #1677FF);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    font-weight: 500;
}

/* 角色标签 */
.role-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.role-admin { background: #F6FFED; color: #389E0D; border: 1px solid #B7EB8F; }
.role-boss { background: #E6F7FF; color: #096DD9; border: 1px solid #91D5FF; }
.role-finance { background: #FFF7E6; color: #D48806; border: 1px solid #FFD591; }
.role-content_admin { background: #F9F0FF; color: #722ED1; border: 1px solid #D3ADF7; }

/* ===== 骨架屏 ===== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.skel-card {
    background: #fff;
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
    overflow: hidden;
}
.skel-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
}
.skel-line {
    height: 12px;
    margin: 10px 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
}
.skel-line.short { width: 50%; }
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* ===== 错误边界 ===== */
.error-boundary {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary, #666);
}
.error-boundary .error-icon { font-size: 44px; opacity: 0.5; margin-bottom: 12px; }
/* ===== 内容区面包屑 ===== */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--text-secondary, #666);
}
.breadcrumb-bar .crumb-link {
    color: var(--text-muted, #999);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}
.breadcrumb-bar .crumb-link:hover {
    color: var(--primary, #1677FF);
}
.breadcrumb-bar .crumb-sep {
    color: var(--border, #dcdcdc);
}
.breadcrumb-bar .crumb-current {
    color: var(--text-primary, #333);
    font-weight: 600;
}

/* ===== 弹窗面包屑 ===== */
.modal-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-secondary, #666);
}
.modal-breadcrumb .crumb-link {
    color: var(--text-muted, #999);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}
.modal-breadcrumb .crumb-link:hover {
    color: var(--primary, #1677FF);
}
.modal-breadcrumb .crumb-sep {
    color: var(--border, #dcdcdc);
}
.modal-breadcrumb .crumb-current {
    color: var(--text-primary, #333);
    font-weight: 600;
}

/* ===== 移动端适配增强 ===== */
@media (max-width: 768px) {
    body {
        overflow-x: visible;
    }

    .top-bar {
        gap: 8px;
        padding: 0 12px;
        height: 52px;
    }

    .topbar-search {
        display: none;
    }

    .current-time {
        display: none;
    }

    .breadcrumb {
        font-size: 13px;
        max-width: 100%;
    }

    .crumb-current {
        display: inline-block;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    .content-area {
        width: 100%;
        min-width: 0;
        padding: 12px;
        box-sizing: border-box;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
        margin-bottom: 16px;
    }

    .stats-grid .stat-card {
        min-width: 0;
    }

    .stat-card {
        padding: 14px 16px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-sub {
        font-size: 11px;
    }

    .stat-sub span,
    .stat-sub .badge {
        white-space: nowrap;
    }

    .chart-card,
    .panel-card {
        padding: 14px 16px;
    }

    .chart-container {
        height: 200px;
    }

    .range-selector {
        flex-wrap: wrap;
        width: 100%;
    }

    .range-btn {
        flex: 1;
        min-width: 52px;
        padding: 5px 6px;
        font-size: 11px;
    }

    .rank-item {
        padding: 8px 0;
    }

    .rank-title {
        font-size: 13px;
    }

    /* ===== 移动端表格转卡片列表（每行一张卡片，无需横向滚动） ===== */
    .table-wrap {
        overflow: visible;
    }

    table.card-ready {
        width: 100% !important;
        min-width: 0 !important;
        border: none;
        background: transparent;
    }

    table.card-ready thead {
        display: none;
    }

    table.card-ready,
    table.card-ready tbody,
    table.card-ready tr,
    table.card-ready td {
        display: block;
        width: 100%;
    }

    table.card-ready tr {
        background: #fff;
        border: 1px solid var(--border, #ebedf0);
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 2px 4px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    table.card-ready td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 12px;
        border: none;
        border-bottom: 1px solid #f3f4f6;
        white-space: normal !important;
        max-width: none;
        overflow: visible;
        text-align: right;
        font-size: 13px;
        line-height: 1.4;
    }

    table.card-ready tr td:last-child {
        border-bottom: none;
    }

    table.card-ready td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 40%;
        margin-right: auto;
        text-align: left;
        color: var(--text-secondary, #6b7280);
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    table.card-ready .empty-row td {
        display: block;
        text-align: center;
        border: none;
        color: #9ca3af;
    }

    table.card-ready .empty-row td::before {
        content: none;
    }

    .action-btns {
        flex-wrap: wrap;
        gap: 4px;
    }

    .action-btns .btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .batch-toolbar .btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }

    .modal-card {
        width: 96vw;
        max-height: 86vh;
    }

    .modal-body {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .toolbar-left,
    .toolbar-right {
        flex-wrap: wrap;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .group-page {
        padding: 20px 16px;
    }

    .group-cards {
        grid-template-columns: 1fr;
    }

    .group-card {
        padding: 20px;
    }

    .user-dropdown {
        right: 0;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar-user {
        border-left: none;
        padding-left: 0;
    }

    .breadcrumb {
        display: none;
    }

    .hamburger {
        margin-right: auto;
    }
}

