﻿/* ============================================
   /portal/assets/css/home_page.css
   PC 端首页布局样式（彻底隔离版）
============================================ */

/* ============================
   顶部 Banner（容器）
============================ */
.home-banner {
    width: 100%;
    height: 320px;
    /*background: #f5f5f5; 改成下吗这个变量颜色变    /* ⭐ 原来默认背景颜色浅灰色#f5f5f5 */
	background: var(--home-banner-bg-color, #f5f5f5);   /* ⭐ 默认浅灰色 */
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 0px;
}

/* Banner 文案区域 */
/* ⭐ 标题区域宽度限制 + 自动换行（防止长文字撑满整个 Banner） */
.banner-content {
    max-width: 25%;        /* 标题区域最多占 Banner 左侧 40% 宽度 */
    word-wrap: break-word; /* 长字自动换行 */
    overflow-wrap: break-word;
}

.banner-title {
    font-size: 28px;       /* 可根据你需求调整 */
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 10px;
}

.banner-desc {
    font-size: 16px;
    line-height: 1.4;
}

/* ============================
   顶部 Banner（淡入淡出轮播）
============================ */
.banner-images {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
}

.banner-images .banner-box {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: none;
}
.banner-images .banner-box.active {
    display: block;
}

/* ⭐ 新增：兜底保证 <img.active> 也能显示 */
.banner-images .banner-box img.active {
    display: block;
}

.banner-images .banner-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ⭐ 方案A：标题浮层叠加在每张轮播图上 */
.banner-box .banner-content {
    position: absolute;
    top: 40px;
    left: 50px;
    z-index: 10;
    color: #fff;
    pointer-events: none; /* 让标题不影响点击图片跳转 */
}

.banner-box .banner-title {
    font-size: 36px;
    font-weight: 600;
}

.banner-box .banner-desc {
    font-size: 18px;
    margin-top: 10px;
}

/* 小圆点指示器 */
.banner-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 25px;
    position: relative;
    z-index: 9999;
    margin: 10px 0;
}

.banner-dots span {
    width: 10px;
    height: 10px;
    background: #d5d5d5;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, opacity 0.3s;
}

.banner-dots span.active {
    background: #333;
}

/* ============================
   首页推荐栏（横向滑动）
============================ */
.home-slider {
    margin-top: 30px;
    padding: 20px 0;
    background: #ffe4ec;
    border-radius: 12px;
}

.slider-title {
    font-size: 22px;
    font-weight: 550;
    padding-left: 20px;
    margin-bottom: 10px;
}

.slider-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding: 10px 0;
    scrollbar-width: none;
}

.slider-scroll::-webkit-scrollbar {
    display: none;
}

.slider-item {
    width: 225px;
    height: 348px;
    background: #fff;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.slider-img {
    width: 225px;
    height: 217px;   /* 商品图保持原来的高度 */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 广告图铺满整个框 */
.ad-img {
    height: 348px;      /* 和 slider-item 一样高 */
    margin-bottom: 0;   /* 去掉底部间距 */
    border-radius: 10px;
}

.slider-name {
    margin-top: 8px;
    font-size: 14px;
    color: #333;
    padding: 0 10px;
}

.slider-price {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #e60023;
    padding: 0 10px;
}

/* 外层包裹容器（用于定位箭头） */
.slider-wrapper {
    position: relative;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.30);
    cursor: pointer;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.left-arrow {
    left: 5px;
    display: none;
}

.right-arrow {
    right: 5px;
}

.slider-inner {
    padding: 0 20px;
    overflow: hidden;
}

/* ============================
   底部按钮（仅返回顶部）
============================ */
.bottom-btn-row {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.back-to-top-btn {
    width: 120px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: #e6e6e6;
    color: #333;
    border-radius: 8px;
    border: 1px solid #ccc;
    text-decoration: none;
    font-size: 15px;
}

.back-to-top-btn:hover {
    background: #dcdcdc;
}

/* ============================
   页面容器
============================ */
.home-page {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
