/* PC 端自定义首页 —— 大气简洁版 */
:root {
    --main: #16a34a;
    --main-dark: #12833b;
    --price: #e4393c;
    --text: #222;
    --text-2: #666;
    --text-3: #999;
    --line: #eee;
    --bg: #f5f6f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }

.wrap { width: 1200px; max-width: 100%; margin: 0 auto; }

/* 顶部 */
/* 顶部黑色导航条（与详情页 Nuxt 原生黑条一致） */
.pcx-blackbar { background: #282828; border-bottom: 1px solid #1c1c1c; }
.pcx-blackbar .wrap { display: flex; align-items: center; height: 40px; max-width: 1200px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.pcx-blackbar a { color: #ccc; text-decoration: none; white-space: nowrap; margin-left: 18px; font-size: 13px; line-height: 40px; transition: color .15s; }
.pcx-blackbar a:hover { color: #16a34a; }
.pcx-blackbar .bb-fav { margin-left: 0; color: #bbb; }
.pcx-blackbar .bb-flex { flex: 1; }
.pcx-blackbar .bb-user, .pcx-blackbar .bb-cart { color: #fff; }
.pcx-blackbar .bb-cart { font-weight: 600; }
@media (max-width: 768px) {
  .pcx-blackbar .wrap { overflow-x: auto; }
  .pcx-blackbar .wrap::-webkit-scrollbar { display: none; }
  .pcx-blackbar .bb-fav { display: none; }
}

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
/* 三栏等分布局：LOGO 左 / 搜索居中 / 菜单右，整行垂直居中 */
.topbar .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 84px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 12px; justify-self: start; min-width: 0; }
/* 固定 52px 高 + 宽度上限，任何比例的图片都不会撑高头部、不会挤压搜索框 */
.logo img {
    height: 52px; width: auto; max-width: 280px; object-fit: contain; object-position: left center;
    display: block;
}
.logo-text { font-size: 25px; font-weight: 500; letter-spacing: 2px; color: var(--main-dark); white-space: nowrap; }

.search { flex: 1; display: flex; width: 560px; max-width: 100%; justify-self: center; }
.search input {
    flex: 1; height: 42px; padding: 0 16px; font-size: 14px;
    border: 2px solid var(--main); border-right: 0; border-radius: 4px 0 0 4px; outline: none;
}
.search button {
    width: 96px; height: 42px; border: 0; cursor: pointer; color: #fff;
    background: var(--main); font-size: 15px; border-radius: 0 4px 4px 0;
}
.search button:hover { background: var(--main-dark); }

.top-links { display: flex; align-items: center; gap: 20px; color: var(--text-2); justify-self: end; }
/* 统一高度，保证所有链接文字在同一基线上 */
.top-links a { display: inline-flex; align-items: center; height: 34px; line-height: 1; white-space: nowrap; }
.top-links a:hover { color: var(--main); }
.top-links .btn-login { color: var(--price); font-weight: 700; font-size: 15px; }
.top-links .btn-login:hover { color: var(--price); text-decoration: underline; }

/* 分类导航条：浅绿底色 + 居中 */
.navbar { background: #eef6f1; border-bottom: 1px solid #dcebe2; }
.navbar .wrap { display: flex; align-items: center; justify-content: center; height: 52px; gap: 8px; overflow-x: auto; }
.navbar .wrap::-webkit-scrollbar { display: none; }

.nav-cate { display: flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; }
.nav-all {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 20px; border-radius: 4px;
    background: var(--main); color: #fff; font-size: 15px; line-height: 1;
    margin-right: 10px; flex-shrink: 0; white-space: nowrap;
}
.nav-all:hover { background: var(--main-dark); }
.nav-cate a {
    display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 4px;
    font-size: 15px; line-height: 1; color: #2f4a3c; white-space: nowrap;
    letter-spacing: 1px; transition: background .15s, color .15s;
}
.nav-cate a:hover { background: #fff; color: var(--main-dark); box-shadow: 0 1px 5px rgba(22, 163, 74, .12); }

/* 轮播：按图片比例自适应，避免裁切 */
/* 轮播：默认按 10:3（1200 x 360，比原来的 24:5 高一些），再由 JS 按当前图片的
   真实宽高比微调高度（见 pc_index.js fitBanner），保证任何尺寸的上传图都不被
   拉伸或大幅裁切。 */
.banner { position: relative; margin: 18px auto 0; aspect-ratio: 10 / 3; max-height: 460px; overflow: hidden; border-radius: 8px; background: #fff; }
.banner .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; }
.banner .slide.on { opacity: 1; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner .arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px;
    background: rgba(0, 0, 0, .3); color: #fff; border: 0; cursor: pointer; font-size: 20px;
    display: none; align-items: center; justify-content: center;
}
.banner:hover .arrow { display: flex; }
.banner .arrow.prev { left: 0; border-radius: 0 6px 6px 0; }
.banner .arrow.next { right: 0; border-radius: 6px 0 0 6px; }
.banner .dots {
    position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 8px;
}
.banner .dots i {
    width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .6); cursor: pointer;
}
.banner .dots i.on { background: var(--main); width: 24px; border-radius: 5px; }

/* 板块 */
.section { background: #fff; border-radius: 8px; margin-top: 18px; padding: 20px 22px 26px; }
.sec-head { display: flex; align-items: center; margin-bottom: 18px; }
.sec-head h2 {
    font-size: 20px; font-weight: 500; margin: 0; padding-left: 12px;
    border-left: 4px solid var(--main); line-height: 1.2;
}
.sec-head .more { margin-left: auto; color: var(--text-3); font-size: 13px; }
.sec-head .more:hover { color: var(--main); }
.sec-head .sub { color: var(--text-3); font-size: 13px; margin-left: 12px; font-weight: 400; }

/* 商品网格：宽屏一行 6 个，按屏幕宽度逐级减少 */
.goods-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.goods {
    position: relative; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden;
    transition: transform .18s, box-shadow .18s; display: block;
}
/* 秒杀角标 */
.goods .tag {
    position: absolute; top: 0; left: 0; z-index: 1;
    background: var(--price); color: #fff; font-size: 12px; line-height: 1;
    padding: 5px 10px; border-radius: 6px 0 8px 0; letter-spacing: 1px;
}
.goods.seckill:hover { box-shadow: 0 8px 20px rgba(228, 57, 60, .18); }
.sec-head .timer { color: var(--price); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 精品推荐：左侧 5 列商品（可多行） + 右侧 1 个广告位
   用 flex 而非 grid：商品区行数随后台配置的推荐数量自动变化，
   广告位靠 align-items:stretch 自动等高，不需要预先算出行数。
   宽度推演：容器 1156px = 5 卡 x 178 + 广告 186 + 5 间距 x 16
   卡宽由 179.3px 变为 178px，仅差 1.3px，商品尺寸无需调整 */
.rec-wrap { display: flex; align-items: stretch; gap: 16px; }
.rec-goods {
    flex: 1 1 auto; min-width: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
/* 未配置广告图时，退回一行 6 个商品，不留空白 */
.rec-wrap.no-ad .rec-goods { grid-template-columns: repeat(6, 1fr); }
.rec-ad {
    position: relative; overflow: hidden; border-radius: 6px; background: #fff;
    display: block; min-height: 0;
    /* 固定在最右侧，高度自动等于左侧商品区的总高度（配置 6~10 个时跨 2 行） */
    flex: 0 0 186px;
}
.rec-ad img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-ad:hover { opacity: .96; }

/* 秒杀：左侧场次时间块 + 右侧商品 */
.sk-wrap { display: grid; grid-template-columns: 186px 1fr; gap: 16px; }
.sk-side {
    background: #e4393c; color: #fff; border-radius: 6px; padding: 14px 12px;
    display: flex; flex-direction: column; align-self: start;
}
.sk-title { font-size: 17px; font-weight: 500; letter-spacing: 2px; line-height: 1.2; }
.sk-now { margin-top: 4px; font-size: 12px; opacity: .92; }
.sk-count { margin-top: 10px; }
.sk-count span { display: block; font-size: 11px; opacity: .9; }
.sk-count .timer {
    display: block; margin-top: 2px; font-size: 19px; font-weight: 700;
    letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.sk-slots { margin-top: 10px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.sk-slot {
    background: rgba(255, 255, 255, .16); border-radius: 4px; padding: 5px 2px; text-align: center;
}
.sk-slot.on { background: #fff; color: #e4393c; }
.sk-slot b { display: block; font-size: 13px; font-weight: 500; line-height: 1.2; }
.sk-slot em { display: block; font-size: 10px; font-style: normal; margin-top: 1px; opacity: .85; }
.sk-slot.on em { opacity: .75; }
.sk-all { margin-top: 10px; padding-top: 0; font-size: 12px; }
.sk-all:hover { text-decoration: underline; }
.sk-goods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.goods:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0, 0, 0, .1); }
.goods .pic { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; }
.goods .pic img { width: 100%; height: 100%; object-fit: contain; padding: 8px; display: block; }
.goods .info { padding: 10px 10px 12px; }
.goods .name {
    font-size: 13px; line-height: 1.45; height: 38px; overflow: hidden; color: #333;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.goods:hover .name { color: var(--main); }
.goods .price { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; }
.goods .price b { color: var(--price); font-size: 17px; font-weight: 500; }
.goods .price s { color: var(--text-3); font-size: 12px; }
.goods .sales { margin-top: 4px; color: var(--text-3); font-size: 12px; }

/* 楼层间距 */
.floor + .floor { margin-top: 18px; }

/* ============ 页脚（大气商务版） ============ */
.footer {
    margin-top: 24px;
    background: #0f2a1d;
    color: #b9cbc1;
    font-size: 13px;
    /* 顶部一条主色高光，收口更利落 */
    border-top: 3px solid var(--main);
}

/* 一、导航条 */
.foot-nav { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.foot-nav .wrap {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; height: 56px; gap: 0;
}
.foot-nav a {
    position: relative; padding: 0 22px; height: 56px; line-height: 56px;
    color: #d5e3da; font-size: 14px; white-space: nowrap; transition: color .15s;
}
.foot-nav a + a::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 1px; height: 12px; background: rgba(255, 255, 255, .16);
}
.foot-nav a:hover { color: var(--main); }

/* 二、四栏主体 */
.foot-main { padding: 40px 0 36px; }
.foot-main .wrap {
    display: grid;
    grid-template-columns: 264px 132px 132px minmax(240px, 1fr) auto;
    gap: 36px;
    align-items: start;
}

/* 品牌栏 */
.foot-brand { min-width: 0; align-self: center; }
.foot-logo { display: block; margin-bottom: 16px; }
.foot-logo img { height: 46px; width: auto; max-width: 240px; object-fit: contain; display: block; }
.foot-logo span { font-size: 24px; font-weight: 500; letter-spacing: 2px; color: #fff; line-height: 46px; display: block; }
.foot-slogan { margin: 0 0 18px; color: #8fa89a; font-size: 13px; line-height: 1.7; }
.foot-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-badges span {
    padding: 4px 10px; font-size: 12px; line-height: 1.4;
    color: #7fbf9a; border: 1px solid rgba(22, 163, 74, .38); border-radius: 3px;
    background: rgba(22, 163, 74, .08); white-space: nowrap;
}

/* 链接栏 */
.foot-links h4, .foot-contact h4 {
    margin: 0 0 18px; padding-bottom: 12px;
    font-size: 15px; font-weight: 500; color: #fff; position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.foot-links h4::after, .foot-contact h4::after {
    content: ""; position: absolute; left: 0; bottom: -1px;
    width: 28px; height: 2px; background: var(--main);
}
.foot-links a {
    display: block; height: 30px; line-height: 30px; color: #b9cbc1;
    transition: color .15s, transform .15s;
}
.foot-links a:hover { color: var(--main); transform: translateX(3px); }

/* 联系方式 */
.foot-contact p {
    margin: 0 0 12px; display: flex; gap: 10px; line-height: 1.7; color: #b9cbc1;
}
.foot-contact p span { flex: 0 0 auto; color: #7e9488; letter-spacing: 1px; white-space: nowrap; }
.foot-contact p em { font-style: normal; flex: 1; min-width: 0; word-break: break-word; }
.foot-contact p.foot-empty { color: #6b8578; font-size: 12px; line-height: 1.8; }

/* 二维码 */
.foot-qr { display: flex; gap: 20px; }
.qr-item { text-align: center; }
.qr-img {
    width: 108px; height: 108px; padding: 5px; background: #fff; border-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22); overflow: hidden;
}
.qr-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-tip { display: block; margin-top: 9px; font-size: 12px; color: #9db3a8; white-space: nowrap; }

/* 三、版权条 */
.foot-bottom {
    background: #0a1f15;
    border-top: 1px solid rgba(255, 255, 255, .07);
    padding: 20px 0;
}
.foot-bottom .wrap {
    display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.foot-bottom .copy { color: #7e9488; font-size: 13px; line-height: 1.8; flex: 1; min-width: 260px; }
.foot-bottom .copy a { color: #7e9488; }
.foot-bottom .copy a:hover { color: var(--main); }
.foot-bottom .copy .sep { margin: 0 8px; color: #3d5a4c; }

.hotline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hot-label { font-size: 12px; color: #7e9488; }
.hot-num {
    font-size: 26px; font-weight: 700; color: #f0b429; letter-spacing: .5px;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.hot-mobile { font-style: normal; font-size: 15px; color: #d5e3da; }

.empty { text-align: center; color: var(--text-3); padding: 40px 0; }

@media (max-width: 1240px) {
    .wrap { width: 96%; }
    .goods-grid { grid-template-columns: repeat(5, 1fr); }
    .rec-goods { grid-template-columns: repeat(4, 1fr); }
    .rec-wrap.no-ad .rec-goods { grid-template-columns: repeat(5, 1fr); }
    /* 页脚：品牌栏收窄 */
    .foot-main .wrap { grid-template-columns: 220px 120px 120px minmax(210px, 1fr) auto; gap: 26px; }
    .qr-img { width: 96px; height: 96px; }
}
@media (max-width: 1024px) {
    .goods-grid { grid-template-columns: repeat(4, 1fr); }
    .rec-goods { grid-template-columns: repeat(3, 1fr); }
    .rec-wrap.no-ad .rec-goods { grid-template-columns: repeat(4, 1fr); }
    .rec-ad { flex-basis: 168px; }
    .sk-wrap { grid-template-columns: 168px 1fr; }
    .sk-goods { grid-template-columns: repeat(4, 1fr); }
    /* 页脚：品牌栏独占一行，其余三栏 + 二维码 */
    .foot-main .wrap { grid-template-columns: 120px 120px minmax(220px, 1fr) auto; gap: 24px; }
    .foot-brand { grid-column: 1 / -1; padding-bottom: 24px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .foot-badges { margin-top: 4px; }
}
/* 960 以下：LOGO + 560px 搜索框 + 4 个导航链接 会挤爆一行并撑出横向滚动条，
   这里提前把顶部改成三行居中（原本只在 768 以下才切换） */
@media (max-width: 960px) {
    .topbar .wrap { grid-template-columns: 1fr; height: auto; padding: 12px 0; gap: 12px; justify-items: center; }
    .logo { justify-self: center; }
    .search { width: 100%; max-width: 480px; justify-self: stretch; }
    .top-links { justify-self: center; }
}
@media (max-width: 860px) {
    .goods-grid { grid-template-columns: repeat(3, 1fr); }
    .rec-goods { grid-template-columns: repeat(3, 1fr); }
    .rec-wrap.no-ad .rec-goods { grid-template-columns: repeat(3, 1fr); }
    /* 页脚：二维码移到下一行 */
    .foot-main .wrap { grid-template-columns: 110px 110px minmax(200px, 1fr); }
    .foot-qr { grid-column: 1 / -1; justify-content: flex-start; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
    .foot-nav .wrap { height: auto; padding: 10px 0; }
    .foot-nav a { height: 36px; line-height: 36px; padding: 0 14px; font-size: 13px; }
    .foot-nav a + a::before { display: none; }
}
@media (max-width: 768px) {
    .banner { height: 180px; aspect-ratio: auto; }
    .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    /* 窄屏：商品 2 列会排成多行，右侧竖广告会被拉得过长 → 改为广告移到下方整幅横幅 */
    .rec-wrap { flex-direction: column; gap: 10px; }
    .rec-goods { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .rec-wrap.no-ad .rec-goods { grid-template-columns: repeat(2, 1fr); }
    .rec-ad { flex: 0 0 auto; width: 100%; aspect-ratio: 5 / 3; }
    .sk-wrap { grid-template-columns: 1fr; }
    .sk-goods { grid-template-columns: repeat(2, 1fr); }
    /* 页脚：窄屏两栏 */
    .foot-main { padding: 28px 0 24px; }
    .foot-main .wrap { grid-template-columns: 1fr 1fr; gap: 22px; }
    .foot-contact { grid-column: 1 / -1; }
    .foot-bottom .wrap { flex-direction: column; align-items: flex-start; gap: 16px; }
    .hotline { justify-content: flex-start; }
    .hot-num { font-size: 22px; }
}
/* 超窄屏：商品卡再收窄，广告位已在上方排在商品下方 */
@media (max-width: 520px) {
    .rec-goods { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .rec-ad { aspect-ratio: 3 / 2; }
}
