.report {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}[dir] .report {
    padding: 1rem;
}

/* 滚动容器：列多时横向滚动，行多时表头吸顶 */
.report-scroll {
    max-height: calc(100vh - 22rem);
    min-height: 12rem;
    overflow: auto;
}
[dir] .report-scroll {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.report-table {
    border-collapse: separate; /* sticky 表头需要 separate 才能保留边框 */
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
    line-height: 1.4;
}

.report-table th,
.report-table td {
    vertical-align: middle;
    white-space: nowrap;
}

[dir] .report-table th, [dir] .report-table td {
    border-bottom: 1px solid #ececec;
    padding: 8px 12px;
}

[dir=ltr] .report-table th, [dir=ltr] .report-table td {
    border-right: 1px solid #ececec;
}

[dir=rtl] .report-table th, [dir=rtl] .report-table td {
    border-left: 1px solid #ececec;
}

[dir=ltr] .report-table th:last-child, [dir=ltr] .report-table td:last-child {
    border-right: none;
}

[dir=rtl] .report-table th:last-child, [dir=rtl] .report-table td:last-child {
    border-left: none;
}

[dir] .report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 36px; /* 固定行高，多层表头才能按行号算出 sticky 的 top 偏移 */
    box-sizing: border-box;
    color: #4b4b4b;
    font-weight: 700;
    white-space: nowrap;
}

[dir] .report-table th {
    background-color: #f3f4f6;
}

[dir] .text-center {
    text-align: center;
}

/* separate 模式下 sticky 表头的下边框会跟着滚动，用阴影补一条 */
[dir] .report-table thead th {
    box-shadow: inset 0 -1px 0 #d9d9d9;
}

.report-table tbody td {
    font-weight: 500;
    color: #4b4b4b;
}

[dir] .report-table tbody tr:nth-child(even) > td:not(.subtotal-row) {
    background-color: #fafafa;
}

[dir] .report-table tbody tr:hover > td:not(.subtotal-row) {
    background-color: #f0f4fa;
}

[dir=ltr] .text-right {
    text-align: right;
}

[dir=rtl] .text-right {
    text-align: left;
}

/* 金额列等宽数字，便于上下对位比较 */
.report-table td.text-right,
.report-table th.text-right {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.subtotal-row {
    font-weight: 700;
    color: #2b4f81;
}

[dir] .subtotal-row {
    background-color: #eaf1fb;
}

.report-table td.subtotal-row {
    color: #2b4f81;
    font-weight: 700;
}

[dir] .report-table td.subtotal-row {
    background-color: #eaf1fb;
    border-bottom: 1px solid #cddcf2;
}

/* 小计行左侧色条，避免和斑马纹混淆 */
[dir=ltr] .report-table tr.subtotal-row > td:first-child {
    box-shadow: inset 3px 0 0 #2b4f81;
}
[dir=rtl] .report-table tr.subtotal-row > td:first-child {
    box-shadow: inset -3px 0 0 #2b4f81;
}

/* 放在小计规则之后，保证小计行里的负数同样标红 */
.report-table td.is-negative {
    color: #ea5455;
}

.report-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    color: #a0a0a0;
}

[dir] .report-empty {
    border: 1px dashed #d8d8d8;
    border-radius: 6px;
    background-color: #fbfbfb;
    text-align: center;
}

.report-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #7a7a7a;
}

[dir] .report-empty-title {
    margin-top: 0.75rem;
}

.report-empty-hint {
    font-size: 12px;
}

[dir] .report-empty-hint {
    margin-top: 0.25rem;
}

/* ---------- Configure 弹窗 ---------- */

[dir] .pivot-container {
    padding: 4px;
}

.pivot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

[dir] .pivot-box {
    border: 1px solid #e6e6e6;
    padding: 12px;
    background: #fbfbfb;
}

.pivot-box-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: #5e5873;
}

[dir] .pivot-box-title {
    margin-bottom: 0.5rem;
}

.pivot-box-hint {
    font-size: 11px;
    font-weight: 500;
    color: #b0b0b0;
}

.drop-box {
    position: relative;
    min-height: 110px;
}

[dir] .drop-box {
    padding: 6px;
    border: 1px dashed #dcdcdc;
    border-radius: 6px;
    background: #fff;
}

/* 空区域提示：仅在没有子元素时显示 */
.drop-box:empty::after {
    content: attr(data-placeholder);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 98px;
    font-size: 12px;
    color: #bdbdbd;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

[dir] .field-item {
    padding: 6px 10px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    cursor: grab;
}

[dir] .field-item:hover {
    border-color: #b8c9e6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[dir] .field-item:active {
    cursor: grabbing;
}

.field-item .field-handle {
    color: #c4c4c4;
    font-size: 11px;
    letter-spacing: -1px;
}

.field-item .field-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

[dir] .field-item .field-tag {
    padding: 1px 6px;
    border-radius: 4px;
}

[dir=ltr] .field-item .field-tag {
    margin-left: auto;
}

[dir=rtl] .field-item .field-tag {
    margin-right: auto;
}

.dimension-field {
    color: #4b4b4b;
}

.dimension-field .field-tag {
    color: #6b7280;
}

[dir] .dimension-field .field-tag {
    background: #eceff3;
}

.value-field {
    color: #0d6efd;
}

.value-field .field-tag {
    color: #0d6efd;
}

[dir] .value-field .field-tag {
    background: #e6efff;
}

.sortable-ghost {
    opacity: 0.5;
}

[dir] .sortable-ghost {
    background-color: #d9edf7;
}

