/* ==========================================================================
   汉魏优选 · 全站布局视觉系统（顶部导航 + 底部 + 悬浮客服）
   --------------------------------------------------------------------------
   针对老站问题的改进：
   1. 品牌统一 —— 老站头部 #3498db 亮蓝 / 底部 #1a2332，与业务页 #1e40af 靛蓝
      割裂；本文件沿用 business.css 的 CSS 变量，全站一个视觉语言。
   2. 信息层级 —— 新增顶部工具条（电话 / 地址 / 服务时间），让客户第一眼
      看到联系方式，而不是埋在页面里。
   3. 导航体验 —— sticky 吸顶 + 滚动阴影 + 下拉面板 + 当前页高亮 +
      移动端抽屉菜单（老站移动端只能横向溢出滚动）。
   4. 合规完整 —— 底部补齐 ICP 备案、公安备案（含官方图标）、增值电信业务
      经营许可证，老站虽有但散落在硬编码 HTML 里，此处集中到 config/site.php。
   5. 转化入口 —— 底部保留在线客服悬浮（电话 / QQ / 微信二维码）。
   ========================================================================== */

/* 品牌变量（与 business.css 保持一致；此处独立声明，确保首页等
   未加载 business.css 的页面同样生效） */
:root {
    --hw-primary: #1e40af;
    --hw-primary-dark: #1e3a8a;
    --hw-primary-light: #3b82f6;
    --hw-accent: #f59e0b;
    --hw-accent-dark: #d97706;
    --hw-ink: #0f172a;
    --hw-body: #475569;
    --hw-muted: #64748b;
    --hw-line: #e2e8f0;
    --hw-bg: #f8fafc;
    --hw-white: #ffffff;
    --hw-radius: 16px;
    --hw-shadow: 0 4px 20px rgba(15, 23, 42, .08);
    --hw-shadow-lg: 0 16px 48px rgba(15, 23, 42, .12);
    --hw-max: 1280px;
}

/* 基础排版兜底 */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    color: var(--hw-body);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------------- 顶部工具条 ---------------- */
.hw-topbar {
    background: #0f172a;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1;
}
.hw-topbar .hw-topbar-inner {
    max-width: var(--hw-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.hw-topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}
.hw-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-topbar-item .ico {
    font-size: 13px;
    opacity: .85;
}
.hw-topbar-item a { color: #cbd5e1; text-decoration: none; }
.hw-topbar-item a:hover { color: #fff; }
.hw-topbar .hot-phone {
    color: var(--hw-accent);
    font-weight: 700;
    letter-spacing: .3px;
}
.hw-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hw-topbar-right a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color .2s;
}
.hw-topbar-right a:hover { color: #fff; }

/* ---------------- 主导航 ---------------- */
.hw-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--hw-line);
    transition: box-shadow .25s, border-color .25s;
}
.hw-header.is-stuck {
    box-shadow: 0 6px 24px rgba(15, 23, 42, .10);
    border-bottom-color: transparent;
}
.hw-header-inner {
    max-width: var(--hw-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Logo */
.hw-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.hw-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--hw-primary) 0%, #3b82f6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -1px;
    box-shadow: 0 6px 16px rgba(30, 64, 175, .28);
}
.hw-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.hw-logo-name {
    font-size: 19px;
    font-weight: 800;
    color: var(--hw-ink);
    letter-spacing: .5px;
}
.hw-logo-slogan {
    font-size: 11px;
    color: var(--hw-muted);
    letter-spacing: .2px;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 导航菜单 */
.hw-nav { flex: 1; min-width: 0; }
.hw-nav-list {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.hw-nav-item { position: relative; }
.hw-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 72px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hw-body);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s;
    position: relative;
}
.hw-nav-link::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--hw-primary);
    transform: scaleX(0);
    transition: transform .22s;
}
.hw-nav-link:hover { color: var(--hw-primary); }
.hw-nav-link:hover::after { transform: scaleX(1); }
.hw-nav-item.is-active > .hw-nav-link { color: var(--hw-primary); font-weight: 600; }
.hw-nav-item.is-active > .hw-nav-link::after { transform: scaleX(1); }
.hw-nav-caret {
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: .6;
    transition: transform .22s;
}
.hw-nav-item.has-dropdown:hover .hw-nav-caret { transform: rotate(180deg); }

/* 下拉面板 */
.hw-dropdown {
    position: absolute;
    top: 72px;
    left: 0;
    min-width: 188px;
    background: #fff;
    border: 1px solid var(--hw-line);
    border-radius: 12px;
    box-shadow: var(--hw-shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    z-index: 20;
}
.hw-nav-item.has-dropdown:hover .hw-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.hw-dropdown a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--hw-body);
    text-decoration: none;
    transition: background .18s, color .18s;
}
.hw-dropdown a:hover {
    background: #eff6ff;
    color: var(--hw-primary);
}

/* 右侧操作区
   说明：z-index + 白底确保任何情况下按钮都在导航之上，
   不会被溢出的一级菜单压住（老站曾出现“登录/注册被折叠覆盖”的问题）。 */
.hw-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
    background: #fff;
}
.hw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.hw-btn-ghost {
    color: var(--hw-primary);
    border-color: var(--hw-line);
    background: #fff;
}
.hw-btn-ghost:hover { border-color: var(--hw-primary); background: #eff6ff; }
.hw-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--hw-primary) 0%, #3b82f6 100%);
    box-shadow: 0 4px 14px rgba(30, 64, 175, .28);
}
.hw-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, .34);
}
.hw-btn-accent {
    color: #fff;
    background: linear-gradient(135deg, var(--hw-accent) 0%, var(--hw-accent-dark) 100%);
    box-shadow: 0 4px 14px rgba(245, 158, 11, .30);
}
.hw-btn-accent:hover { transform: translateY(-1px); }

.hw-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 14px;
    color: var(--hw-body);
    text-decoration: none;
    border: 1px solid var(--hw-line);
    transition: all .2s;
}
.hw-cart:hover { border-color: var(--hw-primary); color: var(--hw-primary); }
.hw-cart-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* 移动端汉堡按钮 */
.hw-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--hw-line);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
}
.hw-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--hw-ink);
    border-radius: 2px;
    position: relative;
    transition: background .2s;
}
.hw-nav-toggle span::before,
.hw-nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--hw-ink);
    border-radius: 2px;
    transition: transform .25s, top .25s;
}
.hw-nav-toggle span::before { top: -6px; }
.hw-nav-toggle span::after  { top: 6px; }
.hw-header.is-open .hw-nav-toggle span { background: transparent; }
.hw-header.is-open .hw-nav-toggle span::before { top: 0; transform: rotate(45deg); }
.hw-header.is-open .hw-nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

/* ---------------- 紧凑模式（抽屉导航）----------------
   触发条件（满足其一，由 layout.js 判定并加 .is-compact）：
   1) 视口宽度 <= 1280px（CSS 兜底，见下方媒体查询）
   2) 视口虽宽，但一级菜单总宽超出可用空间（避免菜单溢出压住右侧按钮） */
.hw-header.is-compact .hw-nav { display: none; }
.hw-header.is-compact .hw-nav-toggle { display: flex; }
.hw-header.is-compact.is-open .hw-nav {
    display: block;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--hw-line);
    box-shadow: var(--hw-shadow-lg);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    padding: 8px 24px 16px;
}
.hw-header.is-compact.is-open .hw-nav-list { flex-direction: column; align-items: stretch; gap: 0; }
.hw-header.is-compact.is-open .hw-nav-link {
    height: 48px;
    padding: 0 4px;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}
.hw-header.is-compact.is-open .hw-nav-link::after { display: none; }
.hw-header.is-compact.is-open .hw-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 4px 0 8px;
    background: #f8fafc;
    border-radius: 8px;
    display: none;
}
.hw-header.is-compact.is-open .hw-nav-item.is-open > .hw-dropdown { display: block; }

/* 抽屉内的登录入口（窄屏右侧按钮放不下时兜底） */
.hw-nav-mobile-auth { display: none; }

/* ---------------- 底部 ---------------- */
.hw-footer {
    background: linear-gradient(180deg, #0f172a 0%, #131c33 100%);
    color: #cbd5e1;
    margin-top: 0;
}

/* 底部 CTA 条 */
.hw-footer-cta {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.hw-footer-cta-inner {
    max-width: var(--hw-max);
    margin: 0 auto;
    padding: 30px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.hw-footer-cta-text { color: #fff; }
.hw-footer-cta-text strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.hw-footer-cta-text span { font-size: 14px; color: #94a3b8; }
.hw-footer-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 底部主区 */
.hw-footer-main {
    max-width: var(--hw-max);
    margin: 0 auto;
    padding: 52px 24px 40px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr) 1.5fr;
    gap: 40px;
}
.hw-footer-brand .hw-logo-mark { background: linear-gradient(135deg, #3b82f6 0%, #0ea5e9 100%); }
.hw-footer-brand .hw-logo-name { color: #fff; }
.hw-footer-brand .hw-logo-slogan { color: #94a3b8; }
.hw-footer-brand-desc {
    margin: 16px 0 20px;
    font-size: 13.5px;
    line-height: 1.85;
    color: #94a3b8;
}
.hw-footer-qr {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hw-footer-qr-img {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    background: #fff;
    padding: 5px;
    flex-shrink: 0;
}
.hw-footer-qr-txt { font-size: 12.5px; color: #94a3b8; line-height: 1.7; }
.hw-footer-qr-txt strong { display: block; color: #fff; font-size: 14px; }

.hw-footer-col h4 {
    margin: 0 0 18px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    position: relative;
    padding-bottom: 10px;
}
.hw-footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--hw-accent);
}
.hw-footer-col ul { list-style: none; margin: 0; padding: 0; }
.hw-footer-col li { margin-bottom: 11px; }
.hw-footer-col li a {
    font-size: 13.5px;
    color: #94a3b8;
    text-decoration: none;
    transition: color .2s, padding-left .2s;
}
.hw-footer-col li a:hover { color: #fff; padding-left: 4px; }

/* 联系方式卡片 */
.hw-footer-contact { display: flex; flex-direction: column; gap: 14px; }
.hw-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}
.hw-contact-ico {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(59, 130, 246, .14);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.hw-contact-body { min-width: 0; }
.hw-contact-label {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 2px;
}
.hw-contact-value {
    font-size: 14px;
    color: #e2e8f0;
    line-height: 1.6;
    word-break: break-all;
}
.hw-contact-value.hot {
    font-size: 21px;
    font-weight: 800;
    color: var(--hw-accent);
    letter-spacing: .5px;
}
.hw-contact-value a { color: inherit; text-decoration: none; }
.hw-contact-value a:hover { color: #fff; }

/* 底部版权 / 备案区 */
.hw-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .18);
}
.hw-footer-bottom-inner {
    max-width: var(--hw-max);
    margin: 0 auto;
    padding: 24px;
}
.hw-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 16px;
    font-size: 13px;
}
.hw-footer-nav a {
    color: #94a3b8;
    text-decoration: none;
    transition: color .2s;
}
.hw-footer-nav a:hover { color: #fff; }
.hw-footer-nav span.sep { color: #334155; }

.hw-footer-legal {
    font-size: 12.5px;
    color: #64748b;
    line-height: 2;
}
.hw-footer-legal p { margin: 0; }
.hw-footer-legal a {
    color: #94a3b8;
    text-decoration: none;
    transition: color .2s;
}
.hw-footer-legal a:hover { color: #fff; text-decoration: underline; }
.hw-footer-legal .beian-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 14px;
}
.hw-footer-legal .beian-logo {
    width: 15px;
    height: 15px;
    vertical-align: middle;
}

/* ---------------- 悬浮客服 ---------------- */
.hw-float-service {
    position: fixed;
    right: 20px;
    bottom: 88px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.hw-float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--hw-primary) 0%, #3b82f6 100%);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(30, 64, 175, .34);
    transition: transform .2s;
}
.hw-float-btn:hover { transform: scale(1.06); }
.hw-float-panel {
    width: 232px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--hw-shadow-lg);
    padding: 18px;
    display: none;
}
.hw-float-service.is-open .hw-float-panel { display: block; }
.hw-float-panel h5 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--hw-ink);
}
.hw-float-panel .hw-float-time {
    font-size: 12px;
    color: var(--hw-muted);
    margin-bottom: 14px;
}
.hw-float-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--hw-body);
    margin-bottom: 10px;
}
.hw-float-line .ico { font-size: 14px; }
.hw-float-line strong { color: var(--hw-accent); font-size: 15px; }
.hw-float-qr {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--hw-line);
    text-align: center;
}
.hw-float-qr img {
    width: 116px;
    height: 116px;
    border-radius: 8px;
    border: 1px solid var(--hw-line);
}
.hw-float-qr p { margin: 6px 0 0; font-size: 12px; color: var(--hw-muted); }

/* 回到顶部 */
.hw-backtop {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--hw-line);
    background: #fff;
    color: var(--hw-body);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hw-shadow);
    opacity: 0;
    visibility: hidden;
    transition: all .25s;
}
.hw-backtop.is-show { opacity: 1; visibility: visible; }
.hw-backtop:hover { color: var(--hw-primary); border-color: var(--hw-primary); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
    .hw-footer-main { grid-template-columns: 1fr 1fr 1fr; }
    .hw-footer-brand { grid-column: 1 / -1; }
}
/* 断点说明：一级菜单共 9 项 + Logo + 登录/注册，实测需要约 1160px 净宽，
   而 1200px 容器只有 1152px 可用 —— 菜单会溢出并压住右侧按钮。
   因此容器放宽到 1280px，并把“收进抽屉”的断点从 900px 提到 1280px。 */
@media (max-width: 1280px) {
    /* CSS 兜底：即使 JS 未执行，也绝不让菜单与登录/注册按钮重叠 */
    .hw-header .hw-nav { display: none; }
    .hw-header .hw-nav-toggle { display: flex; }
}
@media (max-width: 900px) {
    .hw-topbar .hw-topbar-inner { height: auto; padding: 8px 16px; flex-wrap: wrap; }
    .hw-topbar-right { display: none; }
    .hw-header-inner { height: 62px; padding: 0 16px; gap: 12px; }
    .hw-header-actions .hw-btn-ghost { display: none; }
    .hw-header.is-compact.is-open .hw-nav {
        top: 62px;
        max-height: calc(100vh - 62px);
        padding: 8px 16px 16px;
    }
    /* 登录按钮已隐藏，抽屉里补一个入口 */
    .hw-header.is-compact .hw-nav-mobile-auth { display: list-item; }
}
@media (max-width: 640px) {
    .hw-footer-main { grid-template-columns: 1fr 1fr; gap: 28px; padding: 36px 16px 28px; }
    .hw-footer-cta-inner { padding: 22px 16px; }
    .hw-footer-bottom-inner { padding: 20px 16px; }
    .hw-float-service { right: 12px; bottom: 72px; }
    .hw-logo-slogan { display: none; }
}
