/* ===== 汉嘉晟企业官网 - 共享样式 ===== */
/* 版本: v1.0 */

:root {
    --primary: #0055a4;
    --primary-dark: #003d7a;
    --primary-light: #e8f1fa;
    --accent: #f5a623;
    --text: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --bg: #ffffff;
    --bg-gray: #f7f8fa;
    --bg-dark: #2c3e50;
    --border: #e0e4e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    --radius: 4px;
    --radius-lg: 8px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
    --cat-color-1: #2196F3;
    --cat-color-2: #4CAF50;
    --cat-color-3: #FF9800;
    --cat-color-4: #9C27B0;
    --cat-color-5: #F44336;
    --cat-color-6: #00BCD4;
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul, li { list-style: none; }
img { max-width: 100%; display: block; }

/* ========== Header ========== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 44px; height: 44px;
    border-radius: 9px;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-icon svg { width: 100%; height: 100%; display: block; }
.logo > svg {
    width: 44px; height: 44px; display: block; flex-shrink: 0;
    border-radius: 9px;
}
.logo > svg + span { font-size: 16px; color: var(--primary); font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.logo-text h1 { font-size: 16px; color: var(--primary); font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.logo-text p { font-size: 11px; color: var(--text-light); letter-spacing: 1px; }
.nav { display: flex; gap: 32px; }
.nav a {
    font-size: 15px; color: var(--text); font-weight: 500;
    padding: 8px 0; position: relative;
}
.nav a:hover, .nav a.active { color: var(--primary); }
.nav a.active::after {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 2px; background: var(--primary);
}
.header-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; gap: 8px; font-size: 13px; }
.lang-switch span.active { color: var(--primary); font-weight: 600; }
.lang-switch span { color: var(--text-light); cursor: pointer; }
.mobile-menu { display: none; font-size: 24px; cursor: pointer; }

/* ========== Banner ========== */
.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 48px 24px;
    position: relative; overflow: hidden;
}
.banner::before {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05); border-radius: 50%;
}
.banner::after {
    content: ''; position: absolute; bottom: -30%; left: -5%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.03); border-radius: 50%;
}
.banner-inner {
    max-width: var(--max-width); margin: 0 auto;
    position: relative; z-index: 1;
}
.breadcrumb { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 12px; }
.breadcrumb a:hover { color: white; }
.breadcrumb .current { color: var(--accent); }
.banner h2 { font-size: 36px; color: white; font-weight: 700; letter-spacing: 2px; }
.banner p { margin-top: 8px; font-size: 15px; color: rgba(255,255,255,0.8); }

/* ========== Buttons ========== */
.btn {
    padding: 10px 24px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: var(--transition); border: none; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #e09500; }
.btn-lg { padding: 14px 36px; font-size: 16px; border-radius: var(--radius-lg); }

/* ========== Section ========== */
.section { padding: 64px 24px; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-title {
    text-align: center; margin-bottom: 48px;
}
.section-title h3 {
    font-size: 28px; color: var(--text); font-weight: 700;
    position: relative; display: inline-block;
}
.section-title h3::after {
    content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 3px; background: var(--primary); border-radius: 2px;
}
.section-title p { margin-top: 16px; color: var(--text-light); font-size: 15px; }
.section-gray { background: var(--bg-gray); }

/* ========== Cards ========== */
.card {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin-bottom: 16px;
}
.card h4 { font-size: 17px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-light); line-height: 1.7; }

/* ========== Footer ========== */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.8);
    padding: 48px 24px 24px;
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer h4 { color: white; font-size: 15px; margin-bottom: 16px; }
.footer p { font-size: 13px; line-height: 2; }
.footer-links a {
    display: block; font-size: 13px;
    color: rgba(255,255,255,0.6); padding: 4px 0;
}
.footer-links a:hover { color: white; }
.footer-bottom {
    max-width: var(--max-width); margin: 32px auto 0;
    padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-between;
    font-size: 12px; color: rgba(255,255,255,0.5);
}

/* ========== Product Sidebar ========== */
.sidebar {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    height: fit-content; position: sticky; top: 88px;
}
.sidebar-title {
    background: var(--primary); color: white;
    padding: 16px 20px; font-size: 16px; font-weight: 600;
}
.category { border-bottom: 1px solid var(--border); }
.category:last-child { border-bottom: none; }
.category-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; cursor: pointer;
    transition: var(--transition); font-weight: 600; font-size: 14px;
}
.category-header:hover { background: var(--primary-light); }
.category-header.active { background: var(--primary-light); color: var(--primary); }
.cat-icon {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.cat-icon.c1 { background: rgba(33,150,243,0.12); color: var(--cat-color-1); }
.cat-icon.c2 { background: rgba(76,175,80,0.12); color: var(--cat-color-2); }
.cat-icon.c3 { background: rgba(255,152,0,0.12); color: var(--cat-color-3); }
.cat-icon.c4 { background: rgba(156,39,176,0.12); color: var(--cat-color-4); }
.cat-icon.c5 { background: rgba(244,67,54,0.12); color: var(--cat-color-5); }
.cat-icon.c6 { background: rgba(0,188,212,0.12); color: var(--cat-color-6); }
.category-arrow {
    margin-left: auto; font-size: 12px;
    transition: transform 0.3s; color: var(--text-light);
}
.category-header.active .category-arrow { transform: rotate(90deg); }
.product-list { display: none; padding: 0 20px 12px 64px; }
.product-list.show { display: block; }
.product-list li {
    padding: 8px 0; font-size: 13px;
    color: var(--text-light); cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px dashed #f0f0f0;
}
.product-list li:last-child { border-bottom: none; }
.product-list li:hover { color: var(--primary); padding-left: 6px; }
.product-list li.active { color: var(--primary); font-weight: 600; }

/* ========== Product Detail ========== */
.product-detail {
    display: none; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; animation: slideIn 0.3s ease;
}
.product-detail.show { display: block; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.detail-header {
    background: var(--primary-light); padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.detail-header h3 { font-size: 22px; color: var(--primary-dark); }
.detail-close {
    width: 32px; height: 32px; border: none;
    background: rgba(0,0,0,0.06); border-radius: 50%;
    cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.detail-close:hover { background: rgba(0,0,0,0.12); }
.detail-body { padding: 24px; }
.detail-tag {
    display: inline-block; background: var(--primary); color: white;
    padding: 3px 10px; border-radius: 12px; font-size: 12px; margin-bottom: 16px;
}
.detail-body > p { font-size: 14px; line-height: 1.8; color: var(--text); margin-bottom: 20px; }
.detail-specs {
    background: var(--bg-gray); border-radius: var(--radius);
    padding: 20px; margin-top: 16px;
}
.detail-specs h4 {
    font-size: 14px; color: var(--primary); margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spec-item { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.spec-label { color: var(--text-light); }
.spec-value { color: var(--text); font-weight: 500; }
.detail-actions { margin-top: 24px; display: flex; gap: 12px; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu { display: block; }
    .banner h2 { font-size: 28px; }
    .header-inner { height: 60px; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; }
    .spec-grid { grid-template-columns: 1fr; }
    .section { padding: 40px 16px; }
    .section-title h3 { font-size: 24px; }
}
/* ========== 产品详情图片 ========== */
.detail-media {
    display: none;
    margin-bottom: 18px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-gray);
    border: 1px solid var(--border);
}
.detail-media.show { display: block; }
.detail-media img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ========== 分类内产品图片墙 ========== */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
}
.thumb {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border);
    cursor: zoom-in;
}
.thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.thumb:hover img { transform: scale(1.05); }
.thumb-ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #94a3b8;
}

/* ========== 图片放大层 ========== */
.lightbox {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.86);
    z-index: 999;
    align-items: center; justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
    max-width: 90vw; max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* ========== 右侧分类图片墙 ========== */
.gallery-view { display: none; }
.gallery-view.show { display: block; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.gallery-grid .thumb { aspect-ratio: 4 / 3; }

/* ========== 右侧单图视图 ========== */
.image-view {
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.image-view.show { display: block; }
.image-view img {
    max-width: 100%;
    max-height: 560px;
    border-radius: 8px;
    display: none;
    margin: 0 auto;
}
.image-view-ph {
    display: none;
    color: #94a3b8;
    font-size: 14px;
    padding: 120px 0;
    margin: 0;
}

/* ========== 页脚（两栏布局） ========== */
.footer {
    background: #1b2b3e;
    color: #cbd5e1;
    margin-top: 60px;
}
.footer .container {
    padding-top: 44px;
    padding-bottom: 18px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px 48px;
}
.footer-grid h4 {
    color: #fff;
    font-size: 16px;
    margin: 0 0 14px;
}
.footer-grid ul {
    list-style: none;
    margin: 0; padding: 0;
}
.footer-grid li {
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: nowrap;
}
.footer-grid a { color: #cbd5e1; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 30px;
    padding-top: 14px;
    font-size: 13px;
    color: #8fa3b8;
}
.footer-bottom p { margin: 4px 0; }
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-grid li { white-space: normal; }
}

/* ==========================================================
   微信内置浏览器 / 手机端适配（v2.0 2026-10-27）
   目标：微信里打开字体不被放大、不横向溢出、组件可点按
   ========================================================== */

/* 1) 禁止微信安卓端自动放大字号（X5 内核 text autosizing） */
html {
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}
body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 2) 刘海屏 / 全面屏安全区 */
.header-inner,
.footer .container,
.main-content,
.container,
.section {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}
.footer {
    padding-bottom: env(safe-area-inset-bottom);
}

/* 3) 图片与容器不撑破屏幕 */
img, svg, video, table { max-width: 100%; }
.detail-media img { height: auto; max-height: 320px; }

/* 4) 触控目标不小于 44px（微信里手指点按） */
@media (max-width: 768px) {
    .nav a, .mobile-nav a, .sidebar a, .sidebar li a,
    .btn, button, .tab, .category-item, .product-item > a {
        min-height: 44px;
    }
    .sidebar a, .sidebar li a {
        display: flex;
        align-items: center;
        padding: 12px 14px;
        font-size: 15px;
    }
    /* 产品图片墙：手机两列，避免三列过窄 */
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .main-content { padding: 18px 14px 48px; gap: 18px; }
    .lightbox { padding: 12px; }
    .lightbox img { max-width: 96vw; max-height: 86vh; }
    .image-view { padding: 12px; }
    .image-view-ph { padding: 60px 0; }
    .logo-text h1, .logo > span { font-size: 14px !important; }
    .footer { margin-top: 36px; }
    .footer .container { padding-top: 28px; }
}

/* 5) 超窄屏（微信小屏机 320~360px） */
@media (max-width: 380px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .header-inner { padding: 0 12px; }
    .logo-text h1, .logo > span { font-size: 12.5px !important; }
    .content-default { padding: 48px 14px; }
}

/* 6) 微信里长按图片可保存原图：取消图片拖拽与选中干扰 */
.thumb img, .image-view img, .gallery-grid img {
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    user-select: auto;
}

/* 7) 横向滚动类容器（分类 tab 等）在微信里顺滑滚动 */
.scroll-x,
.category-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.scroll-x::-webkit-scrollbar,
.category-tabs::-webkit-scrollbar { display: none; }
