/* ============================================================
   PC 商城首页样式
   仅使用本文件与 /static/pc/images、/static/images 下的本地资源
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-width: 1200px;
    background: #f4f5f7;
    color: #333;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

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

img {
    border: 0;
    display: block;
}

.container {
    width: 1200px;
    margin: 0 auto;
}

/* ---------- 顶部信息栏 ---------- */
.topbar {
    height: 36px;
    background: #232323;
    color: #a9a9a9;
    font-size: 12px;
    line-height: 36px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    letter-spacing: .5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-right a {
    color: #d7d7d7;
    transition: color .2s;
}

.topbar-right a:hover {
    color: #ffca28;
}

.topbar-sep {
    margin: 0 6px;
    color: #555;
}

.user-area {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.user-area .user-name {
    color: #ffca28;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-link {
    padding-left: 22px;
    background: url("/static/pc/images/cart.svg") left center no-repeat;
    background-size: 15px 15px;
}

/* ---------- 头部 LOGO 与导航 ---------- */
.mall-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.header-main {
    height: 96px;
    display: flex;
    align-items: center;
}

.logo img {
    width: 200px;
    height: 50px;
    object-fit: contain;
}

.site-title {
    margin-left: 22px;
    padding-left: 22px;
    border-left: 1px solid #e8e8e8;
}

.site-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #b71c1c;
}

.site-title p {
    margin-top: 5px;
    font-size: 12px;
    color: #999;
    letter-spacing: 1px;
}

.header-badges {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.header-badges span {
    padding: 5px 14px;
    border: 1px solid #ead6d6;
    border-radius: 20px;
    color: #b76b6b;
    background: #fff9f9;
    font-size: 12px;
}

.mall-nav {
    height: 46px;
    background: linear-gradient(90deg, #9f1717 0%, #d32f2f 48%, #9f1717 100%);
}

.nav-inner {
    display: flex;
    align-items: stretch;
    height: 46px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 22px;
    color: #fff;
    font-size: 15px;
    letter-spacing: .5px;
    transition: background .2s, color .2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(0, 0, 0, .16);
    color: #ffd54f;
}

.nav-item.active::after {
    content: "";
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 0;
    height: 2px;
    background: #ffd54f;
}

/* ---------- 主内容 ---------- */
.main-content {
    padding: 20px 0 40px;
}

/* ---------- 头部轮播 ---------- */
.hero-section {
    display: flex;
    gap: 16px;
    height: 420px;
}

.hero-carousel {
    position: relative;
    flex: 1;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: #1f1f24;
    box-shadow: 0 8px 26px rgba(31, 31, 36, .16);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease;
    z-index: 0;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.hero-slide a,
.hero-slide img {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-slide img {
    object-fit: cover;
}

.hero-slide::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.hero-caption {
    position: absolute;
    left: 42px;
    bottom: 42px;
    z-index: 2;
    color: #fff;
}

.hero-caption-en {
    display: block;
    font-size: 12px;
    letter-spacing: 5px;
    color: #ffca28;
    margin-bottom: 8px;
}

.hero-caption strong {
    display: block;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.hero-caption em {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 22px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 20px;
    font-style: normal;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.hero-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 18px;
    line-height: 42px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s, background .25s;
}

.hero-carousel:hover .hero-arrow {
    opacity: 1;
}

.hero-arrow:hover {
    background: rgba(183, 28, 28, .9);
}

.hero-prev {
    left: 18px;
}

.hero-next {
    right: 18px;
}

.hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 9px;
}

.hero-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: width .25s, background .25s;
}

.hero-dots button.active {
    width: 26px;
    border-radius: 5px;
    background: #ffca28;
}

/* ---------- 轮播右侧信息 ---------- */
.hero-side {
    width: 284px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.side-panel {
    border-radius: 12px;
    padding: 22px;
    overflow: hidden;
}

.side-panel h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.side-panel-dark {
    flex: 1;
    color: #fff;
    background: linear-gradient(145deg, #38383f, #1f1f24);
    position: relative;
}

.side-panel-dark::after {
    content: "";
    position: absolute;
    right: -38px;
    top: -38px;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255, 202, 40, .28);
    border-radius: 50%;
}

.side-panel-dark h3 {
    color: #ffca28;
}

.side-panel-dark ul {
    list-style: none;
}

.side-panel-dark li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    color: #d9d9d9;
    font-size: 13px;
    border-bottom: 1px dashed rgba(255, 255, 255, .1);
}

.side-panel-dark li:last-child {
    border-bottom: 0;
}

.side-panel-dark li span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 202, 40, .14);
    color: #ffca28;
    font-size: 12px;
    line-height: 26px;
    text-align: center;
    flex: none;
}

.side-panel-light {
    background: #fff;
}

.side-panel-light h3 {
    color: #333;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.service-grid div {
    padding: 10px 8px;
    border-radius: 8px;
    background: #faf7f7;
    text-align: center;
}

.service-grid strong {
    display: block;
    color: #b71c1c;
    font-size: 15px;
    letter-spacing: 1px;
}

.service-grid span {
    display: block;
    margin-top: 3px;
    color: #999;
    font-size: 12px;
}

/* ---------- 区块标题 ---------- */
.section-block {
    margin-top: 36px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #d32f2f, #ffca28);
}

.section-en {
    display: block;
    color: #b8b8b8;
    font-size: 11px;
    letter-spacing: 4px;
    margin-bottom: 3px;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #262626;
}

.section-more {
    color: #999;
    font-size: 13px;
    transition: color .2s;
}

.section-more em {
    font-style: normal;
    margin-left: 3px;
}

.section-more:hover {
    color: #b71c1c;
}

/* ---------- 推荐广告 ---------- */
.recommend-grid {
    display: grid;
    /* 广告数量不足 4 条时自动均分整行，避免右侧留白 */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.recommend-card {
    position: relative;
    display: block;
    height: 190px;
    border-radius: 12px;
    overflow: hidden;
    background: #e9e9ee;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}

.recommend-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.recommend-card:hover img {
    transform: scale(1.06);
}

.recommend-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.recommend-mask {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.recommend-mask strong {
    max-width: 72%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 700;
}

.recommend-mask span {
    padding: 4px 12px;
    border-radius: 14px;
    background: #ffca28;
    color: #5b3a00;
    font-size: 12px;
}

.recommend-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f7e9e9, #fff7e8);
    border: 1px dashed #e3c9c9;
    box-shadow: none;
}

.recommend-empty-box {
    text-align: center;
    color: #b57b7b;
}

.recommend-empty-box strong {
    display: block;
    font-size: 20px;
    letter-spacing: 3px;
    color: #b71c1c;
}

.recommend-empty-box span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #a99a9a;
}

/* ---------- 商品列表 ---------- */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.goods-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .045);
    transition: transform .25s ease, box-shadow .25s ease;
}

.goods-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .1);
}

.goods-img {
    position: relative;
    height: 218px;
    background: #f1f1f4;
    overflow: hidden;
}

.goods-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.goods-card:hover .goods-img img {
    transform: scale(1.05);
}

.goods-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 3px 9px;
    border-radius: 3px;
    background: linear-gradient(135deg, #e53935, #b71c1c);
    color: #fff;
    font-size: 11px;
    letter-spacing: 1px;
}

.goods-info {
    padding: 13px 14px 15px;
}

.goods-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.goods-intro {
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #aaa;
}

.goods-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 13px;
}

.goods-price {
    color: #d32f2f;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
}

.goods-price em {
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
    margin-right: 2px;
}

.goods-buy {
    padding: 4px 10px;
    border: 1px solid #e2bcbc;
    border-radius: 14px;
    color: #c94b4b;
    font-size: 12px;
    transition: background .2s, color .2s;
}

.goods-card:hover .goods-buy {
    background: #b71c1c;
    border-color: #b71c1c;
    color: #fff;
}

.goods-empty {
    grid-column: 1 / -1;
    padding: 70px 0;
    border-radius: 12px;
    background: #fff;
    color: #aaa;
    text-align: center;
    letter-spacing: 2px;
}

/* ---------- 底部 ---------- */
.mall-footer {
    margin-top: 46px;
    background: #232323;
    color: #a9a9a9;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 0 22px;
}

.footer-brand img {
    width: 160px;
    height: 40px;
    object-fit: contain;
    filter: grayscale(1) brightness(2.4);
    opacity: .9;
}

.footer-brand p {
    margin-top: 8px;
    font-size: 12px;
    color: #777;
}

.footer-links {
    display: flex;
    gap: 28px;
    font-size: 13px;
}

.footer-links a {
    transition: color .2s;
}

.footer-links a:hover {
    color: #ffca28;
}

.footer-copy {
    padding: 14px 0 22px;
    border-top: 1px solid #333;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* ---------- 小屏适配 ---------- */
@media screen and (max-width: 1240px) {
    body {
        min-width: 0;
    }

    .container {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-section {
        height: auto;
        flex-direction: column;
    }

    .hero-carousel {
        height: 420px;
    }

    .hero-side {
        width: 100%;
        flex-direction: row;
    }

    .side-panel {
        flex: 1;
    }

    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
