/*
 * 青岩汽车后台基础布局样式
 *
 * 入口：views/layout/app.php 在 apex-vi.css 之后、页面专用 CSS 之前加载。
 * 依赖：apex-admin.css 负责最终 VI 覆盖；本文件保留业务页面与旧模板依赖的类名。
 * 关键约定：侧边栏一级分组的展开状态只由点击后的 .open 类控制，悬停只提供视觉反馈；
 *           二级分组的三级菜单交互保持原有“悬停预览、点击固定”口径。
 */
:root {
    --car-primary: #1f6feb;
    --car-dark: #1c2331;
    --car-dark-2: #232b3d;
    --car-border: #e3e7ef;
    --car-bg: #f4f6fa;
}

body {
    background: var(--car-bg);
    font-size: 14px;
    color: #23282f;
}

/* ---------------------------------------------------------------- 顶部导航 */
.app-header {
    height: 56px;
    background: var(--car-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.app-header__brand i {
    color: #5aa9ff;
    font-size: 20px;
}

.app-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------------------------------------------------------------- 侧边栏 */
.app-shell {
    display: flex;
    min-height: calc(100vh - 56px);
}

.app-sidebar {
    width: 218px;
    flex: 0 0 218px;
    background: var(--car-dark-2);
    color: #cfd6e4;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.app-sidebar .nav-link {
    color: #cfd6e4;
    padding: 9px 18px;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.app-sidebar .nav-link.active {
    background: rgba(90, 169, 255, .14);
    border-left-color: #5aa9ff;
    color: #fff;
    font-weight: 600;
}

.sidebar-group {
    margin-top: 6px;
}

.sidebar-group__title {
    padding: 9px 18px;
    font-size: 13.5px;
    color: #cfd6e4;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
}

.sidebar-group__title:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

/* 当前页面所在的一级菜单：页面上下文可默认展开；子项激活时一级标题不再整行高亮，
   分组位置改由展开箭头表达，避免与二级/三级激活项重复抢视觉焦点 */

.sidebar-group__arrow {
    margin-left: auto;
    font-size: 12px;
    color: #7d879b;
    transition: transform .18s ease, color .18s ease;
}

.sidebar-group.open > .sidebar-group__title .sidebar-group__arrow {
    transform: rotate(90deg);
    color: #5aa9ff;
}

/*
 * 二级菜单展开容器。
 * 使用 0fr ↔ 1fr 的网格行高动画，而不是固定 max-height：产品库等菜单会继续增加入口，
 * 固定像素上限一旦小于实际内容高度，后面的“拆车件目录”等菜单就会被 overflow 裁掉。
 */
.sidebar-group__children {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .2s ease;
}

.sidebar-group.open > .sidebar-group__children {
    grid-template-rows: 1fr;
}

/*
 * 网格动画的实际裁剪层。
 * min-height: 0 是 0fr 能真正收起到零高度的前提；展开后由内容决定高度，
 * 不再限制菜单项数量。外层侧栏自身的 overflow-y 负责长菜单滚动。
 */
.sidebar-group__children-inner,
.sidebar-subgroup__children-inner {
    min-height: 0;
    overflow: hidden;
}

/* 三级菜单：二级分组「1688产品大全」，鼠标移到它上面才展开三级入口 */
.sidebar-subgroup {
    padding: 0;
}

.sidebar-subgroup__title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px 8px 30px;
    font-size: 12.5px;
    color: #9aa5ba;
    letter-spacing: .2px;
    cursor: pointer;
    user-select: none;
    border-left: 3px solid transparent;
    transition: background .15s ease, color .15s ease;
}

.sidebar-subgroup__title:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.sidebar-subgroup.has-active > .sidebar-subgroup__title {
    color: #a9c4e8;
}

.sidebar-subgroup__arrow {
    margin-left: auto;
    font-size: 11px;
    color: #7d879b;
    transition: transform .18s ease, color .18s ease;
}

.sidebar-subgroup:hover > .sidebar-subgroup__title .sidebar-subgroup__arrow,
.sidebar-subgroup.open > .sidebar-subgroup__title .sidebar-subgroup__arrow {
    transform: rotate(90deg);
    color: #5aa9ff;
}

/*
 * 三级菜单沿用同一套按内容展开的动画。
 * 主图维护、1688 产品大全等分组后续增加子项时，不会再被 320px 固定高度截断。
 */
.sidebar-subgroup__children {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .2s ease;
}

/* 悬停「1688产品大全」或点击固定后显示三级入口 */
.sidebar-subgroup:hover > .sidebar-subgroup__children,
.sidebar-subgroup.open > .sidebar-subgroup__children {
    grid-template-rows: 1fr;
}

.sidebar-subgroup__children .sidebar-child {
    padding-left: 46px;
    font-size: 13px;
}

.app-sidebar .sidebar-child {
    padding-left: 30px;
    font-size: 13px;
}

.app-sidebar .sidebar-child .bi-dot {
    color: #5aa9ff;
}

.sidebar-footer {
    padding: 12px 18px 4px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    margin-top: 12px;
}

/* ---------------------------------------------------------------- 主区域 */
.app-main {
    flex: 1 1 auto;
    padding: 16px 20px 40px;
    min-width: 0;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.page-head__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

.page-head__right .page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-head__right .page-actions:empty {
    display: none;
}

.page-head__right > .page-guide-trigger {
    margin-left: auto;
}

.page-title {
    font-size: 19px;
    font-weight: 600;
    margin: 0;
}

.page-guide-trigger {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* ------------------------------------------------------------ 页面说明弹窗 */
.page-guide-modal .modal-dialog {
    max-width: min(1180px, calc(100vw - 32px));
}

.page-guide-modal .modal-content {
    border: 0;
    border-radius: 12px;
    overflow: hidden;
}

.page-guide-modal__header {
    align-items: flex-start;
    background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 62%);
    border-bottom: 1px solid #dfe6f2;
    padding: 16px 20px;
}

.page-guide-modal__eyebrow {
    color: #5e6b84;
    font-size: 12px;
    margin-bottom: 3px;
}

.page-guide-modal__header .modal-title {
    font-size: 20px;
    font-weight: 650;
    margin: 0;
}

.page-guide-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    color: #74809a;
    font-size: 12px;
    margin-top: 6px;
}

.page-guide-modal__body {
    background: #f8fafc;
    padding: 0 20px 20px;
}

.page-guide-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8fafc;
    padding-top: 12px;
    margin-bottom: 0;
}

.page-guide-tabs .nav-link {
    color: #5b6780;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 13px;
    padding: 9px 12px;
}

.page-guide-tabs .nav-link.active {
    color: #165dff;
    background: transparent;
    border-bottom-color: #165dff;
    font-weight: 600;
}

.page-guide-content {
    background: #fff;
    border: 1px solid #e1e7f0;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    padding: 20px;
}

.page-guide-purpose {
    border-left: 3px solid #165dff;
    background: #f7faff;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
}

.page-guide-purpose p {
    margin-bottom: 6px;
    line-height: 1.75;
}

.page-guide-section-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    color: #263650;
    font-size: 15px;
    font-weight: 650;
    margin-bottom: 10px;
}

.page-guide-function {
    border: 1px solid #e2e8f1;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
}

.page-guide-function__name {
    color: #1b4fd8;
    font-weight: 650;
    margin-bottom: 8px;
}

.page-guide-function__line {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.6;
    margin-top: 5px;
}

.page-guide-function__line > span {
    color: #7b8598;
}

.page-guide-flow {
    display: flex;
    align-items: stretch;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 2px 12px;
}

.page-guide-flow__step {
    position: relative;
    flex: 1 0 150px;
    max-width: 230px;
    min-height: 142px;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
    border: 1px solid #dbe5f3;
    border-radius: 9px;
    padding: 12px;
}

.page-guide-flow__no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #165dff;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-guide-flow__title {
    font-size: 13px;
    font-weight: 650;
    color: #253858;
    margin-bottom: 5px;
}

.page-guide-flow__detail {
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
}

.page-guide-flow__arrow {
    flex: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8da2c3;
}

.page-guide-branch {
    border: 1px solid #e0e6ef;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.6;
    height: 100%;
    background: #fbfcfe;
}

.page-guide-branch__title {
    font-weight: 650;
    margin-bottom: 3px;
}

.page-guide-branch--success { border-color: #b7e4c7; background: #f4fcf7; }
.page-guide-branch--warning { border-color: #f3d39b; background: #fffaf0; }
.page-guide-branch--danger { border-color: #f1b7b7; background: #fff6f6; }
.page-guide-branch--info { border-color: #b9d8f5; background: #f4f9ff; }

.page-guide-metric {
    border: 1px solid #e1e7f0;
    border-radius: 9px;
    padding: 12px 14px;
    background: #fbfcfe;
}

.page-guide-metric__label {
    font-weight: 650;
    color: #253858;
    margin-bottom: 7px;
}

.page-guide-metric__formula {
    background: #0f172a;
    color: #d8e5ff;
    border-radius: 6px;
    padding: 8px 10px;
    overflow-x: auto;
}

.page-guide-metric__formula code {
    color: inherit;
    font-size: 11.5px;
    white-space: pre-wrap;
    word-break: break-word;
}

.page-guide-metric__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    color: #69758c;
    font-size: 11.5px;
    margin-top: 8px;
}

.page-guide-metric__note {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.6;
    margin-top: 7px;
}

.page-guide-tables .accordion-button {
    font-size: 13px;
    padding: 11px 13px;
    background: #fbfcfe;
}

.page-guide-tables .accordion-button:not(.collapsed) {
    color: #174ea6;
    background: #f1f6ff;
    box-shadow: none;
}

.page-guide-table-name {
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 650;
}

.page-guide-table-label {
    color: #77839a;
    font-size: 12px;
    margin-left: 9px;
}

.page-guide-schema-table th {
    background: #f7f9fc;
    font-size: 12px;
}

.page-guide-schema-table td {
    font-size: 12px;
    vertical-align: top;
}

.page-guide-schema-table tr.table-primary > td {
    --bs-table-bg: #eef5ff;
}

.page-guide-schema-note {
    color: #5f6b80;
    font-size: 12px;
    line-height: 1.7;
    margin-top: 3px;
}

.page-guide-script-table td,
.page-guide-trouble-table td {
    font-size: 12.5px;
    vertical-align: top;
}

.page-guide-script-table th,
.page-guide-trouble-table th {
    font-size: 12px;
    background: #f7f9fc;
}

.page-guide-doc-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 7px 0;
    border-bottom: 1px dashed #e5eaf1;
    font-size: 12.5px;
}

.page-guide-rule-list {
    margin: 0;
    padding-left: 20px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.8;
}

.page-guide-modal__footer {
    justify-content: space-between;
    background: #fff;
    padding: 10px 20px;
}

@media (max-width: 767.98px) {
    .page-head {
        align-items: flex-start;
        gap: 8px;
    }

    .page-head__right {
        gap: 6px;
    }

    .page-guide-trigger span {
        display: none;
    }

    .page-guide-modal__body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-guide-content {
        padding: 14px;
    }

    .page-guide-flow {
        flex-direction: column;
        overflow: visible;
    }

    .page-guide-flow__step {
        flex-basis: auto;
        max-width: none;
        min-height: 0;
    }

    .page-guide-flow__arrow {
        height: 16px;
    }

    .page-guide-flow__arrow i::before {
        content: "\f128";
    }
}

.card {
    border: 1px solid var(--car-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(20, 30, 60, .04);
}

.card-header {
    background: #fbfcfe;
    border-bottom: 1px solid var(--car-border);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
}

.table > :not(caption) > * > * {
    padding: .45rem .55rem;
}

.table thead th {
    background: #f7f9fc;
    font-size: 13px;
    color: #55607a;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- 统计卡片 */
.stat-card .card-body {
    padding: 12px 14px;
}

.stat-label {
    font-size: 12px;
    color: #7b869c;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.stat-hint {
    font-size: 12px;
    color: #9aa4b6;
    margin-top: 2px;
}

/* ---------------------------------------------------------------- 明细表 */
.detail-table th {
    width: 120px;
    color: #7b869c;
    font-weight: 400;
    background: transparent;
    white-space: nowrap;
}

.thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--car-border);
    background: #fff;
}

/* 商品标题里匹配到的 OE 码：黄色背景高亮 */
mark.oe-hl {
    background: #ffe58f;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* 相同产品合并：展开明细（一行 3 列，只展示图片/宝贝ID/商品名称，图片高度 300） */
.merge-item {
    background: #fff;
    border: 1px solid var(--car-border);
    border-radius: 6px;
    flex-wrap: wrap;
}

.merge-item__media {
    flex: 0 0 auto;
    max-width: 100%;
}

.merge-item__img {
    display: block;
    height: 200px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border: 1px solid var(--car-border);
    border-radius: 4px;
    background: #fff;
}

a.js-image-preview .merge-item__img {
    cursor: zoom-in;
}

a.js-image-preview:hover .merge-item__img {
    border-color: var(--car-primary);
    box-shadow: 0 0 0 2px rgba(31, 111, 235, .15);
}

.merge-item__noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    max-width: 100%;
    border: 1px dashed var(--car-border);
    border-radius: 4px;
}

.merge-item__body {
    flex: 1 1 180px;
    min-width: 0;
}

.merge-item__title {
    margin-top: 2px;
    line-height: 1.45;
    word-break: break-word;
}

.merge-item__title a {
    color: inherit;
    text-decoration: none;
}

.merge-item__title a:hover {
    color: var(--car-primary);
}

.merge-item__price {
    margin-top: 4px;
    color: #d4380d;
}

.merge-item__codes {
    line-height: 1.9;
}

/* 点击 OE 码徽章即可复制：鼠标手型 + 复制成功/失败反馈 */
.merge-item__codes .js-merge-copy-code {
    cursor: pointer;
}

.merge-item__codes .badge.is-copied {
    background-color: #198754 !important;
    color: #fff;
}

.merge-item__codes .badge.is-copy-failed {
    background-color: #dc3545 !important;
    color: #fff;
}

/* 审核通过后自动展开的分组行：淡黄底提示当前行 */
tr.merge-group-row--focus > td {
    background-color: #fffbe6;
}

/* 已复制（取用）过的 OE 码：绿色字体 */
code.oe-copied {
    color: #00b42a;
    font-weight: 600;
}

/* 可点击放大的缩略图 */
a.js-image-preview {
    display: inline-block;
    line-height: 0;
    transition: transform .12s ease;
}

a.js-image-preview:hover {
    transform: scale(1.06);
}

a.js-image-preview:hover .thumb {
    border-color: var(--car-primary);
    box-shadow: 0 0 0 2px rgba(31, 111, 235, .15);
}

a.js-image-preview .thumb {
    cursor: zoom-in;
}

.product-main-image {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    border: 1px solid var(--car-border);
    border-radius: 6px;
    background: #fff;
}

.form-label.required::after {
    content: " *";
    color: #dc3545;
}

.text-break {
    word-break: break-all;
}

/* ---------------------------------------------------------------- 导入向导 */
.step-block {
    border-bottom: 1px dashed var(--car-border);
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.step-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-no {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--car-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ---------------------------------------------------------------- 登录页 */
.plain-body {
    background: linear-gradient(135deg, #1c2331 0%, #2c3a55 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.plain-wrap {
    width: 100%;
    max-width: 620px;
}

.login-card {
    max-width: 420px;
    margin: 0 auto;
    border: none;
}

.login-logo {
    font-size: 34px;
    color: var(--car-primary);
}

.pagination {
    margin-bottom: 0;
}

/* Select2 与 Bootstrap 5 小尺寸表单（form-select-sm）对齐 */
.select2-container--bootstrap-5.car-select2-sm .select2-selection--single {
    min-height: calc(1.5em + .5rem + 2px);
    padding: .25rem .5rem;
    font-size: .875rem;
}

.select2-container--bootstrap-5.car-select2-sm .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: 1.5;
}

.select2-container--bootstrap-5.car-select2-sm .select2-selection--single .select2-selection__arrow {
    height: 100%;
}

.select2-container--bootstrap-5.car-select2-sm .select2-results__option,
.select2-container--bootstrap-5.car-select2-sm .select2-search__field {
    font-size: .875rem;
}

/* 筛选条中的 Select2 铺满所在列 */
#productFilterForm .select2-container,
#importForm .select2-container {
    width: 100% !important;
}

@media (max-width: 991px) {
    .app-sidebar {
        display: none;
    }

    .app-main {
        padding: 12px;
    }
}

/* ------------------------------------------------------------------
   AI 标准化与去重页（供应商管理 → 1688产品大全 → AI 标准化与去重）
   OE 码一行一个，点击即复制
   ------------------------------------------------------------------ */
.ai-oe-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.ai-oe-item + .ai-oe-item {
    border-top: 1px dashed #eaecf0;
}

.ai-oe-item code.js-copy-oe {
    flex: 1 1 auto;
    cursor: pointer;
    user-select: all;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f2f4f7;
    color: #1d2939;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.ai-oe-item code.js-copy-oe:hover {
    background: #d0e2ff;
    color: #0d6efd;
}

.ai-oe-item code.js-copy-oe.is-copied {
    background: #d1e7dd;
    color: #0f5132;
}

.ai-part-name {
    word-break: break-all;
}

/* 商品标题整条展示（不再截断），窄列时自动换行 */
.ai-title {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

/* 宝贝ID 可点进产品详情 */
.ai-baby-link {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 4px;
    background: #f2f4f7;
    color: #0d6efd;
    text-decoration: none;
    font-size: .85rem;
    word-break: break-all;
}

.ai-baby-link:hover {
    background: #d0e2ff;
    color: #0a58ca;
    text-decoration: underline;
}

/* 抽取明细里：已获取 OE 数据的码旁边加个小对勾，点进 OE 详情 */
.ai-oe-fetched {
    color: #198754;
    font-size: .85rem;
    line-height: 1;
}

.ai-oe-fetched:hover {
    color: #0f5132;
}

/* 待入库OE数据页：自动采集的实时日志面板 */
.ac-logs {
    max-height: 240px;
    overflow-y: auto;
    background: #fbfbfc;
    font-size: .82rem;
    line-height: 1.7;
    padding: 4px 8px;
}

.ac-log-line {
    border-bottom: 1px dashed #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-log-line:last-child {
    border-bottom: none;
}

.ac-log-line code {
    color: #0d6efd;
    background: #eef3ff;
    padding: 0 4px;
    border-radius: 3px;
}

/* ---------------------------------------------------------------
   零件图查看：零件图 + OE 码位置框（OE ↔ 图片坐标）
   --------------------------------------------------------------- */
.ama-diagram-stage {
    position: relative;
    display: block;
    line-height: 0;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ama-diagram-stage img {
    display: block;
    width: 100%;
    height: auto;
}

.ama-diagram-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ama-area-box {
    position: absolute;
    display: none;
    border: 2px solid #dc3545;
    background: rgba(220, 53, 69, .22);
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .6) inset;
    pointer-events: auto;
    cursor: crosshair;
}

.ama-area-box.is-oe {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, .22);
}

.ama-area-box.is-on {
    display: block;
}

.ama-area-box.is-faint {
    opacity: .38;
    border-style: dashed;
}

.ama-area-box.is-strong {
    box-shadow: 0 0 8px 2px rgba(220, 53, 69, .55);
    opacity: 1;
}

.ama-area-box.is-strong.is-oe {
    box-shadow: 0 0 8px 2px rgba(13, 110, 253, .55);
}

/* 表格行被图上热区选中时的强调（Bootstrap 的 table-primary 偏淡，这里再压一层） */
.ama-part-row.table-primary > td {
    background-color: #cfe2ff;
}

/* ---------------------------------------------------------------- 产品主图人工选择 */
/* 产品列表里的主图：250×250（小图看不清，运营要挑图） */
.thumb-250 {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--car-border, #e5e8ee);
    background: #fafbfc;
}

/* 列表里的主图点一下就能打开选图弹窗 */
img.thumb-250.js-pick-image {
    cursor: pointer;
    transition: box-shadow .12s ease, border-color .12s ease;
}

img.thumb-250.js-pick-image:hover {
    border-color: var(--car-primary, #1f6feb);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .18);
}

/* 产品列表主图 —— 100×100 缩略图、右上角图片来源标签；颜色全部复用 APEX 令牌 */
.release-image-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    min-height: 100px;
}

.release-image {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.release-image__img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 1px solid var(--apx-slate-200, #e2e8f0);
    border-radius: var(--apx-radius-control, 4px);
    background: var(--apx-surface-raised, #fff);
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.release-image__img:hover,
.release-image__img:focus-visible {
    border-color: var(--apx-forest-600, #287a45);
    box-shadow: 0 0 0 3px var(--apx-forest-100, #ddf7e3);
    outline: none;
}

.release-image__source {
    position: absolute;
    top: 4px;
    right: 4px;
    max-width: calc(100% - 8px);
    padding: 2px 4px;
    overflow: hidden;
    border-radius: var(--apx-radius-control, 4px);
    color: var(--apx-white, #fff);
    font-size: 11px;
    font-weight: 700;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.release-image__source--ai {
    background: var(--apx-forest-700, #00612f);
}

.release-image__source--manual {
    background: var(--apx-charcoal-800, #213145);
}

.release-image__source--upload {
    background: var(--apx-slate-700, #3f4c5a);
}

.release-image__source--auto {
    background: var(--apx-slate-600, #565f69);
}

/* 产品列表 OE 码 —— 整枚编号可点击复制，保留等宽技术字体与键盘焦点 */
.release-oe-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 2px 4px;
    border: 0;
    border-radius: var(--apx-radius-control, 4px);
    background: transparent;
    color: var(--apx-forest-700, #00612f);
    text-align: left;
}

.release-oe-copy code {
    color: inherit;
    white-space: nowrap;
}

.release-oe-copy .bi {
    color: var(--apx-slate-500, #65707a);
    font-size: 12px;
}

.release-oe-copy:hover,
.release-oe-copy:focus-visible,
.release-oe-copy.is-copied {
    background: var(--apx-forest-050, #effaf2);
    color: var(--apx-forest-800, #164627);
    outline: none;
}

.release-oe-copy:focus-visible {
    box-shadow: 0 0 0 2px var(--apx-forest-600, #287a45);
}

/* 产品列表适配品牌 —— 每行一个，前 5 个后显示省略号，完整清单放在 title */
.release-brand-list {
    display: grid;
    gap: 1px;
    min-width: 88px;
    color: var(--apx-slate-700, #3f4c5a);
    font-size: 12px;
    line-height: 16px;
}

.release-brand-list__item,
.release-brand-list__more {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.release-brand-list__more {
    color: var(--apx-slate-500, #65707a);
    font-family: var(--apx-font-mono, "JetBrains Mono", monospace);
    letter-spacing: .08em;
}

/* 产品列表分类 —— 两级分类保持单行可扫描，完整英文口径放在 title 中 */
.release-category {
    display: inline;
    color: var(--apx-slate-700, #3f4c5a);
    line-height: 18px;
    overflow-wrap: anywhere;
}

/* 商品详情编辑 —— 人工上传主图预览；沿用产品列表主图边线与来源角标 */
.release-edit-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--apx-slate-200, #e2e8f0);
    border-radius: var(--apx-radius-card, 8px);
    background: var(--apx-surface-sunken, #f1f5f9);
}

.release-edit-image img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
}

/* 商品详情编辑页签 —— 沿用后台 Forest 激活色与 Slate 分隔线 */
.release-edit-tabs {
    border-bottom-color: var(--apx-slate-200, #e2e8f0);
}

.release-edit-tabs .nav-link {
    color: var(--apx-slate-600, #565f69);
    font-size: 13px;
    font-weight: 600;
}

.release-edit-tabs .nav-link.active {
    color: var(--apx-forest-700, #00612f);
    border-bottom-color: var(--apx-forest-600, #287a45);
}

.release-edit-tabs .nav-link:focus-visible {
    outline: 2px solid var(--apx-forest-600, #287a45);
    outline-offset: 2px;
}

/* 候选图弹窗：一行固定 5 张，单张按 350×350 等比缩放
   （弹窗加宽到 1900px，5 × 350 + 间距 才放得下；窄屏时图片等比缩小，仍保持一行 5 张） */
.pick-modal {
    max-width: min(1900px, 97vw);
}

.pick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.pick-item {
    border: 2px solid var(--car-border, #e5e8ee);
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.pick-item:hover {
    border-color: var(--car-primary, #1f6feb);
    box-shadow: 0 2px 12px rgba(31, 111, 235, .22);
}

.pick-item.is-current {
    border-color: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .2);
}

.pick-item img {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    background: #fafbfc;
    display: block;
    margin: 0 auto;
}

.pick-item__badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.pick-item { position: relative; }

/* 候选图卡片：AI 处理中的遮罩 + 图下的「智能抠图 / 智能消除」按钮 */
.pick-item__imgwrap {
    position: relative;
}

.pick-item__loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .84);
    border-radius: 6px;
    z-index: 2;
}

.pick-item.is-busy {
    pointer-events: none;
}

.pick-item__actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.pick-item__actions .btn {
    flex: 1 1 0;
    white-space: nowrap;
    /* 高度做成 btn-sm 的 2 倍（原来约 31px → 62px），方便点 */
    min-height: 62px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pick-item__badge-right {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ---------------------------------------------------------------- 主图选择工作台（三栏） */
.pick-wb {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* 左 / 右固定宽度（默认 260px 兜底，实际由左右修饰类覆盖），各自可滚动 */
.pick-wb__side {
    width: 260px;
    flex: 0 0 260px;
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    border: 1px solid var(--car-border, #e5e8ee);
    border-radius: 8px;
    background: #fff;   /* 兜底，实际由左右各自的浅色底覆盖 */
}

/* 三栏底色区分模块：左=淡红（待处理） 中=淡灰（挑选） 右=淡绿（已处理） */
.pick-wb__side--left {
    width: 200px;
    flex: 0 0 200px;
    background: #fff5f5;
    border-color: #f0d5d5;
}

.pick-wb__side--right {
    width: 300px;
    flex: 0 0 300px;
    background: #f1fbf4;
    border-color: #cfe9d6;
}

.pick-wb__side--left > .pick-wb__head {
    background: #fff5f5;
}

.pick-wb__side--right > .pick-wb__head {
    background: #f1fbf4;
}

.pick-wb__head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--car-border, #e5e8ee);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.pick-wb__list {
    padding: 2px;
}

/* 中间自适应 */
.pick-wb__center {
    flex: 1 1 auto;
    min-width: 0;
    background: #f6f7f9;
    border: 1px solid #e6e9ee;
    border-radius: 8px;
    padding: 10px;
}

.wb-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 6px;
    cursor: pointer;
    background: #fff;   /* 让卡片在浅色底上浮起来 */
}

.wb-item:hover {
    border-color: var(--car-primary, #1f6feb);
    background: #f7faff;
}

.wb-item.is-current {
    border-color: var(--car-primary, #1f6feb);
    background: #eef5ff;
}

.wb-item__flag {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}

/* 已处理列表卡片左上角的「重置」按钮（删除该 OE 码的主图关系，回到待处理） */
.wb-item__reset {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.7;
}

/* 左右列表里的缩略图：250px */
.wb-thumb {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fafbfc;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

.wb-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5ba;
    font-size: 12px;
}

.wb-item__oe {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
    padding: 0 4px;
    word-break: break-all;
}

.wb-item__meta {
    font-size: 12px;
    color: #6b7280;
    padding: 0 4px 4px;
    line-height: 1.3;
}

/* 中间候选图网格：按 400px 铺，窄了就自动减少列数
   （400 的图 + 卡片内边距 12 + 边框 4 = 416 的最小列宽） */
.wb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(416px, 1fr));
    gap: 12px;
}

/* 工作台中间的候选图放大到 400×400（产品列表弹窗里仍是 350×350） */
.pick-wb__center .pick-item img {
    max-width: 400px;
}

/* ---------------------------------------------------------------- 批量主图审核表 */
/* 原图 / 裁剪图都用 250×250 展示（小图看不清零件细节，运营要审图） */
.batch-thumb {
    width: 250px;
    height: 250px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--car-border, #e5e8ee);
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* 裁剪图是透明底 PNG：铺一层棋盘格，人工一眼能看出哪里被抠成透明 */
.ai-review-cell {
    min-width: 240px;
    vertical-align: middle;
}

.ai-review-cell .badge {
    font-weight: 600;
}

.ai-review-cell .small {
    line-height: 1.35;
    word-break: break-word;
}

.batch-thumb--checker {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e9ecef 25%, transparent 25%, transparent 75%, #e9ecef 75%),
        linear-gradient(45deg, #e9ecef 25%, transparent 25%, transparent 75%, #e9ecef 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* ---------------------------------------------------------------- 主图选择（批量处理） */
/* 队列缩略图条：人工一眼看出已经加了哪 16 张、还差几张 */
.batch-queue-strip {
    display: grid;
    grid-template-columns: repeat(16, minmax(0, 1fr));
    gap: 6px;
}

.batch-qitem {
    position: relative;
    width: auto;
    min-width: 0;
    height: auto;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--car-border, #e5e8ee);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.batch-qitem img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.batch-qitem__oe {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-qitem--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3c9d4;
    font-size: 14px;
    background: #fafbfc;
    border-style: dashed;
}
@media (max-width: 1200px) {
    /* 16 张固定一行；窄屏改为横向滚动，避免格子被压到无法辨认 */
    .batch-queue-strip {
        grid-template-columns: repeat(16, 86px);
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
    }
}

/* AI 处理中的全屏遮罩（拼图 + 2 次接口调用，约 20 秒） */
.batch-overlay {
    position: fixed;
    inset: 0;
    z-index: 1085;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .88);
}

/* 3 个按钮一行（智能抠图 / 智能消除 / 批量处理）时字号收一点，避免挤压换行 */
.pick-item__actions--3 .btn {
    font-size: .92rem;
    padding-left: 4px;
    padding-right: 4px;
    min-height: 62px;
}

/* ---------------------------------------------------------------- 主图选择调试版：同零件归并

   一个零件的多个 OE 码共用一张主图（中间选区一行一个 OE 码，超出部分横向滚动）。
   只被 assets/js/product-image-pick-debug.js 使用，类名统一 gp- 前缀，不影响正式版。 */
.gp-spots {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gp-spot {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid #d8dde5;
    border-radius: 999px;
    background: #fff;
    color: #33415c;
    font-size: .85rem;
    text-decoration: none;
}

.gp-spot:hover {
    border-color: var(--car-primary, #1f6feb);
    color: var(--car-primary, #1f6feb);
}

.gp-spot.is-current {
    background: var(--car-primary, #1f6feb);
    border-color: var(--car-primary, #1f6feb);
    color: #fff;
}

.gp-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gp-row {
    border: 1px solid var(--car-border, #e5e8ee);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.gp-row__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #eef1f5;
    background: #fafbfc;
    cursor: pointer;               /* 整条标题栏都可点击 = 勾选/取消勾选 */
    user-select: none;
}

.gp-row__head:hover {
    background: #eef4ff;
}

/* 第 1 行（本次待处理的 OE 码）固定勾选，不可点击切换 */
.gp-row__head--locked {
    cursor: default;
}

.gp-row__head--locked:hover {
    background: #fafbfc;
}

.gp-row__head code {
    font-size: .95rem;
}

.gp-check {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    flex: 0 0 auto;
}

/* 一行放这个 OE 码的全部候选图；超出部分横向滚动 */
.gp-row__strip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
}

.gp-img {
    position: relative;
    flex: 0 0 auto;
    border: 2px solid var(--car-border, #e5e8ee);
    border-radius: 8px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
}

.gp-img:hover {
    border-color: var(--car-primary, #1f6feb);
}

.gp-img.is-current {
    border-color: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .2);
}

.gp-img.is-busy {
    pointer-events: none;
}

.gp-img img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    background: #fafbfc;
    display: block;
}

.gp-img__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
}

.gp-img__wrap {
    position: relative;
}

.gp-img__loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .84);
    border-radius: 6px;
    z-index: 2;
}

.gp-img__actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.gp-img__actions .btn {
    flex: 1 1 0;
    font-size: .8rem;
    padding: 4px 2px;
    min-height: 46px;
}

/* 队列条 / 审核弹窗里的「同零件 N 个码共用」角标 */
.batch-qitem__group {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 1;
    padding: 0 5px;
    border-radius: 999px;
    background: #0dcaf0;
    color: #06384a;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
}

.batch-qitem {
    position: relative;
}

/* 底部「相关 OE 码」清单：EPC 里同一个零件在其它车系/世代的件号 */
.gp-related {
    margin-top: 14px;
    border-top: 1px dashed #dfe4ec;
    padding-top: 10px;
}

.gp-related__title {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.gp-related__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}

.gp-rel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fafbfc;
    font-size: .88rem;
}

.gp-rel code {
    min-width: 130px;
}

.gp-rel__car {
    color: #33415c;
    min-width: 240px;
}

.gp-rel__name {
    color: #6c757d;
    flex: 1 1 auto;
}

.gp-rel__meta {
    color: #99a1ad;
    white-space: nowrap;
}

.gp-rel.is-current {
    background: #eef4ff;
}

/* 能切换的（这个件号所在的零件位置也是任务码出现过的位置）用下划线提示可点 */
.gp-rel.is-clickable {
    cursor: pointer;
}

.gp-rel.is-clickable code {
    text-decoration: underline;
    text-decoration-style: dotted;
}

.gp-rel.is-clickable:hover {
    background: #e3edff;
}

/* 行头里的品牌·车系·世代 / 配件名 */
.gp-row__car {
    color: #33415c;
}

.gp-row__part {
    color: #6c757d;
}

/* 中间区顶部操作条（说明文字 + 全选/全不选）

   长图列表往下滚之后，还要翻回顶部才能勾选很烦，所以整条**吸顶**：
   页面顶栏（.app-header）是 sticky，这里使用 APEX VI 的工作台抬头高度。 */
.gp-bar {
    position: sticky;
    top: var(--apx-header-workspace, 72px);
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    /* 卡片内边距是 1rem：用负边距让操作条铺满卡片宽度，吸顶时不会露出底下的内容 */
    margin: -16px -16px 10px;
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid var(--car-border, #e5e8ee);
    border-radius: .375rem .375rem 0 0;
}

.gp-bar__text {
    flex: 1 1 auto;
    line-height: 1.55;
}

.gp-bar__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 2px;
}

.gp-bar__actions .btn {
    white-space: nowrap;
}

/* ---------------------------------------------------------------- 主图选择调试版：AI 选主图 */
.gp-single-ai {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 10px;
    background: var(--apx-forest-050, #effaf2);
    border: 1px solid var(--apx-forest-100, #ddf7e3);
    border-radius: 6px;
}

.manual-ai-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.manual-ai-item {
    display: grid;
    grid-template-columns: 64px minmax(180px, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 330px;
    max-width: 440px;
    padding: 8px;
    background: #fff;
    border: 1px solid #f0c8c8;
    border-radius: 8px;
    color: var(--apx-ink, #0b1c30);
    text-align: left;
}

.manual-ai-item:hover {
    border-color: var(--apx-error-fg, #b91c1c);
    background: #fffafa;
}

.manual-ai-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--apx-surface-sunken, #f1f5f9);
    border-radius: 6px;
}

.manual-ai-item__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.manual-ai-item__oe {
    font-family: var(--apx-font-mono, monospace);
    font-weight: 700;
}

.manual-ai-item__meta,
.manual-ai-item__reason {
    overflow: hidden;
    color: var(--apx-ink-muted, #565f69);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manual-ai-item__reason {
    color: var(--apx-error-fg, #b91c1c);
}

.manual-ai-item__score {
    color: var(--apx-error-fg, #b91c1c);
    font-family: var(--apx-font-mono, monospace);
    font-size: 18px;
    font-weight: 700;
}

.gp-ai-loading {
    padding: 22px 18px;
    background: var(--apx-surface-sunken, #f1f5f9);
    border: 1px solid var(--apx-line, #e2e8f0);
    border-radius: 8px;
}

.gp-ai-result {
    padding: 2px;
}

.gp-ai-preview-card {
    padding: 12px;
    background: var(--apx-surface-sunken, #f1f5f9);
    border: 1px solid var(--apx-line, #e2e8f0);
    border-radius: 8px;
}

.gp-ai-preview-card img {
    display: block;
    width: 100%;
    max-height: 430px;
    object-fit: contain;
    background: var(--apx-surface-raised, #fff);
    border: 1px solid var(--apx-line, #e2e8f0);
    border-radius: 6px;
}

.gp-ai-score {
    color: var(--apx-forest-700, #00612f);
    font-family: var(--apx-font-mono, monospace);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.gp-ai-reason {
    padding: 12px 14px;
    color: var(--apx-ink, #0b1c30);
    background: var(--apx-forest-050, #effaf2);
    border-left: 3px solid var(--apx-forest-600, #287a45);
    border-radius: 6px;
    line-height: 1.65;
}

.gp-ai-candidate {
    appearance: none;
    padding: 5px;
    background: var(--apx-surface-raised, #fff);
    border: 1px solid var(--apx-line, #e2e8f0);
    border-radius: 7px;
    color: var(--apx-ink, #0b1c30);
    text-align: left;
}

.gp-ai-candidate:hover,
.gp-ai-candidate.is-selected {
    border-color: var(--apx-forest-600, #287a45);
    box-shadow: 0 0 0 2px rgba(40, 122, 69, .14);
}

.gp-ai-candidate img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: var(--apx-surface-sunken, #f1f5f9);
    border-radius: 4px;
}

.gp-ai-candidate span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
}

.gp-ai-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.gp-ai-score-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--apx-surface-sunken, #f1f5f9);
    border-radius: 6px;
}

.gp-ai-score-grid span {
    color: var(--apx-ink-soft, #65707a);
    font-size: 11px;
}

.gp-ai-score-grid b {
    color: var(--apx-ink, #0b1c30);
    font-family: var(--apx-font-mono, monospace);
    font-size: 16px;
}

.gp-ai-steps {
    font-family: var(--apx-font-mono, monospace);
    letter-spacing: .02em;
}

@media (max-width: 767.98px) {
    .pick-wb {
        flex-direction: column;
    }

    .pick-wb__center {
        order: -1;
        width: 100%;
        flex: 1 0 auto;
    }

    .pick-wb__side,
    .pick-wb__side--left,
    .pick-wb__side--right {
        width: 100%;
        flex: 1 0 auto;
        max-height: 360px;
    }

    .gp-bar {
        position: static;
        flex-direction: column;
        margin: -16px -16px 10px;
    }

    .gp-bar__actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gp-bar__actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .gp-ai-score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------------------------------------------------------------- 主图复核（8 列 × 20 行） */
.image-review-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
}

.image-review-card {
    border: 2px solid var(--car-border, #e5e8ee);
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.image-review-card:hover {
    border-color: var(--car-primary, #1f6feb);
    box-shadow: 0 2px 12px rgba(31, 111, 235, .22);
}

.image-review-card.is-replaced {
    border-color: #198754;
    box-shadow: 0 0 0 2px rgba(25, 135, 84, .2);
}

.image-review-card__img {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: #fafbfc;
}

.image-review-card__img img,
.image-review-grid img.thumb-250 {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    border: 0;
    border-radius: 0;
    background: #fafbfc;
}

.image-review-card__body {
    padding: 5px 2px 1px;
    min-width: 0;
}

.image-review-card__oe {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-review-card__name {
    font-size: 11px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .image-review-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .image-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
    .image-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.image-review-card__count {
    margin-top: 2px;
    font-size: 11px;
}

/* --------------------------------------------------------------------------
 * 内部消息：顶栏未读铃铛（全后台共用）
 * 未读数由 assets/js/message-bell.js 异步拉取，红点仅在有未读时显示。
 * ----------------------------------------------------------------------- */
.apex-admin .msg-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border: 1px solid var(--apx-line);
    border-radius: 10px;
    background: var(--apx-surface-raised);
    color: var(--apx-ink-muted);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.apex-admin .msg-bell:hover {
    border-color: var(--apx-forest-300);
    background: var(--apx-forest-050);
    color: var(--apx-forest-800);
}

.msg-bell i {
    font-size: 17px;
}

.apex-admin .msg-bell.has-unread {
    border-color: var(--apx-error-line);
    background: var(--apx-error-bg);
    color: var(--apx-error-fg);
}

.msg-bell.has-unread i {
    animation: msgBellRing 2.4s ease-in-out infinite;
    transform-origin: 50% 12%;
}

.msg-bell__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--apx-error-fg);
    color: #fff;
    font-family: var(--apx-font-mono);
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--apx-white);
}

@keyframes msgBellRing {
    0%, 70%, 100% { transform: rotate(0deg); }
    75% { transform: rotate(12deg); }
    80% { transform: rotate(-10deg); }
    85% { transform: rotate(6deg); }
    90% { transform: rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .msg-bell.has-unread i { animation: none; }
}

@media (max-width: 767px) {
    .apex-admin .msg-bell {
        width: 40px;
        height: 40px;
        margin-right: 6px;
    }
}