/* ============================================================
   style.css — 河南新安大科技有限公司 公用样式
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
    --c-primary:         #2563eb;
    --c-primary-hover:   #3b82f6;
    --c-primary-btn:     #2563eb;
    --c-bg:              #f8faff;
    --c-bg-alt:          #eef2ff;
    --c-surface:         #ffffff;
    --c-header:          rgba(255,255,255,0.97);
    --c-header-scrolled: rgba(255,255,255,0.95);
    --c-footer:          #0f172a;
    --c-brand:           #0f172a;
    --c-accent:          #0ea5e9;
    --shadow-text:       none;
}

/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Microsoft YaHei", sans-serif; scroll-behavior: smooth; }
html { scroll-padding-top: 60px; }
body { color: #1e293b; line-height: 1.7; background: var(--c-bg); }
.container { width: 1200px; margin: 0 auto; max-width: 95%; }
a { text-decoration: none; color: inherit; }

/* ===== 文字层级 ===== */
p, li, .text { letter-spacing: 0.3px; }
.first-level-text { color: var(--c-brand); }
.second-level-text { color: var(--c-accent); }

/* ===== 淡入动画（子页面） ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== 顶部导航 ===== */
.header {
    background: var(--c-header);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: background 0.3s, box-shadow 0.3s;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 20px rgba(0,0,0,0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.header.scrolled { background: var(--c-header-scrolled); box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.nav { display: flex; align-items: center; flex-wrap: wrap; }
.logo { font-size: 24px; font-weight: 700; color: var(--c-brand); letter-spacing: -0.3px; margin-right: auto; }

/* ===== 汉堡按钮（移动端显示） ===== */
.menu-toggle {
    display: none;
    background: none;
    border: 1.5px solid rgba(15,23,42,0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    color: var(--c-brand);
    padding: 3px 10px;
    line-height: 1.4;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.menu-toggle:hover { background: var(--c-bg-alt); border-color: var(--c-primary); color: var(--c-primary); }

/* ===== 主菜单 ===== */
.menu { display: flex; gap: 24px; font-size: 15px; list-style: none; position: relative; z-index: 99; flex-wrap: wrap; }
.menu li { position: relative; display: inline-block; }
.menu a { color: #475569; padding: 6px 0; position: relative; transition: color 0.2s, transform 0.2s; display: inline-block; font-weight: 500; }
.menu a:hover { color: var(--c-primary); transform: translateY(-1px); }
.menu a::after { content: ''; width: 0; height: 2px; background: var(--c-primary); position: absolute; bottom: 0; left: 0; transition: width 0.25s; border-radius: 2px; }
.menu a:hover::after { width: 100%; }
.menu a.active { color: var(--c-primary); font-weight: 600; }
.menu > li:not(.has-submenu) > a.active::after { width: 100%; }

/* 桌面端：有子菜单的项通过伪元素显示 ▾ */
.has-submenu > a::after { content: ' ▾'; width: auto; height: auto; background: none; position: static; }
.has-submenu > a:hover::after { width: auto; }

/* ===== 子菜单展开按钮（移动端显示） ===== */
.submenu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-brand);
    font-size: 15px;
    padding: 8px 10px;
    line-height: 1;
    transition: transform 0.25s;
    vertical-align: middle;
}
.submenu-toggle[aria-expanded="true"] { transform: rotate(180deg); }

/* ===== 下拉菜单 ===== */
.submenu { position: absolute; top: calc(100% + 10px); left: 0; min-width: 220px; background: #fff; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease; list-style: none; padding: 6px 0; border: 1px solid rgba(0,0,0,0.06); z-index: 100; }
.submenu li { display: block; padding: 0; }
.submenu a { display: block; padding: 9px 20px; white-space: nowrap; color: #334155; font-size: 14px; transition: background 0.15s, color 0.15s, padding-left 0.15s; }
.submenu a:hover { background: var(--c-bg-alt); color: var(--c-primary); padding-left: 24px; transform: none; }
.submenu a::after { display: none; }
.menu li:hover .submenu { opacity: 1; visibility: visible; transform: translateY(0); }

/* ===== 面包屑导航 ===== */
.breadcrumb-container { margin-bottom: 14px; }
.breadcrumb-nav { display: inline-block; max-width: 100%; }
.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.4;
    list-style: none;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.breadcrumb-list::-webkit-scrollbar { display: none; }
.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: #94a3b8;
}
.breadcrumb-item a {
    color: #64748b;
    transition: color 0.2s;
}
.breadcrumb-item a:hover { color: var(--c-primary); }
.breadcrumb-item[aria-current="page"] span {
    color: var(--c-brand);
    font-weight: 600;
}

/* ===== 页脚 ===== */
.footer { background: var(--c-footer); color: #64748b; padding: 55px 0 25px; margin-top: 50px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 45px; margin-bottom: 35px; }
.footer-col { flex: 1 1 250px; }
.footer-col h4 { color: #f1f5f9; margin-bottom: 18px; font-size: 15px; letter-spacing: 0.3px; font-weight: 600; }
.footer-col p { margin-bottom: 10px; color: #64748b; font-size: 14px; }
.footer-col a { color: #64748b; transition: color 0.2s; }
.footer-col a:hover { color: var(--c-accent); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 22px; margin-top: 25px; color: #475569; font-size: 13px; }
.footer-qr-placeholder {
  width: 100px; height: 100px; margin-top: 12px;
  border: 1.5px dashed rgba(255,255,255,0.18); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); color: #475569;
  font-size: 11px; text-align: center; line-height: 1.6;
  white-space: pre-line;
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: #fff;
    color: var(--c-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.06);
    transition: opacity 0.3s ease, background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--c-primary); color: #fff; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(37,99,235,0.3); border-color: transparent; }

/* ===== 导航右侧组（语言切换 + 汉堡按钮） ===== */
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: 24px; }

/* ===== 语言切换按钮 ===== */
.lang-switch { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; border: 1px solid #cbd5e1; border-radius: 6px; padding: 2px 6px; transition: border-color 0.2s, box-shadow 0.2s; }
.lang-switch:hover { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.lang-switch-link { color: #64748b; padding: 3px 5px; border-radius: 4px; transition: color 0.2s; }
.lang-switch-link:hover { color: var(--c-primary); }
.lang-switch-link.lang-active { color: var(--c-primary); font-weight: 700; }
.lang-sep { color: #cbd5e1; line-height: 1; }

/* ===== 产业布局 2×2 网格 ===== */
.business-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
@media (max-width: 768px) { .business-grid { grid-template-columns: 1fr; } }

/* ===== 产品子页面公用布局 ===== */
.product-section { padding: 10px 0 70px; background-color: var(--c-bg); }

/* ===== 通用卡片 ===== */
.card {
  background: var(--c-surface); border-radius: 10px; overflow: hidden;
  box-shadow: 0 3px 15px rgba(0,0,0,.1); padding: 28px; transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  border: 1px solid rgba(0,102,204,0.15); cursor: pointer;
  text-align: center; min-height: 200px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.card p     { color: #000; white-space: pre-line; word-break: break-all; }
.card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 12px 30px rgba(0,102,204,0.2); border-color: rgba(0,102,204,0.3); }
.card:hover h3 { color: var(--c-primary); }
.card h3    { color: var(--c-accent); margin-bottom: 12px; }
.card-icon { color: var(--c-accent); margin-bottom: 20px; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.section-spaced { margin-top: 60px; }
.centered-text { text-align: center; }
.narrow-panel { max-width: 480px; margin: 0 auto; }
.wide-panel { max-width: 800px; margin: 0 auto; }
.contact-link { color: var(--c-primary); font-weight: 600; }
.contact-link-large { color: var(--c-primary); font-size: 18px; font-weight: 700; }
.muted-note { margin-top: 8px; color: #64748b; font-size: 13px; }
.compact-note { margin-top: 8px; }
.section-note { margin-top: 20px; }

/* ── 荣誉资质总览卡片网格 ── */
.honor-hub-grid {
  display: flex; flex-wrap: wrap; gap: 28px;
  justify-content: center; align-items: stretch; width: 100%;
}
.honor-hub-grid .card { flex: 0 1 280px; min-width: 260px; max-width: 32%; height: auto; min-height: 200px; }
.honor-hub-pending { cursor: default; }
.honor-hub-pending:hover { transform: none; box-shadow: 0 3px 15px rgba(0,0,0,.1); border-color: rgba(0,102,204,0.15); }
@media (max-width: 768px) { .honor-hub-grid .card { max-width: 100%; } }

.product-title { text-align: center; margin-bottom: 45px; }
.product-title h2 { font-size: 28px; margin-bottom: 10px; color: var(--c-brand); font-weight: 700; }
.product-title p { font-size: 15px; color: #64748b; }

.product-content { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.product-text { flex: 1 1 400px; }
.product-text h3 { font-size: 22px; margin-bottom: 18px; color: var(--c-brand); font-weight: 700; }
.product-text p { margin-bottom: 15px; line-height: 1.8; color: #334155; }

.product-gallery { flex: 1 1 500px; display: flex; flex-wrap: wrap; gap: 12px; }
.product-gallery-item { flex: 1 1 200px; overflow: hidden; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.06); }
.product-gallery-item img { width: 100%; height: 210px; object-fit: cover; }

.advantage-grid { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 40px; }
.advantage-card { flex: 1 1 220px; background: var(--c-surface); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.06); }
.advantage-card h4 { font-size: 15px; margin-bottom: 10px; color: var(--c-brand); font-weight: 700; }
.advantage-card p { color: #475569; line-height: 1.7; font-size: 14px; }
.contact-card-pending { border: 1.5px dashed #c0c8d8; background: var(--c-bg); }
.contact-card-pending h4 { color: #64748b; }

.job-list { display: flex; flex-direction: column; gap: 0; margin-top: 40px; max-width: 900px; margin-left: auto; margin-right: auto; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.06); }
.job-item { display: flex; align-items: center; gap: 0; background: var(--c-surface); border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.15s; }
.job-item:last-child { border-bottom: none; }
.job-item:hover { background: #f8fafc; }
.job-item-title { flex: 0 0 auto; width: 148px; padding: 22px 24px; border-right: 1px solid rgba(0,0,0,0.05); font-size: 15px; font-weight: 700; color: var(--c-brand); display: flex; align-items: center; gap: 10px; }
.job-item-title::before { content: ''; display: inline-block; width: 3px; height: 18px; border-radius: 2px; background: var(--c-primary-btn); flex-shrink: 0; }
.job-item-desc { flex: 1; padding: 22px 28px; color: #475569; font-size: 14px; line-height: 1.7; }

.param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 30px 0; }
.param-item { background: var(--c-surface); padding: 22px; border-radius: 12px; text-align: center; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.param-item h4 { font-size: 13px; color: #64748b; margin-bottom: 8px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.param-item .value { font-size: 17px; color: var(--c-primary); font-weight: 700; }

.product-table { width: 100%; border-collapse: collapse; margin: 30px 0; background: var(--c-surface); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.06); }
.product-table th { background: var(--c-primary-btn); color: #fff; padding: 14px 16px; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
.product-table td { padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.04); vertical-align: top; color: #334155; font-size: 14px; }
.product-table tr:last-child td { border-bottom: none; }
.product-table tr:hover td { background: var(--c-bg); }

/* ===== 实验室图片网格 ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 40px 0; }
.gallery-card { background: var(--c-surface); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.06); }
.gallery-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-caption { padding: 14px 18px; text-align: center; color: #475569; font-weight: 500; font-size: 14px; }

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    /* 导航栏顶行 */
    .nav { flex-wrap: wrap; align-items: center; }
    .logo { flex: 1; text-align: left; font-size: 16px; }
    .nav-right { order: 2; }
    .menu-toggle { display: inline-flex; }

    /* 菜单折叠为抽屉 */
    .menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        margin-top: 8px;
        background: var(--c-surface);
        border-radius: 10px;
        border: 1px solid rgba(0,0,0,0.06);
        box-shadow: 0 8px 32px rgba(0,0,0,0.08);
        overflow: hidden;
    }
    .menu.open { display: flex; }

    /* 每个菜单项一行 */
    .menu > li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05); }
    .menu > li:last-child { border-bottom: none; }
    .menu > li > a { flex: 1; padding: 13px 18px; font-size: 15px; color: #334155; }
    .menu > li > a:hover { transform: none; color: var(--c-primary); background: var(--c-bg); }
    .menu > li > a::after { display: none; }

    /* 显示子菜单展开按钮，隐藏桌面端伪元素 ▾ */
    .has-submenu > a::after { content: none; }
    .submenu-toggle { display: inline-flex; padding: 13px 14px; }

    /* 子菜单展开为竖向列表 */
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        background: var(--c-bg);
        padding: 4px 0;
    }
    .submenu.open { display: block; }
    /* 关闭桌面 hover 触发 */
    .menu li:hover .submenu { opacity: 1; visibility: visible; transform: none; display: none; }
    .menu li:hover .submenu.open { display: block; }
    .submenu li { display: block; }
    .submenu a { padding: 11px 18px 11px 34px; white-space: normal; font-size: 14px; color: #475569; }
    .product-content { flex-direction: column; }
    .product-gallery-item { flex: 1 1 100%; }
    .advantage-grid { flex-direction: column; }
    .advantage-card { flex: 1 1 100%; }
    .job-item { flex-direction: column; align-items: stretch; }
    .job-item-title { width: auto; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 16px 20px 12px; }
    .job-item-desc { padding: 12px 20px 16px; }
    .product-table { font-size: 13px; }
    .product-table th, .product-table td { padding: 10px 8px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .back-to-top { width: 40px; height: 40px; bottom: 20px; right: 20px; font-size: 18px; border-radius: 8px; }
}
