/* jike-header.css — 购物车主题专用：官网 jk-header 导航条样式
   从 themes/web/jike/static/css/jike.css 抽取导航/巨型下拉相关规则（避免整包全局样式影响购物车页面） */

:root {
    --jk-main: #0056ff;
    --jk-darker1: #0040cc;
    --jk-darker2: #003399;
    --jk-lighter1: #3d81ff;
    --jk-lighter2: #7aa8ff;
    --jk-radius: 12px;
    --jk-text: #1b2231;
    --jk-muted: #6b7688;
    --jk-line: #e8ecf3;
    --jk-soft: #f5f8fd;
    --jk-max: 1440px;          /* 与速科云 .comp_container 一致：max-width:1440px + 左右 64px 内边距 */
    --jk-gutter: 64px;         /* 栅格左右留白（速科云为 64px；平板 32px；手机 16px） */
}

.jk-header { position: sticky; top: 0; z-index: 90; background: #fff; border-bottom: 1px solid var(--jk-line); }
.jk-header-inner { display: flex; align-items: center; height: 66px; padding-left: 40px; }
.jk-logo { flex: 0 0 auto; display: flex; align-items: center; }
.jk-logo img { height: 33px; width: auto; }

.jk-nav { display: flex; align-items: center; flex: 1; min-width: 0; margin-left: 30px; }
.jk-nav-item { position: relative; }
.jk-nav-item > a {
    position: relative; display: block; padding: 0 12px; line-height: 66px;
    font-size: 15px; font-weight: 700; color: #181818; white-space: nowrap; transition: color .18s;
}
.jk-nav-item > a::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 18px; height: 2px;
    background: var(--jk-main); border-radius: 2px; transform: scaleX(0); transition: transform .25s;
}
.jk-nav-item > a:hover, .jk-nav-item.active > a { color: var(--jk-main); }
.jk-nav-item > a:hover::after, .jk-nav-item.active > a::after { transform: scaleX(1); }
.jk-nav-item > a i { font-size: 10px; opacity: .55; margin-left: 4px; }
.jk-nav-item.has-child:hover .jk-drop { visibility: visible; opacity: 1; transform: translateY(0); }

.jk-nav-tag {
    position: absolute; top: 16px; right: 0; padding: 0 4px; line-height: 15px;
    font-size: 10px; font-weight: 700; font-style: normal; color: #fff;
    border-radius: 4px 4px 4px 0; background: #ff2626;
}

.jk-drop {
    position: absolute; left: 0; top: 100%; min-width: 168px; z-index: 80;
    background: #fff; border: 1px solid var(--jk-line); border-radius: var(--jk-radius);
    box-shadow: 0 14px 34px rgba(20, 35, 70, .12);
    padding: 8px; visibility: hidden; opacity: 0; transform: translateY(6px); transition: .18s;
}
.jk-drop a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--jk-text); white-space: nowrap; }
.jk-drop a:hover { background: var(--jk-soft); color: var(--jk-main); }

/* 头部右侧：搜索 + 文档中心/控制台/登录 + 免费注册 */
.jk-header-right { flex: 0 0 auto; display: flex; align-items: center; height: 66px; }
.jk-header-extra { display: inline-flex; align-items: center; }
.jk-search {
    display: flex; align-items: center; height: 34px; margin-right: 6px; padding: 0 12px;
    background: #f7f8fa; border-radius: 2px; transition: background .18s;
}
.jk-search:focus-within { background: #eef2fa; }
.jk-search input { width: 116px; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--jk-text); }
.jk-search button { border: 0; background: none; padding: 0 0 0 8px; cursor: pointer; color: #9aa3b2; font-size: 14px; }
.jk-search button:hover { color: var(--jk-main); }
.jk-navsep { width: 1px; height: 14px; background: #ccc; margin: 0 12px; flex: 0 0 auto; }
.jk-header-link { font-size: 15px; font-weight: 700; color: #181818; white-space: nowrap; }
.jk-header-link:hover { color: var(--jk-main); }
.jk-register {
    display: inline-flex; align-items: center; justify-content: center;
    height: 40px; margin-left: 20px; margin-right: 40px; padding: 0 24px;
    font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--jk-lighter1) 0%, var(--jk-main) 64%, var(--jk-darker1) 100%);
}
.jk-register:hover { filter: brightness(1.08); }
.jk-menu-toggle { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--jk-text); }
.jk-header-user { display: none; }

/* ---------------- 导航右侧登录用户盒（小狸同款） ---------------- */
.jk-userbox { position: relative; display: inline-flex; align-items: center; margin-left: 20px; margin-right: 40px; flex: 0 0 auto; }
.jk-userchip {
    display: inline-flex; align-items: center; gap: 8px;
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: 15px; font-weight: 700; color: var(--jk-text);
}
.jk-userchip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jk-userchip-caret { font-size: 12px; color: #666; transition: transform .2s; }
.jk-userbox.open .jk-userchip-caret { transform: rotate(180deg); }
.jk-userchip-avatar {
    width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--jk-main); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--jk-main);
}
.jk-userchip-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jk-usermenu {
    display: none; position: absolute; top: calc(100% + 14px); right: 0;
    width: 176px; padding: 8px 6px; background: #fff;
    border-radius: 10px; box-shadow: 0 12px 40px rgba(31, 50, 88, .16), 0 0 0 1px rgba(31, 50, 88, .05);
    z-index: 1200;
}
.jk-userbox.open .jk-usermenu { display: block; }
.jk-usermenu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 14px; color: var(--jk-text); text-decoration: none; white-space: nowrap;
}
.jk-usermenu-item i { font-size: 15px; color: var(--jk-main); width: 18px; text-align: center; flex: none; }
.jk-usermenu-item:hover { background: #f2f6ff; color: var(--jk-main); }
.jk-usermenu-item em { font-style: normal; margin-left: auto; color: #666; font-size: 13px; }
.jk-usermenu-item.jk-usermenu-static { cursor: default; }
.jk-usermenu-item.jk-usermenu-static:hover { background: none; color: var(--jk-text); }
.jk-usermenu-tag {
    margin-left: auto; padding: 1px 6px; font-size: 11px; font-style: normal;
    color: #ff6b00; background: #fff3e8; border-radius: 4px;
}
.jk-usermenu-logout { border-top: 1px solid #f0f1f5; border-radius: 0 0 8px 8px; margin-top: 4px; }
.jk-usermenu-logout i, .jk-usermenu-logout span { color: #e31519; }
.jk-usermenu-logout:hover { background: #fdf1f1; }

/* ---------------- 导航巨型下拉（照抄速科云：左标题列表 + 中搜索/推荐 + 右卡片） ---------------- */

/* ---------------- 导航巨型下拉（照抄速科云：左标题列表 + 中搜索/推荐 + 右卡片） ---------------- */
.jk-nav-item.has-mega { position: static; }
.jk-nav-item.has-mega:hover .jk-mega { visibility: visible; opacity: 1; transform: translateY(0); }

.jk-mega {
    position: absolute; left: 0; top: 100%; width: 100%; z-index: 80;
    background: #fff; border-top: 1px solid var(--jk-line);
    box-shadow: 0 20px 40px rgba(16, 32, 68, .12);
    visibility: hidden; opacity: 0; transform: translateY(6px); transition: .22s;
}
.jk-mega-inner { display: flex; align-items: stretch; max-width: 1400px; margin: 0 auto; }

.jk-mega-left {
    flex: 0 0 288px; max-width: 288px; display: flex; flex-direction: column;
    background: #f7f9fd; padding: 26px 28px 22px 40px;
}
.jk-mega-title { font-size: 24px; font-weight: 700; color: #181818; line-height: 1.3; }
.jk-mega-list { list-style: none; margin: 18px 0 0; padding: 0; }
.jk-mega-tab { display: flex; align-items: center; line-height: 42px; cursor: pointer; }
.jk-mega-tab a { position: relative; display: block; font-size: 14px; color: #181818; transition: color .2s; }
.jk-mega-tab a::after {
    content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
    background: var(--jk-main); transition: width .45s ease-out;
}
.jk-mega-tab:hover a, .jk-mega-tab.active a { color: var(--jk-main); font-weight: 500; }
.jk-mega-tab.active a::after { width: 100%; }
.jk-mega-desc { font-size: 13px; line-height: 1.8; color: #6e6e6e; margin: 20px 0 12px; }
.jk-mega-hot {
    margin-left: 4px; padding: 0 4px; line-height: 16px; font-size: 10px; font-style: normal;
    color: #fff; border-radius: 2px;
    background: linear-gradient(180deg, var(--jk-lighter1), var(--jk-main));
}
.jk-mega-more { margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--jk-main); }
.jk-mega-more:hover { text-decoration: underline; }

.jk-mega-main { flex: 1; min-width: 0; padding: 20px 32px 26px; }

.jk-mega-searchbar { display: flex; align-items: center; padding-bottom: 18px; }
.jk-mega-searchbox { flex: 1; display: flex; align-items: center; padding: 0 10px; background: #f4f6fb; }
.jk-mega-searchbox i { margin-right: 6px; font-size: 15px; color: var(--jk-main); }
.jk-mega-searchbox input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font-size: 12px; line-height: 34px; color: var(--jk-text);
}
.jk-mega-tags { display: flex; list-style: none; margin: 0 0 0 20px; padding: 0; }
.jk-mega-tags li {
    margin-left: 10px; padding: 0 17px; line-height: 34px; font-size: 12px;
    background: #f1f2f5; border-radius: 1px; white-space: nowrap; transition: background .3s;
}
.jk-mega-tags li:hover { background: var(--jk-main); }
.jk-mega-tags li a { color: #000; font-weight: 500; }
.jk-mega-tags li:hover a { color: #fff; }

.jk-mega-pane { display: none; }
.jk-mega-pane.active { display: block; animation: jkFade .22s ease; }
@keyframes jkFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.jk-mega-blockhead {
    display: flex; align-items: flex-end; justify-content: space-between;
    width: 100%; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0;
}
.jk-mega-blockhead span { font-size: 14px; font-weight: 500; color: #181818; }
.jk-mega-blockhead span em { margin-right: 6px; font-style: normal; color: #f44336; }
.jk-mega-blockhead a { padding-right: 8px; font-size: 13px; color: #ccc; }
.jk-mega-blockhead a:hover { color: var(--jk-main); }

.jk-mega-reco { display: flex; align-items: flex-start; }
.jk-mega-reco-hot { flex: 0 0 40%; max-width: 40%; }
.jk-mega-hotitem {
    display: flex; align-items: center; margin-bottom: 10px; padding: 18px 20px;
    background: #f4f7ff; border-radius: var(--jk-radius); transition: background .18s;
}
.jk-mega-hotitem:last-child { margin-bottom: 0; }
.jk-mega-hotitem em { margin-right: 10px; font-size: 22px; font-weight: 700; font-style: normal; color: var(--jk-main); }
.jk-mega-hotitem span { font-size: 14px; font-weight: 500; color: #181818; }
.jk-mega-hotitem:hover { background: #eaf0ff; }
.jk-mega-hotitem:hover span { color: var(--jk-main); }
.jk-mega-reco-list {
    flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px; margin-left: 20px; padding: 0 4px 0 12px;
}
.jk-mega-orditem span {
    display: block; font-size: 14px; font-weight: 500; line-height: 32px; color: #181818;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.jk-mega-orditem:hover span { color: var(--jk-main); }

.jk-mega-news {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px;
    padding: 16px 20px; background: #f4f7ff; border-radius: var(--jk-radius);
}
.jk-mega-news a {
    font-size: 14px; line-height: 42px; color: #181818;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.jk-mega-news a:hover { color: var(--jk-main); }

.jk-mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 20px; }
.jk-mega-card {
    display: flex; flex-direction: column; padding: 20px; min-height: 124px;
    background: #f4f7ff; border-radius: var(--jk-radius); transition: .18s;
}
.jk-mega-card:hover { background: #fff; box-shadow: 0 4px 16px rgba(20, 40, 90, .12); }
.jk-mega-card-name { margin-bottom: 10px; font-size: 14px; font-weight: 500; color: #181818; }
.jk-mega-card:hover .jk-mega-card-name { color: var(--jk-main); }
.jk-mega-card-desc {
    font-size: 13px; color: var(--jk-muted); line-height: 24px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.jk-mega-empty { display: flex; align-items: center; gap: 8px; padding: 28px 0; color: var(--jk-muted); font-size: 13px; }

.jk-mega-right { flex: 0 0 264px; max-width: 264px; padding: 24px 40px 24px 20px; }
.jk-mega-ad {
    position: relative; display: block; margin-bottom: 22px; overflow: hidden;
    border-radius: var(--jk-radius); box-shadow: 0 1px 3px rgba(49, 49, 49, .1); transition: box-shadow .3s;
}
.jk-mega-ad:last-child { margin-bottom: 0; }
.jk-mega-ad:hover { box-shadow: 0 6px 18px rgba(49, 49, 49, .22); }
.jk-mega-ad img { width: 100%; height: 108px; object-fit: cover; }
.jk-mega-ad-text {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    padding: 0 20px 0 22px; width: 100%;
}
.jk-mega-ad-title { margin-bottom: 6px; font-size: 15px; font-weight: 500; color: #181818; }
.jk-mega-ad-desc { font-size: 12px; color: var(--jk-muted); line-height: 1.5; }

/* 巨型下拉补充：推广卡文字块、相邻小标题间距、精选推荐图标 */
.jk-mega-ad-title, .jk-mega-ad-desc { display: block; }
.jk-mega-blockhead + .jk-mega-blockhead { margin-top: 24px; }

/* ---------------- 响应式（与官网一致） ---------------- */
@media (max-width: 1280px) {
    .jk-header-extra { display: none; }
}
@media (max-width: 1080px) {
    .jk-search { display: none; }
    .jk-header-inner { padding-left: 20px; }
    .jk-nav { margin-left: 18px; }
    .jk-nav-item > a { padding: 0 9px; font-size: 14px; }
}

/* ---------------- 购物车页适配 ---------------- */
/* 官网导航为 sticky（占据文档流）；购物车框架的面包屑条是 fixed，
   内容区统一按 --navheight + --pageheight 偏移，这里改为 fixed 保持原有布局偏移不变 */
.jk-header { position: fixed; top: 0; left: 0; right: 0; z-index: 999; }

/* ---------------- WAP（≤768px，与官网一致 + 购物车框架适配） ---------------- */
@media (max-width: 768px) {
    .jk-header-inner { height: 56px; padding-left: 20px; }
    .jk-topbar { display: none; }
    .jk-nav, .jk-header-right { display: none; }
    /* 顶部常驻头像按钮（小狸 WAP 同款：蓝底圆形，始终显示，无需点三条杠） */
    .jk-header-user {
        display: flex; align-items: center; justify-content: center;
        width: 32px; height: 32px; margin-left: auto; margin-right: 4px;
        border-radius: 50%; background: var(--jk-main); color: #fff;
        font-size: 14px; text-decoration: none; flex: none;
    }
    .jk-menu-toggle { display: block; padding: 0 16px; height: 56px; }
    /* 移动端抽屉菜单：速科云 WAP 同款 —— 左侧菜单面板(39%) + 点开滑出右侧二级面板(41%)，
       关闭/用户按钮固定屏幕右上角，页面其余部分加蒙版 */
    .jk-drawer-mask {
        position: fixed; inset: 0; z-index: 90; background: rgba(17, 20, 45, .5);
        opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
    }
    .jk-drawer-mask.open { opacity: 1; visibility: visible; }
    .jk-drawer { position: fixed; inset: 0; z-index: 91; pointer-events: none; visibility: hidden; }
    .jk-drawer.open { visibility: visible; }
    body.jk-drawer-lock { overflow: hidden; }
    .jk-drawer-menu {
        position: absolute; left: 0; top: 0; bottom: 0; width: 39%; min-width: 150px;
        background: #fff; pointer-events: auto; display: flex; flex-direction: column;
        box-shadow: 4px 0 20px rgba(0, 0, 0, .08);
        transform: translateX(-102%); transition: transform .28s ease;
    }
    .jk-drawer.open .jk-drawer-menu { transform: none; }
    .jk-drawer-logo { height: 24px; width: auto; margin: 14px 14px 10px 16px; align-self: flex-start; }
    .jk-drawer-nav { flex: 1; overflow-y: auto; padding: 2px 0; }
    .jk-drawer-item {
        display: flex; align-items: center; gap: 5px; padding: 13px 12px 13px 16px;
        font-size: 14px; color: #333; text-decoration: none;
    }
    .jk-drawer-item .fa-angle-down { margin-left: auto; font-size: 12px; color: #b9bfc9; transition: transform .2s; }
    .jk-drawer-item.active { color: #333; font-weight: 500; }
    .jk-drawer-item.active .fa-angle-down { transform: rotate(180deg); }
    .jk-drawer-item.current { color: var(--jk-main); background: #eef4ff; }
    .jk-drawer-children { display: none; padding-bottom: 4px; }
    .jk-drawer-children.open { display: block; }
    .jk-drawer-child {
        display: block; padding: 12px 12px 12px 18px; font-size: 13px; color: #555;
        text-decoration: none;
    }
    .jk-drawer-child.active { color: var(--jk-main); background: #eef4ff; font-weight: 500; }
    .jk-drawer-tag {
        font-size: 10px; line-height: 1; padding: 3px 4px; border-radius: 3px;
        color: #ff6a00; background: #fff3e8; font-style: normal; flex: none;
    }
    .jk-drawer-foot { flex: none; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
    .jk-drawer-reg {
        display: inline-flex; align-items: center; gap: 7px; background: var(--jk-main);
        color: #fff; font-size: 13px; padding: 9px 20px; border-radius: 6px; text-decoration: none;
    }
    .jk-drawer-sub {
        position: absolute; left: 39%; right: 0; top: 0; bottom: 0; width: auto;
        background: #fff; pointer-events: auto; overflow-y: auto;
        border-left: 1px solid #f0f2f7;
        opacity: 0; visibility: hidden; transform: translateX(-14px);
        transition: opacity .25s, transform .25s, visibility .25s;
    }
    .jk-drawer-sub.show { opacity: 1; visibility: visible; transform: none; }
    /* 抽屉整体关闭时，无论面板是否带 .show 都强制收回 */
    .jk-drawer:not(.open) .jk-drawer-sub { opacity: 0; visibility: hidden; transform: translateX(-14px); }
    .jk-drawer:not(.open) .jk-drawer-menu { transform: translateX(-102%); }
    .jk-drawer-panel { display: none; }
    .jk-drawer-panel.active { display: block; }
    .jk-drawer-panel-head {
        display: flex; justify-content: flex-start; padding: 14px 14px 4px; font-size: 12px;
    }
    .jk-drawer-panel-head a { color: #999; text-decoration: none; }
    .jk-drawer-panel-head a i { font-size: 10px; margin-left: 3px; }
    .jk-drawer-panel a.jk-drawer-link {
        display: block; padding: 12px 16px; font-size: 14px; color: #333; text-decoration: none;
    }
    .jk-drawer-panel a.jk-drawer-link:active,
    .jk-drawer-panel a.jk-drawer-link.active { color: var(--jk-main); }
    .jk-drawer-ctrl {
        position: absolute; top: 10px; right: 12px; display: flex; align-items: center;
        gap: 10px; pointer-events: auto; z-index: 6;
    }
    .jk-drawer-iconbtn {
        width: 32px; height: 32px; border-radius: 50%; background: var(--jk-main);
        color: #fff; display: flex; align-items: center; justify-content: center;
        font-size: 14px; text-decoration: none; border: 0; cursor: pointer; padding: 0;
    }
    /* 关闭按钮：小狸同款深色裸叉，不用蓝底圆 */
    .jk-drawer-ctrl button#jkDrawerClose { background: transparent; color: #2b3a55; font-size: 20px; }
    .jk-mega-inner { display: block; max-width: none; }
    .jk-mega-left { flex: none; max-width: none; padding: 14px 20px; }
    .jk-mega-title { font-size: 18px; }
    .jk-mega-list { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 8px; }
    .jk-mega-more { margin-top: 8px; padding-top: 0; }
    .jk-mega-main { padding: 14px 20px 18px; }
    .jk-mega-searchbar { display: none; }
    .jk-mega-reco { display: block; }
    .jk-mega-reco-hot { flex: none; max-width: 100%; }
    .jk-mega-hotitem { padding: 12px 16px; }
    .jk-mega-reco-list { margin: 12px 0 0; padding: 0; }
    .jk-mega-news { display: block; padding: 10px 16px; }
    .jk-mega-grid { grid-template-columns: 1fr 1fr; }
    .jk-mega-right { flex: none; max-width: none; padding: 0 20px 20px; }
    .jk-mega-ad { margin-bottom: 12px; }
    /* 产品分组手风琴（小狸 WAP 同款）：面板内一级分组行，点行展开二级分组 */
    .jk-drawer-gitem { border-bottom: 1px solid #f3f5f9; }
    .jk-drawer-grow {
        display: flex; align-items: center; gap: 5px; padding: 13px 14px;
        font-size: 14px; color: #333; text-decoration: none;
    }
    .jk-drawer-grow .fa-angle-down { margin-left: auto; font-size: 12px; color: #b9bfc9; transition: transform .2s; }
    .jk-drawer-grow.open { color: var(--jk-main); font-weight: 500; }
    .jk-drawer-grow.open .fa-angle-down { transform: rotate(180deg); }
    .jk-drawer-gsub { display: none; padding: 0 8px 8px; }
    .jk-drawer-gsub.open { display: block; }
    .jk-drawer-gsub .jk-drawer-link { padding: 11px 12px 11px 26px; font-size: 13px; color: #555; }
    /* 购物车框架适配：sk 框架的二级条/内容区按 --wapnavheight(62px) 偏移，
       官网 WAP 头部是 56px，这里对齐成 62px 保持偏移不变 */
    .jk-header-inner { height: var(--wapnavheight, 62px); }
    .jk-menu-toggle { height: var(--wapnavheight, 62px); }
    /* 购物车框架适配：头部在购物车页是 z-index:999（fixed），
       抽屉必须压过它才能盖住导航条 */
    .jk-drawer-mask { z-index: 1000; }
    .jk-drawer { z-index: 1001; }
}

/* PC（>768px）抽屉整体隐藏（与官网 jike.css 1308 行同款） */
@media (min-width: 769px) {
    .jk-drawer, .jk-drawer-mask { display: none !important; }
}
