/**
 * Bootstrap 5.3 公共皮肤：以 Meta Studio 的蓝灰色、细边框和紧凑数据界面为基础。
 * 由 _fragment :: bootstrap 引入；仅用于独立页面，主站主题和报告 PDF 不引入。
 * 页面布局、业务状态、插件滚动与弹层层级由各页面维护。
 */
:root {
    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
    --bs-body-font-size: .875rem;
    --bs-body-line-height: 1.6;
    --bs-body-color: #243047;
    --bs-heading-color: #17243b;
    --bs-secondary-color: #657189;
    --bs-tertiary-color: #8490a3;
    --bs-primary: #2864df;
    --bs-primary-rgb: 40, 100, 223;
    --bs-link-color: #376bc5;
    --bs-link-color-rgb: 55, 107, 197;
    --bs-link-hover-color: #245fd6;
    --bs-link-hover-color-rgb: 36, 95, 214;
    --bs-border-color: #dfe5ef;
    --bs-border-radius: .5rem;
    --bs-border-radius-sm: .375rem;
    --bs-border-radius-lg: .75rem;
    --bs-focus-ring-color: rgba(40, 100, 223, .15);
    --ui-page-bg: #f5f7fb;
    --ui-surface-bg: #fff;
    --ui-text: #34425a;
    --ui-border-subtle: #edf0f5;
    --ui-selected-bg: #edf4ff;
    --ui-hover-bg: #f3f7ff;
    --ui-success-color: #25805c;
    --ui-warning-color: #a76815;
}

/* 基础排版。页面高度、滚动方式与布局不在公共皮肤设置。 */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
b, strong, .fw-bold, th { font-weight: 600; }
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; letter-spacing: -.01em; }
.table, .badge { font-variant-numeric: tabular-nums; }

/* 按钮：通过变量保留 Bootstrap 大小号变体。 */
.btn {
    --bs-btn-font-size: var(--bs-body-font-size);
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: .4375rem;
    --bs-btn-focus-shadow-rgb: 40, 100, 223;
    --bs-btn-padding-y: .375rem;
    --bs-btn-padding-x: .875rem;
    box-shadow: 0 1px 2px rgba(36, 48, 71, .04);
}
.btn-sm { --bs-btn-font-size: .8125rem; --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .625rem; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: .625rem; --bs-btn-padding-x: 1.125rem; }
.btn:active { box-shadow: none; }
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #245fd6;
    --bs-btn-hover-border-color: #245fd6;
    --bs-btn-active-bg: #1f53bd;
    --bs-btn-active-border-color: #1f53bd;
    --bs-btn-disabled-bg: #a9bde5;
    --bs-btn-disabled-border-color: #a9bde5;
    --bs-btn-disabled-opacity: 1;
}
.btn-outline-secondary {
    --bs-btn-color: var(--ui-text);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-primary);
    --bs-btn-hover-bg: #f0f5ff;
    --bs-btn-hover-border-color: #7fa5f4;
    --bs-btn-active-color: #245fd6;
    --bs-btn-active-bg: #edf3ff;
    --bs-btn-active-border-color: #658ce3;
    --bs-btn-disabled-color: var(--bs-tertiary-color);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--bs-border-color);
}
.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: #245fd6;
    --bs-btn-active-border-color: #245fd6;
    --bs-btn-disabled-color: #a9bde5;
    --bs-btn-disabled-border-color: #a9bde5;
}
.btn-text { padding: 2px 0; border: 0; background: transparent; font: inherit; color: #587198; cursor: pointer; font-size: 12px; }
.btn-text:hover, .btn-text[aria-pressed="true"] { color: var(--bs-link-hover-color); }
.btn-text[aria-pressed="true"] { font-weight: 600; }
.btn-help { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--bs-tertiary-color); font: inherit; font-size: 14px; vertical-align: middle; cursor: help; }
.btn-help:hover, .btn-help:focus-visible { color: var(--bs-primary); background: #edf3ff; }
.btn-text:focus-visible, .btn-help:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 3px; }

/* 表单：字号跟随正文，保留大小号控件和多行输入的尺寸语义。 */
.form-control, .form-select, .form-check, .input-group-text, .form-label { font-size: var(--bs-body-font-size); }
.form-control, .form-select { min-height: 34px; padding-top: .375rem; padding-bottom: .375rem; border-color: var(--bs-border-color); border-radius: .4375rem; color: var(--ui-text); }
.form-control-sm, .form-select-sm { min-height: 30px; font-size: .8125rem; padding-top: .25rem; padding-bottom: .25rem; }
.form-control-lg, .form-select-lg { min-height: 42px; font-size: 1rem; padding-top: .5rem; padding-bottom: .5rem; }
textarea.form-control { min-height: 0; }
.form-label { color: var(--ui-text); font-weight: 600; margin-bottom: 8px; }
.form-text { color: #738097; font-size: 12px; line-height: 1.7; }
.form-control::placeholder { color: var(--bs-tertiary-color); }
.form-control:hover:not(:disabled), .form-select:hover:not(:disabled) { border-color: #7fa5f4; }
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 2px var(--bs-focus-ring-color); }
.form-control:disabled, .form-select:disabled { background: var(--ui-page-bg); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-check-input:focus { border-color: #7fa5f4; box-shadow: 0 0 0 2px var(--bs-focus-ring-color); }
.input-group-text { border-color: var(--bs-border-color); background: var(--ui-page-bg); color: var(--bs-secondary-color); }

/* 表格：浅色表头与分隔线；紧凑密度通过 table-sm 启用。 */
.table { --bs-table-color: var(--ui-text); --bs-table-border-color: var(--ui-border-subtle); --bs-table-hover-bg: var(--ui-hover-bg); --bs-table-hover-color: var(--ui-text); --bs-table-striped-bg: #f8fafd; }
.table > :not(caption) > * > * { padding: 8px 12px; vertical-align: middle; }
.table > thead > tr > th { background: var(--ui-page-bg); color: var(--bs-secondary-color); font-weight: 600; border-bottom-color: var(--ui-border-subtle); }
.table-sm { font-size: 13px; }
.table-sm > :not(caption) > * > * { padding: 6px 10px; }
.table-sm > thead > tr > th { font-size: 12px; }
.table > tbody > tr.selected > * { --bs-table-bg: var(--ui-selected-bg); --bs-table-accent-bg: var(--ui-selected-bg); --bs-table-striped-bg: var(--ui-selected-bg); --bs-table-hover-bg: var(--ui-selected-bg); }
.table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--bs-primary); cursor: pointer; }
.table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .5; }
.table .th-zh { display: block; }
.table .th-en { display: block; margin-top: 2px; color: var(--bs-tertiary-color); font-size: 11px; font-weight: 400; line-height: 1.4; }

/* 卡片、浮层与插件的基础外观。插件定位、滚动与层级仍由页面管理。 */
.card { --bs-card-border-color: var(--bs-border-color); --bs-card-border-radius: .75rem; --bs-card-cap-bg: #f8fafd; box-shadow: 0 1px 2px rgba(36, 48, 71, .03); }
.dropdown-menu, .modal-content, .popover { border-color: var(--bs-border-color); border-radius: .5rem; box-shadow: 0 8px 24px rgba(36, 48, 71, .1); }
.dropdown-menu { --bs-dropdown-font-size: .8125rem; --bs-dropdown-color: var(--ui-text); --bs-dropdown-link-color: var(--ui-text); --bs-dropdown-link-hover-bg: var(--ui-hover-bg); --bs-dropdown-link-active-bg: var(--bs-primary); padding: 6px 0; }
.dropdown-item { padding: 7px 12px; font-size: 13px; line-height: 1.6; }
.modal-header, .modal-footer { border-color: var(--ui-border-subtle); }
.tooltip { --bs-tooltip-font-size: .75rem; }
.tooltip-inner { padding: 10px 12px; line-height: 1.7; }
.badge { font-weight: 500; }
.pagination { --bs-pagination-color: var(--bs-link-color); --bs-pagination-border-color: var(--bs-border-color); --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-focus-box-shadow: 0 0 0 2px var(--bs-focus-ring-color); }

/* Bootstrap Table 1.22：兼容插件样式在公共皮肤之后加载。
 * 保留固定表头宽度、排序图标间距、滚动、列显隐和分页结构；只重置外观。
 */
.bootstrap-table { color: var(--ui-text); font-size: var(--bs-body-font-size); }
.bootstrap-table .fixed-table-container { border-radius: var(--bs-border-radius); }
:root .bootstrap-table .fixed-table-container.fixed-height:not(.has-footer),
:root .bootstrap-table .fixed-table-container.fixed-height.has-card-view,
:root .bootstrap-table .fixed-table-container.fixed-height .fixed-table-border { border-color: var(--bs-border-color); }
:root .bootstrap-table .fixed-table-container.fixed-height .table:not(.table-dark) thead th { border-bottom-color: var(--ui-border-subtle); }
:root .bootstrap-table .fixed-table-container .table thead th .th-inner { padding: 8px 12px; font-weight: 600; }
:root .bootstrap-table .fixed-table-container .table.table-sm thead th .th-inner { padding: 6px 4px; }
:root .bootstrap-table .fixed-table-container .table thead th:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
:root .bootstrap-table .fixed-table-container .table:not(.table-dark) tbody tr.selected td {
    background-color: var(--ui-selected-bg);
    --bs-table-bg: var(--ui-selected-bg);
    --bs-table-accent-bg: var(--ui-selected-bg);
    --bs-table-bg-state: var(--ui-selected-bg);
}
.bootstrap-table .fixed-table-container .table .bs-checkbox input { accent-color: var(--bs-primary); }
.bootstrap-table .fixed-table-container .table tbody tr.no-records-found td { padding: 28px 16px; color: var(--bs-tertiary-color); background: var(--ui-surface-bg); font-size: 13px; }
.bootstrap-table .fixed-table-container .table .card-view .card-view-title { color: var(--bs-secondary-color); font-weight: 600; }
.bootstrap-table .fixed-table-toolbar .btn-secondary,
.bootstrap-table .fixed-table-pagination .btn-secondary {
    --bs-btn-color: var(--ui-text);
    --bs-btn-bg: var(--ui-surface-bg);
    --bs-btn-border-color: var(--bs-border-color);
    --bs-btn-hover-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--ui-hover-bg);
    --bs-btn-hover-border-color: #7fa5f4;
    --bs-btn-active-color: var(--bs-primary);
    --bs-btn-active-bg: var(--ui-selected-bg);
    --bs-btn-active-border-color: #7fa5f4;
    --bs-btn-disabled-color: var(--bs-tertiary-color);
    --bs-btn-disabled-bg: var(--ui-page-bg);
    --bs-btn-disabled-border-color: var(--bs-border-color);
}
.bootstrap-table .fixed-table-toolbar .columns .dropdown-menu { border-color: var(--bs-border-color); font-size: 13px; }
.bootstrap-table .fixed-table-toolbar .columns label { padding: 7px 12px; color: var(--ui-text); line-height: 1.6; }
.bootstrap-table .fixed-table-toolbar .columns label:hover { background: var(--ui-hover-bg); }
.bootstrap-table .fixed-table-pagination { color: var(--bs-secondary-color); font-size: 13px; }
.bootstrap-table .fixed-table-pagination .pagination .page-link { font-size: 13px; }
.bootstrap-table .fixed-table-pagination .pagination .page-item.active .page-link { background: var(--bs-primary); border-color: var(--bs-primary); }
.bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading:not(.table-dark) { background: var(--ui-surface-bg); color: var(--bs-secondary-color); font-size: 13px; }
:root .bootstrap-table .fixed-table-container .fixed-table-loading:not(.table-dark) .loading-wrap .animation-dot,
:root .bootstrap-table .fixed-table-container .fixed-table-loading:not(.table-dark) .loading-wrap .animation-wrap::before,
:root .bootstrap-table .fixed-table-container .fixed-table-loading:not(.table-dark) .loading-wrap .animation-wrap::after { background: var(--bs-primary); }

/* Bootstrap Select 1.14：同时覆盖内嵌菜单和 container: body 弹出的菜单。
 * 不覆盖插件测量的宽高、transform、z-index、虚拟列表或滚动容器。
 */
.bootstrap-select > .dropdown-toggle { border: 1px solid var(--bs-border-color); border-radius: .4375rem; background: var(--ui-surface-bg); padding: 8px 10px; color: var(--ui-text); font: inherit; }
:root .bootstrap-select > .dropdown-toggle.bs-placeholder,
:root .bootstrap-select > .dropdown-toggle.bs-placeholder:is(:hover, :focus, :active) { color: var(--bs-tertiary-color); }
.bootstrap-select > .dropdown-toggle:hover:not(:disabled):not(.disabled) { border-color: #7fa5f4; }
/* 插件用 !important 设置原生焦点轮廓，此处保留同等优先级以统一键盘焦点。 */
:root .bootstrap-select .dropdown-toggle:focus,
:root .bootstrap-select > select.mobile-device:focus + .dropdown-toggle { outline: 2px solid var(--bs-primary) !important; outline-offset: 2px; }
.bootstrap-select > .dropdown-toggle:disabled,
.bootstrap-select.disabled > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle.disabled { color: var(--bs-tertiary-color); background: var(--ui-page-bg); border-color: var(--bs-border-color); }
.bootstrap-select.is-invalid > .dropdown-toggle,
.was-validated .bootstrap-select select:invalid + .dropdown-toggle { border-color: var(--bs-form-invalid-border-color); }
.bootstrap-select.is-valid > .dropdown-toggle,
.was-validated .bootstrap-select select:valid + .dropdown-toggle { border-color: var(--bs-form-valid-border-color); }
.bootstrap-select .dropdown-toggle .filter-option-inner-inner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bootstrap-select > .dropdown-menu { border-color: var(--bs-border-color); border-radius: var(--bs-border-radius); box-shadow: 0 8px 24px rgba(36, 48, 71, .1); font-size: 13px; }
.bootstrap-select .dropdown-menu.inner { border-radius: 0; box-shadow: none; }
.bootstrap-select .dropdown-menu .dropdown-item { font-size: 13px; line-height: 1.6; }
.bootstrap-select .dropdown-menu .dropdown-item.active,
.bootstrap-select .dropdown-menu .dropdown-item.selected { color: var(--bs-primary); background: var(--ui-selected-bg); }
/* 插件默认把 active 项的说明文字强制设为白色，与浅色选中背景不匹配。 */
.bootstrap-select .dropdown-menu li.active .dropdown-item small { color: var(--bs-secondary-color) !important; }
.bootstrap-select .dropdown-menu .dropdown-item.disabled { color: var(--bs-tertiary-color); background: transparent; }
.bootstrap-select .bs-searchbox { padding: 4px 8px 6px; }
.bootstrap-select .bs-searchbox .form-control { min-width: 0; font-size: 13px; }
.bootstrap-select .bs-actionsbox { padding: 0 8px 6px; }
.bootstrap-select .bs-actionsbox .btn { font-size: 12px; }
.bootstrap-select .no-results { padding: 8px 12px; color: var(--bs-secondary-color); background: var(--ui-page-bg); white-space: normal; overflow-wrap: anywhere; font-size: 13px; }
.bootstrap-select .dropdown-menu .notify { color: var(--bs-secondary-color); background: var(--ui-page-bg); border-color: var(--bs-border-color); box-shadow: none; font-size: 12px; }

/* Treegrid：保留插件缩进、展开图标和点击区域。 */
.treegrid-expander { opacity: .65; }
.treegrid-expander:hover { opacity: 1; }

/* ========== studio 壳层（side/main 工作区） ==========
   .tcm-studio-page 管页面布局，.report-tool-panel 可复用标题、报告卡片和导航样式。 */
body.tcm-studio-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; overflow: hidden; background: var(--ui-page-bg); }
.tcm-studio-page .studio-body { flex: 1 1 auto; min-height: 0; display: flex; }
.tcm-studio-page .studio-side { flex: 0 0 320px; min-width: 0; padding: 24px 20px; background: #fff; border-right: 1px solid #e5eaf2; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; }
:is(.tcm-studio-page, .report-tool-panel) .studio-brand { margin-bottom: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; color: #172b4d; font-size: 26px; font-weight: 700; line-height: 1.25; }
.report-tool-panel .studio-brand h1 { margin: 0; font: inherit; color: inherit; }
:is(.tcm-studio-page, .report-tool-panel) .studio-brand small { color: var(--bs-tertiary-color); font-size: 12px; font-weight: 400; line-height: 1.5; white-space: normal; }
:is(.tcm-studio-page, .report-tool-panel) .studio-report { padding: 14px; background: var(--ui-page-bg); border: 1px solid #e9edf4; border-radius: 9px; }
:is(.tcm-studio-page, .report-tool-panel) .studio-report p { font-size: 13px; font-weight: 600; line-height: 1.8; margin: 0; overflow-wrap: anywhere; }
:is(.tcm-studio-page, .report-tool-panel) .studio-side-label { color: var(--bs-secondary-color); font-size: 12px; font-weight: 600; margin: 0 0 10px; }
.tcm-studio-page .studio-side-section { margin-top: 24px; }
.tcm-studio-page .studio-side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--ui-border-subtle); }
:is(.tcm-studio-page, .report-tool-panel) .studio-back { display: inline-block; color: var(--bs-secondary-color); font-size: 12px; text-decoration: none; }
.tcm-studio-page .studio-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; padding: 16px 18px 18px; }
.tcm-studio-page .studio-data-card { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: #fff; border: 1px solid #e1e7f0; border-radius: 10px; overflow: hidden; }
.tcm-studio-page .studio-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--bs-tertiary-color); font-size: 14px; text-align: center; }
@media (max-width: 1100px) {
    .tcm-studio-page .studio-side { flex-basis: 280px; padding: 20px 16px; }
    .tcm-studio-page .studio-main { padding: 14px 16px 14px; }
}
@media (max-width: 760px) {
    body.tcm-studio-page { overflow: auto; height: auto; min-height: 100dvh; }
    .tcm-studio-page .studio-body { flex-direction: column; }
    .tcm-studio-page .studio-side { flex: none; padding: 16px; overflow: visible; border-right: 0; border-bottom: 1px solid #e5eaf2; }
    .tcm-studio-page .studio-side-section { margin-top: 16px; }
    .tcm-studio-page .studio-main { flex: none; padding: 12px; }
    .tcm-studio-page .studio-data-card { flex: none; height: 72dvh; }
    .tcm-studio-page .studio-empty { min-height: 320px; }
}
