/* 顶栏 */
header {
    position: relative;
    width: 100%;
    height: 128px;
    top: 0;
    z-index: 1000;
    background: #FFFFFF;
}

.heard-msg {
    font-size: 14px;
    background: #f7f7f7;
    height: 33px;
    line-height: 33px;
    border-bottom: 1px solid #ececec;
    color: #666;
}

.heard-msg .heard-msg-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 顶部宣传语占满整行 */
.heard-msg .heard-msg-content .header-slogan {
    flex: 1 1 auto;
    display: block;
    text-align: left;
}

/* 会员登录状态区域 */
.heard-msg .user-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.heard-msg .user-auth .user-link {
    color: #333;
}
.heard-msg .user-auth .user-link:hover { color: var(--main); }
.heard-msg .user-auth .sep { color: #999; }
.heard-msg .user-auth .user-greet { color: #333; }
.heard-msg .user-auth .auth-btn {
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    height: 24px;
    line-height: 24px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
}

.logo {
    margin: 20px 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.logo img {
    height: 56px;
}

.nav {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        align-items: center;
        height: auto;
        padding: 5px 0;
    }

.nav-content {
    margin: 0;
    float: right;
    list-style: none;
    justify-self: end;
}

.nav-content .bar {
    display: none;
    text-align: center;
    color: #343434;
}

.nav-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 32px; /* 导航间距加大100%：16px -> 32px */
}

.nav-content li {
    flex: 0 0 auto; /* PC端改为按内容宽度排列，更紧凑 */
    text-align: center;
    cursor: default;
    color: #343434;
    font-size: 15px;
}
/* PC端不显示图标，保证样式不变 */
.nav-content ul li i { display: none; }
/* 桌面端隐藏关闭按钮项（移动端单独显示） */
.nav-content .nav-close-item { display: none; }
/* 桌面端不显示移动端的登录入口（仅移动抽屉显示） */
.nav-content .mobile-auth { display: none; }

.nav-content li .title {
    position: relative;
    display: block;
    text-align: center;
    width: 100%;
}

.nav-content li .title:after {
    content: '';
    display: block;
    position: absolute;
    bottom: -5px;
    height: 3px;
}

.nav-content li .title:after {
    width: 0;
    left: 50%;
    background: var(--main);
}


.nav-content li.active, .nav-content li:hover {
    color: var(--main)
}

.nav-content li.active .title:after, .nav-content li:hover .title:after {
    width: 100%;
    left: 0;
}

.swiper {
    width: 100%;
    height: var(--banner-h);
    min-height: calc(var(--banner-h) * 0.7);
    overflow: hidden;
    margin-bottom: 0;
}
.swiper-content { height: 100%; }
.swiper-slide { height: 100%; }
.swiper-slide a { display: block; height: 100%; }

/* 顶栏右侧注册/登录按钮高度与宣传语对齐 */
.heard-msg .user-auth .auth-btn { height: 24px; line-height: 24px; padding: 0 10px; }

.swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 通用遮罩层（PC与移动端均适用，默认不显示） */
.nav-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0; /* 兼容微信内置浏览器，不使用 inset 简写 */
    background: rgba(0,0,0,.35);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    display: none;
    z-index: 900; /* 低于抽屉(9999)，不遮挡菜单；兼容微信点击 */
}
.nav-overlay.show {
    display: block;
}

/* 中文注释：注册/登录弹窗通用样式 */
.modal { position: fixed; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,.45); display:none; z-index: 1000; }
.modal.show { display:block; }
.modal-dialog { position: relative; background:#fff; width:420px; max-width:90%; margin:8vh auto; border-radius:6px; box-shadow:0 10px 30px rgba(0,0,0,.15); }
.modal-header { display:flex; gap:6px; padding:12px 16px; border-bottom:1px solid #eee; }
.modal-header .tab { flex:1; padding:8px 10px; border:1px solid #ddd; border-radius:4px; background:#fafafa; cursor:pointer; }
.modal-header .tab.active { background:#fff; border-color: var(--main); color: var(--main); }
.modal-body { padding:16px; }
.modal .close { position:absolute; right:10px; top:10px; background:transparent; border:none; color:#666; cursor:pointer; }
.auth-form .form-group { margin-bottom:12px; }
.auth-form .form-control { width:100%; height:36px; border:1px solid #ddd; border-radius:4px; padding:0 10px; }
.auth-form .form-control { background: transparent !important; }
.auth-form input::placeholder { color:#999; }
.auth-form .btn-primary { display:block; background: var(--main); color:#fff; border:none; height:36px; border-radius:4px; cursor:pointer; }
.recovery-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.tab-pane { display:none; }
.tab-pane.show { display:block; }

@media (max-width: 768px) {

    header {
        position: relative;
        background: #FFFFFF;
        height: auto;
    }

    .swiper {
        height: var(--banner-h);
        min-height: calc(var(--banner-h) * 0.7);
        margin-bottom: 10px !important;
    }
    .swiper-overlay { display: none !important; }

    .logo {
        margin: 0;
        padding: 15px 0;
        justify-self: start;
        justify-items: start;
        align-items: center;
    }

    .logo img {
        height: 32px;
    }

    .nav-content {
        width: 30px;
        position: relative;
        z-index: 10001;
    }

    .nav-content .bar {
        display: block;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Banner（移动端）：显示完整图片，宽度100%，高度自适应，无圆角 */
    .swiper-content {
        border-radius: 0;
        overflow: hidden;
    }

    /* 限制每个滑块内的溢出，防止看到下一张 */
    .swiper-slide {
        overflow: hidden;
        width: 100% !important;
        flex: 0 0 100% !important; /* 每个滑块占满视口宽度，避免下一张露出 */
    }

    /* 包裹图片的链接也需限制尺寸与溢出，避免右侧空白与下一张泄露 */
    .swiper-slide a {
        display: block;
        width: 100%;
        height: auto;
        overflow: hidden;
    }

    .swiper-slide img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* 防止滑块之间产生空隙或露出下一张 */
    .swiper-wrapper { gap: 0 !important; }

    /* 右侧抽屉容器（移动端） */
    .nav-content .nav-content-list {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 80vw; /* 抽屉宽度更适配移动端 */
        max-width: 360px;
        min-width: 240px;
        display: flex;
        flex-direction: column;
        background: #FFFFFF;
        box-shadow: -12px 0 24px rgba(0,0,0,.15);
        border-left: 1px solid #eee;
        border-radius: 12px 0 0 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform .3s ease;
        z-index: 9999; /* 保证抽屉始终在最上层 */
        padding-bottom: 12px;
        pointer-events: none; /* 隐藏时不拦截点击，避免阻挡汉堡按钮 */
    }

    /* 列表内容（跟随抽屉布局） */
    .nav-content ul {
        display: flex;
        padding-left: 0;
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: 0;
    }

    .nav-content .nav-content-list.show {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-content ul li {
        color: #343434;
        padding: 10px 16px; /* 较小字号对应更紧凑的内边距 */
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }

    .nav-content li .title:before {
        width: 100px;
        left: calc(50% - 50px);
        background: #838383;
    }

    .nav-content li.active .title:after, .nav-content li:hover .title:after {
        width: 100px;
        left: calc(50% - 50px);
    }


    /* 覆盖层样式已在媒体查询外统一定义，这里不重复设置 */

    /* 移动端关闭按钮样式（顶部吸附） */
    .nav-content .nav-close-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        background: #fff;
        padding: 14px 16px;
        border-bottom: 1px solid #eee;
        z-index: 1;
    }
    .nav-content .nav-close-item .nav-title {
        font-size: 15px;
        font-weight: bold;
        color: #343434;
    }
    .nav-content .nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 16px;
        font-size: 20px;
        color: #343434;
        background: transparent;
        border: none;
        cursor: pointer;
        transition: background .2s, color .2s;
    }
    .nav-content .nav-close:hover {
        background: #f5f5f5;
        color: var(--main);
    }

    /* 列表项布局与状态 */
    .nav-content ul li a {
        display: flex;
        align-items: center;
        gap: 8px; /* 图标与文字更紧凑 */
        color: inherit;
        text-decoration: none;
    }
    .nav-content ul li i { display: inline-block; color: var(--main); width: 20px; text-align: center; }
    .nav-content ul li:hover { background: #f8f9fa; }
    .nav-content ul li.active { background: #fff4ec; }

    /* 抽屉内的会员入口（移动端显示），并隐藏顶栏重复入口 */
    .heard-msg .user-auth { display: none; }
    .nav-content .mobile-auth { display: block; }
    .nav-content .mobile-auth {
        color: #343434;
        padding: 12px 16px;
        border-top: 1px solid #f0f0f0;
        background: #fff;
    }
    .nav-content .mobile-auth .auth-item {
        display: block;
        margin-top: 10px;
        padding: 8px 12px;
        background: #fff4ec;
        color: var(--panel-2);
        border: 1px solid #f5d9c9;
        border-radius: 8px;
        text-align: center;
        font-size: 14px;
    }
    .nav-content .mobile-auth .auth-item + .auth-item { margin-top: 8px; }
    .nav-content .mobile-auth .user-greet { color: #666; margin-bottom: 8px; font-size: 13px; }
    .nav-content .mobile-auth .user-link { color: #343434; }
    .nav-content .mobile-auth .user-link:hover { color: var(--main); }
    .nav-content .mobile-auth .sep { color: #999; margin: 0 6px; }
    .nav-content .mobile-auth .user-greet { color: #343434; margin-right: 6px; }
}
