/**
 * 首页新版样式
 * 所有屏幕尺寸统一移动端布局，内容区固定 480px 居中，灰色背景
 * 模块：顶部导航 → 轮播 → 金刚区 → 商城头条 → 爆款推荐
 */

/* ===== 整体容器 ===== */
.home-new {
    background: #f7f7f7;
    min-height: 100vh;
    padding-bottom: 2rem;
    padding: 1.5rem;
}

/* 内容区内边距（顶部导航和轮播不需要白卡片包裹，用内边距） */
.home-new-banner,
.home-new-jingang,
.home-new-news,
.home-new-hot {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ============================================
   ① 顶部导航块（新设计：上下两部分）
   ============================================ */

/* --- 容器：确保在绝对定位元素之上 --- */
.home-new-header {
  position: relative;
  z-index: 200;
}

/* --- 上半部分：Logo + 导航标签 + 分享图 --- */
.home-new-header-top {
    padding: var(--header-top-padding, 0.8rem 0);
}
.home-new-header-top-inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 1.5rem;
        justify-content: space-between;
}

/* 首页由 .home-new 容器提供边距，header-top 不需要再加 */
.home-new .home-new-header-top-inner {
    padding-left: 0;
    padding-right: 0;
}

/* Logo */
.home-new-logo {
    flex-shrink: 0;
    margin-right: 0.8rem;
}
.home-new-logo img {
    display: block;
    height: 3.5rem;
    object-fit: contain;
}

/* 返回按钮（非首页，替代 Logo 位置） */
.home-new-back {
    flex-shrink: 0;
    margin-right: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--header-btn-bg, rgba(255, 255, 255, 0.9));
    text-decoration: none;
}
.home-new-back .iconfont {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--header-btn-icon-color, #333);
}

/* 顶部脱离文档流（覆盖在内容上方，不随页面滚动） */
.home-new-header-top-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}
.home-new-header-top-fixed .home-new-header-top-inner {
    /* 保持 inner 的 max-width 居中布局 */
}

/* 导航标签容器 */
.home-new-nav-tabs {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
.home-new-nav-tabs-inner {
    display: flex;
    position: relative;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.home-new-nav-tabs-inner::-webkit-scrollbar {
    display: none;
}

/* 单个标签 */
.home-new-nav-tab {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 1.6rem;
    font-weight: 400;
    font-family: 'OPPOSans-R', 'Microsoft YaHei', SimSun;
    color: #757475;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s ease;
}
.home-new-nav-tab.active {
    color: var(--color-main, #00472b);
    font-weight: 700;
    font-family: 'OPPOSans-H', 'Microsoft YaHei', SimSun;
}

/* 滑动下划线 */
.home-new-nav-tab-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-main, #00472b);
    border-radius: 1px;
    transition: left 0.3s ease, width 0.3s ease;
    pointer-events: none;
}

/* 分享图（首页：图片） */
.home-new-share {
    flex-shrink: 0;
    margin-left: 0.8rem;
}
.home-new-share img {
    display: block;
    width: auto;
    max-width: 6.8rem;
    object-fit: contain;
}

/* 分享按钮（非首页：圆形图标） */
.home-new-share-icon {
    flex-shrink: 0;
    margin-left: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: var(--header-btn-bg, rgba(255, 255, 255, 0.9));
    text-decoration: none;
}
.home-new-share-icon .iconfont {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--header-btn-icon-color, #333);
    line-height: 1;
}

/* 内联搜索栏（非首页，顶部行内） */
.home-new-search-inline {
    display: flex;
    align-items: center;
    height: 3.2rem;
    background: #fff;
    border-radius: 1.6rem;
    padding: 0 0.8rem;
    text-decoration: none;
    color: #999;
    font-size: 1.2rem;
    margin-left: auto;
    width: 30%;
}
.home-new-search-inline .iconfont {
    font-size: 1.4rem;
    margin-right: 0.4rem;
    color: #999;
    flex-shrink: 0;
}
.home-new-search-inline input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.2rem;
    color: #333;
    font-family: inherit;
    -webkit-appearance: none;
    box-shadow: none;
}
.home-new-search-inline input:focus,
.home-new-search-inline input:focus-visible {
    outline: none;
    box-shadow: none;
}
.home-new-search-inline input::placeholder {
    color: #999;
}
.home-new-search-inline span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 下半部分：全宽搜索栏 --- */
.home-new-header-bottom {
    padding: 0.5rem 1.5rem;
}
.home-new .home-new-header-bottom {
    padding-left: 0;
    padding-right: 0;
}
.home-new-search-bar {
    display: flex;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 2.4rem;
    text-decoration: none;
    box-sizing: border-box;
    padding: 0.3rem;
    border: 1px solid #e8e8e8;
}
.home-new-search-bar-left {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0rem 0.8rem;
    color: #999;
    font-size: 1.2rem;
    min-width: 0;
}
.home-new-search-bar-left .iconfont {
    font-size: 1.4rem;
    margin-right: 0.4rem;
    color: #999;
}
.home-new-search-bar-left input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.2rem;
    color: #333;
    font-family: inherit;
    -webkit-appearance: none;
    box-shadow: none;
}
.home-new-search-bar-left input:focus,
.home-new-search-bar-left input:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}
.home-new-search-bar-left input::placeholder {
    color: #999;
}
.home-new-search-bar-right {
    flex-shrink: 0;
    padding: 0.3rem 1rem;
    background: #eeeeef;
    color: #c9caca;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

/* ============================================
   ② 轮播图块
   ============================================ */
.home-new-banner {
    margin-top: 1rem;
}
.home-new-banner .swiper {
    position: relative;
    border-radius: 0.8rem;
    overflow: hidden;
}
.home-new-banner .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
}
/* 轮播指示器 */
.home-new-banner .swiper-pagination {
    position: absolute;
    bottom: 0.8rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 0.3rem 1rem;
    border-radius: 1rem;
    z-index: 10;
}
.home-new-banner .swiper-pagination-bullet {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    margin: 0 0.3rem;
    transition: all 0.3s;
    opacity: 1;
}
.home-new-banner .swiper-pagination-bullet-active {
    background: #fff;
    width: 1.5rem;
    border-radius: 0.3rem;
}

/* ============================================
   ③ 金刚区块
   ============================================ */
.home-new-jingang {
    margin-top: 1rem;
    padding: 1.5rem 0;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0.8rem;
}
.home-new-jingang-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem 0;
    /* grid-template-columns 由内联 style 动态覆盖 */
}
.home-new-jingang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
}
.home-new-jingang-item .jingang-icon-wrapper {
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    overflow: hidden;
    background: #f7f7f7;
}
.home-new-jingang-item img {
    width: 8rem;
    height: 8rem;
    object-fit: contain;
}
.home-new-jingang-item .jingang-name {
    font-size: 1.5rem;
    color: var(--color-main, #00472b);
}

/* 空状态 */
.home-new-jingang-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 1.2rem;
}

/* ============================================
   ④ 商城头条块
   ============================================ */
.home-new-news {
    margin-top: 1rem;
    padding: 0 1.2rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    background: var(--color-main, #00472b);
    border-radius: 0.8rem;
    overflow: hidden;
}
.home-new-news-left {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
.home-new-news-img {
    height: 1.7rem;
    width: auto;
    margin-right: 0.8rem;
    flex-shrink: 0;
}
.home-new-news-ticker-wrap {
    flex: 1;
    overflow: hidden;
    height: 3rem;
    line-height: 3rem;
    min-width: 0;
    cursor: pointer;
}
.home-new-news-ticker {
    list-style: none;
    margin: 0;
    padding: 0;
}
.home-new-news-ticker li {
    height: 3rem;
    line-height: 3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
}
.home-new-news-ticker li a {
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
}
.home-new-news-right {
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    cursor: pointer;
}
.home-new-news-right .iconfont,
.home-new-news-right i {
    color: #fff;
    font-size: 1.6rem;
}

/* ============================================
   ⑤ 爆款推荐块
   ============================================ */
.home-new-hot {
    background: #fff;
    margin-top: 1rem;
    padding: 1.5rem 1.2rem;
    border-radius: 0.8rem;
}
.home-new-hot-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.home-new-hot-title-left {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-main, #00472b);
}
.home-new-hot-title-right {
    font-size: 1.2rem;
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.home-new-hot-title-right .iconfont {
    font-size: 1.2rem;
    margin-left: 0.2rem;
}
.home-new-hot-goods {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.home-new-hot-goods::-webkit-scrollbar {
    display: none;
}
.home-new-hot-item {
    flex-shrink: 0;
    width: 50%;
    text-align: center;
    position: relative;
    text-decoration: none;
    display: block;
}
.home-new-hot-item + .home-new-hot-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #eee;
}
.home-new-hot-item .hot-goods-thumb {
    width: 10rem;
    height: 10rem;
    object-fit: cover;
    margin: 0 auto 0.6rem;
    display: block;
    border-radius: 0.4rem;
}
.home-new-hot-item .hot-goods-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
    padding: 0 0.4rem;
}
.home-new-hot-item .hot-goods-brand-logo {
    width: 1.8rem;
    height: 1.8rem;
    object-fit: contain;
    margin-right: 0.3rem;
    flex-shrink: 0;
}
.home-new-hot-item .hot-goods-name {
    font-size: 1.6rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
    margin: 0 auto;
}
.home-new-hot-item .hot-goods-price {
    font-size: 1.6rem;
    color: var(--color-main, #e22c2c);
    font-weight: 600;
    margin-top: 0.2rem;
}

/* 空状态 */
.home-new-hot-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 1.2rem;
}

/* ============================================
   页脚适配（移除旧首页楼层相关 padding）
   ============================================ */
.home-new ~ .am-footer {
    padding-bottom: 2rem;
}

/* ============================================
   通用横向滑动列表（插件商品区复用）
   用法：容器加 .h-scroll-list，子项加 .h-scroll-item
   ============================================ */
.h-scroll-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.h-scroll-list::-webkit-scrollbar {
    display: none;
}
.h-scroll-item {
    flex-shrink: 0;
    width: 45%;
    scroll-snap-align: start;
}

/* 移动端底部导航适配 */
.mobile-navigation ~ .home-new {
    padding-bottom: 7rem;
}

/* ============================================
   导航标签 AJAX 内容区域
   ============================================ */
.home-new-navtab-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
}
.home-new-navtab-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}
.home-new-navtab-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1.3rem;
}

/* 加载中状态 */
.home-new-loading {
    text-align: center;
    padding: 4rem 1rem;
    color: #999;
    font-size: 1.3rem;
}

/* ============================================
   ⑥ 猜你喜欢块（2列瀑布流）
   ============================================ */
.home-new-guess-like {
    max-width: 480px;
    margin: 1rem auto 0;
    padding: 1.5rem 1.2rem;
    border-radius: 0.8rem;
    box-sizing: border-box;
}
.home-new-guess-like-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}
.home-new-guess-like-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-main, #00472b);
}
.home-new-guess-like-more {
    font-size: 1.2rem;
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.home-new-guess-like-more .iconfont {
    font-size: 1.2rem;
    margin-left: 0.2rem;
}

/* 瀑布流容器 - 2列 Flex 布局（左→右，上→下） */
.home-new-waterfall {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}
.waterfall-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* 通用瀑布流卡片 */
.waterfall-item {
    border-radius: 0.8rem;
    overflow: hidden;
}

/* ===== 轮播卡片 ===== */
.waterfall-carousel-card {
    background: #f0f0f0;
}
.waterfall-carousel-card .swiper {
    border-radius: 0.8rem;
    overflow: hidden;
}
.waterfall-carousel-card .swiper-slide a {
    display: block;
    width: 100%;
}
.waterfall-carousel-card .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
}
.waterfall-carousel-card .swiper-pagination {
    position: absolute;
    bottom: 0.6rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}
.waterfall-carousel-card .swiper-pagination-bullet {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    margin: 0 0.2rem;
    transition: all 0.3s;
}
.waterfall-carousel-card .swiper-pagination-bullet-active {
    background: #fff;
    width: 1.2rem;
    border-radius: 0.3rem;
}

/* ===== 商品卡片 ===== */
.waterfall-goods-card {
    text-decoration: none;
    color: inherit;
    display: block;
    background: #fff;
    transition: box-shadow 0.2s;
}

.waterfall-goods-img {
    width: 100%;
    display: block;
    object-fit: cover;
    background: #f5f5f5;
}
.waterfall-goods-info {
    padding: 0.6rem 0.8rem;
}
.waterfall-goods-title {
    font-size: 1.6rem;
    color: #333;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    word-break: break-all;
}
.waterfall-goods-price {
    font-size: 1.6rem;
    color: #e22c2c;
    font-weight: 600;
    margin: 0.4rem 0 0;
}

/* 加载状态 */
.guess-like-loading,
.guess-like-no-more {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    font-size: 1.2rem;
    color: #999;
}

/* 空状态 */
.home-new-guess-like-empty {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 1.2rem;
}
