/*
 * yuhai-accio WordPress 适配样式
 * accio.css 为 Accio 构建产物(勿改),WP 特有内容(正文排版/分页/搜索/登录条等)在此补充。
 */

/* ── 首页产品中心: WP 版将全部分类面板服务端渲染,JS 切换显示 ── */
.reference-products-preview .reference-products-detail {
    display: none;
}
.reference-products-preview .reference-products-detail.is-active {
    display: flex;
}

/* ── 产品分类页 tabs 用 <a> 实现(WP 分类为真实链接,样式对齐 .tabs button) ── */
.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 15px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--color-text-secondary, #5a6472);
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}
.tabs a:hover,
.tabs a.active {
    color: var(--color-primary, #1a3390);
    border-color: var(--color-primary, #1a3390);
    font-weight: 600;
}

/* ── 产品详情 tag-chip(Accio JSX 使用但构建 CSS 未含) ── */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #eef2fb;
    color: #1a3390;
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
}

/* ── 关于页 研发/标准/质量:演示站该类无任何 CSS(原生文档流堆叠),故不加自定义样式 ── */

/* ── 首页荣誉资质:按客户确认的调整稿(调整荣誉资质.png)改为统一 5×2 等宽网格,
      取代设计 CSS 的马赛克变宽布局;卡片顺序/置顶逻辑不变 ── */
@media (min-width:1024px) {
    .honors-preview-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
    .honors-preview-grid .honors-preview-card {
        grid-column: auto !important;
        grid-row: auto !important;
        order: initial !important;
    }
}
@media (min-width:768px) and (max-width:1023px) {
    .honors-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .honors-preview-grid .honors-preview-card {
        grid-column: auto !important;
        grid-row: auto !important;
        order: initial !important;
    }
}
.honors-preview-card h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

/* ── 新闻列表页手机端:设计 CSS 隐藏第4+张(演示站无分页所致),真实站点有分页需全部展示(横向滑动卡设计保留) —— 记录为对演示站的刻意优化 ── */
@media (max-width: 767px) {
    .news-list-page .news-grid .news-card:nth-child(n+4) {
        display: block !important;
    }
}

/* ── 正文排版(the_content 输出,用于新闻详情/产品详情/解决方案详情) ── */
.entry-content {
    color: #333;
    font-size: 16px;
    line-height: 1.9;
    word-break: break-word;
}
.entry-content > * + * {
    margin-top: 1em;
}
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: #1a3390;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 1.6em;
}
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 19px; }
.entry-content h4 { font-size: 17px; }
.entry-content p { margin: 0; }
.entry-content a {
    color: #1a3390;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.entry-content ul,
.entry-content ol {
    padding-left: 1.6em;
    margin-top: 0.6em;
}
.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: decimal; }
.entry-content li + li { margin-top: 0.35em; }
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}
.entry-content img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.entry-content img.alignleft {
    float: left;
    margin: 0 1.2em 0.8em 0;
}
.entry-content img.alignright {
    float: right;
    margin: 0 0 0.8em 1.2em;
}
.entry-content::after {
    content: "";
    display: block;
    clear: both;
}
.entry-content blockquote {
    border-left: 3px solid #1a3390;
    background: #f5f7fb;
    padding: 12px 18px;
    border-radius: 0 8px 8px 0;
    color: #555;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}
.entry-content table th {
    background: #f4f7fb;
    color: #1a3390;
}
.entry-content figure { margin: 0; }
.entry-content figcaption {
    text-align: center;
    color: #888;
    font-size: 13px;
    margin-top: 6px;
}
.entry-content iframe,
.entry-content video {
    max-width: 100%;
}
.entry-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
}
.entry-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}
.entry-content hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 2em 0;
}

/* ── 新闻详情正文容器 ── */
.news-detail-article .entry-content {
    margin-top: 24px;
}

/* ── 产品详情 gallery 缩略图 ── */
.detail-gallery-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.detail-gallery-thumbs button {
    width: 72px;
    height: 72px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.detail-gallery-thumbs button.active,
.detail-gallery-thumbs button:hover {
    border-color: #1a3390;
}
.detail-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.detail-main-image img {
    transition: opacity 0.25s ease;
}
.detail-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 9px 18px;
    border: 1px solid #1a3390;
    border-radius: 999px;
    color: #1a3390;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}
.detail-pdf-link:hover {
    background: #1a3390;
    color: #fff;
}

/* ── 分页(Accio 无分页样式,WP 列表页需要) ── */
.yuhai-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
}
.yuhai-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #d9dce1;
    background: #fff;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}
.yuhai-pagination .page-numbers:hover {
    border-color: #1a3390;
    color: #1a3390;
}
.yuhai-pagination .page-numbers.current {
    background: #1a3390;
    border-color: #1a3390;
    color: #fff;
    cursor: default;
}
.yuhai-pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}
.yuhai-pagination .prev,
.yuhai-pagination .next {
    padding: 0 20px;
}

/* ── 页头搜索面板(增强:Accio 原型搜索按钮无动作,此处接入 WP 搜索) ── */
.header-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e4ebf2;
    box-shadow: 0 14px 28px rgba(15, 30, 70, 0.08);
    padding: 18px 0;
    display: none;
    z-index: 45;
}
.header-search-panel.is-open {
    display: block;
}
.header-search-panel form {
    width: min(var(--container), calc(100% - 64px));
    margin: 0 auto;
    display: flex;
    gap: 10px;
}
.header-search-panel input[type="search"] {
    flex: 1;
    height: 46px;
    border: 1px solid #d9dce1;
    border-radius: 999px;
    padding: 0 20px;
    font-size: 15px;
    outline: none;
    background: #f5f6f8;
    color: #111;
}
.header-search-panel input[type="search"]:focus {
    border-color: #1a3390;
    background: #fff;
}
.header-search-panel button[type="submit"] {
    height: 46px;
    padding: 0 28px;
    border-radius: 999px;
    background: #1a3390;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
}
.header-search-panel button[type="submit"]:hover {
    background: #24428e;
}
.header-actions {
    position: relative;
}
.site-header .header-search.is-active {
    color: #1a3390;
}

/* ── 通用列表(搜索结果/归档回退) ── */
.generic-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
@media (max-width: 1023px) {
    .generic-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .generic-list-grid { grid-template-columns: 1fr; }
}
.generic-card {
    display: block;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.generic-card:hover {
    box-shadow: 0 14px 30px rgba(15, 30, 70, 0.1);
    transform: translateY(-3px);
}
.generic-card-cover {
    aspect-ratio: 16 / 9;
    background: #f4f7fb;
    overflow: hidden;
}
.generic-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.generic-card-body {
    padding: 18px 20px 20px;
}
.generic-card-body small {
    color: #8a93a3;
    font-size: 13px;
}
.generic-card-body h3 {
    margin-top: 6px;
    font-size: 17px;
    font-weight: 700;
    color: #111;
    line-height: 1.5;
}
.no-results-note {
    text-align: center;
    color: #667;
    padding: 48px 0;
    font-size: 15px;
}

/* ── 产品详情规格表(Accio spec-table 扩展多行) ── */
.spec-table > div + div {
    border-top: 1px solid #eef1f5;
}

/* ── 相关产品区块 ── */
.related-products-section {
    padding: 64px 0 8px;
}
.related-products-section .section-heading {
    margin-bottom: 32px;
}
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 1023px) {
    .related-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .related-products-grid { grid-template-columns: 1fr; }
}

/* ── 上下篇导航 ── */
.post-neighbor-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e8edf3;
}
.post-neighbor-nav a {
    max-width: 48%;
    color: #1a3390;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.6;
}
.post-neighbor-nav a:hover { text-decoration: underline; }
.post-neighbor-nav .nav-next { margin-left: auto; text-align: right; }

/* ── 页脚联系方式:设计 CSS 将 p 设为 flex(演示站 p 内为纯文本),此处 p 内是可点击 <a>,需恢复 block 使 <br> 换行生效 ── */
.reference-footer .footer-contact > div p {
    display: block !important;
}
.reference-footer .footer-contact > div p a {
    display: inline !important;
    color: inherit;
}

/* ── 移动端细节修正 ── */
@media (max-width: 767px) {
    .header-search-panel form {
        width: calc(100% - 32px);
    }
    .post-neighbor-nav {
        flex-direction: column;
    }
    .post-neighbor-nav a { max-width: 100%; }
    .post-neighbor-nav .nav-next { margin-left: 0; text-align: left; }
}

/* ════ 1023 整改 ════ */

/* 1. 产品图居中且不裁切(部分浏览器 object-fit:cover 表现为图左移右侧留白;产品照应完整展示) */
.product-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img {
    object-fit: contain;
}
.detail-image img {
    object-fit: contain;
}

/* 3/8. 手机端浮动快捷联系:设计 CSS 在 ≤1280 隐藏,客户要求手机显示 —— 紧凑胶囊版 */
@media (max-width: 1280px) {
    .floating-contact {
        display: block !important;
        position: fixed;
        right: 12px;
        bottom: 12px;
        top: auto;
        transform: none;
        width: 54px;
        height: auto;
        padding: 8px 2px 4px;
        background: #fff;
        border-radius: 28px;
        box-shadow: 0 4px 16px rgba(10, 40, 80, 0.18);
        z-index: 20;
    }
    .floating-contact li {
        margin: 0 0 6px;
    }
    .floating-contact li > a p {
        font-size: 11px;
        line-height: 20px;
    }
    .floating-contact-phone-icon {
        width: 40px;
        height: 40px;
    }
    .floating-contact-phone-icon:after {
        display: none;
    }
    .floating-contact-phone-icon svg {
        width: 20px;
        height: 20px;
    }
    .floating-contact li > a svg {
        width: 20px;
        height: 20px;
    }
    .floating-contact-hotline {
        display: none !important;
    }
}

/* 4. 页脚联系方式:三个独立外框 + 间隔;图标与右侧内容垂直居中,内容在框内居中 */
.reference-footer .footer-contact {
    display: grid;
    gap: 14px;
    grid-template-rows: none;
}
.reference-footer .footer-contact > div {
    height: auto;
    min-height: 0;
    border: 1px solid #dfe3ea;
    background: #fbfcfe;
    border-radius: 10px;
    padding: 10px 16px;
    align-items: center;
    gap: 14px;
}
.reference-footer .footer-contact > div svg {
    margin-top: -4px;
    flex: 0 0 auto;
}
/* 地址框:文字下移至红框位置(图标保持原位);固定框高避免上下留白过大 */
.reference-footer .footer-contact > div:nth-child(3) {
    height: 104px;
}
.reference-footer .footer-contact > div:nth-child(3) p {
    margin-top: 26px;
}
.reference-footer .footer-contact > div p {
    display: block;
    line-height: 1.7;
}

/* 5. 小屏手机首屏:缩小标题并把产品图下移,避免文字压图 */
@media (max-width: 430px) {
    .hero-carousel {
        height: calc(60px + 105vw) !important;
    }
    .reference-hero-content .reference-hero-copy h1 {
        font-size: 30px !important;
    }
    .reference-hero-visual {
        width: 92% !important;
        right: 0 !important;
        bottom: 0 !important;
    }
}

/* 6. 手机端产品中心:加大堆叠卡舞台高度(图片过小) */
@media (max-width: 767px) {
    .reference-products-stage {
        aspect-ratio: auto;
        height: 340px;
        padding: 10px 18px;
    }
    .reference-products-card {
        max-height: none;
        height: calc(100% - 20px);
    }
}

/* 7a. 首页新闻横滑:touch-action:pan-x 会吞掉纵向手势导致页面卡死,放开纵轴 */
.news-section .news-grid {
    touch-action: pan-x pan-y !important;
}

/* 7b. 手机端新闻列表页:改为两列网格(横滑容器在部分机型图片渲染异常/蓝底),并让封面图满格覆盖 */
@media (max-width: 767px) {
    .news-list-page .news-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
        width: 100% !important;
        margin-right: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        scroll-snap-type: none !important;
        touch-action: auto !important;
    }
    .news-list-page .news-card {
        flex: none !important;
        width: auto !important;
        min-width: 0 !important;
        scroll-snap-align: auto !important;
    }
}
/* 新闻封面图:满格展示,渐变仅作加载底色(修复部分机型蓝底/图不显示) */
.news-cover {
    padding: 0 !important;
    display: block;
    overflow: hidden;
}
.news-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* (1024 banner 缩小调整已按客户要求取消还原,恢复 Accio 原设计布局) */

/* 打印/无障碍:跳转链接 */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999999;
    background: #1a3390;
    color: #fff;
    padding: 10px 18px;
    border-radius: 0 0 8px 0;
}
.skip-link:focus {
    left: 0;
}
