* {
    box-sizing: border-box;
}

:root {
    --bg-0: #eef3ff;
    --bg-1: #e5efff;
    --text-main: #12223d;
    --text-sub: #607399;
    --primary: #2d75ff;
    --primary-deep: #1f60dc;
    --line: #d8e4ff;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 14% 16%, rgba(125, 170, 255, 0.3), transparent 40%),
        radial-gradient(circle at 88% 4%, rgba(107, 211, 255, 0.26), transparent 35%),
        linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

.page {
    max-width: 1380px;
    margin: 0 auto;
    padding: 22px 20px 28px;
}

.toolbar-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 10px 28px rgba(29, 71, 150, 0.08);
    backdrop-filter: blur(8px);
}

.toolbar-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}

.toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4f8ff;
    border: 1px solid #dce8ff;
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.4;
}

.meta-chip-label {
    color: #8a9bb8;
}

.meta-chip-value {
    color: var(--text-main);
    font-weight: 600;
}

.meta-chip.is-ready {
    background: #edfbf4;
    border-color: #c6ecd8;
}

.meta-chip.is-ready .meta-chip-value {
    color: #167a52;
}

.meta-chip.is-loading {
    background: #fff8ed;
    border-color: #f5dfc0;
}

.meta-chip.is-loading .meta-chip-value {
    color: #a66b12;
}

.meta-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
    flex-shrink: 0;
}

.meta-chip.is-ready .meta-dot {
    background: #22c55e;
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.meta-chip.is-loading .meta-dot {
    background: #f59e0b;
    opacity: 1;
    animation: metaPulse 1.2s ease-in-out infinite;
}

@keyframes metaPulse {
    0%, 100% { opacity: 0.45; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1); }
}

.toolbar-head {
    min-width: 0;
    flex: 1;
}

.report-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.report-title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-edit-title {
    flex-shrink: 0;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--text-sub, #666);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-edit-title:hover {
    border-color: var(--primary, #2d75ff);
    color: var(--primary, #2d75ff);
}

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 18px;
}

.toolbar-actions .btn-ai-report {
    background: linear-gradient(135deg, #fff5fb 0%, #f3e8ff 100%);
    color: #8b3d6b;
    border: 1px solid #e8c4d8;
    font-weight: 600;
}

.toolbar-actions .btn-ai-report:hover:not(:disabled) {
    background: linear-gradient(135deg, #fdeef5 0%, #ebe0ff 100%);
}

.toolbar-actions .btn-ai-report:disabled {
    opacity: 0.55;
}

.title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-sub);
    letter-spacing: 0.2px;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 9px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, #4a94ff 100%);
    box-shadow: 0 6px 16px rgba(45, 117, 255, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4a94ff 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(45, 117, 255, 0.28);
}

.btn-icon-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-glyph {
    font-size: 15px;
    line-height: 1;
    opacity: 0.88;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(45, 117, 255, 0.38);
    filter: brightness(1.02);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(45, 117, 255, 0.28);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stage-wrap {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(29, 71, 150, 0.14);
}

.stage {
    position: relative;
    min-height: 780px;
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--line);
    border-bottom: none;
    background-color: #ffffffbf;
    backdrop-filter: blur(6px);
    background-image:
        linear-gradient(to right, rgba(45, 117, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(45, 117, 255, 0.1) 1px, transparent 1px);
    overflow: hidden;
    transition: box-shadow 0.26s ease, border-color 0.26s ease, background-color 0.26s ease;
}

.stage.is-empty {
    background-color: #fbfcffcc;
}

.stage-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-top: 1px solid #e8f0ff;
    border-radius: 0 0 18px 18px;
    font-size: 12px;
    color: var(--text-sub);
}

.stage-bar-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--primary-deep);
    cursor: pointer;
    transition: color 0.15s ease;
}

.stage-bar-link:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.stage-bar-divider {
    width: 1px;
    height: 12px;
    background: #d8e4ff;
}

.stage-bar-count {
    margin-left: auto;
    font-weight: 600;
    color: #5f7296;
}

.stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    pointer-events: none;
    z-index: 1;
}

.stage-empty .btn {
    pointer-events: auto;
}

.stage-empty-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: min(220px, 60vw);
    margin-bottom: 22px;
    opacity: 0.55;
}

.stage-empty-block {
    height: 52px;
    border-radius: 12px;
    border: 1px dashed #b8cff5;
    background: rgba(45, 117, 255, 0.06);
}

.stage-empty-block.wide {
    grid-column: 1 / -1;
    height: 44px;
}

.stage-empty-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.stage-empty-desc {
    margin: 0 0 20px;
    max-width: 360px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-sub);
}

.stage.operating {
    border-color: #bfd4ff;
    background-color: #ffffffd6;
    background-image:
        linear-gradient(to right, rgba(45, 117, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(45, 117, 255, 0.18) 1px, transparent 1px);
}

.widget:hover .widget-tools,
.widget.active .widget-tools {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.widget {
    position: absolute;
    background: #fff;
    border: 1px solid #d7e3ff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(27, 63, 131, 0.1);
    overflow: hidden;
    user-select: none;
    will-change: left, top, width, height;
    transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.widget:hover {
    box-shadow: 0 12px 28px rgba(27, 63, 131, 0.16);
}

.widget.active {
    border-color: #7aa9ff;
    box-shadow: 0 14px 32px rgba(45, 117, 255, 0.22);
}

.widget-tools {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.drag-handle-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cddcff;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.95);
    color: #4a71b0;
    cursor: grab;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(31, 72, 148, 0.12);
}

.drag-handle-btn:active {
    cursor: grabbing;
}

.widget-actions button {
    border: 1px solid #d4e2ff;
    background: rgba(255, 255, 255, 0.96);
    color: #2d75ff;
    border-radius: 8px;
    padding: 4px 9px;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget-actions button:hover {
    border-color: #b9d0ff;
    background: #f3f8ff;
}

.widget-actions .btn-ai {
    color: #6e4bff;
    border-color: #d9d0ff;
    background: rgba(244, 240, 255, 0.95);
}

.widget-actions .btn-ai:hover {
    border-color: #c1b0ff;
    background: #eee7ff;
}

.widget-actions .btn-preview {
    color: #0d8a6a;
    border-color: #b8e6d8;
    background: rgba(240, 252, 247, 0.96);
}

.widget-actions .btn-preview:hover {
    border-color: #8fd9c2;
    background: #e6faf3;
}

.widget-body {
    height: 100%;
    padding: 10px;
    overflow: auto;
}

.resize-handle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 48%, var(--primary) 52%);
    border-bottom-right-radius: 9px;
    opacity: 0.85;
    z-index: 5;
}

.drag-ghost {
    position: absolute;
    border-radius: 14px;
    border: 1px dashed rgba(45, 117, 255, 0.95);
    background: rgba(45, 117, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(45, 117, 255, 0.12);
    pointer-events: none;
    z-index: 6;
}

.align-line {
    position: absolute;
    pointer-events: none;
    z-index: 7;
}

.align-line-v {
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, rgba(255, 120, 80, 0.92), rgba(255, 120, 80, 0.35));
}

.align-line-h {
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 120, 80, 0.92), rgba(255, 120, 80, 0.35));
}

.panel-mask {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 17, 30, 0.36);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    animation: maskFadeIn 0.2s ease;
}

.panel {
    width: 600px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 52px rgba(17, 39, 81, 0.25);
    animation: panelIn 0.26s ease;
    overflow: hidden;
}

.panel-layout,
.panel-create,
.panel-setting-split,
.panel-dialog {
    padding: 0;
}

.panel > .form-row,
.panel > .filter-list,
.panel > .ai-explain-text,
.panel > .data-preview-tabs,
.panel > .data-preview-meta,
.panel > .data-preview-empty,
.panel > .data-preview-table-wrap,
.panel > .component-groups,
.panel > .panel-footer {
    margin-left: 16px;
    margin-right: 16px;
}

.panel > h3:first-child,
.panel > .panel-header + .form-row,
.panel > .panel-header ~ .form-row:first-of-type {
    margin-top: 0;
}

.panel > .panel-footer {
    margin-bottom: 16px;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #eef2f8;
    background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
}

.panel-header-main h3 {
    margin: 0 0 4px;
}

.panel-header .panel-hint {
    margin: 0;
}

.panel-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f0f4fa;
    color: #6b7c99;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.panel-close:hover {
    background: #e8eef8;
    color: var(--text-main);
}

.panel h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.panel-layout .form-row,
.panel-create .component-groups {
    padding-top: 4px;
}

.panel-layout .form-row:first-of-type,
.panel-create .component-groups {
    margin-top: 16px;
}

.panel-layout .panel-footer {
    padding-top: 4px;
    border-top: 1px solid #eef2f8;
    padding-bottom: 16px;
    margin-top: 8px;
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
    padding-right: 16px;
}

.panel-create {
    width: 640px;
}

.component-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.component-group-title {
    font-size: 12px;
    font-weight: 700;
    color: #8a9bb8;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.panel-config {
    width: 380px;
    padding: 20px 18px 16px;
}

.panel-setting-split {
    width: min(1380px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    height: calc(100vh - 36px);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.panel-setting-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.setting-preview-pane {
    flex: 1 1 56%;
    width: auto;
    max-width: none;
    min-width: 0;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f8 100%);
    border-right: 1px solid #e2e9f3;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.setting-preview-head {
    padding: 16px 16px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.setting-preview-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.setting-preview-name {
    font-size: 12px;
    color: var(--text-sub);
}

.setting-preview-body {
    flex: 1;
    min-height: 0;
    margin: 0 16px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e9f3;
    overflow: hidden;
    position: relative;
}

.setting-preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-sub);
    font-size: 14px;
}

.setting-config-pane {
    flex: 0 0 44%;
    width: 44%;
    min-width: 420px;
    max-width: 560px;
    padding: 20px 18px 16px;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 1100px) {
    .setting-config-pane {
        flex: 0 0 46%;
        width: 46%;
        min-width: 360px;
        max-width: none;
    }
}

@media (max-width: 1024px) {
    .panel-setting-split {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }
    .panel-setting-body {
        flex-direction: column;
    }
    .setting-preview-pane {
        width: 100%;
        flex: 0 0 38%;
        min-height: 220px;
        border-right: none;
        border-bottom: 1px solid #e2e9f3;
    }
    .setting-preview-body {
        min-height: 180px;
    }
    .setting-config-pane {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
    }
}

.panel-config-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
}

.input-title {
    margin-bottom: 8px;
    font-weight: 600;
}

.config-hint {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.config-block {
    margin-bottom: 18px;
}

.config-block-compact {
    margin-bottom: 12px;
}

.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-main);
}

.config-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.config-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.config-inline-3 {
    grid-template-columns: repeat(3, 1fr);
}

.panel-layout {
    max-width: 420px;
}

.panel-hint {
    margin: -4px 0 16px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
}

.config-preview {
    font-size: 12px;
    color: var(--primary-deep);
    background: #f3f8ff;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.panel-footer-sticky {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #eef2f8;
}

.segmented {
    display: flex;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.segmented-full {
    width: 100%;
}

.seg-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 6px;
    font-size: 12px;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.seg-btn.active {
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chart-type-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-type-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}

.chart-type-btn:hover {
    border-color: #b8d1ff;
}

.chart-type-btn.active {
    border-color: var(--primary);
    background: #f0f6ff;
}

.chart-type-icon {
    font-size: 18px;
    line-height: 1;
    color: #555;
}

.chart-type-btn.active .chart-type-icon {
    color: var(--primary-deep);
}

.btn-add-line.is-disabled {
    color: #c8c8c8;
    cursor: not-allowed;
    pointer-events: none;
}

.field-chips-mt {
    margin-top: 8px;
}

.textarea-setting {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

.vmxtext-editor-wrap {
    min-height: 360px;
    border: 1px solid #dce3ef;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.vmxtext-editor-wrap .tox-tinymce {
    border: none !important;
    border-radius: 8px;
    min-height: 360px;
}

.config-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.btn-fullscreen {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.3;
}

/* 盖过组件设置弹层，避免全屏被挡住 */
body.vmxtext-editor-fullscreen .tox.tox-tinymce.tox-fullscreen,
body.vmxtext-editor-fullscreen .tox-tinymce.tox-fullscreen,
.tox-fullscreen {
    z-index: 10050 !important;
}

body.vmxtext-editor-fullscreen .tox-tinymce-aux,
.tox-tinymce-aux {
    z-index: 10060 !important;
}

.vmxtext-token-panel {
    margin: 8px 0 10px;
    padding: 10px;
    border: 1px dashed #c9d6ea;
    border-radius: 8px;
    background: #f7f9fc;
}

.vmxtext-token-caption {
    font-size: 12px;
    color: #6b7c93;
    margin-bottom: 8px;
}

.vmxtext-token-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vmxtext-token-bar .btn-token {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
    min-width: 108px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    text-align: left;
    line-height: 1.25;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.vmxtext-token-bar .btn-token:hover {
    border-color: #7aa2e3;
    box-shadow: 0 0 0 3px rgba(59, 111, 217, 0.12);
}

.vmxtext-token-bar .btn-token-primary {
    border-color: #9bb8e8;
    background: #eef4ff;
}

.vmxtext-token-bar .btn-token-primary:hover {
    background: #e4edff;
}

.btn-token-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2a37;
}

.btn-token-sub {
    font-size: 11px;
    color: #7b8ba1;
}

.vmxtext-template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.vmxtext-template-actions .btn-outline:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.config-hint-inline {
    margin-top: 8px;
}

.vmxtext-rich .vmx-calc-token,
.vmxtext-editor-wrap .vmx-calc-token {
    display: inline-block;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 4px;
    background: #eef3ff;
    color: #3b6fd9;
    font-size: 0.92em;
    line-height: 1.4;
    white-space: nowrap;
}

.vmxtext-rich {
    font-weight: 400;
}

.vmxtext-rich strong,
.vmxtext-rich b {
    font-weight: 700;
}

.vmxtext-rich p {
    margin: 0 0 0.5em;
}

.vmxtext-rich p:last-child {
    margin-bottom: 0;
}

.vmxtext-rich ul,
.vmxtext-rich ol {
    margin: 0.25em 0 0.5em 1.25em;
    padding: 0;
}

.vmxtext-rich li {
    margin: 0.15em 0;
}

.vmx-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #999;
    font-size: 13px;
    padding: 16px;
    text-align: center;
}

.vmx-image-placeholder-icon {
    font-size: 32px;
    opacity: 0.5;
}

.image-upload-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.config-hint.inline-hint {
    margin-bottom: 0;
}

.image-preview-box {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin-top: 4px;
}

.image-preview-thumb {
    display: block;
    max-width: 100%;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    background: #fff;
}

/* 标题组件 */
.vmx-heading-wrap {
    overflow: hidden;
}

.vmx-heading {
    width: 100%;
    max-width: 100%;
}

.vmx-heading--align-left {
    text-align: left;
}

.vmx-heading--align-center {
    text-align: center;
}

.vmx-heading--align-right {
    text-align: right;
}

.vmx-heading-title {
    margin: 0;
    font-weight: 700;
    word-break: break-word;
}

.vmx-heading-sub {
    margin: 0;
    word-break: break-word;
}

.vmx-heading-divider {
    width: 48px;
    height: 3px;
    border-radius: 2px;
    margin: 10px auto;
    opacity: 0.85;
}

.vmx-heading--align-left .vmx-heading-divider {
    margin-left: 0;
    margin-right: auto;
}

.vmx-heading--align-right .vmx-heading-divider {
    margin-left: auto;
    margin-right: 0;
}

.vmx-heading-leftbar {
    border-left: 4px solid var(--heading-accent, #4f6ef7);
    padding-left: 14px;
}

.vmx-heading-title-underline {
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--heading-accent, #4f6ef7);
}

.vmx-heading-title-gradient {
    background: linear-gradient(90deg, var(--heading-accent, #4f6ef7), color-mix(in srgb, var(--heading-accent, #4f6ef7) 55%, #fff));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.input-color-hex {
    width: 88px;
    min-width: 72px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    padding: 4px 6px;
}

.vmx-heading-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--heading-accent, #4f6ef7) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--heading-accent, #4f6ef7) 35%, #fff);
    margin-bottom: 8px;
    font-weight: 500;
}

.vmx-heading--card .vmx-heading-card-inner {
    background: linear-gradient(135deg, color-mix(in srgb, var(--heading-accent, #4f6ef7) 8%, #fff), #f8f9fc);
    border: 1px solid color-mix(in srgb, var(--heading-accent, #4f6ef7) 18%, #e8eaf0);
    border-radius: 10px;
    padding: 16px 20px;
    width: 100%;
    box-sizing: border-box;
}

.heading-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.heading-style-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.heading-style-item:hover {
    border-color: #c5cad6;
}

.heading-style-item.active {
    border-color: var(--primary, #4f6ef7);
    background: #f0f4ff;
}

.heading-style-item-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.heading-style-item-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
}

.heading-typo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.heading-typo-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.input-color {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.image-clear-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
}

.pie-style-icon {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-sizing: border-box;
}

.pie-style-solid {
    background: #555;
}

.pie-style-ring {
    border: 5px solid #555;
    background: transparent;
}

.chart-type-btn.active .pie-style-solid {
    background: var(--primary-deep);
}

.chart-type-btn.active .pie-style-ring {
    border-color: var(--primary-deep);
}

.radar-style-icon {
    display: block;
    width: 24px;
    height: 24px;
    position: relative;
}

.radar-style-line::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 2px solid #555;
    border-radius: 2px;
    transform: rotate(45deg);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.radar-style-area::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: #888;
    opacity: 0.55;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.chart-type-btn.active .radar-style-line::before {
    border-color: var(--primary-deep);
}

.chart-type-btn.active .radar-style-area::before {
    background: var(--primary-deep);
    opacity: 0.45;
}

.area-style-icon {
    display: block;
    width: 26px;
    height: 22px;
    position: relative;
    overflow: hidden;
}

.area-style-icon::before,
.area-style-icon::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    border-radius: 1px 1px 0 0;
}

.area-style-normal::before {
    bottom: 2px;
    background: linear-gradient(180deg, rgba(85, 85, 85, 0.15) 0%, rgba(85, 85, 85, 0.55) 100%);
    clip-path: polygon(0% 100%, 15% 40%, 35% 70%, 55% 30%, 75% 55%, 100% 20%, 100% 100%);
}

.area-style-stack::before {
    bottom: 2px;
    background: rgba(85, 85, 85, 0.45);
    clip-path: polygon(0% 100%, 20% 60%, 50% 80%, 80% 50%, 100% 70%, 100% 100%);
}

.area-style-stack::after {
    bottom: 8px;
    background: rgba(85, 85, 85, 0.25);
    clip-path: polygon(0% 100%, 25% 75%, 55% 90%, 85% 65%, 100% 85%, 100% 100%);
}

.area-style-percent::before {
    bottom: 2px;
    background: rgba(85, 85, 85, 0.5);
    height: 100%;
    clip-path: polygon(0% 100%, 0% 30%, 35% 30%, 35% 100%);
}

.area-style-percent::after {
    bottom: 2px;
    left: 35%;
    background: rgba(85, 85, 85, 0.3);
    height: 100%;
    clip-path: polygon(0% 100%, 0% 50%, 100% 50%, 100% 100%);
}

.chart-type-btn.active .area-style-normal::before {
    background: linear-gradient(180deg, rgba(22, 93, 255, 0.12) 0%, rgba(22, 93, 255, 0.5) 100%);
}

.chart-type-btn.active .area-style-stack::before {
    background: rgba(22, 93, 255, 0.45);
}

.chart-type-btn.active .area-style-stack::after {
    background: rgba(22, 93, 255, 0.22);
}

.chart-type-btn.active .area-style-percent::before,
.chart-type-btn.active .area-style-percent::after {
    background: rgba(22, 93, 255, 0.45);
}

.btn-add-line {
    border: none;
    background: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
}

.btn-icon-del {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.45;
    padding: 4px;
}

.btn-icon-del:hover {
    opacity: 0.85;
}

.stat-value-row {
    display: grid;
    grid-template-columns: 1fr 1fr 32px;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.stat-value-list {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .panel-config {
        width: calc(100vw - 24px);
    }
    .config-inline,
    .config-inline-3 {
        grid-template-columns: 1fr;
    }
    .seg-btn {
        font-size: 11px;
        padding: 8px 4px;
    }
}

.panel-scroll:not(.panel-setting-split):not(.panel-data-preview) {
    padding: 16px;
}

.panel-dialog.panel-scroll,
.panel-dialog.panel-data-preview {
    padding: 0;
}

.panel-dialog .panel-footer {
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 16px;
}

.panel-dialog > .filter-list,
.panel-dialog > .ai-explain-text,
.panel-dialog > .data-preview-tabs {
    margin-top: 16px;
}

.panel-data-preview.panel-dialog {
    padding: 0;
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    font-size: 13px;
    display: block;
    margin-bottom: 5px;
    color: #5f7296;
}

.input,
.select,
textarea {
    width: 100%;
    border: 1px solid #d6e4ff;
    border-radius: 9px;
    padding: 9px 11px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.select:focus,
textarea:focus {
    border-color: #9ebfff;
    box-shadow: 0 0 0 3px rgba(45, 117, 255, 0.13);
}

.panel-footer {
    text-align: right;
    margin-top: 14px;
}

.ai-explain-text {
    line-height: 1.8;
    color: #31415e;
    font-size: 14px;
    background: #f7f9ff;
    border: 1px solid #e2e9ff;
    border-radius: 10px;
    padding: 12px;
}

.ai-md-body {
    word-break: break-word;
}

.ai-md-body > :first-child {
    margin-top: 0;
}

.ai-md-body > :last-child {
    margin-bottom: 0;
}

.ai-md-body h1,
.ai-md-body h2,
.ai-md-body h3,
.ai-md-body h4 {
    color: #1f2a44;
    line-height: 1.45;
    margin: 1em 0 0.55em;
    font-weight: 600;
}

.ai-md-body h1 { font-size: 1.25em; }
.ai-md-body h2 { font-size: 1.12em; }
.ai-md-body h3 { font-size: 1.05em; }

.ai-md-body p {
    margin: 0.55em 0;
}

.ai-md-body ul,
.ai-md-body ol {
    margin: 0.45em 0 0.65em;
    padding-left: 1.35em;
}

.ai-md-body li {
    margin: 0.25em 0;
}

.ai-md-body li > p {
    margin: 0.2em 0;
}

.ai-md-body strong {
    color: #1f2a44;
    font-weight: 600;
}

.ai-md-body em {
    color: #4a5878;
}

.ai-md-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
    background: #eef2ff;
    color: #334155;
    padding: 0.12em 0.35em;
    border-radius: 4px;
}

.ai-md-body pre {
    margin: 0.65em 0;
    padding: 10px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
}

.ai-md-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.ai-md-body blockquote {
    margin: 0.65em 0;
    padding: 0.35em 0 0.35em 12px;
    border-left: 3px solid #c7d2fe;
    color: #52607a;
}

.ai-md-body hr {
    border: none;
    border-top: 1px dashed #d5def5;
    margin: 0.85em 0;
}

.ai-md-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.65em 0;
    font-size: 13px;
}

.ai-md-body th,
.ai-md-body td {
    border: 1px solid #dbe4ff;
    padding: 6px 8px;
    text-align: left;
}

.ai-md-body th {
    background: #eef2ff;
    color: #1f2a44;
}

.ai-explain-loading {
    color: #607399;
    margin-bottom: 8px;
}

.ai-cursor {
    display: inline-block;
    animation: ai-cursor-blink 1s step-end infinite;
}

@keyframes ai-cursor-blink {
    50% { opacity: 0; }
}

.btn-lite {
    background: #ecf3ff;
    color: var(--primary-deep);
    box-shadow: none;
}

.btn-lite:hover {
    background: #e0ecff;
    box-shadow: none;
    filter: none;
}

.panel-footer .btn-lite {
    margin-right: 8px;
}

.component-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.component-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    border: 1px solid #d5e3fb;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    font-size: 13px;
    color: #3b5b86;
    background: #f8fbff;
    text-align: center;
    transition: all 0.18s ease;
}

.component-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #dce8ff;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-deep);
    line-height: 1;
}

.component-item:hover {
    transform: translateY(-1px);
    border-color: #b8d1ff;
    background: #f1f7ff;
}

.component-item.active {
    border-color: var(--primary);
    background: #eaf3ff;
    color: var(--primary-deep);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(45, 117, 255, 0.16);
}

.component-item.active .component-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.component-label {
    line-height: 1.3;
}

body.is-dragging-widget,
body.is-dragging-widget * {
    cursor: grabbing !important;
}

@keyframes maskFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.panel-scroll {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.panel-data-preview {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.panel-data-preview h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.data-preview-meta {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 12px;
}

.data-preview-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.data-preview-tabs .seg-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #d4e2ff;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #4a71b0;
}

.data-preview-tabs .seg-btn.active {
    background: #2d75ff;
    border-color: #2d75ff;
    color: #fff;
}

.data-preview-empty {
    padding: 32px 16px;
    text-align: center;
    color: #999;
    background: #f7f9fc;
    border-radius: 10px;
}

.data-preview-table-wrap {
    flex: 1;
    min-height: 200px;
    max-height: calc(100vh - 220px);
    overflow: auto;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    background: #fff;
}

.panel-dialog .data-preview-table-wrap,
.panel-dialog .data-preview-empty {
    margin-bottom: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.5;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr auto;
    gap: 6px;
    align-items: center;
}

.field-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-chips .chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d6e4ff;
    background: #f8fbff;
    font-size: 12px;
    cursor: pointer;
}

.btn-mini {
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    background: #ffe8e8;
    color: #c0392b;
    font-size: 12px;
}

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

.form-section {
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px dashed #d6e4ff;
}

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.data-range-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-outline {
    border: 1px solid #c5d6f5;
    border-radius: 10px;
    padding: 8px 16px;
    background: #fff;
    color: #3b5b86;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: #f3f8ff;
}

.range-status {
    font-size: 13px;
    color: var(--text-sub);
}

.filter-value-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 14px;
    min-height: 38px;
}

.form-section-inner {
    margin-top: 8px;
}

.stat-mode-toggle {
    display: inline-flex;
    border: 1px solid #d6e4ff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.mode-btn {
    border: none;
    background: #fff;
    padding: 8px 14px;
    font-size: 13px;
    color: #5f7296;
    cursor: pointer;
}

.mode-btn.active {
    background: #eef4ff;
    color: var(--primary-deep);
    font-weight: 600;
}

.stat-value-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-value-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
    align-items: center;
}

/* 排行榜 */
.vmx-rank-title {
    padding: 10px 14px 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
}

.vmx-rank {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
    color: #333;
}

.vmx-rank-head {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #999;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.vmx-rank-body {
    flex: 1;
    overflow: auto;
}

.vmx-rank-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
    background: #fff;
}

.vmx-rank-row.is-alt {
    background: #f7f7f7;
}

.vmx-rank-col-no {
    flex: 0 0 44px;
    display: flex;
    justify-content: center;
}

.vmx-rank-col-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vmx-rank-col-value {
    flex: 0 0 120px;
    text-align: right;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.vmx-rank-name {
    font-size: 14px;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vmx-rank-bar-track {
    height: 8px;
    background: #eef1f5;
    border-radius: 999px;
    overflow: hidden;
}

.vmx-rank-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.rank-medal-num {
    line-height: 1;
}

.rank-medal-gold {
    background: linear-gradient(145deg, #ffd54f 0%, #ffb300 100%);
    color: #5d4200;
}

.rank-medal-silver {
    background: linear-gradient(145deg, #e8eef5 0%, #b0c4de 100%);
    color: #3d4f66;
}

.rank-medal-bronze {
    background: linear-gradient(145deg, #f0c4a8 0%, #e9967a 100%);
    color: #5c3a2e;
}

.rank-medal-plain {
    background: #e8eaed;
    color: #888;
    box-shadow: none;
    font-weight: 600;
}

.vmx-rank-empty {
    padding: 32px;
    text-align: center;
    color: #999;
}

/* 指标进度条 vmxmetricbar */
.vmx-metricbar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    font-size: 13px;
    color: color-mix(in srgb, var(--metric-accent, #b8889a) 55%, #1a1a1a);
}

.vmx-metricbar-title {
    padding: 10px 12px 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #12223d);
}

.vmx-metricbar-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid color-mix(in srgb, var(--metric-accent, #b8889a) 28%, #fff);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 8px 8px;
}

.vmx-metricbar-head,
.vmx-metricbar-row {
    display: grid;
    grid-template-columns: 72px 1fr 88px;
    align-items: stretch;
    min-height: 44px;
}

.vmx-metricbar-head {
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 72%, #fff);
    color: color-mix(in srgb, var(--metric-accent, #b8889a) 40%, #1a1a1a);
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid color-mix(in srgb, var(--metric-accent, #b8889a) 35%, #fff);
}

.vmx-metricbar-col-bar {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 8%, #fff);
}

.vmx-metricbar-head .vmx-metricbar-col-bar {
    justify-content: space-between;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 55%, #fff);
}

.vmx-metricbar-tick {
    flex: 1;
    text-align: center;
    line-height: 36px;
}

.vmx-metricbar-col-label,
.vmx-metricbar-col-value {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 62%, #fff);
    border-right: 1px solid rgba(255, 255, 255, 0.45);
    line-height: 1.35;
    word-break: break-all;
}

.vmx-metricbar-col-value {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.45);
    font-weight: 700;
    font-size: 13px;
}

.vmx-metricbar-label {
    display: inline-block;
    max-width: 100%;
    letter-spacing: 0.06em;
}

.vmx-metricbar-body {
    flex: 1;
    overflow: auto;
}

.vmx-metricbar-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.vmx-metricbar-row:last-child {
    border-bottom: none;
}

.vmx-metricbar-track {
    position: relative;
    width: 100%;
    height: 22px;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 12%, #f7f2f4);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metric-accent, #b8889a) 18%, #fff);
}

.vmx-metricbar-fill {
    position: relative;
    height: 100%;
    min-width: 0;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 78%, #3a2030);
    border-radius: 2px 0 0 2px;
    transition: width 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
}

.vmx-metricbar-pct {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    line-height: 1;
}

.vmx-metricbar-empty {
    padding: 28px 16px;
    text-align: center;
    color: #999;
    background: color-mix(in srgb, var(--metric-accent, #b8889a) 6%, #fff);
}

.metric-theme-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.metric-theme-item {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-theme-item:hover {
    transform: scale(1.06);
}

.metric-theme-item.active {
    border-color: var(--text-main, #12223d);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--metric-accent, #b8889a) 40%, #fff);
}

.config-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.config-label-row .config-label {
    margin-bottom: 0;
}

.config-label-actions {
    display: flex;
    gap: 8px;
}

.btn-link-mini {
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    color: var(--primary-deep);
    cursor: pointer;
}

.btn-link-mini:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .vmx-metricbar-head,
    .vmx-metricbar-row {
        grid-template-columns: 56px 1fr 72px;
    }
}

@media (max-width: 900px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        padding-top: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .component-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page {
        padding: 14px 12px 20px;
    }

    .toolbar-card {
        padding: 14px 14px;
    }

    .title {
        font-size: 20px;
    }

    .stage {
        min-height: 520px;
    }

    .stage-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stage-bar-count {
        margin-left: 0;
        width: 100%;
    }

    .component-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-create {
        width: calc(100vw - 24px);
    }
}
 