/* =========================================================
 * sonsion-table v3.3.1 · 前端样式（强制浅色）
 * 开发者：sonsion.com
 * ========================================================= */

/* ============================================================
 * 设计 Token（浅色）
 * ============================================================ */
:root {
    --st-red:            #dc2626;
    --st-red-dark:       #b91c1c;
    --st-red-soft:       #fef2f2;
    --st-red-soft-2:     #fee2e2;

    --st-gray-50:        #f9fafb;
    --st-gray-100:       #f3f4f6;
    --st-gray-200:       #e5e7eb;
    --st-gray-300:       #d1d5db;
    --st-gray-400:       #9ca3af;
    --st-gray-500:       #6b7280;
    --st-gray-700:       #374151;
    --st-gray-900:       #111827;

    --st-bg:             #ffffff;
    --st-bg-stripe:      #fafafa;
    --st-transition:     0.12s ease;

    --st-row-height:     38px;

    --st-first-col-min:  100px;
    --st-first-col-max:  140px;

    --st-label-font-size:   13.5px;
    --st-label-font-weight: 600;
    --st-label-color:       #111827;

    --st-first-col-pad-left:  8px;
    --st-first-col-pad-right: 8px;

    --st-cell-pad-x:     14px;

    --st-hint-bg:        rgba( 17, 24, 39, 0.88 );
    --st-hint-bg-hover:  rgba( 17, 24, 39, 0.95 );

    --st-radius-pill:    999px;
}

/* ============================================================
 * 1. 容器
 * ============================================================ */
.sonsion-table-container {
    width: 100%;
    overflow: auto;
    max-height: 640px;
    position: relative;
    border-radius: 0;
    border: 1px solid var(--st-gray-300);
    background: var(--st-bg);
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    box-sizing: border-box;
}

.sonsion-table-container * {
    box-sizing: border-box;
}

.sonsion-table-container.has-filter-active {
    width: fit-content;
    max-width: 100%;
}

/* ============================================================
 * 2. 表格基础
 * ============================================================ */
.sonsion-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100%;
    min-width: 720px;
    background: var(--st-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-feature-settings: "tnum" 1;
    color: var(--st-gray-900);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    border: none !important;
    margin: 0 !important;
}

.sonsion-table thead,
.sonsion-table tbody,
.sonsion-table tfoot {
    border: none !important;
}

.sonsion-table thead tr,
.sonsion-table tbody tr {
    border: none !important;
}

.sonsion-table,
.sonsion-table th,
.sonsion-table td,
.sonsion-table tr,
.sonsion-table thead,
.sonsion-table tbody {
    border-radius: 0 !important;
}

/* ============================================================
 * 3. 所有单元格
 * ============================================================ */
.sonsion-table th,
.sonsion-table td,
.sonsion-table > tbody > tr > td,
.sonsion-table > tbody > tr > th {
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
    padding: 0 var(--st-cell-pad-x) !important;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap !important;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--st-gray-900);
    background-clip: padding-box;
    position: relative;
    transition: background-color var(--st-transition), color var(--st-transition);
    text-shadow: none !important;
    outline: none !important;

    border-top: none;
    border-bottom: 1px solid var(--st-gray-200) !important;
    border-right: 1px solid var(--st-gray-200) !important;
    border-left: none !important;

    box-shadow: none !important;
    background-image: none !important;
}

.sonsion-table tr > *:first-child {
    border-left: 1px solid var(--st-gray-200) !important;
}

.sonsion-table tbody tr:first-child > * {
    border-top: 1px solid var(--st-gray-200) !important;
}

.sonsion-table tbody tr:last-child > * {
    border-bottom: 1px solid var(--st-gray-200) !important;
}

/* ============================================================
 * 4. 表头 & 第一列样式统一
 * ============================================================ */
.sonsion-table thead th,
.sonsion-table thead tr > th,
.sonsion-table thead tr > td,
.sonsion-table > thead > tr > th,
.sonsion-table tbody td:first-child,
.sonsion-table tbody th:first-child {
    background: var(--st-gray-50);
    background-image: none !important;
    font-weight: var(--st-label-font-weight) !important;
    font-size: var(--st-label-font-size) !important;
    color: var(--st-label-color) !important;
    text-align: center;
    vertical-align: middle;
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
    text-shadow: none !important;
    outline: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

.sonsion-table thead th,
.sonsion-table thead tr > th {
    position: sticky;
    top: 0;
    z-index: 20;
    user-select: none;
}

.sonsion-table thead th::before,
.sonsion-table thead th::after {
    display: none !important;
    content: none !important;
}

.sonsion-table thead th:first-child {
    z-index: 30;
    background: var(--st-gray-50) !important;
}

.sonsion-table thead th:hover {
    background: var(--st-gray-100) !important;
}

/* ============================================================
 * 5. 第一列
 * ============================================================ */
.sonsion-table th:first-child,
.sonsion-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    border-right: 1px solid var(--st-gray-200) !important;
    min-width: var(--st-first-col-min);
    max-width: var(--st-first-col-max);
    text-align: left !important;
    padding-left:  var(--st-first-col-pad-left) !important;
    padding-right: var(--st-first-col-pad-right) !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sonsion-table thead th:first-child {
    z-index: 30;
}

/* ★ 未勾选「固定首列」时首列不吸附，跟着表格一起横向滚动。
   这一段 sticky 原来是写死的，所以后台那个开关一直是空转。 */
.sonsion-table:not(.has-first-col-header) th:first-child,
.sonsion-table:not(.has-first-col-header) td:first-child {
    position: static;
    z-index: auto;
}

/* ============================================================
 * 6. 斑马纹
 * ============================================================ */
.sonsion-table tbody tr:nth-child(even) td {
    background: var(--st-bg-stripe);
}
.sonsion-table tbody tr:nth-child(even) td:first-child {
    background: var(--st-gray-100);
}

/* ============================================================
 * 7. 行列联动高亮
 * ============================================================ */
.sonsion-table tbody tr:hover td,
.sonsion-table .row-highlight {
    background: var(--st-red-soft) !important;
}

.sonsion-table tbody tr:hover td:first-child,
.sonsion-table .row-highlight:first-child {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark);
}

.sonsion-table .col-highlight {
    background: var(--st-red-soft) !important;
}

.sonsion-table thead th.col-highlight {
    background: var(--st-red-soft) !important;
    color: var(--st-red-dark) !important;
}

.sonsion-table tbody td.col-highlight:first-child,
.sonsion-table tbody th.col-highlight:first-child {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark);
}

.sonsion-table .current-cell {
    background: var(--st-red-soft-2) !important;
    color: var(--st-red-dark) !important;
    font-weight: 600 !important;
    box-shadow: inset 0 0 0 1px var(--st-red) !important;
    z-index: 5;
}

.sonsion-table tbody td.current-cell:first-child,
.sonsion-table tbody th.current-cell:first-child {
    box-shadow: none !important;
    font-weight: var(--st-label-font-weight) !important;
    color: var(--st-red-dark) !important;
}

.sonsion-table thead th.current-cell,
.sonsion-table thead th.current-cell:first-child {
    box-shadow: none !important;
}

/* ============================================================
 * 8. 空状态
 * ============================================================ */
.sonsion-table .empty-row td {
    height: auto !important;
    line-height: 1.5 !important;
    padding: 40px 20px !important;
    color: var(--st-gray-400);
    font-style: italic;
    border: 1px solid var(--st-gray-200);
}

/* ============================================================
 * 9. 隐藏列
 * ============================================================ */
.sonsion-table .col-hidden { display: none !important; }

/* ============================================================
 * 10. 行标签单元格
 * ============================================================ */
.sonsion-table th.has-row-filter,
.sonsion-table td.has-row-filter,
.sonsion-table thead th.has-filter {
    padding: 0 !important;
    min-width: var(--st-first-col-min);
    max-width: var(--st-first-col-max);
    box-sizing: border-box;
    text-align: left !important;
    height: var(--st-row-height) !important;
    line-height: var(--st-row-height) !important;
}

.sonsion-row-filter-content {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: var(--st-row-height);
    padding: 0 var(--st-first-col-pad-right) 0 var(--st-first-col-pad-left);
    box-sizing: border-box;
    justify-content: flex-start;
}

.sonsion-row-filter-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    text-align: left !important;
    font-weight: var(--st-label-font-weight);
    font-size: var(--st-label-font-size);
    color: var(--st-label-color);
    line-height: 1.4;
    word-break: keep-all;
}

/* ============================================================
 * 11. 行筛选按钮
 * ============================================================ */
.sonsion-row-filter-btn {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    box-sizing: border-box;
    border: none;
    border-radius: 5px;
    background: var(--st-red-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-red);
    opacity: 1;
    transition: all 0.15s ease;
    outline: none;
    line-height: 0;
    font-size: 0;
    margin-left: auto;
    box-shadow: 0 0 0 1px var(--st-red-soft-2);
}

.sonsion-table tr:hover .sonsion-row-filter-btn {
    background: var(--st-red-soft-2);
    color: var(--st-red);
    box-shadow: 0 0 0 1px var(--st-red-soft-2);
}

.sonsion-row-filter-btn:hover {
    background: var(--st-red-soft-2);
    color: var(--st-red-dark);
    box-shadow: 0 0 0 2px var(--st-red-soft-2);
    transform: scale( 1.05 );
}

.sonsion-row-filter-btn:focus {
    box-shadow: 0 0 0 3px var(--st-red-soft-2);
}

.sonsion-row-filter-btn.active {
    background: var(--st-red);
    color: #fff;
    box-shadow: 0 0 0 1px var(--st-red);
}

.sonsion-row-filter-btn.active:hover {
    background: var(--st-red-dark);
    transform: scale( 1.05 );
}

.sonsion-row-filter-btn svg {
    width: 12px;
    height: 12px;
    display: block;
    flex-shrink: 0;
    stroke-width: 2.5;
}

/* ============================================================
 * 12. 列筛选按钮
 * ============================================================ */
.sonsion-filter-btn {
    position: relative;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    box-sizing: border-box;
    border: none;
    border-radius: 5px;
    background: var(--st-red-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-red);
    opacity: 1;
    transition: all 0.15s ease;
    outline: none;
    line-height: 0;
    font-size: 0;
    margin-left: auto;
    box-shadow: 0 0 0 1px var(--st-red-soft-2);
}

.sonsion-table thead tr:hover .sonsion-filter-btn {
    background: var(--st-red-soft-2);
    color: var(--st-red);
    box-shadow: 0 0 0 1px var(--st-red-soft-2);
}

.sonsion-filter-btn:hover {
    background: var(--st-red-soft-2);
    color: var(--st-red-dark);
    box-shadow: 0 0 0 2px var(--st-red-soft-2);
    transform: scale( 1.05 );
}

.sonsion-filter-btn:focus {
    box-shadow: 0 0 0 3px var(--st-red-soft-2);
}

.sonsion-filter-btn.active {
    background: var(--st-red);
    color: #fff;
    box-shadow: 0 0 0 1px var(--st-red);
}

.sonsion-filter-btn.active:hover {
    background: var(--st-red-dark);
    transform: scale( 1.05 );
}

.sonsion-filter-btn svg {
    width: 12px;
    height: 12px;
    display: block;
    flex-shrink: 0;
    stroke-width: 2.5;
}

/* ============================================================
 * 13. 徽标
 * ============================================================ */
.sonsion-filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    background: var(--st-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba( 0, 0, 0, 0.15 );
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

/* ============================================================
 * 14. 筛选弹窗
 * ============================================================ */
.sonsion-filter-dropdown {
    position: fixed;
    top: -9999px;
    left: -9999px;
    min-width: 260px;
    max-width: 340px;
    background: #fff;
    border: 1px solid var(--st-gray-300);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.1 );
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY( -4px );
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--st-gray-900);
    text-align: left;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "tnum" 1;
}

.sonsion-filter-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY( 0 );
}

.sonsion-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    flex-shrink: 0;
}

.sonsion-filter-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
    font-size: 13px;
    font-weight: 600;
}

.sonsion-filter-count {
    font-weight: 400;
    color: var(--st-gray-400);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* 头部计数：显示 X / Y 项 */
.sonsion-filter-count-visible {
    color: var(--st-red);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.sonsion-filter-count-total {
    color: var(--st-gray-400);
    font-weight: 400;
}

.sonsion-filter-search {
    position: relative;
    padding: 0 12px 8px;
    flex-shrink: 0;
}

.sonsion-filter-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 32px;
    padding: 0 28px 0 30px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--st-gray-900);
    background: var(--st-gray-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    border: 1px solid var(--st-gray-200);
    border-radius: 2px !important;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin: 0;
    line-height: 32px;
}

.sonsion-filter-search-input::placeholder { color: var(--st-gray-400); }

.sonsion-filter-search-input:focus {
    background-color: #fff;
    border-color: var(--st-red);
    box-shadow: 0 0 0 2px var(--st-red-soft);
}

.sonsion-filter-search-clear {
    position: absolute;
    right: 18px;
    top: 16px;
    margin-top: -10px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--st-gray-400);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: background 0.15s, color 0.15s;
    box-sizing: border-box;
}

.sonsion-filter-search-clear:hover {
    background: var(--st-gray-200);
    color: var(--st-gray-700);
}

/* 工具栏 */
.sonsion-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--st-gray-200);
    border-bottom: 1px solid var(--st-gray-200);
    background: var(--st-gray-50);
    flex-shrink: 0;
}

.sonsion-filter-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--st-gray-700);
    user-select: none;
    margin: 0;
}

.sonsion-filter-all-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--st-red);
    width: 15px;
    height: 15px;
}

.sonsion-filter-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sonsion-filter-action {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12.5px;
    color: var(--st-gray-700);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--st-gray-300);
    border-radius: 4px;
    transition: all 0.15s;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

.sonsion-filter-action:hover {
    background: var(--st-red-soft);
    border-color: var(--st-red-soft-2);
    color: var(--st-red);
    text-decoration: none;
}

.sonsion-filter-action:active {
    background: var(--st-red-soft-2);
    color: var(--st-red-dark);
    transform: scale( 0.97 );
}

/* ===== 已选列表（智能显示） ===== */
.sonsion-filter-selected {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid var(--st-gray-200);
    flex-shrink: 0;
}

.sonsion-filter-selected-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--st-gray-500);
    line-height: 1.4;
}

.sonsion-filter-selected-label {
    font-weight: 600;
    color: var(--st-gray-700);
}

.sonsion-filter-selected-count {
    color: var(--st-gray-500);
}

.sonsion-filter-selected-num {
    color: var(--st-red);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-right: 2px;
}

.sonsion-filter-selected-hint {
    color: var(--st-gray-400);
    font-size: 11px;
    margin-left: auto;
}

.sonsion-filter-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 90px;
    overflow-y: auto;
    padding-right: 2px;
}

.sonsion-filter-selected-chips::-webkit-scrollbar { width: 5px; }
.sonsion-filter-selected-chips::-webkit-scrollbar-thumb {
    background: var(--st-gray-200);
    border-radius: 3px;
}

.sonsion-filter-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 8px;
    background: var(--st-red-soft);
    border: 1px solid var(--st-red-soft-2);
    border-radius: 4px;
    font-size: 12px;
    color: var(--st-red-dark);
    line-height: 1.4;
    max-width: 100%;
    box-sizing: border-box;
}

.sonsion-filter-selected-chip:hover {
    background: var(--st-red-soft-2);
    border-color: #fca5a5;
}

/* 已排除项样式：灰底 + 删除线 */
.sonsion-filter-selected-chip.is-excluded {
    background: var(--st-gray-50);
    border-color: var(--st-gray-200);
    color: var(--st-gray-500);
}

.sonsion-filter-selected-chip.is-excluded .sonsion-filter-selected-chip-text {
    text-decoration: line-through;
    text-decoration-color: #cbd5e1;
}

.sonsion-filter-selected-chip.is-excluded:hover {
    background: var(--st-gray-100);
    border-color: var(--st-gray-300);
    color: var(--st-gray-700);
}

.sonsion-filter-selected-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    font-weight: 500;
}

.sonsion-filter-selected-chip-remove {
    width: 16px;
    height: 16px;
    padding: 0;
    margin-left: 2px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.15s;
}

.sonsion-filter-selected-chip-remove:hover {
    opacity: 1;
    background: rgba( 0, 0, 0, 0.06 );
}

.sonsion-filter-selected-chip.is-excluded .sonsion-filter-selected-chip-remove:hover {
    background: rgba( 0, 0, 0, 0.08 );
    color: var(--st-gray-900);
}

/* 值列表 */
.sonsion-filter-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
    border-bottom: 1px solid var(--st-gray-200);
    flex: 1 1 auto;
    min-height: 0;
}

.sonsion-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--st-gray-900);
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    user-select: none;
}

.sonsion-filter-item:hover {
    background: var(--st-gray-50);
}

.sonsion-filter-item input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--st-red);
    width: 15px;
    height: 15px;
}

.sonsion-filter-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sonsion-filter-list::-webkit-scrollbar { width: 6px; }
.sonsion-filter-list::-webkit-scrollbar-thumb {
    background: var(--st-gray-200);
    border-radius: 3px;
}

.sonsion-filter-empty {
    display: none;
    padding: 20px 14px;
    text-align: center;
    color: var(--st-gray-400);
    font-size: 13px;
    font-style: italic;
    flex-shrink: 0;
}

/* 底部按钮 */
.sonsion-filter-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--st-gray-50);
    flex-shrink: 0;
}

/* 弹窗内的临时提示（例如「请至少保留一项」） */
.sonsion-filter-note {
    padding: 8px 14px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    color: #92400e;
    font-size: 12.5px;
    line-height: 1.5;
    flex-shrink: 0;
}

.sonsion-filter-note[hidden] { display: none !important; }

.sonsion-filter-btn-check-all,
.sonsion-filter-btn-clear-all,
.sonsion-filter-btn-cancel,
.sonsion-filter-btn-apply {
    /* ★ 不压缩、不换行：宽度不够时整行换行，而不是把文字挤成两行 */
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
    text-align: center;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
    box-sizing: border-box;
    outline: none;
    line-height: 1.5;
}

.sonsion-filter-btn-check-all,
.sonsion-filter-btn-clear-all {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--st-gray-300);
    background: #fff;
    color: var(--st-gray-700);
    font-weight: 500;
}

.sonsion-filter-btn-check-all:hover,
.sonsion-filter-btn-clear-all:hover {
    background: var(--st-red-soft);
    border-color: var(--st-red-soft-2);
    color: var(--st-red);
}

.sonsion-filter-btn-check-all:active,
.sonsion-filter-btn-clear-all:active {
    background: var(--st-red-soft-2);
    color: var(--st-red-dark);
}

.sonsion-filter-btn-cancel {
    margin-left: auto;
    border: 1px solid var(--st-gray-300);
    background: #fff;
    color: var(--st-gray-700);
}

.sonsion-filter-btn-cancel:hover {
    background: var(--st-gray-50);
    border-color: var(--st-gray-400);
}

.sonsion-filter-btn-apply {
    border: 1px solid var(--st-red);
    background: var(--st-red);
    color: #fff;
    font-weight: 600;
}

.sonsion-filter-btn-apply:hover {
    background: var(--st-red-dark);
    border-color: var(--st-red-dark);
}

/* ============================================================
 * 15. 滚动条
 * ============================================================ */
.sonsion-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.sonsion-table-container::-webkit-scrollbar-track {
    background: var(--st-gray-50);
}
.sonsion-table-container::-webkit-scrollbar-thumb {
    background: var(--st-gray-300);
    border-radius: 5px;
    border: 2px solid var(--st-gray-50);
}
.sonsion-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--st-gray-400);
}

/* ============================================================
 * 16. 响应式
 * ============================================================ */
@media (max-width: 768px) {
    :root {
        --st-row-height:     38px;
        --st-cell-pad-x:     8px;
        --st-first-col-min:  85px;
        --st-first-col-max:  110px;
        --st-label-font-size: 12.5px;
        --st-first-col-pad-left:  6px;
        --st-first-col-pad-right: 4px;
    }

    .sonsion-table th,
    .sonsion-table td { font-size: 12.5px; }

    .sonsion-table th:first-child,
    .sonsion-table td:first-child,
    .sonsion-table th.has-row-filter,
    .sonsion-table td.has-row-filter,
    .sonsion-table thead th.has-filter { text-align: left !important; }

    .sonsion-row-filter-content { justify-content: flex-start !important; }
    .sonsion-row-filter-label { font-size: 12.5px; text-align: left !important; }

    .sonsion-row-filter-btn,
    .sonsion-filter-btn { width: 20px; height: 20px; }
    .sonsion-row-filter-btn svg,
    .sonsion-filter-btn svg { width: 11px; height: 11px; }

    .sonsion-table-container { max-height: 65vh; }

    .sonsion-filter-dropdown { min-width: 220px; max-width: 85vw; max-height: 70vh; }
    .sonsion-filter-list { max-height: 180px; }
    .sonsion-filter-btn-check-all,
    .sonsion-filter-btn-clear-all,
    .sonsion-filter-btn-cancel,
    .sonsion-filter-btn-apply { padding: 7px 10px; font-size: 13px; }
    .sonsion-filter-selected { padding: 6px 12px; gap: 4px; }
    .sonsion-filter-selected-chip-text { max-width: 100px; }
}

@media (max-width: 480px) {
    :root {
        --st-row-height:     38px;
        --st-cell-pad-x:     7px;
        --st-first-col-min:  72px;
        --st-first-col-max:  95px;
        --st-label-font-size: 12px;
        --st-first-col-pad-left:  5px;
        --st-first-col-pad-right: 3px;
    }

    .sonsion-table th,
    .sonsion-table td { font-size: 12px; }

    .sonsion-table th:first-child,
    .sonsion-table td:first-child,
    .sonsion-table th.has-row-filter,
    .sonsion-table td.has-row-filter,
    .sonsion-table thead th.has-filter { text-align: left !important; }

    .sonsion-row-filter-content { justify-content: flex-start !important; }
    .sonsion-row-filter-label { font-size: 12px; text-align: left !important; }

    .sonsion-row-filter-btn,
    .sonsion-filter-btn { width: 18px; height: 18px; }
    .sonsion-row-filter-btn svg,
    .sonsion-filter-btn svg { width: 10px; height: 10px; }

    .sonsion-filter-dropdown { min-width: 200px; max-width: 92vw; max-height: 65vh; }
    .sonsion-filter-list { max-height: 150px; }
    .sonsion-filter-action { padding: 3px 8px; font-size: 12px; }
}

/* ============================================================
 * 17. 打印
 * ============================================================ */
@media print {
    .sonsion-filter-btn,
    .sonsion-row-filter-btn,
    .sonsion-filter-dropdown,
    .sonsion-scroll-hint,
    .sonsion-filter-hint,
    .sonsion-table-toolbar,
    .st-inquiry-bar,
    .st-inquiry-modal,
    .sonsion-filter-bar { display: none !important; }
    .sonsion-table-container { border: 1px solid #999; max-height: none; }
    .sonsion-table th,
    .sonsion-table td { border: 1px solid #999 !important; }
}

/* ============================================================
 * 18. 筛选生效后：表格收缩 + 首列自适应 + 数据列左对齐
 * ============================================================ */
.sonsion-table.has-filter-active {
    display: table !important;
    width: fit-content !important;
    width: -moz-fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
    margin: 0 !important;
}

.sonsion-table.has-filter-active th:first-child,
.sonsion-table.has-filter-active td:first-child,
.sonsion-table.has-filter-active th.has-row-filter,
.sonsion-table.has-filter-active td.has-row-filter,
.sonsion-table.has-filter-active thead th.has-filter {
    width: 1px !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-content {
    display: inline-flex !important;
    width: auto !important;
    gap: 6px !important;
    justify-content: flex-start !important;
    padding-left: var(--st-first-col-pad-left) !important;
    padding-right: var(--st-first-col-pad-right) !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-label {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    text-align: left !important;
}

.sonsion-table.has-filter-active .sonsion-row-filter-btn,
.sonsion-table.has-filter-active .sonsion-filter-btn {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
}

.sonsion-table.has-filter-active th:not(:first-child),
.sonsion-table.has-filter-active td:not(:first-child) {
    text-align: left !important;
    padding-left: 16px !important;
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    .sonsion-table.has-filter-active th:not(:first-child),
    .sonsion-table.has-filter-active td:not(:first-child) {
        padding-left: 10px !important;
    }
    .sonsion-table.has-filter-active .sonsion-row-filter-content {
        gap: 4px !important;
    }
}

/* ============================================================
 * 19. 提示气泡通用
 * ============================================================ */

/* 横向滑动提示 */
.sonsion-scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX( -50% ) translateY( 10px );
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    background: var(--st-hint-bg);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.2 );
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur( 8px );
    -webkit-backdrop-filter: blur( 8px );
}

.sonsion-scroll-hint.visible {
    opacity: 1;
    transform: translateX( -50% ) translateY( 0 );
}

.sonsion-scroll-hint:hover {
    background: var(--st-hint-bg-hover);
    box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.28 );
}

.sonsion-scroll-hint-text { letter-spacing: 0.02em; }

.sonsion-scroll-hint-arrow {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    animation: sonsion-arrow-bounce 1.4s ease-in-out infinite;
}

.sonsion-scroll-hint-arrow:first-child {
    animation-name: sonsion-arrow-bounce-left;
    animation-delay: 0s;
}

.sonsion-scroll-hint-arrow:last-child { animation-delay: 0.7s; }

@keyframes sonsion-arrow-bounce {
    0%, 100% { transform: translateX( 0 ); opacity: 0.7; }
    50%      { transform: translateX( 3px ); opacity: 1; }
}

@keyframes sonsion-arrow-bounce-left {
    0%, 100% { transform: translateX( 0 ); opacity: 0.7; }
    50%      { transform: translateX( -3px ); opacity: 1; }
}

@media (max-width: 768px) {
    .sonsion-scroll-hint {
        font-size: 12px;
        padding: 7px 14px;
        bottom: 14px;
        gap: 8px;
    }
    .sonsion-scroll-hint-arrow { font-size: 13px; }
}

/* 筛选按钮浮动提示 */
.sonsion-filter-hint {
    z-index: 999998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    background: var(--st-hint-bg);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.2 );
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    transform: translateY( 6px );
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur( 8px );
    -webkit-backdrop-filter: blur( 8px );
}

.sonsion-filter-hint.visible {
    opacity: 1;
    transform: translateY( 0 );
}

.sonsion-filter-hint.below { transform: translateY( -6px ); }
.sonsion-filter-hint.below.visible { transform: translateY( 0 ); }

.sonsion-filter-hint:hover {
    background: var(--st-hint-bg-hover);
    box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.28 );
}

.sonsion-filter-hint-text {
    letter-spacing: 0.02em;
    display: inline-block;
    line-height: 1;
}

.sonsion-filter-hint::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--st-hint-bg);
    transition: border-top-color 0.15s;
}

.sonsion-filter-hint:hover::after {
    border-top-color: var(--st-hint-bg-hover);
}

.sonsion-filter-hint.below::after {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid var(--st-hint-bg);
}

.sonsion-filter-hint.below:hover::after {
    border-bottom-color: var(--st-hint-bg-hover);
}

@media (max-width: 768px) {
    .sonsion-filter-hint {
        font-size: 12px;
        padding: 7px 14px;
    }
}

/* ============================================================
 * 20. 筛选标签栏
 * ============================================================ */
.sonsion-filter-bar {
    display: none;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--st-gray-900);
    -webkit-font-smoothing: antialiased;
}

.sonsion-filter-bar-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--st-red-soft);
    border: 1px solid var(--st-red-soft-2);
    border-radius: 6px;
}

.sonsion-filter-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--st-red);
    white-space: nowrap;
    flex-shrink: 0;
}

.sonsion-filter-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.sonsion-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px 3px 10px;
    background: #fff;
    border: 1px solid var(--st-red-soft-2);
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--st-gray-900);
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.4;
    transition: all 0.15s;
}

.sonsion-filter-chip:hover {
    border-color: var(--st-red);
    box-shadow: 0 1px 4px rgba( 220, 38, 38, 0.12 );
}

.sonsion-filter-chip-label {
    font-weight: 600;
    color: var(--st-red);
    flex-shrink: 0;
}

.sonsion-filter-chip-sep {
    color: var(--st-gray-400);
    flex-shrink: 0;
}

.sonsion-filter-chip-value {
    color: var(--st-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.sonsion-filter-chip-remove {
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 2px;
    border: none;
    background: transparent;
    color: var(--st-gray-400);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.15s;
    flex-shrink: 0;
    box-sizing: border-box;
}

.sonsion-filter-chip-remove:hover {
    background: var(--st-red-soft-2);
    color: var(--st-red-dark);
}

.sonsion-filter-bar-clear {
    flex-shrink: 0;
    display: inline-block;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid var(--st-red-soft-2);
    color: var(--st-red);
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

.sonsion-filter-bar-clear:hover {
    background: var(--st-red);
    border-color: var(--st-red);
    color: #fff;
}

.sonsion-filter-bar-clear:active {
    background: var(--st-red-dark);
    border-color: var(--st-red-dark);
}

@media (max-width: 768px) {
    .sonsion-filter-bar-inner {
        padding: 6px 10px;
        gap: 6px;
    }
    .sonsion-filter-bar-label {
        font-size: 12px;
    }
    .sonsion-filter-chip {
        font-size: 12px;
        padding: 2px 4px 2px 8px;
    }
    .sonsion-filter-chip-value {
        max-width: 120px;
    }
    .sonsion-filter-bar-clear {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ============================================================
 * 21. 后台编辑入口（左下角，只有管理员登录时才会输出这段 DOM）
 * 字号 / 配色 / 边框沿用表格自身的 token，让它看起来是表格的一部分
 * ============================================================ */
.sonsion-table-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 管理员的编辑入口推到最右边 */
.sonsion-table-toolbar .sonsion-table-edit-link { margin-left: auto; }

/* ============================================================
 * 24. 「数据被全部隐藏」的恢复提示
 * ============================================================ */
.st-hidden-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding: 10px 14px;
    background: var(--st-red-soft);
    border: 1px solid var(--st-red-soft-2);
    border-radius: 6px;
    color: var(--st-red-dark);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.st-hidden-notice button {
    margin-left: auto;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: var(--st-red);
    border: 1px solid var(--st-red);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.st-hidden-notice button:hover {
    background: var(--st-red-dark);
    border-color: var(--st-red-dark);
}

@media print {
    .st-hidden-notice { display: none !important; }
}

/* ============================================================
 * 25. 单元格里的图片与链接
 * ============================================================ */
.sonsion-table td a {
    color: var(--st-red);
    text-decoration: none;
}

.sonsion-table td a:hover { text-decoration: underline; }

/* 含图片的单元格：放开固定行高，图片按高度自适应 */
.sonsion-table td.has-media {
    height: auto !important;
    line-height: 1.4 !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.sonsion-table td.has-media img {
    max-height: 64px;
    width: auto;
    max-width: 100%;
    vertical-align: middle;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .sonsion-table td.has-media img { max-height: 48px; }
}

.sonsion-table-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--st-row-height);
    padding: 0 var(--st-cell-pad-x);
    font-size: var(--st-label-font-size);
    font-weight: var(--st-label-font-weight);
    line-height: 1;
    color: var(--st-label-color);
    background: var(--st-gray-50);
    border: 1px solid var(--st-gray-200);
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    font-feature-settings: "tnum" 1;
    transition: background-color var(--st-transition), color var(--st-transition),
        border-color var(--st-transition);
}

.sonsion-table-edit-link:hover,
.sonsion-table-edit-link:focus {
    background: var(--st-red-soft);
    border-color: var(--st-red-soft-2);
    color: var(--st-red-dark);
    text-decoration: none;
}

.sonsion-table-edit-icon {
    font-size: var(--st-label-font-size);
    line-height: 1;
    color: var(--st-red);
}

/* ============================================================
 * 22. 询价（访客可用，无需登录）
 * ============================================================ */

/* 表头型号勾选框 */
.st-pick {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    vertical-align: middle;
    cursor: pointer;
}

.st-pick-box {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--st-red);
}

/* 右下角浮动的询价单 */
.st-inquiry-bar {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 16px;
    background: #fff;
    border: 1px solid var(--st-red-soft-2);
    border-left: 4px solid var(--st-red);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba( 220, 38, 38, 0.18 ), 0 2px 8px rgba( 0, 0, 0, 0.08 );
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--st-gray-900);
    opacity: 0;
    transform: translateY( 8px );
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.st-inquiry-bar[hidden] { display: none !important; }

.st-inquiry-bar.visible {
    opacity: 1;
    transform: translateY( 0 );
}

.st-inquiry-bar-icon { font-size: 17px; line-height: 1; }

/* 数量变化时脉冲一下，确保用户看到右下角 */
.st-inquiry-bar.st-pulse {
    animation: st-inquiry-pulse 0.9s ease-out 2;
}

@keyframes st-inquiry-pulse {
    0%   { box-shadow: 0 10px 30px rgba( 220, 38, 38, 0.18 ), 0 0 0 0 rgba( 220, 38, 38, 0.45 ); transform: translateY( 0 ) scale( 1 ); }
    40%  { box-shadow: 0 10px 30px rgba( 220, 38, 38, 0.18 ), 0 0 0 10px rgba( 220, 38, 38, 0 ); transform: translateY( 0 ) scale( 1.035 ); }
    100% { box-shadow: 0 10px 30px rgba( 220, 38, 38, 0.18 ), 0 0 0 0 rgba( 220, 38, 38, 0 ); transform: translateY( 0 ) scale( 1 ); }
}

.st-inquiry-bar-text b {
    color: var(--st-red);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.st-inquiry-go {
    padding: 9px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--st-red);
    border: 1px solid var(--st-red);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba( 220, 38, 38, 0.25 );
}

.st-inquiry-go:hover { background: var(--st-red-dark); border-color: var(--st-red-dark); }

/* 勾选型号旁的临时提示 */
.st-inquiry-hint {
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--st-red);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba( 220, 38, 38, 0.35 );
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY( 4px );
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.st-inquiry-hint.visible { opacity: 1; transform: translateY( 0 ); }

.st-inquiry-hint-more { font-weight: 400; opacity: 0.9; }

.st-inquiry-hint-arrow { font-size: 14px; line-height: 1; }

.st-inquiry-hint::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    margin-left: -5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--st-red);
}

.st-inquiry-hint.below::after {
    bottom: auto;
    top: -5px;
    border-top: none;
    border-bottom: 5px solid var(--st-red);
}

.st-inquiry-clear {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--st-gray-400);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.st-inquiry-clear:hover { background: var(--st-gray-100); color: var(--st-gray-700); }

/* 弹窗 */
body.st-inquiry-lock { overflow: hidden; }

.st-inquiry-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
}

.st-inquiry-modal[hidden] { display: none !important; }

.st-inquiry-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba( 15, 23, 42, 0.45 );
}

.st-inquiry-panel {
    position: relative;
    width: min( 580px, 92vw );
    max-height: 88vh;
    overflow: auto;
    margin: 6vh auto 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.28 );
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--st-gray-900);
    text-align: left;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.st-inquiry-panel * { box-sizing: border-box; }

.st-inquiry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--st-gray-200);
    font-size: 15px;
    font-weight: 600;
    color: var(--st-gray-900);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.st-inquiry-close {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--st-gray-400);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.st-inquiry-close:hover { background: var(--st-gray-100); color: var(--st-gray-700); }

.st-inquiry-content { padding-bottom: 4px; }

.st-inquiry-picked-label {
    padding: 12px 16px 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--st-gray-700);
}

.st-inquiry-picked-tip {
    margin-left: 6px;
    font-weight: 400;
    color: var(--st-gray-400);
}

/* 数量输入 */
.st-inquiry-qty {
    width: 66px;
    height: 24px;
    padding: 0 6px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--st-gray-900);
    background: #fff;
    border: 1px solid var(--st-red-soft-2);
    border-radius: 3px;
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
}

.st-inquiry-qty::-webkit-outer-spin-button,
.st-inquiry-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.st-inquiry-qty:focus {
    border-color: var(--st-red);
    box-shadow: 0 0 0 2px var(--st-red-soft);
}

.st-inquiry-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.st-inquiry-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 8px;
    background: var(--st-red-soft);
    border: 1px solid var(--st-red-soft-2);
    border-radius: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--st-red-dark);
    max-width: 100%;
}

.st-inquiry-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    font-weight: 500;
}

.st-inquiry-chip-x {
    width: 16px;
    height: 16px;
    padding: 0;
    margin-left: 2px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
}

.st-inquiry-chip-x:hover { opacity: 1; background: rgba( 0, 0, 0, 0.06 ); }

.st-inquiry-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    padding: 4px 16px 8px;
}

.st-inquiry-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    color: var(--st-gray-700);
}

.st-inquiry-field-full { grid-column: 1 / -1; }

.st-inquiry-req { color: var(--st-red); }

.st-inquiry-field input,
.st-inquiry-field textarea {
    width: 100%;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--st-gray-900);
    background: #fff;
    border: 1px solid var(--st-gray-300);
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    resize: vertical;
}

.st-inquiry-field input:focus,
.st-inquiry-field textarea:focus {
    border-color: var(--st-red);
    box-shadow: 0 0 0 2px var(--st-red-soft);
}

.st-inquiry-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.st-inquiry-msg {
    min-height: 20px;
    padding: 0 16px;
    font-size: 12.5px;
}

.st-inquiry-msg.error { color: var(--st-red); }

.st-inquiry-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid var(--st-gray-200);
    background: var(--st-gray-50);
    position: sticky;
    bottom: 0;
}

.st-inquiry-cancel,
.st-inquiry-submit,
.st-inquiry-done-close {
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.5;
}

.st-inquiry-cancel {
    background: #fff;
    border: 1px solid var(--st-gray-300);
    color: var(--st-gray-700);
}

.st-inquiry-cancel:hover { background: var(--st-gray-50); border-color: var(--st-gray-400); }

.st-inquiry-submit {
    background: var(--st-red);
    border: 1px solid var(--st-red);
    color: #fff;
}

.st-inquiry-submit:hover { background: var(--st-red-dark); border-color: var(--st-red-dark); }

.st-inquiry-submit:disabled { opacity: 0.6; cursor: default; }

/* 提交成功 */
.st-inquiry-done { padding: 34px 24px 30px; text-align: center; }

.st-inquiry-done-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--st-red-soft);
    color: var(--st-red);
    font-size: 26px;
    line-height: 52px;
}

.st-inquiry-done-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }

.st-inquiry-done-text { color: var(--st-gray-500); font-size: 13.5px; margin-bottom: 18px; }

.st-inquiry-done-close {
    display: inline-block;
    background: var(--st-red);
    border: 1px solid var(--st-red);
    color: #fff;
}

@media (max-width: 600px) {
    .st-inquiry-bar {
        right: 12px;
        left: 12px;
        bottom: 12px;
        justify-content: space-between;
    }
    .st-inquiry-fields { grid-template-columns: 1fr; }
    .st-inquiry-panel { margin-top: 3vh; max-height: 94vh; }
}

/* ============================================================
 * 26. 胶囊形按钮 / 圆形图标按钮（统一圆角）
 * ============================================================ */
.sonsion-table-edit-link,
.st-inquiry-go,
.st-inquiry-cancel,
.st-inquiry-submit,
.st-inquiry-done-close,
.sonsion-filter-bar-clear,
.sonsion-filter-btn-check-all,
.sonsion-filter-btn-clear-all,
.sonsion-filter-btn-cancel,
.sonsion-filter-btn-apply,
.sonsion-filter-action,
.st-hidden-notice button,
.st-inquiry-chip,
.st-inquiry-hint,
.sonsion-filter-chip,
.sonsion-filter-selected-chip {
    border-radius: var( --st-radius-pill ) !important;
}

.st-inquiry-clear,
.st-inquiry-close,
.st-inquiry-chip-x,
.sonsion-filter-search-clear,
.sonsion-row-filter-btn,
.sonsion-filter-btn,
.sonsion-filter-chip-remove,
.sonsion-filter-selected-chip-remove {
    border-radius: 50% !important;
}

/* 胶囊按钮左右留白（与 .sonsion-filter-footer 的按钮基线一致，不再额外加宽） */
.st-inquiry-cancel,
.st-inquiry-submit,
.st-inquiry-done-close {
    padding-left: 20px;
    padding-right: 20px;
}