/**
 * 首页 v2 样式
 * 仅用于首页（Head.htm 中通过 $home_css 条件引入），不影响其他页面
 */

.hp-page {
    --hp-green: #0e8a5f;
    --hp-green-d: #0b6a49;
    --hp-green-l: #e9f5ef;
    --hp-ink: #15242f;
    --hp-body: #4a5c69;
    --hp-muted: #7d8f9c;
    --hp-line: #e4ebe7;
    --hp-bg: #f5f8f6;
    --hp-price: #d4551f;
    background: var(--hp-bg);
    padding-bottom: 48px;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--hp-ink);
    line-height: 1.5;
}

.hp-page a {
    text-decoration: none;
    color: inherit;
}

.hp-page img {
    display: block;
}

.hp-wrap {
    width: 1200px;
    margin: 0 auto;
}

/* ---------- 首屏 ---------- */
.hp-hero {
    background: linear-gradient(118deg, #093a2c 0%, #0c5a43 52%, #12815e 100%);
    padding: 24px 0 20px;
}

.hp-hero-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 292px;
    gap: 16px;
    align-items: stretch;
}

/* 左侧分类 */
.hp-side {
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 24px rgba(6, 40, 30, .16);
}

.hp-side-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: var(--hp-green);
    border-radius: 12px 12px 0 0;
    padding: 11px 14px;
}

.hp-side-list {
    padding: 6px 0;
    flex: 1;
}

.hp-side-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 34px;
}

.hp-side-item:hover {
    background: var(--hp-green-l);
}

.hp-side-link {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: var(--hp-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-side-item:hover .hp-side-link {
    color: var(--hp-green-d);
    font-weight: 600;
}

.hp-side-cnt {
    font-size: 11px;
    color: var(--hp-muted);
    background: #f1f5f3;
    border-radius: 10px;
    padding: 1px 7px;
}

.hp-side-all {
    display: block;
    text-align: center;
    font-size: 12.5px;
    color: var(--hp-green-d);
    padding: 10px 0;
    border-top: 1px solid var(--hp-line);
    font-weight: 600;
}

/* 分类浮层 */
.hp-fly {
    display: none;
    position: absolute;
    left: calc(100% + 4px);
    top: -6px;
    width: 560px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(6, 40, 30, .2);
    padding: 16px 18px 18px;
    z-index: 60;
}

.hp-side-item:hover .hp-fly {
    display: block;
}

.hp-fly-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hp-line);
    margin-bottom: 10px;
}

.hp-fly-head a {
    font-size: 15px;
    font-weight: 700;
    color: var(--hp-ink);
}

.hp-fly-head em {
    font-style: normal;
    font-size: 12px;
    color: var(--hp-green);
}

.hp-fly-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 14px;
}

.hp-fly-body a {
    font-size: 12.5px;
    color: var(--hp-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-fly-body a:hover {
    color: var(--hp-green);
}

/* 中间轮播 + 快捷入口 */
.hp-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hp-slider {
    position: relative;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: #0a4a37;
}

.hp-slide {
    position: absolute;
    inset: 0;
    display: flex;
    background: #fff;
    height: 300px;
    opacity: 0;
    animation: hpFade 15s infinite;
    z-index: 1;
}

.hp-slide:nth-child(1) {
    animation-delay: 0s;
}

.hp-slide:nth-child(2) {
    animation-delay: 5s;
}

.hp-slide:nth-child(3) {
    animation-delay: 10s;
}

@keyframes hpFade {
    0% { opacity: 0; }
    2% { opacity: 1; }
    30% { opacity: 1; }
    33.33% { opacity: 0; }
    100% { opacity: 0; }
}

.hp-slide-img {
    display: block;
    width: 300px;
    flex: none;
    background: #f5f7f6;
}

.hp-slide-img img {
    width: 300px;
    height: 300px;
    object-fit: cover;
}

.hp-slide-body {
    flex: 1;
    min-width: 0;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
}

.hp-slide-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hp-green);
}

.hp-slide-body b {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--hp-ink);
}

.hp-slide-body em {
    display: block;
    font-style: normal;
    font-size: 19px;
    font-weight: 700;
    color: var(--hp-price);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-slide-btn {
    align-self: flex-start;
    margin-top: 2px;
    height: 32px;
    line-height: 30px;
    padding: 0 16px;
    border: 1px solid var(--hp-green);
    border-radius: 6px;
    font-size: 13px;
    color: var(--hp-green-d);
}

.hp-slide:hover .hp-slide-btn {
    background: var(--hp-green);
    color: #fff;
}

.hp-dots {
    position: absolute;
    right: 16px;
    bottom: 14px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.hp-dots i {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 4px;
    background: var(--hp-green);
    opacity: .25;
    animation: hpDot 15s infinite;
}

.hp-dots i:nth-child(1) { animation-delay: 0s; }
.hp-dots i:nth-child(2) { animation-delay: 5s; }
.hp-dots i:nth-child(3) { animation-delay: 10s; }

@keyframes hpDot {
    0%, 30% { width: 16px; opacity: 1; }
    33%, 100% { width: 6px; opacity: .25; }
}

.hp-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hp-quick-a {
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    min-width: 0;
}

.hp-quick-a img {
    width: 100%;
    height: 84px;
    object-fit: cover;
    border-radius: 6px;
}

.hp-quick-a span {
    display: block;
    font-size: 12px;
    color: var(--hp-body);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-quick-a:hover span {
    color: var(--hp-green);
}

/* 右侧热销榜 */
.hp-trend {
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(6, 40, 30, .16);
    min-width: 0;
}

.hp-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hp-line);
    margin-bottom: 6px;
}

.hp-trend-head span {
    font-size: 15px;
    font-weight: 700;
}

.hp-trend-head a {
    font-size: 12px;
    color: var(--hp-green);
}

.hp-trend-a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f0;
}

.hp-trend-a:last-child {
    border-bottom: 0;
}

.hp-trend-a img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    flex: none;
    background: #f4f7f5;
}

.hp-rank {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #f0f4f2;
    color: var(--hp-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}

.hp-trend-a:nth-child(2) .hp-rank {
    background: #d4551f;
    color: #fff;
}

.hp-trend-a:nth-child(3) .hp-rank {
    background: #e88a3c;
    color: #fff;
}

.hp-trend-a:nth-child(4) .hp-rank {
    background: #f0b45c;
    color: #fff;
}

.hp-trend-info {
    min-width: 0;
}

.hp-trend-info b {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--hp-ink);
    line-height: 1.35;
}

.hp-trend-info em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: var(--hp-price);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-trend-a:hover .hp-trend-info b {
    color: var(--hp-green);
}

/* 平台数据 */
.hp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: 12px 8px;
}

.hp-stat {
    text-align: center;
    color: #fff;
}

.hp-stat + .hp-stat {
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.hp-stat b {
    display: block;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .4px;
}

.hp-stat span {
    font-size: 12px;
    opacity: .78;
}

/* ---------- 通用版块 ---------- */
.hp-sec {
    margin-top: 40px;
}

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

.hp-sec-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--hp-ink);
    margin: 0;
    line-height: 1.2;
}

.hp-sec-head a {
    font-size: 13px;
    color: var(--hp-green-d);
    font-weight: 600;
}

.hp-sec-head a:hover {
    color: var(--hp-green);
}

/* 分类卡片 */
.hp-catgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hp-tile {
    background: #fff;
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color .2s, box-shadow .2s;
}

.hp-tile:hover {
    border-color: var(--hp-green);
    box-shadow: 0 8px 20px rgba(14, 138, 95, .1);
}

.hp-tile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hp-tile-badge {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--hp-green-l);
    color: var(--hp-green-d);
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    line-height: 34px;
}

.hp-tile-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-ink);
}

.hp-tile-cnt {
    width: 100%;
    font-size: 12px;
    color: var(--hp-muted);
}

.hp-tile-sub {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--hp-line);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hp-tile-sub a {
    font-size: 12.5px;
    color: var(--hp-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-tile-sub a:hover {
    color: var(--hp-green);
}

/* 产品卡片 */
.hp-prods {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.hp-prod {
    background: #fff;
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    overflow: hidden;
    padding-bottom: 12px;
    transition: box-shadow .2s, border-color .2s;
}

.hp-prod:hover {
    border-color: var(--hp-green);
    box-shadow: 0 8px 20px rgba(14, 138, 95, .1);
}

.hp-prod-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f7f6;
}

.hp-prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hp-prod-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
    margin: 10px 12px 0;
    font-size: 13px;
    line-height: 18px;
    color: var(--hp-ink);
}

.hp-prod-name:hover {
    color: var(--hp-green);
}

.hp-prod-price {
    margin: 6px 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--hp-price);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-prod-btn {
    display: block;
    margin: 10px 12px 0;
    height: 30px;
    line-height: 28px;
    text-align: center;
    border: 1px solid var(--hp-green);
    border-radius: 6px;
    color: var(--hp-green-d);
    font-size: 12.5px;
}

.hp-prod-btn:hover {
    background: var(--hp-green);
    color: #fff;
}

/* 供应商 */
.hp-sec-alt {
    background: #fff;
    padding: 32px 0 36px;
    margin-top: 44px;
}

.hp-supps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hp-supp {
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hp-supp:hover {
    border-color: var(--hp-green);
    box-shadow: 0 8px 20px rgba(14, 138, 95, .08);
}

.hp-supp-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hp-supp-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    background: #f7f9f8;
    border: 1px solid var(--hp-line);
    padding: 4px;
    flex: none;
}

.hp-supp-info {
    min-width: 0;
}

.hp-supp-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-ink);
    line-height: 1.35;
}

.hp-supp-name:hover {
    color: var(--hp-green);
}

.hp-supp-meta {
    font-size: 12px;
    color: var(--hp-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-supp-prods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-height: 72px;
}

.hp-supp-prods a {
    display: block;
    background: #f5f7f6;
    border-radius: 6px;
    overflow: hidden;
}

.hp-supp-prods img {
    width: 100%;
    height: 72px;
    object-fit: cover;
}

.hp-supp-btn {
    margin-top: auto;
    display: block;
    height: 30px;
    line-height: 28px;
    text-align: center;
    border: 1px solid var(--hp-green);
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--hp-green-d);
}

.hp-supp-btn:hover {
    background: var(--hp-green);
    color: #fff;
}

/* 国家/地区 */
.hp-countries {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.hp-country {
    background: #fff;
    border: 1px solid var(--hp-line);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hp-country span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hp-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-country em {
    font-style: normal;
    font-size: 11.5px;
    color: var(--hp-muted);
    white-space: nowrap;
}

.hp-country:hover {
    border-color: var(--hp-green);
}

.hp-country:hover span {
    color: var(--hp-green);
}

/* 平台优势 */
.hp-why {
    margin-top: 40px;
}

.hp-why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.hp-why-item {
    background: #fff;
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    padding: 18px;
}

.hp-why-item b {
    display: block;
    font-size: 14.5px;
    color: var(--hp-ink);
    margin-bottom: 6px;
}

.hp-why-item b::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hp-green);
    margin-right: 8px;
    vertical-align: middle;
}

.hp-why-item span {
    font-size: 12.5px;
    color: var(--hp-body);
    line-height: 1.7;
}

/* 文本介绍 */
.hp-seo {
    margin-top: 40px;
}

.hp-seo .hp-wrap {
    background: #fff;
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    padding: 24px 26px;
}

.hp-seo h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--hp-ink);
}

.hp-seo p {
    font-size: 13.5px;
    line-height: 1.9;
    color: var(--hp-body);
    margin: 0 0 8px;
}

.hp-seo p:last-child {
    margin-bottom: 0;
}

/* ---------- 响应式 ---------- */
@media (prefers-reduced-motion: reduce) {
    .hp-slide,
    .hp-dots i {
        animation: none;
    }

    .hp-slide {
        opacity: 0;
    }

    .hp-slide:nth-child(1) {
        opacity: 1;
    }
}

@media (max-width: 1240px) {
    .hp-wrap {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }
}

@media (max-width: 1040px) {
    .hp-hero-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .hp-side {
        display: none;
    }

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

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

    .hp-countries {
        grid-template-columns: repeat(4, 1fr);
    }

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

@media (max-width: 900px) {
    .hp-prods {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .hp-hero-grid {
        grid-template-columns: 1fr;
    }

    .hp-trend {
        display: none;
    }

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

    .hp-stat + .hp-stat {
        border-left: 0;
    }

    .hp-prods {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 560px) {
    .hp-quick {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hp-prods,
    .hp-supps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hp-why-grid {
        grid-template-columns: 1fr;
    }

    .hp-slider,
    .hp-slide {
        height: 220px;
    }

    .hp-slide-img,
    .hp-slide-img img {
        width: 180px;
        height: 220px;
    }

    .hp-slide-body {
        padding: 14px 16px;
        gap: 6px;
    }

    .hp-slide-body b {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }

    .hp-slide-body em {
        font-size: 16px;
    }

    .hp-slide-btn {
        height: 28px;
        line-height: 26px;
        padding: 0 12px;
        font-size: 12px;
    }
}
