/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background: #e9e9e9;
    color: #666666;
    font-family: 'RobotoDraft', 'Roboto', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航栏整体样式 */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative; /* 为下拉菜单定位做准备 */
}

/* 左侧品牌/导航标题 */
.navbar-logo {
    margin-left: 30px;
    font-size: 20px;
    font-weight: bold;
}

/* 右侧用户信息容器 */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 用户名下拉容器 */
.user-dropdown {
    position: relative; /* 下拉菜单基于此定位 */
    cursor: pointer; /* 鼠标移上去显示手型 */
}

/* 用户名文本样式 */
.user-name {
    font-size: 18px;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    top: 100%; /* 紧贴用户名下方 */
    background-color: white;
    color: #333;
    width: 88px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 8px 0;
    opacity: 0; /* 初始隐藏 */
    visibility: hidden; /* 初始不可见（避免点击） */
    transition: all 0.3s ease; /* 平滑显示/隐藏 */
    z-index: 999; /* 确保在最上层 */
}

/* 悬停时显示下拉菜单 */
.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* 下拉菜单项样式 */
.dropdown-menu li a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

/* 菜单项悬停效果 */
.dropdown-menu li a:hover {
    background-color: #f5f5f5;
}

/* 金额文本样式 */
.user-balance {
    font-size: 14px;
    color: #f1c40f;
    font-weight: bold;
}

/* 退出登录按钮样式 */
.logout-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}


/* 货盘核心样式：精致感设计 */
/* 容器样式：让货盘整齐排列，自适应布局 */
.pallet-container {

    width: 100%;
    display: grid;
    /* 核心：每列最小宽度150px，自动填充，最多5列 */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* 限制最大列数为5 */
    gap: 1px;
    padding: 30px;
    box-sizing: border-box;
    justify-content: center;
    justify-items: center;
}

/* 货盘核心样式：精致感设计 */
.pallet-item {
    width: 280px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
}

/* 鼠标悬浮效果 */
.pallet-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #2196f3;
}

/* 商品图片区域 */
.pallet-img-box {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pallet-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pallet-item:hover .pallet-img {
    transform: scale(1.05);
}

/* 商品信息区域 */
.pallet-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pallet-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pallet-stock {
    font-size: 12px;
    color: #666;
}

.pallet-price-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pallet-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.pallet-discount-price {
    font-size: 18px;
    font-weight: 700;
    color: #e53935;
}

/* 数量操作区域 */
.pallet-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #f5f5f5;
    border-color: #2196f3;
}

.quantity-input {
    width: 50px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    outline: none;
}

.quantity-input:focus {
    border-color: #2196f3;
}

/* 购买按钮区域 */
.pallet-btns {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.cart-btn, .buy-btn {
    flex: 1;
    height: 40px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-btn {
    background-color: #fff;
    border: 1px solid #2196f3;
    color: #2196f3;
}

.cart-btn:hover {
    background-color: #e3f2fd;
}

.buy-btn {
    background-color: #2196f3;
    color: #fff;
}

.buy-btn:hover {
    background-color: #1976d2;
}

/* 当屏幕宽度小于等于768px（移动端）时应用的样式 */
@media screen and (max-width: 768px) {
}