/* ============================================================
   小迈佳科技企业官网 - 自定义样式
   配合 TailwindCSS 使用，补充动画 / 细节样式
   ============================================================ */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ---------- 全局字体高清渲染优化 ---------- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
    letter-spacing: 0.01em;
}
/* 标题更粗更清晰 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-wrap: balance;
}
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }
/* 正文提升可读性 */
p, li, a, span {
    font-weight: 400;
    text-wrap: pretty;
}
/* 导航和按钮加粗 */
nav a, .btn, button {
    font-weight: 500;
}
/* 中文文字微调字距 */
body, .font-sans {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
/* 大标题字重 */
.hero-carousel h1 { font-weight: 800; letter-spacing: -0.02em; }

/* ---------- 图片淡入动画 ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s ease, transform .8s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 卡片悬浮上浮阴影 ---------- */
.card-hover {
    transition: transform .35s ease, box-shadow .35s ease;
}
.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px rgba(7,32,49,0.16);
}

/* ---------- 核心实力卡片（背景图 + 悬停切换 + 高级样式） ---------- */
.strength-card {
    min-height: 250px;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 10px 30px rgba(7,32,49,.12);
}
.strength-card::after {
    content: '';
    position: absolute; inset: 0; z-index: 1;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
    pointer-events: none;
}
.strength-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity .7s ease, transform .9s ease;
}
.strength-bg-base  { opacity: 1; }
.strength-bg-hover { opacity: 0; transform: scale(1.06); }
.strength-card:hover .strength-bg-base  { opacity: 0; transform: scale(1.06); }
.strength-card:hover .strength-bg-hover { opacity: 1; transform: scale(1); }
.strength-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(8,24,42,.30) 0%, rgba(8,24,42,.15) 40%, rgba(8,24,42,.82) 100%);
    transition: background .5s ease;
}
.strength-card:hover .strength-overlay {
    background: linear-gradient(180deg, rgba(7,32,58,.18) 0%, rgba(7,32,58,.08) 35%, rgba(7,32,58,.88) 100%);
}
.strength-card:hover {
    box-shadow: 0 22px 50px rgba(7,32,49,.28);
    border-color: rgba(59,130,246,.45);
}
.strength-card .rich-arrow {
    opacity: 0; transform: translateX(-8px);
    transition: opacity .45s ease, transform .45s ease;
}
.strength-card:hover .rich-arrow { opacity: 1; transform: translateX(0); }

/* ---------- 按钮 hover 变色（Tailwind 已内置，这里补充平滑） ---------- */
.btn-anim {
    transition: all .3s ease;
}

/* ---------- 首页 Banner 大字视差 ---------- */
.hero-slide { opacity: 0; transition: opacity 1s ease; visibility: hidden; }
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-kb { animation: kenburns 18s ease-in-out infinite alternate; }
@keyframes kenburns {
    0%   { transform: scale(1) translate(0,0); }
    100% { transform: scale(1.08) translate(-10px,-6px); }
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #b5c6d6; border-radius: 4px; }
::-webkit-scrollbar-track { background: #f1f5f9; }

/* ---------- 参数表格样式（产品详情页专用） ---------- */
.param-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    overflow: hidden;
}
.param-table th,
.param-table td {
    padding: 11px 16px;
    text-align: left;
    vertical-align: top;
    border-right: 1px solid #edf0f4;
    border-bottom: 1px solid #edf0f4;
}
.param-table th:last-child,
.param-table td:last-child { border-right: none; }
.param-table tbody tr:last-child th,
.param-table tbody tr:last-child td { border-bottom: none; }
/* 表头（thead）深蓝白字 */
.param-table thead th {
    background: #0E3A5D;
    color: #fff;
    font-weight: 600;
    letter-spacing: .03em;
    border-bottom: 2px solid #0E3A5D;
}
/* 两列布局：键列（无 thead 时第一列自动转 th） */
.param-table tbody th {
    background: #f0f6fb;
    color: #0E3A5D;
    font-weight: 600;
    width: 34%;
    white-space: nowrap;
}
.param-table tbody tr:nth-child(even) td { background: #fafbfc; }
.param-table tbody tr:hover td,
.param-table tbody tr:hover th { background: #f0f7ff; }
/* 单行备注（无法解析为 键:值 的行） */
.param-table .param-note { color: #6b7280; font-size: .85rem; font-style: italic; }

/* ---------- 富文本正文内容样式（新闻/方案详情） ---------- */
.rich-content {
    line-height: 1.9;
    color: #374151;
    font-size: 0.98rem;
    /* 防止长型号/长链接/长英文串撑破手机屏幕 */
    overflow-wrap: break-word;
    word-break: break-word;
}
.rich-content h1, .rich-content h2, .rich-content h3 {
    color: #111827;
    font-weight: 700;
    margin: 1.4em 0 .6em;
    overflow-wrap: break-word;
}
.rich-content h1 { font-size: 1.5rem; }
.rich-content h2 { font-size: 1.3rem; }
.rich-content h3 { font-size: 1.1rem; }
.rich-content p { margin: .8em 0; }
.rich-content ul, .rich-content ol { padding-left: 1.4em; margin: .8em 0; }
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 1em 0; }
.rich-content table { max-width: 100%; }
.rich-content a { color: #155A96; text-decoration: underline; word-break: break-all; }
.rich-content pre, .rich-content code { white-space: pre-wrap; word-break: break-all; }

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 36px 0 8px;
}
.pagination .page-info {
    font-size: 0.85rem;
    color: #6b7280;
    margin-right: 8px;
}
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #374151;
    background: #fff;
    transition: all .2s;
}
.pagination .page-link:hover { border-color: #155A96; color: #155A96; }
.pagination .page-link.current { background: #0E3A5D; border-color: #0E3A5D; color: #fff; }
.pagination .page-link.disabled { color: #c4cbd4; pointer-events: none; background: #f9fafb; }

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 0.875rem; color: #6b7280; }
.breadcrumb a { color: #155A96; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- 产品卡片图片占位淡入 ---------- */
.prod-img { transition: transform .5s ease; }
.prod-card:hover .prod-img { transform: scale(1.06); }

/* ============================================================
   分享 / 转发组件样式（微信/微博/QQ空间/QQ/复制链接/X/LinkedIn）
   ============================================================ */

/* ---------- 内联分享条 ---------- */
.share-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}
.share-row-label { font-size: 14px; color: #6b7280; font-weight: 500; margin-right: 2px; }
.share-btn {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: #fff;
    cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    box-shadow: 0 2px 8px rgba(7,32,49,.10);
}
.share-btn .share-svg { width: 18px; height: 18px; display: block; }
.share-btn .share-btn-text { margin-left: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.share-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(7,32,49,.18); opacity: .95; }

/* 各平台品牌色 */
.share-wx   { background: #07C160; }
.share-wb   { background: #E6162D; }
.share-qz   { background: #FDC400; color: #7a4f01; }
.share-qq   { background: #12B7F5; }
.share-copy { background: #6b7280; }
.share-tw   { background: #111827; }
.share-in   { background: #0A66C2; }

/* ---------- 浮动分享按钮 ---------- */
.share-float { position: fixed; right: 18px; bottom: 18px; z-index: 90; }
.share-float-btn {
    width: 54px; height: 54px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #155A96, #0E3A5D); color: #fff;
    border: none; cursor: pointer;
    box-shadow: 0 8px 24px rgba(7,32,49,.30);
    transition: transform .25s ease, box-shadow .25s ease;
}
.share-float-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 30px rgba(7,32,49,.38); }

.share-panel {
    position: absolute; right: 0; bottom: 66px;
    width: 268px;
    background: #fff; border: 1px solid #eef2f6; border-radius: 18px;
    box-shadow: 0 18px 50px rgba(7,32,49,.22);
    padding: 18px;
    transition: opacity .18s ease, transform .18s ease;
}
.share-panel.share-hidden { opacity: 0; transform: translateY(10px) scale(.96); pointer-events: none; }
.share-panel.share-open   { opacity: 1; transform: translateY(0) scale(1); }
.share-panel-title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 14px; }
.share-panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 4px; border: none; background: transparent; cursor: pointer;
    border-radius: 12px; transition: background .15s ease;
}
.share-item:hover { background: #f6f8fa; }
.share-item-icon {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(7,32,49,.14);
}
.share-item-icon .share-svg { width: 20px; height: 20px; }
.share-item-label { font-size: 11px; color: #6b7280; }
.share-panel-tip { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #eef2f6; font-size: 11px; color: #9ca3af; text-align: center; }

/* 分享面板图标品牌色（按钮上同时带 share-item 与品牌类，图标用子元素独立着色） */
.share-panel .share-item.share-wx   .share-item-icon { background: #07C160; }
.share-panel .share-item.share-wb   .share-item-icon { background: #E6162D; }
.share-panel .share-item.share-qz   .share-item-icon { background: #FDC400; color: #7a4f01; }
.share-panel .share-item.share-qq   .share-item-icon { background: #12B7F5; }
.share-panel .share-item.share-copy .share-item-icon { background: #6b7280; }
.share-panel .share-item.share-tw   .share-item-icon { background: #111827; }
.share-panel .share-item.share-in   .share-item-icon { background: #0A66C2; }
/* ---------- 微信扫码弹窗 ---------- */
.share-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(7,32,49,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; transition: opacity .25s ease;
}
.share-overlay.share-overlay-show { opacity: 1; }
.share-modal {
    position: relative;
    width: 100%; max-width: 360px;
    background: #fff; border-radius: 22px;
    padding: 28px 24px 24px; text-align: center;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
    transform: translateY(12px) scale(.97);
    transition: transform .25s ease;
}
.share-overlay-show .share-modal { transform: translateY(0) scale(1); }
.share-modal-close {
    position: absolute; top: 12px; right: 14px;
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: #f3f4f6; color: #6b7280;
    font-size: 18px; line-height: 1; cursor: pointer;
    transition: background .15s ease;
}
.share-modal-close:hover { background: #e5e7eb; }
.share-modal-title { font-size: 17px; font-weight: 700; color: #111827; }
.share-modal-sub { font-size: 12px; color: #6b7280; line-height: 1.7; margin: 8px 0 16px; }
.share-qr {
    width: 216px; height: 216px; margin: 0 auto;
    border: 1px solid #eef2f6; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; padding: 8px;
}
.share-qr img { width: 200px; height: 200px; display: block; }
.share-qr-fallback { font-size: 12px; color: #b91c1c; line-height: 1.6; padding: 8px; }
.share-modal-url {
    margin-top: 14px; font-size: 11px; color: #9ca3af;
    word-break: break-all; line-height: 1.6;
}

/* ---------- 微信咨询弹窗（展示后台上传的二维码图） ---------- */
.wxcontact-modal { max-width: 340px; }
.wxcontact-qr {
    width: 232px; height: 232px; margin: 0 auto;
    border: 1px solid #eef2f6; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; padding: 10px; overflow: hidden;
}
.wxcontact-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wxcontact-id {
    margin-top: 14px; font-size: 13px; color: #374151;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.wxcontact-id span { font-weight: 700; color: #0E3A5D; word-break: break-all; }
.wxcontact-copy {
    padding: 2px 12px; border: 1px solid #155A96; border-radius: 999px;
    background: #EEF5FB; color: #155A96; font-size: 12px; cursor: pointer;
    transition: background .15s ease;
}
.wxcontact-copy:hover { background: #D9EAF7; }
.wxcontact-link {
    display: inline-block; margin-top: 14px;
    font-size: 13px; color: #155A96; text-decoration: underline;
}

/* ---------- 轻提示 ---------- */
.share-toast {
    position: fixed; left: 50%; bottom: 90px; z-index: 1001;
    transform: translateX(-50%) translateY(8px);
    max-width: 80%;
    background: rgba(17,24,39,.92); color: #fff;
    font-size: 13px; padding: 10px 18px; border-radius: 999px;
    opacity: 0; transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.share-toast.share-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端浮动按钮略缩小，避免遮挡 */
@media (max-width: 640px) {
    .share-float-btn { width: 48px; height: 48px; }
    .share-panel { width: 250px; }
}

/* ---------- 在线客服悬浮（右下角：微信咨询 + 返回顶部，后台可开关） ---------- */
.kefu-float {
    position: fixed; right: 18px; bottom: 84px; z-index: 89;
    display: flex; flex-direction: column; gap: 10px;
}
.kefu-btn {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(14,58,93,.22);
    transition: transform .2s ease, box-shadow .2s ease;
    border: none; cursor: pointer; text-decoration: none;
}
.kefu-wx {
    background: linear-gradient(135deg, #16A34A, #15803D); color: #fff;
}
.kefu-wx:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(22,163,74,.35); }
.kefu-top {
    background: rgba(255,255,255,.96); color: #0E3A5D;
    border: 1px solid #eef2f6;
}
.kefu-top:hover { transform: translateY(-3px); background: #fff; }
@media (max-width: 640px) {
    .kefu-float { bottom: 80px; gap: 8px; }
    .kefu-btn { width: 46px; height: 46px; }
}

/* ============================================================
   移动端自适应增强（确保手机上页面完整、无横向溢出/破版）
   ============================================================ */
/* 1. 富文本与参数表：小屏下表格转为块级横向滚动，单元格不换行挤压，
      保证表格结构完整、可滑动查看，不会把页面撑出屏幕 */
@media (max-width: 768px) {
    .rich-content table,
    table.param-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* iOS 顺滑滚动 */
    }
    .rich-content table th,
    .rich-content table td,
    table.param-table th,
    table.param-table td {
        white-space: nowrap;
    }
    /* 小屏适当缩小表格字号，减少滚动距离 */
    .rich-content table,
    table.param-table { font-size: 0.82rem; }
    table.param-table th, table.param-table td { padding: 8px 10px; }

    /* 手机端页脚优化：紧凑间距、二维码不放大、文字不挤 */
    footer { padding-bottom: 4rem; }
    footer .grid { gap: 1.5rem !important; }
    footer h4 { margin-bottom: 0.75rem !important; }
    footer .text-sm { font-size: 0.85rem; line-height: 1.7; }
    /* 手机端二维码 hover 不放大（触屏无 hover） */
    footer .group-hover\:scale-150 { transform: none !important; }
    /* 手机端底部版权栏居中 */
    footer .flex-col.sm\:flex-row { text-align: center; }

    /* 手机端 Banner 文字不贴边 */
    .hero-carousel .relative.z-10 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
    /* 手机端 section 上下间距缩小 */
    section.py-20 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
}
/* 2. 保险丝：任何子内容都不允许把页面横向撑破 */
main img, section img, .rich-content img, .share-modal img { max-width: 100%; }
/* 3. 产品详情缩略图横排可滑动（配合 product.php 的 overflow-x-auto） */
#thumbList { scrollbar-width: thin; }
