/* =============================================================================
   YHZL 新首屏样式
   版本：YHZL_HOME_V1_HOME
   设计要点：
     1. 首屏高度降到约 60vh（手机），让访客不滑动也能看到下一块
     2. 搜索框是首屏主角，按钮用橙色强调色引导视线
     3. 品类带用横向滑动（手机可手指滑），不用自动轮播
     4. 图片一律 loading="lazy"，首屏不加载大图
   ========================================================================== */

/* ---------- 首屏 ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(1000px 460px at 12% -10%, rgba(41, 71, 163, .55), transparent 60%),
        linear-gradient(160deg, #0a1e32 0%, #123055 58%, #0d2540 100%);
    color: #fff;
    overflow: hidden;
}
.hero::after {
    /* 极淡的网格，增加工业质感，不影响性能（纯 CSS） */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 78%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 78%);
}

.hero-inner {
    position: relative; z-index: 1;
    padding-top: 44px;
    padding-bottom: 34px;
    text-align: center;
    max-width: 880px;
}

.hero-title { color: #fff; font-size: clamp(27px, 5.6vw, 50px); margin-bottom: 14px; }
.hero-title .nowrap { white-space: nowrap; }

.hero-sub {
    color: rgba(255,255,255,.82);
    font-size: clamp(15px, 2.4vw, 19px);
    font-weight: 500;
    margin-bottom: 26px;
}

/* 首屏行动按钮 */
.hero-actions {
    display: flex; flex-direction: column; gap: 12px;
    max-width: 460px; margin: 0 auto;
}
.hero-actions .btn { width: 100%; }

/* ---------- 搜索 ---------- */
.search { position: relative; max-width: 660px; margin: 0 auto 18px; z-index: 5; }

.search-form {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 999px;
    padding: 7px 7px 7px 18px;
    box-shadow: 0 14px 36px rgba(5, 18, 33, .38);
    border: 2px solid transparent;
    transition: border-color .15s;
}
.search-form:focus-within { border-color: var(--accent); }

.search-ico { width: 22px; height: 22px; fill: none; stroke: var(--ink-3); stroke-width: 2;
              stroke-linecap: round; flex: none; }

.search-input {
    flex: 1; min-width: 0;
    border: 0; background: transparent; outline: none;
    font-size: 16px; /* ≥16px：iOS 上不会自动放大 */
    color: var(--ink); padding: 12px 0;
    font-family: inherit;
}
.search-input::placeholder { color: #9ca3af; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-submit {
    flex: none;
    background: var(--accent); color: #fff; border: 0;
    border-radius: 999px; padding: 13px 24px;
    font-size: 15px; font-weight: 800; letter-spacing: .02em;
    min-height: 46px;
}
.search-submit:hover { background: var(--accent-dark); }

.search-hint {
    margin-top: 12px; font-size: 13.5px; color: rgba(255,255,255,.72);
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
}
.chip {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28);
    color: #fff; border-radius: 999px; padding: 6px 13px;
    font-size: 13px; font-weight: 600; font-family: inherit;
    min-height: 34px;
}
.chip:hover { background: rgba(255,255,255,.22); }

/* 搜索结果面板 */
.search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 12px);
    background: #fff; border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(5, 18, 33, .32);
    text-align: left; overflow: hidden;
    max-height: min(64vh, 520px); overflow-y: auto;
    z-index: 30;
}
.search-results-head {
    padding: 13px 18px; border-bottom: 1px solid var(--line);
    font-size: 13px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--ink-3);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.search-results-close {
    background: none; border: 0; color: var(--ink-3);
    font-size: 22px; line-height: 1; width: 32px; height: 32px;
}
.search-hit {
    display: flex; gap: 13px; align-items: center;
    padding: 12px 18px; border-bottom: 1px solid #f1f5f9;
    color: inherit;
}
.search-hit:hover { background: #f8fafc; text-decoration: none; }
.search-hit-img {
    width: 56px; height: 56px; flex: none;
    border: 1px solid var(--line); border-radius: 7px;
    background: #fff; object-fit: contain;
}
.search-hit-body { min-width: 0; }
.search-hit-name {
    font-size: 14.5px; font-weight: 700; color: var(--ink);
    margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-hit-meta {
    font-size: 12.5px; color: var(--ink-3); margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-hit-pn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--navy); }
.search-empty { padding: 22px 18px; }
.search-empty p { margin: 0 0 14px; font-size: 14.5px; }
.search-more {
    display: block; text-align: center; padding: 15px;
    font-size: 14px; font-weight: 700; color: var(--navy); background: #f8fafc;
}
.search-more:hover { background: #eff6ff; text-decoration: none; }

/* ---------- 首屏数据条 ---------- */
.hero-facts {
    position: relative; z-index: 1;
    /* 用比首屏底色明显更亮的蓝，让数据条真正分出层次
       （之前用 --navy #1e3a8a，与首屏底色 RGB(16,44,77) 太接近，肉眼看不出来） */
    background: #1d4ed8;
    border-top: 1px solid rgba(255,255,255,.18);
}
.facts-inner {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 4px 0; padding-top: 14px; padding-bottom: 14px;
}
.fact { text-align: center; padding: 8px 6px; }
.fact strong { display: block; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.fact span { font-size: 12px; color: rgba(255,255,255,.78); letter-spacing: .02em; }

/* ---------- 品类横滑带 ---------- */
.section-cats { padding-bottom: 44px; }
.cat-wrap { position: relative; }

/* 手机端滑动提示：只在需要横滑时出现。
   注意：整句必须不换行 —— 否则窄屏会把箭头和文字拆到两行，
   看起来像页面左边多出一行莫名其妙的字。 */
.rail-hint {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    font-size: 12.5px; font-weight: 600; color: var(--ink-3);
    padding: 0 20px 10px;
    white-space: nowrap;
}
.rail-hint .ico { color: var(--navy); flex: none; }
.rail-hint span { white-space: nowrap; }

.cat-rail {
    display: flex; gap: 16px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 6px 20px 18px;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* 默认只显示前 8 个品类；其余靠「Show all」展开。
   两种布局（手机横滑 / 桌面网格）都要生效，所以放在媒体查询外面。 */
.cat-card[data-extra] { display: none; }
.cat-rail.is-expanded .cat-card[data-extra] { display: flex; }

/* 展开全部：改成多行网格，不再横滑（此时隐藏滑动提示） */
.cat-rail.is-expanded {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
    padding: 6px 20px 0;
}
.cat-wrap:has(.cat-rail.is-expanded) .rail-hint { display: none; }
.cat-rail.is-expanded .cat-card { flex: none; }

.cat-card {
    flex: 0 0 250px; scroll-snap-align: start;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; color: inherit;
    display: flex; flex-direction: column;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cbd5e1; text-decoration: none; }
.cat-card-media {
    aspect-ratio: 4 / 3; background: #f8fafc;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cat-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.cat-card-body { padding: 14px 16px 16px; }
.cat-card-body h3 { font-size: 16px; margin-bottom: 4px; }
.cat-card-body p { font-size: 13px; color: var(--ink-3); margin: 0; }
.cat-card-model {
    display: inline-block; margin-top: 9px;
    /* 同 p-card-pn：避免等宽字体在 Windows 上退化成衬线体 */
    font-family: var(--font);
    font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
    color: var(--navy);
    background: #eff6ff; border-radius: 5px; padding: 3px 8px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 品牌 ---------- */
.section-brands { padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brand-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 26px 40px;
}
.brand-row img {
    height: 36px; width: auto; object-fit: contain;
    /* 保留品牌原色：采购要一眼认出这些牌子，灰度等于白放 */
    opacity: .92; transition: opacity .15s, transform .15s;
}
.brand-row img:hover { opacity: 1; transform: translateY(-2px); }
.brand-more { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- 热门产品（一行横滑，与品类区形态区分开） ---------- */
.pop-wrap { position: relative; }
.pop-rail {
    display: flex; gap: 16px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 6px 20px 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.pop-rail .p-card { flex: 0 0 230px; scroll-snap-align: start; }

.product-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.p-card {
    background: #fff;
    /* 边框加深 + 轻微阴影：避免卡片和白色背景糊在一起 */
    border: 1px solid #d7dee8;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.p-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(16, 24, 40, .13);
    border-color: #b9c4d4;
    text-decoration: none;
}
.p-card-media {
    aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.p-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.p-card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.p-card-brand {
    font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-3);
}
.p-card-name {
    font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.35;
    margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card-pn {
    /* 用无衬线字体：等宽字体在 Windows 上会退化成 Courier New（衬线体），
       看起来像宋体，不适合做产品型号 */
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--navy);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-card-cta {
    margin-top: auto; padding-top: 10px;
    font-size: 13px; font-weight: 800; color: var(--accent-dark);
    display: flex; align-items: center; gap: 6px;
}

/* ---------- 两栏内容 ---------- */
.two-col { display: grid; gap: 36px; grid-template-columns: 1fr; }
.lead { font-size: 17px; color: var(--ink-2); }

/* 物流区块的配图：限制高度，避免在小屏上压倒文字（用户反馈图太大） */
.logi-media {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid #d7dee8; background: #eef2f7;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    max-width: 100%;
}
.logi-media img {
    width: 100%; height: 100%; display: block;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    max-height: 220px;
}
@media (min-width: 768px) { .logi-media img { max-height: 260px; } }
@media (min-width: 1024px) { .logi-media img { max-height: 300px; aspect-ratio: 4 / 3; } }

/* 承运商标识：复刻旧版样式（文字拼的 logo，不用图片）
   旧版原样：DHL 黄色斜体加粗 / Fed 白 + Ex 橙 / UPS 黄色 + 盾牌图标 */
.courier-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px;
    margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
}
.courier { line-height: 1; white-space: nowrap; }
.courier-dhl {
    font-size: 26px; font-weight: 800; font-style: italic;
    letter-spacing: -.01em; color: #facc15;
}
.courier-fedex {
    font-size: 26px; font-weight: 800; color: #0f172a;
}
.courier-fedex span { color: #f97316; }
.courier-ups {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 26px; font-weight: 800; color: #ca8a04;
}
.courier-shield { width: 22px; height: 22px; fill: currentColor; flex: none; }
.courier-note { font-size: 13.5px; color: var(--ink-3); }
.tick-list { list-style: none; padding: 0; margin: 0 0 26px; }
.tick-list li {
    position: relative; padding-left: 30px; margin-bottom: 11px; font-size: 15.5px;
}
.tick-list li::before {
    content: ""; position: absolute; left: 0; top: 7px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/12px no-repeat;
}

.workflow-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px 24px; box-shadow: var(--shadow-sm);
}
.workflow-card h3 { margin-bottom: 18px; }
.workflow { list-style: none; padding: 0; margin: 0; }
.workflow li { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.workflow li:last-child { padding-bottom: 0; }
.workflow li::after {
    content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px;
    width: 2px; background: var(--line);
}
.workflow li:last-child::after { display: none; }
.workflow .step {
    flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; z-index: 1;
}
.workflow strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.workflow p { margin: 0; font-size: 14px; color: var(--ink-3); }

/* ---------- 优势卡（居中版式，改回旧版的成品感） ---------- */
.adv-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.adv-card {
    background: #fff; border: 1px solid #d7dee8; border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    padding: 30px 24px; text-align: center;
}
.adv-ico {
    width: 62px; height: 62px; border-radius: 50%;
    background: #eff6ff; color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.adv-ico .ico-lg { width: 27px; height: 27px; }
.adv-card h3 { font-size: 17px; margin-bottom: 9px; }
.adv-card p { margin: 0; font-size: 14.5px; color: var(--ink-3); }

/* ---------- 客户评价 ---------- */
.rev-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.rev-card {
    margin: 0; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px;
    display: flex; flex-direction: column;
}
.rev-card blockquote {
    margin: 0 0 18px; font-size: 15px; color: var(--ink-2); line-height: 1.65;
    flex: 1;
}
.rev-card blockquote::before { content: "“"; }
.rev-card blockquote::after  { content: "”"; }
.rev-card figcaption strong { display: block; color: var(--ink); font-size: 14.5px; }
.rev-card figcaption span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 结尾 CTA（浅色底，与黑色页脚拉开对比） ---------- */
.cta-band {
    background: #eef3fa;
    border-top: 1px solid #dbe4f0;
    border-bottom: 1px solid #dbe4f0;
    padding: 60px 0;
}
.cta-inner { text-align: center; max-width: 720px; }
.cta-inner h2 { color: var(--navy-dark); }
.cta-inner p { color: var(--ink-2); margin-bottom: 26px; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.btn-ghost-light { background: #fff; color: var(--navy-dark); border-color: #c3cedd; }
.btn-ghost-light:hover { background: var(--navy-dark); color: #fff; border-color: var(--navy-dark); }

/* ---------- 响应式 ---------- */
@media (min-width: 640px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rev-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-actions { flex-direction: row; justify-content: center; max-width: none; }
    .hero-actions .btn { width: auto; min-width: 190px; }
    .cta-actions { flex-direction: row; justify-content: center; max-width: none; }
    .facts-inner { grid-template-columns: repeat(4, 1fr); }
    .cat-rail.is-expanded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .hero-inner { padding-top: 62px; padding-bottom: 48px; }
    .cat-card { flex-basis: 280px; }
    .pop-rail .p-card { flex-basis: 250px; }
    .adv-grid { grid-template-columns: repeat(2, 1fr); }
    /* 物流区块：图上文下，先看到货再读字 */
    .two-col--rev .logi-media { order: -1; }
}

@media (min-width: 1024px) {
    .two-col { grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
    .two-col--rev { grid-template-columns: .9fr 1.1fr; }
    .two-col--rev .logi-media { order: 0; }
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .rev-grid { grid-template-columns: repeat(3, 1fr); }
    .adv-grid { grid-template-columns: repeat(4, 1fr); }
    .rail-hint { display: none; }
    .cat-rail {
        overflow: visible; padding-left: 0; padding-right: 0;
        max-width: var(--container); margin: 0 auto;
        display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    }
    .cat-rail.is-expanded { grid-template-columns: repeat(4, 1fr); }
    /* 热门产品：桌面端也保留横滑（一行），不再铺成网格 */
    .pop-rail {
        max-width: var(--container); margin: 0 auto;
        padding-left: 20px; padding-right: 20px;
    }
    .pop-rail .p-card { flex-basis: 260px; }
}

/* 移动端：底部给悬浮球留出空间 */
@media (max-width: 1023px) {
    body { padding-bottom: 0; }
    .site-footer { padding-bottom: 88px; }
}
