/* ========== 基础 ========== */
:root {
    --primary: #e60012; /* 经典正红 */
    --hover: #c5000f;
    --text: #333;
    --text-light: #888;
    --bg: #f5f5f5;
    --border: #eee;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Microsoft YaHei', sans-serif; }
body { background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ========== 头部 ========== */
.header-top { background: #fff; padding: 20px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; }

.search-bar { flex: 1; max-width: 500px; }
.search-form { display: flex; border: 2px solid var(--primary); border-radius: 2px; overflow: hidden; }
.search-input-wrap { display: flex; flex: 1; background: #fff; align-items: center; }
.search-type { border: none; outline: none; padding: 0 10px; font-size: 14px; color: #666; border-right: 1px solid #eee; }
.search-input-wrap input { border: none; outline: none; padding: 10px; flex: 1; font-size: 14px; }
.search-form button { background: var(--primary); color: #fff; border: none; padding: 0 20px; cursor: pointer; font-size: 16px; }
.search-form button:hover { background: var(--hover); }

.header-right { display: flex; flex-direction: column; align-items: flex-end; }
.hotline { color: var(--primary); font-size: 20px; font-weight: bold; margin-bottom: 5px; }
.user-actions { display: flex; gap: 15px; font-size: 13px; color: #666; }
.cart-btn { color: var(--primary); font-weight: bold; }
.badge { background: var(--primary); color: #fff; padding: 2px 6px; border-radius: 10px; font-size: 12px; }

/* ========== 主导航 ========== */
.main-nav { background: var(--primary); border-bottom: 2px solid var(--hover); }
.nav-inner { display: flex; align-items: center; height: 44px; }
.all-categories-btn { width: 180px; background: #d90011; color: #fff; height: 100%; display: flex; align-items: center; padding-left: 20px; font-weight: bold; gap: 10px; }
.nav-links { display: flex; flex: 1; padding-left: 20px; gap: 30px; }
.nav-links a { color: #fff; font-size: 16px; font-weight: bold; }
.nav-links a:hover { color: #ffcccc; }

/* ========== 首屏 ========== */
.main-content { margin-top: 15px; margin-bottom: 50px; }
.home-top-section { display: flex; gap: 15px; margin-bottom: 20px; position: relative; }

/* 侧边栏悬浮菜单 */
.side-categories { width: 180px; background: #fff; border: 1px solid var(--border); position: relative; z-index: 100; }
.side-cat-item { position: relative; }
.side-cat-link { display: flex; justify-content: space-between; padding: 12px 15px; font-size: 14px; color: #333; }
.side-cat-item:hover .side-cat-link { background: #f9f9f9; color: var(--primary); padding-left: 20px; }
.side-cat-link i { color: #ccc; font-size: 12px; }

/* ========== 悬浮菜单（图二复刻版） ========== */
.side-cat-dropdown {
    display: none;
    position: absolute;
    left: 180px; /* 对应左侧菜单宽度 */
    top: 0;
    width: 750px; /* 按照图二的宽度放大 */
    background: #fff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    padding: 20px 30px;
    z-index: 1000;
    min-height: 100%;
}
.side-cat-item:hover .side-cat-dropdown { display: block; }

.dropdown-inner { display: flex; flex-direction: column; }
.dropdown-row { 
    display: flex; 
    align-items: flex-start; 
    border-bottom: 1px dotted #cbd5e1; /* 细虚线分割 */
    padding: 15px 0; 
}
.dropdown-row:last-child { border-bottom: none; }

/* 左侧：二级分类大标题 */
.dropdown-title { 
    width: 120px; 
    flex-shrink: 0; 
    font-size: 15px; 
    font-weight: bold; 
    color: #9f1239; /* 暗红色 */
    display: flex; 
    justify-content: flex-start; 
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.dropdown-title i { font-size: 12px; color: #9f1239; }
.dropdown-title:hover { color: #e60012; }

/* 右侧：三级分类小字平铺 */
.dropdown-links { 
    flex: 1; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px 20px; /* 行距和列距 */
    padding-left: 10px;
}
.dropdown-links a { 
    font-size: 13px; 
    color: #334155; 
    white-space: nowrap;
    text-decoration: none;
}
.dropdown-links a:hover { color: #e60012; }

/* 轮播图 */
.banner-slider { flex: 1; position: relative; overflow: hidden; background: #fff; }
.slides { position: relative; width: 100%; height: 400px; }
.slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; }
.slider-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.slider-dots span.active { background: var(--primary); border: 2px solid #fff; }

/* ========== 楼层展示 ========== */
.floor-section { margin-bottom: 20px; background: #fff; padding: 30px 20px; }
.floor-header { text-align: center; position: relative; margin-bottom: 30px; }
.floor-header::after { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 0px; background: #eee; z-index: 1; }
.floor-title { display: inline-block; background: var(--primary); color: #fff; padding: 5px 40px; font-size: 20px; position: relative; z-index: 2; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0% 100%); }

.floor-tabs { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.tab-item { padding: 6px 20px; background: #f5f5f5; color: #333; font-size: 14px; border-radius: 2px; }
.tab-item:hover { background: var(--primary); color: #fff; }

/* 网格系统 */
.product-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; }
.product-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.product-card { background: #fff; border: 1px solid transparent; padding: 10px; transition: 0.3s; display: flex; flex-direction: column; text-align: center; }
.product-card:hover { border-color: var(--border); box-shadow: 0 5px 15px rgba(0,0,0,0.05); transform: translateY(-2px); }
.product-img-wrap { width: 100%; aspect-ratio: 1; overflow: hidden; margin-bottom: 10px; background: #f9f9f9; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.product-name { font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; font-weight: normal; }
.product-price { color: var(--primary); font-size: 20px; font-weight: bold; }
.product-price span { font-size: 14px; margin-right: 2px; }

/* ========== 超级页脚 ========== */
.site-footer { background: #fff; margin-top: 40px; }
.footer-promises { display: flex; justify-content: space-around; padding: 30px 0; border-bottom: 1px solid #eee; }
.promise-item { display: flex; align-items: center; gap: 15px; }
.promise-icon { font-size: 40px; color: var(--primary); }
.promise-text h4 { font-size: 16px; margin-bottom: 5px; color: #333; }
.promise-text p { font-size: 13px; color: #999; }

.footer-links-wrap { background: #fafafa; padding: 40px 0; border-bottom: 1px solid #eee; }
.footer-links-inner { display: flex; justify-content: space-between; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 15px; margin-bottom: 10px; color: #333; }
.footer-col a { font-size: 13px; color: #888; }
.footer-col a:hover { color: var(--primary); }

.footer-contact { display: flex; align-items: center; gap: 40px; }
.footer-qrcode { text-align: center; }
.footer-qrcode img { width: 90px; height: 90px; margin-bottom: 5px; }
.footer-qrcode p { font-size: 12px; color: #888; }
.footer-hotline p { font-size: 14px; color: #888; margin-bottom: 5px; }
.footer-hotline strong { display: block; font-size: 22px; color: var(--primary); font-family: Arial; }

.footer-bottom { padding: 20px 0; text-align: center; font-size: 13px; color: #888; }
.footer-bottom a { color: #888; margin: 0 5px; }
.copyright { margin-top: 10px; color: #aaa; }

/* ========== 提示框 ========== */
.alert { padding: 10px 15px; margin-bottom: 20px; border-radius: 4px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ========== 响应式 (移动端) ========== */
@media (max-width: 992px) {
    .side-cat-dropdown { display: none !important; }
    .product-grid-5 { grid-template-columns: repeat(3, 1fr); }
    .product-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-links-inner { flex-wrap: wrap; gap: 30px; }
    .footer-contact { width: 100%; justify-content: flex-start; margin-top: 20px; }
}

@media (max-width: 768px) {
    .header-inner { flex-direction: column; }
    .search-bar { width: 100%; max-width: none; }
    .header-right { align-items: center; width: 100%; }
    .hotline { display: none; }
    
    .nav-inner { overflow-x: auto; white-space: nowrap; }
    .all-categories-btn { display: none; }
    .nav-links { padding-left: 0; gap: 15px; }
    
    .home-top-section { flex-direction: column; }
    .side-categories { display: none; }
    .slides { height: 200px; }
    
    .product-grid-5 { grid-template-columns: repeat(2, 1fr); }
    .floor-section { padding: 15px; }
    .floor-title { font-size: 18px; padding: 5px 20px; }
    
    .footer-promises { flex-wrap: wrap; gap: 20px; }
    .promise-item { width: 45%; }
}
/* ========== 悬浮菜单修复增强版 ========== */
.side-cat-dropdown {
    display: none;
    position: absolute;
    left: 180px;
    top: 0;
    width: 650px; /* 加宽面板 */
    min-height: 100%;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    padding: 10px 20px;
    z-index: 1000;
}
.side-cat-item:hover .side-cat-dropdown { display: block; }

.dropdown-inner { display: flex; flex-direction: column; }
.dropdown-row { 
    display: flex; 
    align-items: flex-start; 
    border-bottom: 1px dashed #f1f5f9; 
    padding: 12px 0; 
}
.dropdown-row:last-child { border-bottom: none; }

/* 左侧：二级分类名 */
.dropdown-title { 
    font-weight: 600; 
    font-size: 14px; 
    color: #333; 
    width: 120px; 
    flex-shrink: 0; 
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    white-space: nowrap;
}
.dropdown-title:hover { color: var(--primary); }

/* 右侧：三级分类平铺 */
.dropdown-links { 
    flex: 1; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px 20px; 
    padding-left: 15px;
    border-left: 1px solid #f1f5f9; 
    align-content: flex-start;
    padding-top: 2px;
}
.dropdown-links a { 
    font-size: 13px; 
    color: #666; 
    white-space: nowrap; 
}
.dropdown-links a:hover { color: var(--primary); }
/* ========== 悬浮菜单全量平铺版 ========== */
.side-cat-dropdown {
    display: none;
    position: absolute;
    left: 180px;
    top: 0;
    width: 680px; /* 加宽以适应大量分类 */
    min-height: 100%;
    background: #fff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    padding: 15px 25px;
    z-index: 1000;
}
.side-cat-item:hover .side-cat-dropdown { display: block; }

.dropdown-inner { display: flex; flex-direction: column; gap: 10px; }
.dropdown-row { 
    display: flex; 
    align-items: flex-start; 
    padding: 5px 0;
}

/* 左侧：全部按钮 */
.dropdown-title { 
    width: 120px; 
    flex-shrink: 0; 
    padding-right: 15px;
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

/* 右侧：所有子孙分类平铺 */
.dropdown-links { 
    flex: 1; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px 18px; 
    padding-left: 15px;
    border-left: 1px solid #f1f5f9; 
}
.dropdown-links a { 
    font-size: 13px; 
    color: #666; 
    white-space: nowrap; 
    transition: 0.2s;
}
.dropdown-links a:hover { color: var(--primary); }
/* 商品详情页辅助 */
.attr-btn.active {
    border-color: #e60012 !important;
    color: #e60012 !important;
    font-weight: bold;
}
.thumb-btn.active {
    border-color: #e60012 !important;
}
.btn-add-cart:hover {
    background: #c5000f !important;
}
/* ========== 购物车 / 订单 / 会员中心 专用样式 ========== */
.data-table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 20px; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; vertical-align: middle; }
.data-table th { background: #f8f8f8; font-weight: 600; color: #333; font-size: 14px; }
.data-table td { font-size: 14px; color: #555; }

/* 购物车商品图片 */
.cart-product { display: flex; align-items: center; gap: 15px; }
.cart-product img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; }

/* 数量输入框 */
.qty-input { width: 60px; padding: 6px; text-align: center; border: 1px solid #ddd; border-radius: 4px; outline: none; }

/* 结算栏 */
.cart-footer { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #eee; flex-wrap: wrap; gap: 15px; }
.cart-total { display: flex; align-items: center; gap: 20px; }
.total-amount { color: #e60012; font-size: 24px; font-weight: bold; }

/* 空状态 */
.empty-cart { text-align: center; padding: 60px 0; background: #fff; border-radius: 8px; }
.empty-cart i { font-size: 60px; color: #ddd; margin-bottom: 15px; }
.empty-cart p { color: #999; font-size: 16px; margin-bottom: 20px; }

/* 订单与会员信息块 */
.info-block p { margin-bottom: 10px; font-size: 14px; color: #333; }
.info-block .label { color: #888; display: inline-block; min-width: 80px; }
.order-tags { margin-top: 15px; display: flex; gap: 10px; }
.order-total { text-align: right; margin-top: 20px; font-size: 16px; }

/* 支付信息块 */
.pay-info { background: #f8f8f8; padding: 20px; border-radius: 8px; margin: 20px 0; border: 1px dashed #ddd; }
.pay-info-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.pay-info-row:last-child { margin-bottom: 0; }

/* 会员中心顶部 */
.member-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.balance-label { color: #888; font-size: 14px; }
.balance-amount { color: #e60012; font-size: 28px; font-weight: bold; margin: 10px 0; }

/* 统一表单与按钮 (补齐前端) */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 14px; color: #333; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; outline: none; font-size: 14px; box-sizing: border-box; }
.form-group input:focus { border-color: #e60012; }
.btn-block { width: 100%; display: block; text-align: center; box-sizing: border-box; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-success { background: #10b981; color: #fff; border: none; }
.btn-success:hover { background: #059669; }
/* ========== 登录 / 注册页专用 ========== */
.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 40px 20px;
    background: #f5f5f5;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.auth-card .card-title {
    justify-content: center;
    font-size: 22px;
    border-bottom: none;
    margin-bottom: 25px;
    color: #333;
}

.auth-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-hint a {
    color: #e60012;
    font-weight: bold;
}

/* 登录注册输入框统一放大 */
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
    padding: 12px 15px;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.auth-card input:focus {
    border-color: #e60012;
    box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.1);
}

.auth-card .btn-primary {
    background: #e60012;
    border-color: #e60012;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
}
.auth-card .btn-primary:hover {
    background: #c5000f;
    border-color: #c5000f;
}
/* ==========================================
   前端商品详情 - 规格与SKU图片专属修复
   ========================================== */

/* 规格组 */
.attr-group { margin-bottom: 20px; }
.attr-label { font-weight: 600; color: #333; margin-bottom: 10px; display: block; font-size: 14px; }
.attr-values { display: flex; gap: 10px; flex-wrap: wrap; }

/* 规格按钮（默认与选中状态） */
.attr-btn {
    padding: 8px 18px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.attr-btn:hover {
    border-color: #e60012;
    color: #e60012;
}
.attr-btn.active {
    border-color: #e60012 !important;
    color: #e60012 !important;
    font-weight: bold;
    background: #fff5f5 !important;
}

/* SKU 缩略图图片（前端展示时） */
.sku-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 10px;
    border: 1px solid #eee;
}

/* 多图缩略图高亮 */
.thumb-btn { transition: all 0.2s; }
.thumb-btn.active {
    border-color: #e60012 !important;
}
/* 子分类导航高亮悬浮 */
.sub-category-nav a:hover {
    border-color: #e60012;
    color: #e60012;
}
/* ========== 导航栏“更多”下拉菜单 ========== */
.nav-more-dropdown {
    position: relative;
    display: inline-block;
}

.nav-more-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

/* 悬浮或点击时显示下拉面板 */
.nav-more-dropdown:hover .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉面板样式 */
.nav-more-menu {
    position: absolute;
    top: 100%;
    right: 0; /* 靠右对齐 */
    background: #fff;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    border-radius: 0 0 6px 6px;
    padding: 10px 0;
    z-index: 999;
    
    /* 初始隐藏与动画 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
}

/* 下拉菜单里的链接 */
.nav-more-menu a {
    display: block !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    color: #333 !important;
    font-weight: normal !important;
    text-align: left;
    white-space: nowrap;
}

.nav-more-menu a:hover {
    background: #f5f5f5 !important;
    color: #e60012 !important;
}

/* 移动端兼容：靠左对齐并加宽 */
@media (max-width: 768px) {
    .nav-more-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
}
/* ==========================================
   前端商品列表网格强制修复
   ========================================== */
.product-list-wrap .product-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
}

.product-list-wrap .product-card {
    background: #fff !important;
    border: 1px solid #eee !important;
    padding: 15px !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: 0.3s !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.product-list-wrap .product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px) !important;
}

.product-list-wrap .product-img-wrap {
    width: 100% !important;
    height: 220px !important; /* 固定高度，防止图片撑破 */
    background: #f8f8f8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}

.product-list-wrap .product-img-wrap img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.product-list-wrap .product-info {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

.product-list-wrap .product-name {
    font-size: 14px !important;
    color: #333 !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
    height: 40px !important; /* 固定文字高度，防止长短不一错位 */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    font-weight: normal !important;
}

.product-list-wrap .product-price {
    color: #e60012 !important;
    font-size: 20px !important;
    font-weight: bold !important;
    margin-top: auto !important;
}

.product-list-wrap .product-price span {
    font-size: 14px !important;
    margin-right: 2px !important;
}

/* 手机端兼容 */
@media (max-width: 992px) {
    .product-list-wrap .product-grid-4 { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .product-list-wrap .product-grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .product-list-wrap .product-img-wrap { height: 150px !important; }
}
/* ==========================================
   前端商品卡片布局 终极强制修复 (防错位/防文字撑爆)
   ========================================== */

/* 1. 强制网格布局 */
.product-grid-4, .product-grid-5 {
    display: grid !important;
    gap: 20px !important;
    width: 100% !important;
}
.product-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}
.product-grid-5 {
    grid-template-columns: repeat(5, 1fr) !important;
}

/* 2. 卡片基础外壳 */
.product-card {
    background: #fff !important;
    border: 1px solid #eee !important;
    padding: 15px !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: 0.3s !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-decoration: none !important;
}
.product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    transform: translateY(-2px) !important;
}

/* 3. 图片区域：锁死高度 */
.product-img-wrap {
    width: 100% !important;
    height: 200px !important; /* 强制固定高度 */
    background: #f8f8f8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 15px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
}
.product-img-wrap img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* 4. 信息区域 */
.product-info {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    flex: 1 !important;
}

/* 5. 商品标题：强制最多显示两行，超出打点 */
.product-name {
    font-size: 14px !important;
    color: #333 !important;
    margin-bottom: 10px !important;
    line-height: 1.4 !important;
    height: 40px !important; /* 固定高度 */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    font-weight: normal !important;
    word-break: break-all !important;
}

/* 6. 价格：推到最底部 */
.product-price {
    color: #e60012 !important;
    font-size: 20px !important;
    font-weight: bold !important;
    margin-top: auto !important;
}
.product-price span {
    font-size: 14px !important;
    margin-right: 2px !important;
}

/* 7. 手机端强制缩小 */
@media (max-width: 992px) {
    .product-grid-4, .product-grid-5 { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .product-grid-4, .product-grid-5 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .product-img-wrap { height: 150px !important; }
    .product-name { font-size: 13px !important; height: 36px !important; }
    .product-price { font-size: 18px !important; }
}


/* ==========================================
   首页与列表页 商品网格终极暴力修复
   ========================================== */

/* 1. 强制把容器变成 4列/5列的网格 */
.container .product-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 4列 */
    gap: 20px !important;
    width: 100% !important;
}

.container .product-grid-5 {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important; /* 5列 */
    gap: 15px !important;
    width: 100% !important;
}

/* 2. 锁定商品卡片的宽度 */
.container .product-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #fff !important;
    padding: 10px !important;
    border: 1px solid #eee !important;
    border-radius: 6px !important;
}

/* 3. 强制标题不换行、宽度100%、并且限制2行带省略号 */
.container .product-card .product-name {
    width: 100% !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    word-break: break-all !important;
    text-align: left !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    height: 39px !important; /* 13px * 1.5 * 2 = 39px */
    margin-bottom: 8px !important;
    padding: 0 !important;
}

/* 4. 强制图片缩放 */
.container .product-card .product-img-wrap {
    width: 100% !important;
    height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}
.container .product-card .product-img-wrap img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* 5. 强制价格在底部 */
.container .product-card .product-price {
    margin-top: auto !important;
    color: #e60012 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    text-align: left !important;
}

/* 6. 手机端网格自适应 */
@media (max-width: 992px) {
    .container .product-grid-4, .container .product-grid-5 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .container .product-grid-4, .container .product-grid-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .container .product-card .product-img-wrap { height: 150px !important; }
}