/* ========== 仪表盘钻取 Drawer 样式 ========== */

.dashboard-drilldown-drawer .ant-drawer-content {
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 180px);
}

.dashboard-drilldown-drawer .ant-drawer-wrapper-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dashboard-drilldown-drawer .ant-drawer-header {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    border-bottom: 1px solid var(--linear-border, #e5e7eb);
}

.dashboard-drilldown-drawer .ant-drawer-title {
    color: var(--linear-text, #0b0f19);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.dashboard-drilldown-drawer .ant-drawer-body {
    padding: 18px 24px 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.dashboard-drilldown-drawer .ant-drawer-footer {
    border-top: 1px solid var(--linear-border, #e5e7eb);
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.drilldown-content-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
}

.drilldown-hero-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.94)),
        #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.drilldown-hero-panel::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0));
    pointer-events: none;
}

.drilldown-hero-head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.drilldown-hero-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 8px;
}

.drilldown-hero-title {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--linear-text, #0b0f19);
    margin-bottom: 6px;
}

.drilldown-hero-subtitle {
    max-width: 620px;
    font-size: 13px;
    color: var(--linear-muted, #667085);
    line-height: 1.6;
}

.drilldown-hero-metric {
    position: relative;
    z-index: 1;
    min-width: 132px;
    padding: 14px 16px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.drilldown-hero-metric-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.drilldown-hero-metric-label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475467;
}

.drilldown-hero-metric-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #667085;
}

.drilldown-condition-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.drilldown-condition-card {
    padding: 12px 14px;
    border: 1px solid var(--linear-border, #e5e7eb);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    min-height: 72px;
}

.drilldown-condition-card.is-primary {
    border-color: rgba(37, 99, 235, 0.22);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.drilldown-condition-card.is-accent {
    border-color: rgba(15, 118, 110, 0.2);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.98), rgba(255, 255, 255, 0.98));
}

.drilldown-condition-label {
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #667085;
}

.drilldown-condition-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: #101828;
    word-break: break-word;
}

.drilldown-breadcrumb-shell,
.drilldown-toolbar,
.drilldown-table-shell {
    margin-bottom: 14px;
    border: 1px solid var(--linear-border, #e5e7eb);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.drilldown-hero-panel,
.drilldown-breadcrumb-shell,
.drilldown-toolbar,
.drilldown-summary-cards {
    flex-shrink: 0;
}

.drilldown-breadcrumb-shell {
    padding: 12px 14px;
}

.dashboard-drilldown-drawer .ant-breadcrumb {
    margin-bottom: 0;
}

.drilldown-toolbar {
    padding: 12px 14px 0;
}

.dashboard-drilldown-drawer .ant-radio-group {
    margin-bottom: 12px;
}

.drilldown-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.drilldown-summary-cards .ant-card {
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.drilldown-summary-cards .ant-statistic-title {
    font-size: 12px;
    color: #667085;
}

.drilldown-summary-cards .ant-statistic-content {
    font-size: 22px;
}

.drilldown-table-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.dashboard-drilldown-drawer .ant-table-wrapper,
.dashboard-drilldown-drawer .ant-spin-nested-loading,
.dashboard-drilldown-drawer .ant-spin-container {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.dashboard-drilldown-drawer .ant-table-body {
    overflow-y: auto !important;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 var(--linear-border, #E5E7EB);
}

.dashboard-drilldown-drawer .ant-table-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block !important;
    -webkit-appearance: none;
}

.dashboard-drilldown-drawer .ant-table-body::-webkit-scrollbar-track {
    background: var(--linear-border, #E5E7EB);
    border-radius: 4px;
}

.dashboard-drilldown-drawer .ant-table-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    min-height: 40px;
}

.dashboard-drilldown-drawer .ant-table-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dashboard-drilldown-drawer .ant-table-small {
    border-radius: 14px;
}

.dashboard-drilldown-drawer .ant-table-thead > tr > th {
    background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
    font-weight: 700;
    font-size: 12px;
    color: #475467;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard-drilldown-drawer .ant-table-tbody > tr > td {
    font-size: 13px;
    border-bottom: 1px solid #f2f4f7;
}

.dashboard-drilldown-drawer .ant-table-tbody > tr:hover > td {
    background: #f5faff;
}

.dashboard-drilldown-drawer .ant-table-pagination.ant-pagination {
    padding: 0 14px 14px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.drilldown-action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.drilldown-footer-actions {
    display: flex;
    justify-content: flex-end;
}

.drilldown-export-button {
    min-width: 132px;
    font-weight: 600;
}

/* 图表容器 hover 指针 */
.chart-card .chart-container,
.chart-card > .ant-card-body > div[id$="-chart"] {
    cursor: pointer;
}

/* 响应式：移动端 Drawer 全屏 */
@media (max-width: 768px) {
    .dashboard-drilldown-drawer .ant-drawer-content-wrapper {
        width: 100% !important;
    }

    .dashboard-drilldown-drawer .ant-drawer-body {
        padding: 14px;
    }

    .drilldown-hero-head {
        flex-direction: column;
    }

    .drilldown-hero-metric {
        width: 100%;
        text-align: left;
    }

    .drilldown-summary-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .drilldown-summary-cards,
    .drilldown-condition-grid {
        grid-template-columns: 1fr !important;
    }

    .drilldown-hero-title {
        font-size: 18px;
    }
}
