/* B2B 公共头部样式 · v16 Apple 风格精修
 * 设计语言：毛玻璃吸顶 / 大圆角 / 多层柔和阴影 / 聚焦光晕 / 统一 8px 网格
 * 主题色保持原站红 #e2231a，渐变点缀
 */

:root {
    --b2b-accent: #e2231a;
    --b2b-accent-deep: #c2180f;
    --b2b-ink: #0f172a;
    --b2b-sub: #64748b;
    --b2b-line: rgba(15, 23, 42, .08);
    --b2b-radius: 12px;
    --b2b-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
    --b2b-shadow-md: 0 4px 16px -4px rgba(15, 23, 42, .10), 0 2px 6px -2px rgba(15, 23, 42, .06);
    --b2b-shadow-pop: 0 24px 48px -12px rgba(15, 23, 42, .18), 0 8px 20px -8px rgba(15, 23, 42, .08);
}

/* ===== 吸顶毛玻璃 ===== */
.b2b-header {
    position: sticky;
    top: 0;
    z-index: 900;
}
.b2b-header .b2b-mainbar {
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(1.8) blur(20px);
    backdrop-filter: saturate(1.8) blur(20px);
}
.b2b-header .b2b-nav-row {
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(1.8) blur(20px);
    backdrop-filter: saturate(1.8) blur(20px);
    border-bottom: 1px solid var(--b2b-line);
}

/* ===== 顶部细工具条 ===== */
.b2b-topbar {
    background: #fafbfc;
    border-bottom: 1px solid var(--b2b-line);
    font-size: 12px;
}
.b2b-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.b2b-topbar-right {
    display: flex;
    gap: 4px;
    align-items: center;
}
.b2b-topbar-right a {
    color: var(--b2b-sub);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: .1px;
    transition: color .18s, background .18s;
}
.b2b-topbar-right a:hover {
    color: var(--b2b-accent);
    background: rgba(226, 35, 26, .06);
}
.b2b-topbar-right span {
    color: #e2e8f0;
    font-size: 11px;
    user-select: none;
}

/* ===== 主搜索条 ===== */
.b2b-mainbar {
    background: #fff;
    border-bottom: 1px solid var(--b2b-line);
}
.b2b-mainbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

/* logo */
.b2b-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    justify-self: start;
}
.b2b-logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent) 55%, #b91c0c);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px -2px rgba(226, 35, 26, .35);
}
.b2b-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
}
.b2b-logo-text {
    font-size: 19px;
    font-weight: 800;
    color: var(--b2b-ink);
    letter-spacing: .2px;
    white-space: nowrap;
}

/* 搜索框 · 胶囊化 */
.b2b-searchbox {
    width: 760px;
    max-width: 100%;
    justify-self: center;
    margin-left: 24px;
    display: flex;
    align-items: center;
    height: 50px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    position: relative;
    background: #fff;
    box-shadow: var(--b2b-shadow-sm);
    transition: border-color .2s, box-shadow .2s;
}
.b2b-searchbox:focus-within {
    border-color: rgba(226, 35, 26, .55);
    box-shadow: 0 0 0 4px rgba(226, 35, 26, .10), var(--b2b-shadow-sm);
}
.b2b-cat-wrap { position: relative; flex-shrink: 0; }
.b2b-cat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 18px;
    background: transparent;
    border: none;
    border-right: 1px solid #eef2f6;
    border-radius: 14px 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    transition: color .18s, background .18s;
    white-space: nowrap;
}
.b2b-cat-btn:hover,
.b2b-cat-wrap.open .b2b-cat-btn {
    background: rgba(226, 35, 26, .05);
    color: var(--b2b-accent);
}
.b2b-cat-wrap.open .b2b-cat-btn svg { transform: rotate(180deg); }
.b2b-cat-btn svg { transition: transform .22s cubic-bezier(.4, 0, .2, 1); }

.b2b-search-form {
    flex: 1;
    display: flex;
    height: 46px;
    min-width: 0;
}
.b2b-search-form input {
    flex: 1;
    min-width: 0;
    padding: 0 100px 0 14px;
    border: none;
    outline: none;
    font-size: 14.5px;
    color: var(--b2b-ink);
    background: transparent;
}
.b2b-search-form input::placeholder { color: #a3aec0; }

.b2b-search-btn {
    width: 66px;
    margin: 3px;
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent));
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px -2px rgba(226, 35, 26, .40);
    transition: filter .18s, transform .12s, box-shadow .18s;
}
.b2b-search-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 5px 14px -2px rgba(226, 35, 26, .48);
}
.b2b-search-btn:active { transform: scale(.96); }

/* 类目面板 */
.b2b-cat-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: -2px;
    width: 720px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
    border: 1px solid var(--b2b-line);
    border-radius: 0 0 16px 16px;
    box-shadow: var(--b2b-shadow-pop);
    display: none;
    z-index: 9999;
    overflow: hidden;
}
.b2b-cat-wrap.open .b2b-cat-panel {
    display: grid;
    grid-template-columns: 220px 1fr;
}
.b2b-cat-left {
    background: #f8fafc;
    padding: 10px 8px;
    max-height: 460px;
    overflow-y: auto;
    border-right: 1px solid #eef2f6;
}
.b2b-cat-l1 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: background .16s, color .16s;
    margin-bottom: 2px;
}
.b2b-cat-l1:hover { background: #fff; color: var(--b2b-accent); }
.b2b-cat-l1.on {
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent));
    color: #fff;
    box-shadow: 0 3px 8px -2px rgba(226, 35, 26, .35);
}
.b2b-cat-right {
    padding: 20px 24px;
    max-height: 460px;
    overflow-y: auto;
}
.b2b-cat-group { display: none; }
.b2b-cat-group.on { display: block; }
.b2b-cat-gt {
    font-size: 14px;
    font-weight: 700;
    color: var(--b2b-ink);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f6;
}
.b2b-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.b2b-cat-l2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .16s, transform .16s;
}
.b2b-cat-l2:hover { background: #f8fafc; transform: translateY(-1px); }
.b2b-cat-l2-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef2f1, #fdeaea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--b2b-accent);
}
.b2b-cat-l2-name {
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    text-align: center;
    line-height: 1.3;
}
.b2b-cat-empty {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* ===== 右侧动作区 ===== */
.b2b-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}
.b2b-action-link {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    padding: 9px 6px;
    border-radius: 8px;
    transition: color .18s;
}
.b2b-action-link:hover { color: var(--b2b-accent); }
.b2b-action-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent));
    color: #fff;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;
    text-decoration: none;
    box-shadow: 0 4px 12px -3px rgba(226, 35, 26, .42);
    transition: filter .18s, transform .12s, box-shadow .18s;
}
.b2b-action-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 16px -3px rgba(226, 35, 26, .5);
}
.b2b-action-btn:active { transform: scale(.97); }

/* 语言切换适配 */
.b2b-lang-wrap .lang-menu { position: relative; }
.b2b-lang-wrap .lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f4f6f9;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s, color .18s, border-color .18s;
}
.b2b-lang-wrap .lang-trigger:hover {
    background: rgba(226, 35, 26, .06);
    color: var(--b2b-accent);
}
.b2b-lang-wrap .lang-trigger svg { transition: transform .2s; }
.b2b-lang-wrap .lang-menu.open .lang-trigger svg,
.b2b-lang-wrap .lang-menu:hover .lang-trigger svg { transform: rotate(180deg); }
.b2b-lang-wrap .lang-label { display: none; }
.b2b-lang-wrap .lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 14px;
    box-shadow: var(--b2b-shadow-pop);
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 10000;
    border: 1px solid #f1f5f9;
    padding: 6px;
}
.b2b-lang-wrap .lang-menu:hover .lang-dropdown,
.b2b-lang-wrap .lang-menu.open .lang-dropdown { display: block; }
.b2b-lang-wrap .lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    transition: background .16s;
}
.b2b-lang-wrap .lang-item:hover { background: #f4f6f9; color: var(--b2b-accent); }
.b2b-lang-wrap .lang-item.active {
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent));
    color: #fff;
}
.b2b-lang-wrap .lang-item.active .lang-name { color: rgba(255, 255, 255, .8); }
.b2b-lang-wrap .lang-native { flex: 1; font-weight: 600; }
.b2b-lang-wrap .lang-name { color: #94a3b8; font-size: 11.5px; }

/* 购物车 */
.b2b-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #334155;
    text-decoration: none;
    transition: background .18s, color .18s;
}
.b2b-cart:hover {
    background: rgba(226, 35, 26, .07);
    color: var(--b2b-accent);
}
.b2b-cart-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #f4574d, var(--b2b-accent));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(226, 35, 26, .4);
}

/* ===== 导航行 ===== */
.b2b-nav-row {
    background: #fff;
    border-bottom: 1px solid var(--b2b-line);
}
.b2b-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    height: 40px;
    overflow-x: auto;
    scrollbar-width: none;
}
.b2b-nav-inner::-webkit-scrollbar { display: none; }
.b2b-nav-link {
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: var(--b2b-sub);
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s;
    padding: 0 16px;
    display: flex;
    align-items: center;
}
.b2b-nav-link::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2.5px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(90deg, #f4574d, var(--b2b-accent));
    transform: scaleX(0);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
.b2b-nav-link:hover { color: var(--b2b-accent); }
.b2b-nav-link:hover::after { transform: scaleX(.6); }
.b2b-nav-link.on { color: var(--b2b-ink); font-weight: 700; }
.b2b-nav-link.on::after { transform: scaleX(1); }
.b2b-nav-inner > .b2b-nav-link + .b2b-nav-link::before { content: none; }

/* ===== APP 按钮 + 二维码下拉 ===== */
.b2b-app-wrap { position: relative; display: inline-flex; align-items: center; }
.b2b-app-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--b2b-sub);
    text-decoration: none;
    transition: color .18s;
    cursor: pointer;
    font-weight: 500;
}
.b2b-app-trigger:hover { color: var(--b2b-accent); }
.b2b-app-trigger svg { flex-shrink: 0; }
.b2b-app-pop {
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    box-shadow: var(--b2b-shadow-pop);
    padding: 14px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    z-index: 9999;
    border: 1px solid #f1f5f9;
    text-align: center;
}
.b2b-app-wrap:hover .b2b-app-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.b2b-app-pop::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-left: 1px solid #f1f5f9;
    border-top: 1px solid #f1f5f9;
}
.b2b-app-pop img {
    display: block;
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
}
.b2b-app-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--b2b-sub);
    font-weight: 600;
    letter-spacing: .2px;
}

/* ===== 拍照搜同款 ===== */
.b2b-search-form { position: relative; }
.b2b-img-search-trigger {
    position: absolute;
    right: 86px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: color .18s, background .18s;
    z-index: 10;
}
.b2b-img-search-trigger svg { width: 20px; height: 20px; }
.b2b-img-search-trigger:hover {
    color: var(--b2b-accent);
    background: rgba(226, 35, 26, .07);
}

/* ===== 响应式 ===== */
@media(max-width:900px) {
    .b2b-mainbar-inner { grid-template-columns: 1fr; height: auto; padding: 12px 16px; gap: 12px; }
    .b2b-searchbox { width: 100%; margin-left: 0; }
    .b2b-actions { justify-self: stretch; justify-content: flex-end; }
}
@media(max-width:768px) {
    .b2b-nav-inner { padding: 0 16px; height: 36px; }
    .b2b-nav-link { font-size: 12.5px; padding: 0 12px; }
    .b2b-nav-link::after { left: 12px; right: 12px; }
    .b2b-topbar-right a { padding: 3px 5px; }
}
