﻿
/* 全局主色调定义：清爽的深蓝色 #165DFF */
:root {
    --primary-color: #165DFF;
    --primary-light: #4080FF; /* hover浅一点的蓝色 */
    --bg-color: #F5F7FA; /* 页面背景浅灰，搭配深蓝色更协调 */
    --price-color: #e63946; /* 价格红色 */
}

/* 页面整体背景：浅灰底+低饱和度电商背景图 */
body {
    background-color: var(--bg-color);
    background-image: url('https://picsum.photos/id/1060/1920/1080'); /* 适配电商的浅蓝调背景图 */
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-blend-mode: overlay; /* 背景图和底色融合，不刺眼 */
}

/* 头部样式：LOGO+搜索栏，主色调适配 */
.header {
    background: rgba(255, 255, 255, 0.95); /* 半透明白色，突出背景图又不影响阅读 */
    padding: 12px 0;
    border-bottom: 2px solid var(--primary-color); /* 底部深蓝色边框，强化主色调 */
    box-shadow: 0 2px 8px rgba(22, 93, 255, 0.1);
}
/* LOGO图片自适应样式：核心修改 */
.logo-img {
    display: inline-block;
    max-height: 40px; /* 限制LOGO最大高度，适配头部高度 */
    width: auto; /* 宽度自动，保持图片比例 */
    max-width: 200px; /* 限制最大宽度，防止LOGO过宽 */
    margin-right: 20px;
}
/* 搜索栏样式：主色调美化 */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 15px 0 40px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s;
}

    .search-input:focus {
        border-color: var(--primary-color); /* 聚焦时边框变主色调 */
        box-shadow: 0 0 5px rgba(22, 93, 255, 0.2); /* 浅蓝阴影 */
    }

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color); /* 搜索图标用主色调 */
    font-size: 16px;
}

/* 公告栏样式：醒目设计 */
.notice-bar {
    background: linear-gradient(90deg, #fff1f0, #ffeBE8); /* 浅红渐变背景，醒目不刺眼 */
    border: 1px solid var(--price-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

    .notice-bar .notice-title {
        color: var(--price-color);
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
    }

        .notice-bar .notice-title i {
            margin-right: 8px;
        }

    .notice-bar .notice-content {
        color: #333;
        font-size: 14px;
        line-height: 1.8; /* 行高增大，阅读更舒适 */
    }

        .notice-bar .notice-content p {
            margin: 0;
            padding-left: 24px; /* 缩进，排版更整齐 */
        }

/* 商品容器：白色背景，突出商品 */
.product-section {
    padding: 30px 0;
}

.product-wrap {
    background: rgba(255, 255, 255, 0.9); /* 半透明白色容器，适配背景图 */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
/* 商品样式：名称超出一行隐藏，价格红色放大 */
.product-item {
    margin-bottom: 25px;
    text-align: center;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

    .product-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(22, 93, 255, 0.1); /* hover时浅蓝阴影 */
        border-color: var(--primary-light);
    }

    .product-item img {
        width: 100%;
        height: 180px; /* 固定高度，保证所有商品卡片一样高 */
        object-fit: cover; /* 自动裁剪，不变形 */
        object-position: center; /* 永远居中显示 */
        border-radius: 4px;
        margin-bottom: 10px;
    }
    /* 商品名称超出一行隐藏 */
    .product-item h5 {
        font-size: 15px;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 8px;
    }
    /* 价格样式：红色+放大 */
    .product-item p {
        font-size: 18px; /* 价格放大（原14px） */
        color: var(--price-color); /* 价格恢复红色 */
        font-weight: 700; /* 加粗，更醒目 */
        margin: 0;
    }

    .product-item-col a {
        text-decoration: none;
        color: inherit;
        display: block; /* 让 a 标签占满整个商品卡片区域 */
    }

/* 底部APP式导航：主色调适配，仅手机端显示 */
.mobile-footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95); /* 半透明白色 */
    border-top: 2px solid var(--primary-color); /* 顶部深蓝色边框 */
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 999;
}

    .mobile-footer-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #666;
        font-size: 12px;
        transition: color 0.2s;
    }

        .mobile-footer-nav a i {
            font-size: 18px;
            margin-bottom: 3px;
        }

        .mobile-footer-nav a.active,
        .mobile-footer-nav a:hover {
            color: var(--primary-color); /* 激活/hover时变主色调 */
        }

/* 响应式：手机端适配 */
@media (max-width: 768px) {
    .product-item-col {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .mobile-footer-nav {
        display: flex;
    }

    body {
        padding-bottom: 60px;
    }

    .search-box {
        max-width: none;
    }

    .product-wrap {
        padding: 15px;
    }
    /* 手机端公告栏适配 */
    .notice-bar {
        padding: 12px 15px;
    }

        .notice-bar .notice-title {
            font-size: 15px;
        }

        .notice-bar .notice-content {
            font-size: 13px;
        }
    /* 手机端价格再放大一点 */
    .product-item p {
        font-size: 17px;
    }
    /* 手机端LOGO自适应 */
    .logo-img {
        max-height: 35px; /* 手机端LOGO高度略减小 */
        max-width: 150px; /* 限制手机端最大宽度 */
    }
}

/* PC端样式 */
@media (min-width: 769px) {
    .product-item-col {
        flex: 0 0 33.3333%;
        max-width: 33.3333%;
    }
}
