/**
 * 东泉顺环保｜首页专属样式
 * 从 front-page.php 内联样式中提取，减少 HTML 体积
 * 深海蓝 #00509B + 森林绿 #27ae60
 * 容器宽度 1400px
 */

/* ========== Hero 大图轮播 ========== */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-darker);
}
.hero-slides {
    display: flex;
    height: 100%;
    transition: transform .6s ease;
}
.hero-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Hero 轮播 <img> 替代 background-image — SEO + 无障碍可抓取 */
.hero-slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: .7;
}
/* 渐变遮罩层（用 img::after 无法实现，改用独立 overlay） */
.hero-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,18,31,.38) 0%, rgba(0,18,31,.32) 100%);
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    position: absolute;
    z-index: 2;
    color: var(--text-on-dark-strong);
    padding: 30px 40px;
    max-width: 680px;
    width: 50%;
    top: 50%;
    transform: translateY(-50%);
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
/* 2026-10-25 P0：文字区补光（分区遮罩）—— 随内容块移动，左/右版式通用。
   原遮罩单层 .3/.2，最坏底图（过曝天空）白字仅 2.67:1；补光后文字区 ≥6.8:1，图片区仍透图 */
.hero-content::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -30px;
    bottom: -30px;
    left: -40px;
    right: -40px;
    border-radius: 16px;
    background: radial-gradient(85% 130% at 50% 50%, rgba(0,18,31,.62) 0%, rgba(0,18,31,.40) 55%, rgba(0,18,31,0) 100%);
    pointer-events: none;
}
.hero-content.content-right {
    right: 4%;
    text-align: left;
}
.hero-content.content-left {
    left: 4%;
    text-align: left;
}
.hero-content.content-right .hero-buttons {
    justify-content: flex-start;
}
.hero-content.content-left .hero-buttons {
    justify-content: flex-start;
}
.hero-content.content-right p {
    margin-left: 0;
}
.hero-content.content-left p {
    margin-right: auto;
}
.hero-badge {
    display: inline-block;
    background: rgba(39,174,96,.25);
    border: 1px solid var(--accent);
    color: var(--ok-on-dark);
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 22px;
    margin-bottom: 24px;
    letter-spacing: 2px;
}
.hero h1, .hero h2 {
    font-size: var(--h1-fs, 42px); /* 保持原样：主视觉文案含长句，再放大会加剧折行 */
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.hero p {
    font-size: 21px;
    opacity: 1;
    margin-bottom: 32px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    line-height: 1.7;
    word-break: keep-all;
}
.hero-buttons {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-buttons .btn {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
}
.hero-buttons .btn-outline {
    border: 2px solid var(--white);
    color: var(--text-on-dark-strong);
    background: rgba(255,255,255,.1);
}
.hero-buttons .btn-outline:hover {
    background: var(--bg-card);
    color: var(--primary);
}
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.25);
    color: var(--text-on-dark-strong);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 3;
    transition: .3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-nav:hover {
    background: rgba(255,255,255,.5);
}
.hero-nav.prev { left: 24px; }
.hero-nav.next { right: 24px; }
.hero-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}
.hero-dot {
    /* [P2 FRONT-006 2026-10-24] 圆点已由 div 改为 <button>：
       必须清掉浏览器默认的 border/padding/background，否则会渲染成方块。
       同时保留 12px 视觉尺寸，扩大可点区域到 24px（不改变视觉）。 */
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    cursor: pointer;
    transition: width .3s, background .3s;
    font-size: 0;
    line-height: 0;
    /* 视觉 12px，点击/触控区 24px */
    box-shadow: 0 0 0 6px transparent;
}
.hero-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.hero-dot.active {
    background: var(--accent);
    width: 36px;
    border-radius: 6px;
}

/* ========== 数据滚动条 ========== */
.stats-bar {
    background: var(--primary);
    color: var(--text-on-dark-strong);
    padding: 30px 0;
}
.stats-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
.stat-number {
    font-size: 40px; /* 2026-10-23 48px→40px，7字短语可在单列内容下不再断行 */
    font-weight: 700;
    color: var(--text-on-dark-strong); /* 2026-10-23 深蓝底改用白字，替代低对比绿字 #1e8449 */
    line-height: 1.2;
}
.stat-label {
    font-size: 17px;
    opacity: .8;
    margin-top: 6px;
}
/* 2026-10-23 桌面端数据条单行显示，避免“资深环保工程师/多行业落地案例”断行成两行 */
@media (min-width: 769px) {
    .stat-number { white-space: nowrap; }
}

/* ========== 六大板块入口 ========== */
.categories-section {
    padding: var(--section-padding, 60px 0);
    background: var(--bg-section-alt);
}
.section-header {
    text-align: center;
    margin-bottom: 36px;
}
.section-header h2 {
    font-size: 44px; /* 2026-10-23 首页区块标题放大 40→44px */
    color: var(--primary);
    margin-bottom: 14px;
}
.section-header p {
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
    font-size: 17px;
}
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.cat-card {
    position: relative;
    height: 300px;
    border-radius: var(--radius, 8px);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0,0,0,.08));
    transition: .4s;
    display: block;
    color: inherit;
    text-decoration: none;
}
.cat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg, 0 8px 40px rgba(0,0,0,.1));
}
.cat-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: .6s;
}
.cat-card:hover .cat-card-bg {
    transform: scale(1.1);
}
.cat-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.7) 100%);
}
.cat-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 30px;
    color: var(--text-on-dark-strong);
    width: 100%;
}
.cat-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cat-card p {
    font-size: 15px;
    opacity: .9;
    line-height: 1.7;
}
.cat-card .cat-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--ok);
    color: var(--text-on-dark-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: .3s;
}
.cat-card:hover .cat-arrow {
    transform: rotate(-45deg);
    background: var(--ok-hover);
}

/* ========== 产品子类横向滚动 ========== */
.product-showcase {
    padding: 30px 0;
    background: var(--bg-card);
    /* PERF-01：屏幕外区块跳过渲染（含内部图片），滚动到附近才加载，
       避免首页 40+ 产品图在首屏加载时与 hero 图争抢带宽。auto 记忆真实尺寸防滚动跳动。 */
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
}
.product-showcase:nth-child(even) {
    background: var(--bg-section-alt);
}
.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 28px;
}
.showcase-header h2 {
    font-size: 44px; /* 2026-10-23 首页区块标题放大 40→44px */
    color: var(--primary);
}

/* 除尘滤筒系列：标题组 + 按安装形式入口按钮 */
.showcase-title-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.showcase-header a.mount-entry-btn {
    display: inline-flex; align-items: center;
    padding: 10px 22px;
    background: var(--ok);
    color: var(--text-on-dark-strong) !important;
    border-radius: 24px;
    font-size: 16px; font-weight: 600;
    transition: background .3s, transform .2s;
}
.showcase-header a.mount-entry-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
@media (max-width: 768px) {
    .showcase-header { flex-wrap: wrap; row-gap: 6px; }
    .showcase-title-group { gap: 10px; }
    .showcase-header a.mount-entry-btn { font-size: 14px; padding: 7px 14px; }
}.showcase-header a {
    color: var(--accent-text);
    font-weight: 600;
    font-size: 16px;
}
.scroll-container {
    position: relative;
}
.scroll-track {
    display: flex;
    gap: 24px;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* 2026-10-23 整卡对齐：翻页后永远停在完整卡片上 */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    flex-wrap: nowrap;
}
.scroll-track::-webkit-scrollbar {
    height: 6px;
}
.scroll-track::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}
/* 2026-10-23 整卡显示：每屏正好 4 张完整卡片（4×宽 + 3×24px 间距 = 容器宽），不再露出被切的半张卡 */
.scroll-item {
    flex: 0 0 calc(25% - 18px);
    min-width: 0;
    /* 2026-10-23 连续滚动模式：移除 scroll-snap-align，避免吸附干扰无缝滚动 */
}
.scroll-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: var(--text-on-dark-strong);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: .3s;
}
.scroll-nav:hover {
    background: var(--accent);
}
.scroll-nav.prev { left: -24px; }
.scroll-nav.next { right: -24px; }
.product-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    transition: .3s;
}
.product-mini-card:hover {
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0,0,0,.08));
    border-color: var(--accent);
}
.product-mini-img {
    height: 200px;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-mini-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-soft);
    padding: 12px;
}
.product-mini-body {
    padding: 18px;
}
.product-mini-body h4 {
    font-size: 17px;
    color: var(--primary);
    margin-bottom: 4px;
}
.product-mini-links {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.btn-link {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    transition: .3s;
    white-space: nowrap;
}
.btn-link:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    background: var(--accent-light);
}
.btn-link.active {
    background: var(--accent);
    color: var(--text-dark);
    border-color: var(--accent);
}
.btn-link.active:hover {
    background: var(--accent-hover);
    color: var(--text-dark);
}

/* ========== 案例实拍墙 — 横向滚动 ========== */
.cases-section {
    padding: var(--section-padding, 60px 0);
    background: var(--bg-darker);
    color: var(--text-on-dark-strong);
}
.cases-section .section-header h2 { color: var(--text-on-dark-strong); }
.cases-section .section-header p { color: rgba(255,255,255,.7); }
/* 2026-10-23 案例卡整卡显示：每屏正好 3 张 */
.cases-section .scroll-item {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 0;
    max-width: none;
}
.case-card {
    background: rgba(255,255,255,.05);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    transition: .3s;
    border: 1px solid rgba(255,255,255,.1);
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}
.case-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,.1);
}
.case-img {
    height: 220px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.case-img-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 1;
    transition: .4s;
}
.case-card:hover .case-img-bg {
    transform: scale(1.1);
}
.case-body {
    padding: 20px 24px;
}
.case-body h4 {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--text-on-dark-strong);
}
.case-body p {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    line-height: 1.6;
    margin-bottom: 12px;
}
.case-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.case-stat {
    background: rgba(39,174,96,.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent-on-dark);
    font-weight: 600;
}

/* ========== 证书资质横向滚动 ========== */
.cert-section {
    padding: var(--section-padding, 60px 0);
    background: var(--bg-section-alt);
    /* PERF-01：屏幕外跳过证书图加载，滚动到附近才渲染。 */
    content-visibility: auto;
    contain-intrinsic-size: auto 700px;
}
/* 2026-10-23 资质副标题放宽限宽，整句一行排下，避免“利”字孤行 */
.cert-section .section-header p {
    max-width: 960px;
}
.cert-scroll {
    display: flex;
    gap: 24px;
    padding-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* 2026-10-23 整卡对齐：翻页后永远停在完整卡片上 */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}
/* 证书竖版展示：3:4 比例 + contain 不裁切，兼容横版扫描件 */
.cert-img {
    aspect-ratio: 3 / 4;
    height: auto;
    max-height: 280px;
    margin-bottom: 16px;
    overflow: hidden;
    border-radius: var(--radius, 8px);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.cert-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

/* 横版证书图框：4:3 + 浅灰底 + contain */
.cert-img--horizontal {
    aspect-ratio: auto;
    height: 280px;
    max-height: none;
}
/* 2026-10-29 资质卡整体等高:图片区固定高+cover填充,标题区对齐,白底不再拖长 */
.cert-card { display: flex; flex-direction: column; height: 100%; }
.cert-img, .cert-img--horizontal { height: 280px; aspect-ratio: auto; }
.cert-img img, .cert-img--horizontal img { width: 100%; height: 100%; object-fit: cover; padding: 0; }

/* ========== 关于我们 ========== */
.advantage-section {
    padding: var(--section-padding, 60px 0);
    background: var(--bg-section-alt);
}
.advantage-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    align-items: center;
}
.advantage-img {
    height: 420px;
    background: var(--bg-soft);
    border-radius: var(--radius, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.advantage-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.advantage-content h2 {
    font-size: 44px; /* 2026-10-23 首页区块标题放大 40→44px */
    color: var(--primary);
    margin-bottom: 24px;
}
.advantage-content p {
    color: var(--text-gray);
    margin-bottom: 28px;
    line-height: 1.9;
    font-size: 16px;
}
.advantage-list {
    list-style: none;
}
.advantage-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}
.advantage-list li:last-child {
    border-bottom: none;
}
.advantage-list .icon {
    color: var(--accent-text);
    font-size: 22px;
}
.advantage-list .text {
    font-size: 15px;
    color: var(--text-dark);
}
.advantage-list .text.highlight {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.3px;
}
.advantage-list li:has(.text.highlight) {
    padding: 12px 0 12px 16px;
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, rgba(39,174,96,.06) 0%, transparent 60%);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========== CTA ========== */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-on-dark-strong);
    padding: 50px 0; /* 2026-10-23 对齐全站 CTA 规范 padding 50px 0 */
    text-align: center;
}
.cta-section h2 {
    font-size: 44px; /* 2026-10-23 对齐全站 CTA 规范 h2 44px */
    margin-bottom: 18px;
}
.cta-section p {
    font-size: 22px;
    opacity: .9;
    max-width: 900px;
    margin: 0 auto 36px;
}
.cta-buttons {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}
.cta-buttons .btn {
    padding: 18px 36px;
    font-size: 20px;
    font-weight: 700;
}


.cta-section .btn-eco {
    background: var(--ok);
    color: var(--text-on-dark-strong);
    border-color: var(--ok);
}
.cta-section .btn-eco:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* CTA 三个按钮统一样式见 common.css（.cta-section .btn-primary / .btn-outline，白底蓝字、悬停变绿） */

/* ========== 动画 ========== */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: countUp .6s ease forwards;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-content { width: 45%; padding: 20px 25px; }
    .hero h1, .hero h2 { font-size: 28px; }
    .hero p { font-size: 14px; }
}

@media (max-width: 768px) {
    .hero { height: 500px; }
    .hero h1, .hero h2 { font-size: 30px; }
    .hero p { font-size: 15px; }
    .hero-nav { width: 44px; height: 44px; font-size: 18px; }
    .hero-content {
        position: relative;
        width: 100%;
        max-width: 100%;
        text-align: center;
        top: 0;
        transform: none;
        padding: 30px 20px;
    }
    .hero-content.content-right,
    .hero-content.content-left {
        text-align: center;
    }
    .hero-content.content-right .hero-buttons,
    .hero-content.content-left .hero-buttons {
        justify-content: center;
    }
    .hero-content.content-right p,
    .hero-content.content-left p {
        margin-left: auto;
        margin-right: auto;
    }
    .stats-inner { grid-template-columns: repeat(2, 1fr); }
    .stat-number { font-size: 36px; }
    /* [P1 FRONT-004 2026-10-24] 原为单列 1fr：768 视口下卡片变成 728×240 的
       "横幅广告"比例（约 3:1），页面被拉长且观感失衡。
       改为 2 列：每列约 350px、卡片高 240px，比例约 3:2，与桌面 3 列视觉一致。 */
    .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .cat-card { height: 240px; }
    .cases-grid { grid-template-columns: 1fr; }
    .advantage-grid { grid-template-columns: 1fr; }
    .advantage-img { height: 280px; }
    .section-header h2 { font-size: 30px; }
    .scroll-nav { display: none; }
}

/* [P1 FRONT-004] 600px 以下再退回单列，避免卡片过窄导致文字挤压 */
@media (max-width: 600px) {
    .cat-grid { grid-template-columns: 1fr; gap: 16px; }
    .cat-card { height: 220px; }
}
