@charset "UTF-8";

/* ============================================
   昇磁霍尔商城 - 首页专属样式 index.css
   说明: 仅首页使用。设计参考 trae-v3，应用 plan A：
        - 右侧栏 240px + 卡片化设计（与 banner 高度对齐）
        - Banner 固定 750×350，四周 10px 间距
        - 颜色全部用 common.css 的 CSS 变量
   ============================================ */

/* 首页外层 */
.home-page { background: #e9edf2; padding-bottom: 20px; }

/* 三栏布局（分类 + Banner + 右侧栏） */
.home-hero {
    display: flex;
    gap: 0;
    height: 370px;
    position: relative;
    z-index: 10;
    /* 显式 width: 100% 撑满父容器 .container(1210px)。原因：在本项目加载顺序下
       （bootstrap+shopy+common+index），Chrome 把 .home-hero 的 display:flex;width:auto
       按 inline-flex 的 shrink-to-fit 处理，computed width 缩到 432px（仅够 home-sidebar 200 + 间隔），
       导致 home-banner(750) 与 home-rightbar(240) 溢出到右侧、左侧 ~778px 全空。
       显式 width:100% 强制按 block-level flex container 处理（width:auto = parent content）。 */
    width: 100%;
    background: #E9EDF2;
}

/* 左侧分类 - 使用 common.css 中 mega-sidebar 样式（与导航全部商品下拉一致） */
.home-sidebar {
    width: 200px;
    height: 370px;
    flex-shrink: 0;
    z-index: 10;
}
.home-sidebar .mega-sidebar {
    height: 100%;
    border-right: none;
    background: #F5F7FA;
}
.home-sidebar .mega-sidebar-item {
    border-bottom: 1px solid #F0F2F5;
}
.home-sidebar .mega-sidebar-item:last-child { border-bottom: none; }

/* 首页左侧分类 - 二级悬浮面板（与导航全部商品下拉右侧面板一致） */
.home-sub-panel {
    position: absolute;
    left: 200px;
    top: 0;
    right: 0;
    height: 370px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 20;
    display: none;
    padding: 16px 20px;
    overflow-y: auto;
}
.home-sub-panel.is-visible { display: block; }

/* 中间 Banner 轮播（750×350，四周 10px 间距） */
.home-banner {
    flex: 0 0 750px;
    width: 750px;
    height: 350px;
    margin: 10px;
    background: #E5E7EB;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}
.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .6s ease;
}
.banner-slide.is-active { opacity: 1; z-index: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-dots {
    position: absolute;
    left: 0; right: 0; bottom: 14px;
    z-index: 5;
    text-align: center;
    pointer-events: none;
}
.banner-dot {
    display: inline-block;
    width: 8px; height: 8px;
    margin: 0 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    cursor: pointer;
    pointer-events: auto;
    transition: all .25s;
}
.banner-dot:hover { background: rgba(255,255,255,.85); }
.banner-dot.is-active { width: 18px; border-radius: 4px; background: var(--brand); }

/* 右侧用户区（240px，上下 10px 间距对齐 banner；卡片化设计） */
.home-rightbar {
    width: 240px;
    background: #fff;
    height: 350px;
    flex-shrink: 0;
    margin: 10px 0;
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-welcome {
    text-align: center;
    padding: 14px 12px 10px;
    background: #F5F7FA;
    margin: 0 12px 6px;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}
.user-welcome p { font-size: 13px; color: var(--text); font-weight: 500; margin-bottom: 10px; }
.user-btns { display: flex; gap: 10px; justify-content: center; }
.user-btns .btn { padding: 5px 18px; font-size: 12px; border-radius: var(--radius); flex: 1; max-width: 90px; display: flex; align-items: center; justify-content: center; line-height: 1; min-height: 26px; }
.user-btns .btn-outline { background: var(--brand); color: #fff; border: none; }
.user-btns .btn-primary { background: var(--accent); color: #fff; border: none; }

.site-notice {
    padding: 6px 14px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notice-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-shrink: 0; }
.notice-header span { font-size: 14px; font-weight: 600; color: var(--text); }
.notice-header .more { font-size: 12px; color: var(--text-3); }
.notice-header .more:hover { color: var(--brand); }
.notice-list { flex: 1; overflow: hidden; }
.notice-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 3px 0;
    line-height: 1.7;
}
.notice-list li a { color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 8px; }
.notice-list li a:hover { color: var(--brand); }
.notice-list li .date { color: var(--text-4); font-size: 11px; flex-shrink: 0; }

.user-quick { display: flex; padding: 10px 12px 12px; justify-content: center; gap: 10px; flex-shrink: 0; }
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-2);
    padding: 14px 0;
    border-radius: var(--radius-lg);
    background: #F5F7FA;
    transition: all .2s;
    width: 85px;
    height: 90px;
}
.quick-item:hover { background: var(--brand-light); color: var(--brand); }
.quick-item .fa { font-size: 24px; color: var(--brand); line-height: 1; }
.quick-item:hover .fa { color: var(--brand); }
.quick-item span { color: var(--text-2); }

/* 服务特色栏 */
.service-bar { background: #fff; padding: 10px 0; border-bottom: none; }
.service-bar .container { width: 1210px; max-width: 1210px; }
.service-bar .service-list {
    display: flex;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e9edf2;
    border-radius: 4px;
    padding: 20px 0;
}
.service-bar .service-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    padding: 0 20px;
    border-right: 1px solid #e9edf2;
}
.service-bar .service-item:last-child { border-right: none; }
.service-bar .service-icon {
    width: 48px;
    height: 48px;
    background: #EBF3FC;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1D7AD9;
    font-size: 22px;
    flex-shrink: 0;
}
.service-bar .service-icon img { width: 24px; height: 24px; }
.service-bar .service-text h4 { font-size: 15px; color: #1A202C; margin-bottom: 4px; }
.service-bar .service-text p { font-size: 12px; color: #718096; }

/* 品牌 + 型号替代查询（2026-07-23 接真实数据 + 横向轮播） */
.brand-query-section { background: #fff; padding: 10px 0; }
.brand-query-inner { display: flex; gap: 20px; }
.brand-panel { flex: 1; background: linear-gradient(to bottom, #e9edf3 0%, #dff3fe 30%, #dff3fe 100%); border-radius: var(--radius); padding: 20px; position: relative; }
.panel-header h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 16px; text-align: center; }
.brand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; height: 172px;}
.brand-item { display: flex; align-items: center; justify-content: center; height: 80px; background: #fff; border: 1px solid #E2E8F0; border-radius: var(--radius); transition: all .3s; overflow: hidden; }
.brand-item:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(30, 111, 156, .12); transform: translateY(-1px); }
.brand-item img { width: 100%; height: 100%; object-fit: contain; }
.brand-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 13px; padding: 32px 0; }

/* 品牌轮播：每页 8 个（2×4），超出 8 个左右滑动 */
.brand-carousel { position: relative; }
.brand-page { display: none; }
.brand-page.is-active { display: block; animation: brandPageFade .35s ease; }
@keyframes brandPageFade { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
.brand-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255, 255, 255, .85); color: var(--brand);
    border: 1px solid var(--border); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1; z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    transition: all .2s ease; opacity: 0;
}
.brand-carousel:hover .brand-arrow { opacity: .7; }
.brand-arrow:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-50%) scale(1.05); }
.brand-arrow:disabled { cursor: not-allowed; opacity: .3; }
.brand-arrow:disabled:hover { background: rgba(255, 255, 255, .85); color: var(--brand); transform: translateY(-50%) scale(1); }
.brand-arrow-prev { left: -28px; }
.brand-arrow-next { right: -28px; }
.brand-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: #B8C5D2; cursor: pointer; transition: all .25s ease; }
.brand-dot.is-active { width: 22px; border-radius: 4px; background: var(--brand); }
.brand-dot:hover { background: var(--brand); }
.query-panel { width: 360px; background: #dff3fe; border-radius: var(--radius); padding: 20px; flex-shrink: 0; display: flex; flex-direction: column; }
.query-search { display: flex; gap: 0; margin-bottom: 16px; }
.query-search input { flex: 1; height: 36px; border: 1px solid var(--border); border-right: none; padding: 0 12px; font-size: 13px; border-radius: 4px 0 0 4px; outline: none; }
.query-search .btn { border-radius: 0 4px 4px 0; height: 36px; padding: 0 20px; }
.query-result {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #F5F7FA;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.query-result-img {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}
.query-result-img img { max-width: 50px; max-height: 50px; }
.query-result-info { flex: 1; min-width: 0; }
.query-result-info p { font-size: 12px; color: #4A5568; margin-bottom: 4px; line-height: 1.4; }
.query-result-info p:last-child { margin-bottom: 0; }
.query-result-info label { color: var(--text-3); }
.query-result-info span { color: var(--text); font-weight: 500; }
.query-more { text-align: right; font-size: 12px; color: var(--brand); }
.query-more:hover { text-decoration: underline; }

/* 新闻区域（静态占位区，后续接入数据） */
.news-section { background: #fff; padding: 10px 0; }
.news-inner { display: flex; gap: 20px; background: #fff; border-radius: var(--radius); padding: 40px 20px; }
.news-main { flex: 1; }
.news-tabs { display: flex; justify-content: center; gap: 40px; margin-bottom: 12px; border-bottom: 1px solid #EDF2F7; padding: 0 20px; }
.news-tab { font-size: 15px; color: var(--text-2); padding-bottom: 10px; cursor: pointer; position: relative; }
.news-tab:hover, .news-tab.active { color: var(--brand); font-weight: 600; }
.news-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 40px; height: 3px; background: var(--brand); border-radius: 2px; }
.news-content { display: flex; gap: 20px; align-items: stretch; }
.news-featured { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; height: 280px; }
.news-f-img { width: 100%; height: 160px; overflow: hidden; border-radius: var(--radius); margin-bottom: 10px; background: #F5F7FA; }
.news-f-img img { width: 100%; height: 100%; object-fit: cover; }
.news-f-info { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.news-f-info h4 { font-size: 14px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.news-f-info p { font-size: 12px; color: var(--text-3); line-height: 1.6; flex: 1; }
.news-f-info .more { font-size: 12px; color: var(--brand); margin-top: 6px; display: inline-block; }
.news-list-small { flex: 1; display: flex; flex-direction: column; justify-content: space-between; height: 280px; }
.news-s-item { display: flex; gap: 12px; margin-bottom: 12px; }
.news-s-item:last-child { margin-bottom: 0; }
.news-s-img { width: 160px; height: 90px; flex-shrink: 0; overflow: hidden; border-radius: var(--radius); background: #F5F7FA; }
.news-s-img img { width: 100%; height: 100%; object-fit: cover; }
.news-s-info { flex: 1; min-width: 0; }
.news-s-info h4 { font-size: 14px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.news-s-info p { font-size: 12px; color: var(--text-3); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 商品区块 */
.product-section { background: #fcfcfc; padding: 10px 0; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.product-grid.product-grid-5 { grid-template-columns: repeat(5, 1fr); }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: box-shadow .2s; overflow: hidden; position: relative; }
.product-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.product-card .card-img { height: 220px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; overflow: hidden; border-radius: var(--radius); background: #F5F7FA; }
.product-card .card-img img { height: 100%; width: 100%; object-fit: contain; }
.product-card .card-title { font-size: 14px; color: var(--text); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.product-card .card-brand { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.product-card .card-attr { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.product-card .card-bottom { display: flex; justify-content: space-between; align-items: center; }
.product-card .card-bottom .price { font-size: 15px; font-weight: 600; color: var(--accent); }

/* 热销商品列表 */
.hot-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hot-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; gap: 16px; transition: box-shadow .2s; }
.hot-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.hot-item .hot-img { width: 110px; height: 110px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius); background: #F5F7FA; }
.hot-item .hot-img img { width: 100%; height: 100%; object-fit: contain; }
.hot-item .hot-info { flex: 1; min-width: 0; }
.hot-item .hot-title { font-size: 14px; color: var(--text); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hot-item .hot-brand { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.hot-item .hot-attr { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.hot-item .hot-price { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.hot-item .hot-price .price { color: var(--accent); }

/* 品牌品牌条 */
.brand-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand-bar .brand-item { flex: 1; text-align: center; height: 80px; display: flex; align-items: center; justify-content: center; filter: grayscale(100%); opacity: .7; transition: all .3s; }
.brand-bar .brand-item:hover { filter: grayscale(0); opacity: 1; }
.brand-bar .brand-item img { max-height: 56px; max-width: 100%; }
