:root {
    --bm-primary: #2180cd;
    --bm-primary-dark: #196dac;
    --bm-danger: #f24b50;
    --bm-ink: rgba(0, 0, 0, .85);
    --bm-text: #666;
    --bm-muted: #8b95a1;
    --bm-border: #e8e8e8;
    --bm-soft: #f7f8fa;
    --bm-surface: #fff;
    --bm-focus: rgba(33, 128, 205, .14);
}

* { box-sizing: border-box; }

body.blue-mall-theme {
    min-height: 100vh;
    margin: 0;
    color: var(--bm-ink);
    background: #f5f6f8;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", Tahoma, Arial, sans-serif;
    font-size: 14px;
}

.blue-mall-theme a { text-decoration: none; }
.blue-mall-theme .container { max-width: 1200px; }

/* 顶部导航 */
.bm-header {
    position: relative;
    z-index: 50;
    color: #fff;
    background: var(--bm-primary);
    box-shadow: 0 2px 8px rgba(22, 82, 130, .18);
}

.bm-header .navbar,
.bm-nav-wrap { min-height: 64px; }
.bm-header .navbar { padding: 0; }

.bm-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 260px;
    margin-right: 18px;
    padding: 7px 0;
    color: #fff !important;
}

.bm-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    overflow: hidden;
    border-radius: 5px;
    background: #fff;
}

.bm-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.bm-brand-name { overflow: hidden; font-size: 18px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bm-nav-list { align-items: stretch; gap: 0; }
.bm-nav-list .nav-item { display: flex; }

.bm-nav-list .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 64px;
    padding: 0 16px;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, .92);
    font-size: 14px;
    font-weight: 400;
    transition: background-color .18s ease, border-color .18s ease;
}

.bm-nav-list .nav-link:hover,
.bm-nav-list .nav-link.active {
    border-bottom-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.bm-nav-icon { width: 1em; }
.bm-nav-actions { display: flex; align-items: center; gap: 12px; }

.bm-search,
.bm-mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 4px;
    color: rgba(255, 255, 255, .94);
    background: rgba(255, 255, 255, .1);
}

.bm-search input,
.bm-mobile-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: inherit;
    background: transparent;
}

.bm-search input::placeholder { color: rgba(255, 255, 255, .74); }
.bm-icon-link,
.bm-account-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 4px;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 14px;
}

.bm-icon-link::after { display: none; }
.bm-account-link:hover,
.bm-icon-link:hover { color: #fff; opacity: .84; }
.bm-avatar { width: 28px; height: 28px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 50%; object-fit: cover; }
.bm-toggler { border-color: rgba(255, 255, 255, .55); color: #fff; }
.bm-toggler:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .2); }

/* 首页 */
.bm-main { padding-top: 20px; padding-bottom: 34px; }

.bm-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid #f0d6d6;
    border-left: 3px solid var(--bm-danger);
    color: #bd3f43;
    background: #fff;
    line-height: 1.7;
}

.bm-notice-icon { flex: 0 0 auto; padding-top: 1px; }
.bm-notice-content { min-width: 0; overflow-wrap: anywhere; }
.bm-notice-content p:last-child { margin-bottom: 0; }

.bm-store-panel {
    overflow: hidden;
    border: 1px solid var(--bm-border);
    background: var(--bm-surface);
}

.bm-mobile-tools { padding: 12px; border-bottom: 1px solid var(--bm-border); }
.bm-mobile-search { width: 100%; color: #596673; border-color: #dce2e8; background: #f7f8fa; }
.bm-mobile-search input::placeholder { color: #9aa2aa; }

.bm-table-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 140px 118px;
    align-items: center;
    min-height: 46px;
    padding-left: 78px;
    color: #fff;
    background: var(--bm-primary);
    text-align: center;
    font-size: 17px;
    font-weight: 400;
}

.bm-table-head span:first-child { text-align: left; }

.bm-catalog-row {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--bm-border);
    background: #fafafa;
}

.bm-catalog-label {
    flex: 0 0 auto;
    margin-right: 22px;
    color: #999;
    font-size: 13px;
}

.bm-category-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; }
.bm-category {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 2px;
    color: var(--bm-text);
    background: transparent;
    font-size: 15px;
    transition: color .18s ease;
}

.bm-category::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: transparent;
    content: "";
}

.bm-category:hover,
.bm-category.is-primary { color: var(--bm-primary); }
.bm-category.is-primary { font-weight: 500; }
.bm-category.is-primary::after { background: var(--bm-primary); }
.bm-category-icon { width: 19px; height: 19px; border-radius: 3px; background-position: center; background-size: cover; }

.bm-product-list { display: block; margin: 0; }
.bm-product-list > a {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0;
    border-bottom: 1px solid var(--bm-border);
    color: inherit;
}

.bm-product-list > a:last-child { border-bottom: 0; }
.bm-product-list > a:hover { color: inherit; background: #fbfdff; }
.bm-product-list .acg-card {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 118px;
    align-items: center;
    min-height: 82px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none !important;
}

.bm-product-list .acg-thumb {
    width: 46px;
    height: 46px;
    margin-left: 16px;
    border: 1px solid #ededed;
    border-radius: 3px;
}

.bm-product-list .p-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px 140px;
    align-items: center;
    min-width: 0;
    height: 100%;
    padding: 10px 0 10px 14px !important;
}

.bm-product-list .goods-title {
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
    margin: 0;
    padding-right: 18px;
    color: var(--bm-text);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-product-list .tags { grid-column: 1; grid-row: 2; min-height: 0; margin-top: 4px; }
.bm-product-list .tags:empty { display: none; }
.bm-product-list .badge-soft { padding: 2px 6px; border-radius: 2px; font-size: 11px; font-weight: 400; }
.bm-product-list .stat-row { grid-column: 2; grid-row: 1 / span 2; justify-content: center; margin: 0 !important; text-align: center; }
.bm-product-list .price { color: var(--bm-danger); font-size: 18px; font-weight: 500; }
.bm-product-list .price .unit { margin-right: 2px; font-size: 14px; }
.bm-product-list .stat-bottom { grid-column: 3; grid-row: 1 / span 2; justify-content: center; gap: 7px; color: #88919a; font-size: 12px; }
.bm-product-list .stat-bottom span { display: inline-block; }
.bm-product-list .stat-bottom span:first-child { padding: 3px 7px; border-radius: 3px; color: #fff; background: #34495e; }

.bm-product-list .acg-card::after {
    display: grid;
    place-items: center;
    justify-self: center;
    width: 84px;
    height: 34px;
    border-radius: 2px;
    color: #fff;
    background: var(--bm-primary);
    content: "购买";
    font-size: 14px;
}

.bm-product-list > a:hover .acg-card::after { background: var(--bm-primary-dark); }
.bm-product-list .acg-card.soldout::after { content: "已售罄"; background: #a7afb7; }
.bm-product-list .soldout-ribbon { right: auto; left: 0; transform: none; }
.bm-loading { padding: 30px 20px; color: var(--bm-muted); text-align: center; }

/* 商品详情 */
.bm-detail-page { padding-top: 18px; padding-bottom: 36px; }
.bm-breadcrumb { display: flex; align-items: center; gap: 9px; min-height: 34px; margin-bottom: 10px; color: #999; font-size: 13px; }
.bm-breadcrumb a { color: #666; }
.bm-breadcrumb a:hover { color: var(--bm-primary); }
.bm-breadcrumb i { font-size: 11px; }

.bm-detail-card { border: 1px solid var(--bm-border); background: #fff; }
.bm-detail-grid { display: grid; grid-template-columns: minmax(320px, 42%) minmax(0, 58%); }
.bm-detail-media { display: flex; align-items: flex-start; justify-content: center; padding: 30px; border-right: 1px solid var(--bm-border); }
.bm-cover-frame { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 390px; overflow: hidden; background: #fafafa; }
.bm-cover-frame .item-cover { display: block; max-width: 100%; max-height: 470px; object-fit: contain; }
.bm-detail-purchase { min-width: 0; padding: 28px 30px 30px; }
.bm-item-title { margin: 0 0 12px; color: var(--bm-ink); font-size: 21px; font-weight: 500; line-height: 1.45; }
.bm-item-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 17px; }
.bm-item-badges .badge-soft { font-weight: 400; }
.bm-share { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; color: #8b95a1; background: transparent; }
.bm-share:hover { color: var(--bm-primary); }

.bm-price-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    margin-bottom: 22px;
    padding: 12px 18px;
    background: #f6f6f6;
}

.bm-price-main { display: flex; align-items: baseline; gap: 14px; }
.bm-price-label { color: #999; }
.bm-price-band .abacus { margin: 0; }
.bm-price-band .price { color: var(--bm-danger); font-size: 28px; font-weight: 500; line-height: 1; }
.bm-price-meta { display: flex; flex-direction: column; gap: 5px; color: #9a9a9a; font-size: 12px; }
.bm-price-meta i { width: 16px; color: #7d8791; }

.bm-order-form { gap: 0 !important; }
.bm-form-row {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
    min-height: 52px;
    padding: 8px 0;
}

.bm-form-row > .form-label { margin: 0; padding-right: 15px; color: #777; font-weight: 400; }
.bm-control-area { min-width: 0; }
.bm-control-area > .form-control { width: min(100%, 440px); }
.bm-widget-area:empty { display: none; }
.bm-widget-area > div { margin-bottom: 10px; }
.blue-mall-theme .form-control { min-height: 38px; border-color: #ddd; border-radius: 2px; color: #555; font-size: 14px; }
.blue-mall-theme .form-control::placeholder { color: #b2b2b2; }
.blue-mall-theme .form-control:focus { border-color: var(--bm-primary); box-shadow: 0 0 0 3px var(--bm-focus); }
.blue-mall-theme .sku-list { display: flex; flex-wrap: wrap; gap: 8px; }
.blue-mall-theme .sku { border-color: #ddd; border-radius: 2px; color: #666; background: #fff; }
.blue-mall-theme .sku:hover,
.blue-mall-theme .sku.is-primary { border-color: var(--bm-primary); color: var(--bm-primary); background: #f4faff; }
.blue-mall-theme .optional-card { border-color: #ddd; border-radius: 2px; color: #666; background: #fff; }
.blue-mall-theme .qty-group { width: 144px; }
.blue-mall-theme .qty-group button { width: 38px; border-color: #ddd; color: #666; background: #fafafa; }
.blue-mall-theme .qty-group input { min-width: 52px; padding-right: 4px; padding-left: 4px; }
.bm-captcha { width: 240px; }
.bm-captcha .captcha-img { height: 38px; border-color: #ddd; }

.bm-buy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 14px;
    padding: 18px 0 0 94px;
    border-top: 1px dashed #e5e5e5;
}

.bm-order-total { display: flex; align-items: baseline; gap: 9px; color: #888; }
.bm-order-total strong { color: var(--bm-danger); font-size: 24px; font-weight: 500; }
.bm-buy-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    height: 42px;
    padding: 0 24px;
    border: 1px solid var(--bm-primary);
    border-radius: 2px;
    color: #fff;
    background: var(--bm-primary);
    font-size: 15px;
    transition: background-color .18s ease, border-color .18s ease;
}

.bm-buy-now:hover { border-color: var(--bm-primary-dark); background: var(--bm-primary-dark); }
.bm-buy-now:disabled { cursor: wait; opacity: .7; }

.bm-pay-stage:not(.is-open) { display: none !important; }
.bm-pay-stage.is-open {
    display: block !important;
    margin-top: 18px;
    padding: 18px !important;
    border: 1px solid #dbeaf6;
    background: #f8fbfe;
}

.bm-pay-stage-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.bm-pay-stage-head strong { color: #444; font-size: 15px; font-weight: 500; }
.bm-pay-stage-head span { color: #999; font-size: 12px; }
.bm-pay-stage .pay-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bm-pay-stage .pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #555;
    background: #fff;
    font-size: 15px;
    transition: border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.bm-pay-stage .pay:hover { border-color: var(--bm-primary); color: var(--bm-primary); box-shadow: 0 0 0 2px var(--bm-focus); }
.bm-pay-stage .pay img { width: 30px; height: 30px; object-fit: contain; }
.bm-pay-note { margin: 12px 0 0; color: #9aa2aa; font-size: 12px; }
.bm-pay-note i { margin-right: 4px; }

.blue-mall-theme .panel {
    overflow: hidden;
    border: 1px solid var(--bm-border);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.bm-description-panel { margin-top: 16px; }
.blue-mall-theme .panel-header { min-height: 46px; border-bottom: 1px solid var(--bm-border); color: #555; background: #fafafa; }
.blue-mall-theme .panel-header .panel-title { color: #555; font-weight: 500; }
.blue-mall-theme .panel-header .icon { color: var(--bm-primary); background: transparent; }
.blue-mall-theme .panel-body { padding: 20px; color: var(--bm-text); line-height: 1.75; }
.blue-mall-theme .item-detail img { max-width: 100%; height: auto; }
.blue-mall-theme .btn-primary { border-color: var(--bm-primary); background: var(--bm-primary); }
.blue-mall-theme .btn-primary:hover { border-color: var(--bm-primary-dark); background: var(--bm-primary-dark); }

.bm-footer { padding: 28px 15px; border-top: 1px solid var(--bm-border); color: #89939d; background: #fff; text-align: center; font-size: 13px; }

@media (max-width: 991.98px) {
    .bm-header .navbar,
    .bm-nav-wrap { min-height: 58px; }
    .bm-brand-mark { flex-basis: 40px; width: 40px; height: 40px; }
    .bm-brand-name { font-size: 16px; }
    .bm-header .navbar-collapse { padding: 8px 0 14px; border-top: 1px solid rgba(255, 255, 255, .2); }
    .bm-nav-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
    .bm-nav-list .nav-item { display: block; }
    .bm-nav-list .nav-link { min-height: 42px; padding: 0 12px; border: 0; border-radius: 3px; }
    .bm-nav-list .nav-link.active { background: rgba(255, 255, 255, .14); }
    .bm-nav-actions { justify-content: flex-end; padding: 10px 4px 0; }
    .bm-main { padding-top: 12px; }
    .bm-detail-grid { grid-template-columns: 38% minmax(0, 62%); }
    .bm-detail-media { padding: 20px; }
    .bm-cover-frame { min-height: 320px; }
    .bm-detail-purchase { padding: 22px; }
    .bm-price-band { align-items: flex-start; flex-direction: column; gap: 8px; }
    .bm-price-meta { flex-direction: row; gap: 14px; }
}

@media (max-width: 767.98px) {
    .blue-mall-theme .container { max-width: 100%; padding-right: 10px; padding-left: 10px; }
    .bm-main { padding-bottom: 22px; }
    .bm-notice { padding: 11px 12px; }
    .bm-table-head { display: none; }
    .bm-catalog-row { align-items: flex-start; flex-direction: column; gap: 4px; padding: 10px 12px 8px; }
    .bm-catalog-label { margin: 0; font-size: 12px; }
    .bm-category-list { flex-wrap: nowrap; width: 100%; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
    .bm-category-list::-webkit-scrollbar { display: none; }
    .bm-category { flex: 0 0 auto; }
    .bm-product-list > a { padding: 9px 10px; }
    .bm-product-list .acg-card { grid-template-columns: 68px minmax(0, 1fr); min-height: 86px; }
    .bm-product-list .acg-thumb { width: 56px; height: 56px; margin-left: 0; }
    .bm-product-list .p-3 { display: block; padding: 2px 0 2px 8px !important; }
    .bm-product-list .goods-title { display: -webkit-box; margin-bottom: 6px; padding: 0; overflow: hidden; font-size: 15px; line-height: 1.45; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .bm-product-list .tags { margin-bottom: 6px; }
    .bm-product-list .stat-row { display: inline-flex; margin-right: 9px !important; }
    .bm-product-list .stat-bottom { display: inline-flex; }
    .bm-product-list .stat-bottom span:last-child { display: none; }
    .bm-product-list .acg-card::after { display: none; }
    .bm-detail-page { padding-top: 10px; }
    .bm-breadcrumb { margin-bottom: 6px; }
    .bm-detail-grid { display: block; }
    .bm-detail-media { padding: 16px; border-right: 0; border-bottom: 1px solid var(--bm-border); }
    .bm-cover-frame { min-height: 230px; }
    .bm-cover-frame .item-cover { max-height: 320px; }
    .bm-detail-purchase { padding: 18px 15px 20px; }
    .bm-item-title { font-size: 19px; }
    .bm-price-band { margin-bottom: 12px; padding: 12px 14px; }
    .bm-price-band .price { font-size: 25px; }
    .bm-form-row { grid-template-columns: 82px minmax(0, 1fr); min-height: 48px; }
    .bm-buy-bar { padding-left: 0; }
    .bm-buy-now { min-width: 132px; padding: 0 18px; }
    .bm-pay-stage .pay-list { grid-template-columns: 1fr; }
    .blue-mall-theme .panel-body { padding: 15px; }
}

@media (max-width: 420px) {
    .bm-brand { max-width: 220px; }
    .bm-brand-name { max-width: 145px; }
    .bm-notice-icon { display: none; }
    .bm-form-row { display: block; padding: 7px 0; }
    .bm-form-row > .form-label { display: block; margin-bottom: 6px; }
    .bm-buy-bar { align-items: stretch; flex-direction: column; }
    .bm-buy-now { width: 100%; }
    .bm-pay-stage-head { align-items: flex-start; flex-direction: column; gap: 3px; }
}
