/* ============================================================
   文件位置: assets/css/custom.css
   用途: 全站自定义样式
   对应文档: 第 3.4 节、第 5.4 节、第 5.5 节、第 34.5.2 节
   最后更新: 2026-10-30
   
   ============================================================
   【14F-2b Part A 重构说明】
   
   本文件重构为"仅包含首屏未内联的样式"。
   
   首屏关键 CSS 已全部内联到 app/views/layouts/header.php 的 <style> 标签，
   包括：CSS 变量、body/h1-h6 基础、导航栏、Hero 区块、按钮、分类卡片、
   产品卡片基础结构、移动端浮动询盘按钮、移动端响应式字号。
   
   本文件通过 media="print" onload="this.media='all'" 异步加载，
   只保留以下非首屏样式：
     - 产品卡片 hover 和放大动画（悬停时才有）
     - 产品详情页灯箱和主图悬停放大（详情页二屏）
     - 富文本内容约束（.tab-content / .rich-content）（详情页二屏起）
     - 规格表交错背景色（详情页二屏）
     - Tooltip 样式（悬停时出现）
     - 导航栏下拉展开（@media min-width 992px，悬停时出现）
     - 核心优势卡片（首页二屏）
     - 信任模块（首页三屏）
     - 客户评价（首页三屏）
     - Blog 卡片（首页四屏）
     - 询盘 CTA 区块（首页五屏）
     - 表单错误提示（表单交互时出现）
     - Lightbox 灯箱（点击图片时出现）
     - Blog 详情 TOC（详情页二屏）
   
   【修改原则】
     - 同一属性同一选择器只定义 1 次（硬约束 64）
     - 删除 HTML 前先搜索 CSS（硬约束 60）
     - 删除 CSS 前先搜索 HTML（硬约束 60）
   
   对应文档：
     第 14.1.1 节（首屏关键 CSS 内联）
     硬约束 60、64
     硬约束 119（禁止 CSS !important 覆盖 JS inline style）
   ============================================================ */

/* ============================================================
   一、产品卡片 hover 和动画（首屏已内联基础，此处只放交互）
   ============================================================ */
.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-accent);
}

.product-card:hover .product-card-image img {
    transform: scale(1.35);
}

/* 移动端禁用 hover 放大 */
@media (hover: none) {
    .product-card:hover .product-card-image img,
    .product-gallery .carousel-item:hover img {
        transform: none;
    }
}

/* ============================================================
   二、产品详情页：主图灯箱 + 主图悬停放大
   ============================================================ */
.product-detail-lightbox {
    display: block;
    position: relative;
    cursor: zoom-in;
    text-decoration: none;
}
.product-detail-lightbox img {
    display: block;
    width: 100%;
}
.product-gallery .carousel-item {
    overflow: hidden;
}
.product-gallery .carousel-item img {
    transition: transform 0.4s ease-out;
    will-change: transform;
}
.product-gallery .carousel-item:hover img {
    transform: scale(var(--product-image-hover-scale, 1.88));
}

/* ============================================================
   三、产品详情页：规格表行交替背景色
   ============================================================ */
#tab-specs .table tbody tr:nth-child(even) > th,
#tab-specs .table tbody tr:nth-child(even) > td {
    background-color: #f8f9fa;
}
#tab-specs .table tbody tr:hover > th,
#tab-specs .table tbody tr:hover > td {
    background-color: #eef2f7;
}

/* ============================================================
   四、富文本内容约束（.tab-content / .rich-content）
   ============================================================ */
.tab-content,
.tab-content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.tab-content img {
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px 0 !important;
    border-radius: 6px;
    vertical-align: middle;
}
.tab-content video,
.tab-content iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px auto !important;
}
.tab-content table {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap;
}
.tab-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    overflow-x: hidden !important;
}
.product-tabs .container,
.tab-content {
    overflow-x: hidden !important;
}
@media (max-width: 767.98px) {
    .tab-content {
        padding: 12px !important;
    }
    .tab-content img {
        margin: 8px auto !important;
        border-radius: 4px;
    }
}

/* .rich-content 富文本容器约束 */
.rich-content,
.rich-content * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.rich-content img {
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px 0 !important;
    border-radius: 6px;
    vertical-align: middle;
}
.rich-content video,
.rich-content iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px auto !important;
}
.rich-content table {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap;
}
.rich-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    overflow-x: hidden !important;
}
@media (max-width: 767.98px) {
    .rich-content img {
        margin: 8px auto !important;
        border-radius: 4px;
    }
}

/* ============================================================
   五、Tooltip（悬停时出现，可异步）
   ============================================================ */
.tooltip,
body > .tooltip {
    pointer-events: none !important;
}
.tooltip.show,
body > .tooltip.show,
.tooltip.fade.show {
    pointer-events: auto !important;
}
.tooltip {
    --bs-tooltip-max-width: 640px;
}
.tooltip-inner {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    text-align: left !important;
    cursor: text !important;
    max-width: 640px !important;
    padding: 12px 16px !important;
    line-height: 1.7 !important;
    font-size: 13px !important;
}
.tooltip-inner strong {
    color: #ffd166 !important;
}
body > .tooltip.tooltip-seo-wide .tooltip-inner,
.tooltip-seo-wide .tooltip-inner {
    max-width: 640px !important;
    width: 640px !important;
}
body > .tooltip.tooltip-seo-xwide .tooltip-inner,
.tooltip-seo-xwide .tooltip-inner {
    max-width: 720px !important;
    width: 720px !important;
    max-height: 500px;
    overflow-y: auto;
}
.tooltip-inner * {
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* ============================================================
   六、导航栏 hover 下拉展开（PC 端，hover 时出现）
   ============================================================ */
   
@media (min-width: 992px) {
    .navbar-nav .nav-item.has-children {
        position: relative;
    }
    .navbar-nav .nav-item.has-children:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transition: opacity 0.2s ease-out;
    }
    .navbar-nav .nav-item.has-children > .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
        margin-top: 0;
        top: 100%;
        left: 0;
    }
    .navbar-nav .nav-item.has-children > .nav-link {
        cursor: pointer;
    }
    .navbar-nav .nav-item.has-children > .nav-link::after {
        transition: transform 0.2s;
    }
    .navbar-nav .nav-item.has-children:hover > .nav-link::after {
        transform: rotate(180deg);
    }
}

/* ============================================================
   【新增】三级下拉菜单样式（PC 端悬停向右展开）
   最后更新：2026-11-08
   ============================================================ */
.dropdown-submenu {
    position: relative;
}
.dropdown-submenu > .dropdown-item {
    position: relative;
    padding-right: 30px; /* 给箭头留位置 */
}
/* 添加右侧箭头图标 */
.dropdown-submenu > .dropdown-item::after {
    content: "\f0da"; /* FontAwesome caret-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #adb5bd;
}

@media (min-width: 992px) {
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
        top: 0;
        left: 100%;
        margin-top: -1px;
        margin-left: 0;
    }
}

/* ============================================================
   七、首页非首屏模块：核心优势卡片
   ============================================================ */
.advantage-card {
    background: #fff;
    border-radius: 10px;
    padding: 30px 20px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease-out, border-color 0.3s ease-out;
}
.advantage-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-accent);
}
.advantage-icon {
    font-size: 44px;
    color: var(--brand-accent);
    margin-bottom: 16px;
    line-height: 1;
}
.advantage-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 10px;
}
.advantage-desc {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================================================
   八、首页非首屏模块：信任模块（Logo 墙 + 证书 + 评价）
   ============================================================ */
.trust-logo-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, transform 0.3s;
}
.trust-logo-item:hover {
    border-color: var(--brand-accent);
    transform: translateY(-4px);
}
.trust-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(60%);
    transition: filter 0.3s;
}
.trust-logo-item:hover img {
    filter: grayscale(0%);
}
.trust-cert-item {
    padding: 16px;
}
.trust-cert-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 260px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    cursor: zoom-in;
    text-decoration: none;
}
.trust-cert-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0;
    background: transparent;
    transition: transform 0.3s ease-out;
}
.trust-cert-item a:hover img {
    transform: scale(1.05);
}
.trust-cert-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 0;
}
.review-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    position: relative;
}
.review-quote {
    color: var(--brand-accent);
    font-size: 24px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.review-text {
    flex-grow: 1;
    font-size: 15px;
    color: #2D3748;
    line-height: 1.7;
    margin-bottom: 16px;
    font-style: italic;
}
.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}
.review-avatar {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    background: #e9ecef;
    flex-shrink: 0;
}
.review-company {
    color: var(--brand-primary);
    font-size: 14px;
    display: block;
}
.review-position {
    font-size: 12px;
    color: #6c757d;
}

/* ============================================================
   九、首页非首屏模块：Blog 卡片
   ============================================================ */
.blog-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease-out, border-color 0.3s ease-out;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-accent);
}
.blog-card-image {
    display: block;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}
.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}
.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}
.blog-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    font-size: 40px;
}
.blog-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.blog-card-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}
.blog-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card-title a {
    color: var(--brand-primary);
    text-decoration: none;
}
.blog-card-title a:hover {
    color: var(--brand-accent);
}
.blog-card-summary {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 12px;
}
.blog-card-more {
    color: var(--brand-accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

/* ============================================================
   十、首页非首屏模块：询盘 CTA 区块
   ============================================================ */
.inquiry-cta-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: #fff;
}
.inquiry-cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
}
.inquiry-cta-desc {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.inquiry-cta-points li {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.95);
    padding: 6px 0;
}
.inquiry-cta-points i {
    color: #38A169;
}
@media (max-width: 767.98px) {
    .inquiry-cta-title {
        font-size: 1.5rem;
    }
}

/* ============================================================
   十一、表单字段错误提示（表单交互时出现）
   ============================================================ */
.field-error-msg {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ============================================================
   十二、Lightbox 灯箱（点击图片时出现）
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    cursor: zoom-out;
    -webkit-tap-highlight-color: transparent;
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-content {
    position: relative;
    max-width: 1200px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.lightbox-overlay.active .lightbox-content {
    transform: scale(1);
}
.lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
    color: #fff;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    opacity: 0.85;
    max-width: 800px;
    line-height: 1.5;
}
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}
@media (max-width: 767.98px) {
    .lightbox-overlay {
        padding: 50px 10px 20px;
    }
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .lightbox-img {
        max-height: calc(100vh - 180px);
    }
}

/* ============================================================
   十三、Blog / 新闻详情页：TOC 目录 + 阅读进度条
   ============================================================ */
.blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1040;
    background: transparent;
    pointer-events: none;
}
.blog-progress-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #FF6B35 0%, #FFD166 50%, #FF6B35 100%);
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.6);
    transition: width .1s linear;
}
.blog-toc-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    border: 1px solid #e9ecef;
}
.blog-toc-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
}
.blog-toc-list {
    padding: 8px 0;
}
.blog-toc-link {
    display: block;
    padding: 6px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: color .2s, border-color .2s, background .2s;
    word-wrap: break-word;
}
.blog-toc-link:hover {
    color: var(--brand-accent, #2A6DF4);
    background: #fff;
}
.blog-toc-link.active {
    color: var(--brand-accent, #2A6DF4);
    border-left-color: var(--brand-accent, #2A6DF4);
    background: #fff;
    font-weight: 500;
}
.blog-toc-link.toc-level-3 {
    padding-left: 32px;
    font-size: 12px;
    color: #6c757d;
}
.blog-toc-mobile {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}
.blog-toc-mobile summary {
    list-style: none;
    cursor: pointer;
}
.blog-toc-mobile summary::-webkit-details-marker {
    display: none;
}
.blog-toc-mobile summary .fa-chevron-down {
    transition: transform .2s;
}
.blog-toc-mobile[open] summary .fa-chevron-down {
    transform: rotate(180deg);
}
.blog-toc-mobile .blog-toc-list {
    background: #fff;
    padding: 8px 0;
}
.blog-content.rich-content {
    font-size: 16px;
    line-height: 1.8;
    color: #2D3748;
}
.blog-content.rich-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #e9ecef;
    color: var(--brand-primary, #1A365D);
    scroll-margin-top: 80px;
}
.blog-content.rich-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: .75rem;
    color: var(--brand-primary, #1A365D);
    scroll-margin-top: 80px;
}
.blog-content.rich-content p {
    margin-bottom: 1rem;
}
.blog-content.rich-content a {
    color: var(--brand-accent, #2A6DF4);
    text-decoration: underline;
}
.blog-content.rich-content blockquote {
    border-left: 4px solid var(--brand-accent, #2A6DF4);
    padding: 12px 20px;
    background: #f8f9fa;
    margin: 1.2rem 0;
    color: #495057;
    font-style: italic;
}
.blog-content.rich-content ul,
.blog-content.rich-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.blog-content.rich-content img {
    border-radius: 8px;
    margin: 1rem 0;
}
.blog-summary {
    font-size: 1.05rem;
    line-height: 1.7;
    font-style: italic;
}
.blog-related-articles .blog-card:hover {
    transform: translateY(-2px);
    transition: transform .2s ease-out;
}
@media (max-width: 991.98px) {
    .blog-content.rich-content {
        font-size: 15px;
    }
    .blog-content.rich-content h2 {
        font-size: 1.25rem;
    }
    .blog-content.rich-content h3 {
        font-size: 1.1rem;
    }
}