/* ========================================
   移动端适配 - 仅移动端生效，不影响PC端
   ======================================== */

/* --- 容器自适应 --- */
@media (max-width: 1250px) {
    .container {
        width: 100% !important;
    }
}

/* PC端隐藏移动端按钮 */
.mobile-search-btn,
.mobile-menu-btn {
    display: none;
}

/* PC端默认隐藏用户触发区头像 */
.user-avatar-trigger {
    display: none;
}

.mobile-category-entry {
    display: none !important;
}

/* --- 移动端切换断点 --- */
@media (max-width: 1053px) {
    /* 隐藏PC端头部 */
    .logo-wrapper {
        display: none !important;
    }

    /* 隐藏PC端导航 */
    .navi-wrapper {
        display: none !important;
    }

    /* --- 轮播图响应式 --- */
    .banner-box {
        display: block !important;
    }

    .carousel .slick img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        object-fit: contain !important;
    }

    /* --- 最新动态 + 即买即用 --- */
    .news-wrapper {
        display: block !important;
    }

    .news-wrapper .news-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .news-wrapper .news-left {
        width: 100%;
        flex-shrink: 1;
    }

    .news-wrapper .news-label {
        display: none;
    }

    .news-wrapper .news-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .news-wrapper .service-features {
        width: 100%;
        justify-content: center;
        padding: 0 10px;
        box-sizing: border-box;
    }

    /* 隐藏PC端悬浮服务侧边栏 */
    .sidebar {
        display: none !important;
    }

    /* --- 顶部栏适配 --- */
    .top-bar {
        padding: 0 10px;
        min-height: 44px;
    }

    .top-desktop-welcome {
        display: none;
    }
    .top-mobile-logo {
        display: block;
        height: 24px;
        width: auto;
    }

    .top-right a span {
        display: none;
    }

    .top-right > a {
        width: 32px;
        height: 32px;
        padding: 0 !important;
        border: none !important;
        background: #f7f8fb !important;
        justify-content: center;
        border-radius: 50% !important;
        margin-left: 0;
    }

    .top-right {
        gap: 6px;
    }

    .top-right i {
        font-size: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .top-right a.btn-cart {
        display: none;
    }

    .user-trigger {
        width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .user-trigger .fa-user {
        display: none;
    }
    .user-trigger span {
        display: none;
    }
    .user-avatar-trigger {
        display: inline-block;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* --- 移动端图标按钮（PC隐藏） --- */
    .mobile-search-btn,
    .mobile-menu-btn {
        display: flex;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 50%;
        background: #f7f8fb;
        transition: background 0.2s;
    }

    .mobile-search-btn:hover,
    .mobile-menu-btn:hover {
        background: #f5f5f5;
    }

    .mobile-search-btn i,
    .mobile-menu-btn i {
        font-size: 16px;
        color: var(--primary-red);
    }

    /* --- 商品列表响应式 --- */
    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .goods-img-box {
        height: 170px;
    }
    .title-text {
        font-size: 22px;
    }

    /* --- FAQ常见问题页面响应式 --- */
    .faq-main .faq-header {
        padding: 20px 15px;
    }
    .faq-main .faq-header h1 {
        font-size: 22px;
    }
    .faq-main .faq-header p {
        font-size: 15px;
    }
    .faq-main .faq-list {
        gap: 12px;
    }
    .faq-main .faq-item {
        padding: 15px 12px;
        border-radius: 12px;
    }
    .faq-main .faq-number {
        font-size: 22px;
        min-width: 35px;
        margin-right: 12px;
    }
    .faq-main .faq-icon-container {
        width: 60px;
        height: 45px;
        margin-right: 12px;
        border-radius: 8px;
    }
    .faq-main .faq-title {
        font-size: 15px;
        gap: 6px;
    }
    .faq-main .faq-title .question-icon {
        font-size: 14px;
    }
    .faq-main .faq-meta {
        gap: 15px;
        font-size: 12px;
        margin-top: 6px;
    }
    .faq-main .faq-status {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 11px;
    }
    .faq-main .faq-content-area {
        padding: 15px 0;
    }
    .faq-main .faq-end-tip {
        padding: 20px 15px;
        font-size: 14px;
        margin-top: 5px;
    }

    /* FAQ页面隐藏底部链接栏，保留二维码 */
    body:has(.faq-main) .link-column {
        display: none;
    }
    body:has(.faq-main) .qrcode-section {
        border-top: none;
    }

    /* 文章详情页隐藏底部链接栏，保留二维码 */
    body:has(.article-container) .link-column {
        display: none;
    }
    body:has(.article-container) .qrcode-section {
        border-top: none;
    }

    /* 个人中心、我的订单、购物车、修改密码页面隐藏底部链接栏 */
    body:has(.user-center-wrapper) .link-column {
        display: none;
    }
    body:has(.user-center-wrapper) .qrcode-section {
        border-top: none;
    }
}

/* ========================================
   移动端侧边栏菜单
   ======================================== */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-sidebar.show {
    left: 0;
}

.sidebar-header {
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    height: 40px;
    width: auto;
}

.sidebar-close {
    font-size: 20px;
    cursor: pointer;
    color: var(--primary-red);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background: #f5f5f5;
    color: var(--primary-red);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    color: #999;
}

.sidebar-menu li a.active {
    color: var(--primary-red);
    background: #fff8f8;
}

.sidebar-menu li a.active i {
    color: var(--primary-red);
}

.sidebar-menu li a:hover i {
    color: var(--primary-red);
}

/* 遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   移动端底部导航
   ======================================== */
.mobile-footer-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55px;
    background: #fff;
    border-top: 1px solid #eee;
    z-index: 999;
}

@media (max-width: 1053px) {
    .mobile-footer-nav {
        display: block;
    }
}

.mobile-footer-nav .nav-list {
    display: flex;
    height: 100%;
}

.mobile-footer-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    text-decoration: none;
    gap: 4px;
}

.mobile-footer-nav .nav-item.active {
    color: var(--primary-red);
}

.mobile-footer-nav .nav-item i {
    font-size: 18px;
}

/* ========================================
   移动端搜索弹窗
   ======================================== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.show {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 10px;
    padding: 25px 20px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal.show .search-modal-content {
    transform: translateY(0);
}

.search-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-close:hover {
    color: var(--primary-red);
}

.search-modal-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.search-modal-input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.search-modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

.search-modal-input:focus {
    border-color: var(--primary-red);
}

.search-modal-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-red);
    font-size: 16px;
}

.search-modal-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-red);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.search-modal-btn:hover {
    background: var(--dark-red);
}

.search-modal-tags-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.search-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-modal-tag {
    padding: 6px 12px;
    background: #f8f8f8;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-modal-tag:hover {
    background: var(--primary-red);
    color: #fff;
}

/* ========================================
   移动端中屏适配（平板及以下）
   ======================================== */
@media (max-width: 768px) {
    .carousel .slick img {
        height: auto !important;
        min-height: 0 !important;
    }

    .slick-prev,
    .slick-next {
        width: 26px;
        height: 46px;
        background-size: 52px 46px;
    }
    .slick-prev {
        background-position: 0 -46px;
    }
    .slick-next {
        background-position: -26px -46px;
    }

    .news-wrapper .news-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .news-wrapper .news-left {
        width: 100%;
    }

    .news-wrapper .news-label {
        display: none;
    }

    .news-wrapper .news-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .news-wrapper .news-item a:hover,
    .news-wrapper .news-item a:active {
        color: #d8373e;
    }

    .advantages {
        display: none;
    }

    /* 非首页隐藏底部内容（修复多余空白） */
    body:not(:has(.carousel)) .footer .container {
        display: none;
    }
    body:not(:has(.carousel)) .footer {
        margin-top: 0;
        padding: 0;
        border-top: none;
    }

    .news-wrapper .service-features {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        justify-content: center;
        gap: 10px 14px;
        text-align: center;
        padding: 0;
        box-sizing: border-box;
    }

    @media (min-width: 400px) {
        .news-wrapper .service-features {
            grid-template-columns: repeat(4, 1fr);
            justify-content: center;
            justify-items: center;
        }
    }

    /* --- 底部手风琴 --- */
    .footer {
        padding: 20px 0 15px;
        margin-top: 30px;
    }

    .footer .content {
        flex-direction: column;
        gap: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    .link-column {
        width: 100%;
        min-width: unset;
        margin-left: 0;
        border: 1px solid #eee;
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .link-column h4 {
        width: 100%;
        margin: 0;
        padding: 12px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        font-size: 16px;
    }

    .link-column h4::after {
        display: none;
    }

    .link-column .arrow {
        transition: transform 0.3s ease;
    }

    .link-column.active .arrow {
        transform: rotate(180deg);
    }

    .link-column ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0 20px;
    }

    .link-column.active ul {
        max-height: 200px;
        padding: 10px 20px;
    }

    .qrcode-section {
        width: 100%;
        justify-content: space-around;
        margin-top: 20px;
        padding-top: 20px;
        /* border-top: 1px solid #eee; */
    }

    .qrcode-item .qrcode-wrap {
        width: 120px;
        height: 120px;
    }

    /* --- 商品列表响应式 --- */
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 28px;
    }

    .goods-item {
        display: flex;
        flex-direction: column;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 8px 20px rgba(25, 29, 38, 0.06);
    }

    .goods-img-box {
        height: auto;
        aspect-ratio: 4 / 3;
        border-bottom: 1px solid #eee;
    }

    .goods-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .goods-info {
        display: flex;
        flex: 1;
        flex-direction: column;
        padding: 10px 10px 10px;
    }

    .title-text {
        font-size: 20px;
        background-size: 22px;
        padding-left: 26px;
    }
    .more-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .more-btn svg {
        width: 12px;
        height: 12px;
    }
    .price {
        font-size: 15px;
    }

    .goods-name {
        display: -webkit-box;
        min-height: 36px;
        margin-bottom: 8px;
        overflow: hidden;
        font-size: 13px;
        line-height: 18px;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .price-tag-wrapper {
        min-height: 24px;
        margin-bottom: 8px;
        gap: 6px;
        align-items: center;
        flex-direction: row;
    }

    .goods-item .tags {
        min-width: 0;
        overflow: hidden;
        gap: 4px;
        flex: 1 1 auto;
        flex-wrap: nowrap;
    }

    .goods-item .tag {
        flex: 0 1 auto;
        max-width: 54px;
        overflow: hidden;
        padding: 3px 6px;
        font-size: 11px;
        line-height: 1.1;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .price {
        flex: 0 0 auto;
        font-size: 14px;
        line-height: 20px;
        white-space: nowrap;
    }

    .meta-separator {
        margin: 6px -10px;
    }

    .meta {
        min-height: 34px;
        margin-top: auto;
        align-items: center;
        gap: 6px;
        font-size: 11px;
    }

    .meta > span:first-child {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
        line-height: 1.25;
    }

    .meta-time {
        display: none;
    }
    .meta-read {
        display: block;
        margin-right: 0;
        font-size: 11px;
        white-space: nowrap;
    }

    .read-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        width: 44px;
        height: 30px;
        padding: 0;
        border-radius: 6px;
        font-size: 0;
        white-space: nowrap;
    }

    .read-more::after {
        content: "详情";
        font-size: 12px;
    }

    /* --- 文章详情页响应式 --- */
    .article-container {
        padding: 5px 10px;
    }
    .article-title {
        font-size: 18px;
    }
    .decor-line-text .text-wrapper {
        font-size: 15px;
    }
    .article-content {
        font-size: 15px;
    }
    .article-meta {
        gap: 15px;
        font-size: 13px;
    }
}

/* ========================================
   移动端小屏适配（手机竖屏）
   ======================================== */
@media (max-width: 480px) {
    .goods-grid {
        gap: 10px;
    }

    .goods-img-box {
        height: auto;
        aspect-ratio: 4 / 3;
    }
    .goods-item img {
        height: 100%;
    }
    .title-text {
        font-size: 18px;
        background-size: 20px;
        padding-left: 24px;
    }

    .read-more {
        padding: 0;
        font-size: 0;
    }
    .section-title {
        padding-bottom: 10px;
        margin-bottom: 12px;
    }

    /* 空购物车/空订单移动端适配 */
    .empty-cart,
    .empty-state {
        padding: 40px 16px;
    }

    .empty-cart i,
    .empty-state i {
        font-size: 36px;
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }

    .empty-cart h3,
    .empty-state h3 {
        font-size: 15px;
    }

    .empty-cart p,
    .empty-state p {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .go-shopping {
        padding: 0 10px;
        font-size: 12px;
        height: 32px;
        min-width: 74px;
        width: auto;
        border-radius: 6px;
    }
}
