
/* 默认隐藏底部导航 */
.bottom-nav {
    display: none;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px; /* 为底部导航留出空间 */
    }

    .container {
        padding: 16px 12px;
    }

    /* 顶部导航栏简化 */
    nav {
        padding: 0 16px;
        height: 50px;
        flex-direction: row; /* 强制覆盖 style.css 的 column */
        justify-content: center; /* 品牌居中 */
        align-items: center;
    }

    .nav-brand {
        font-size: 18px;
    }

    /* 隐藏顶部导航链接 */
    .nav-links {
        display: none !important;
    }

    /* 底部导航栏 */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #fff;
        border-top: 1px solid #edf2f7;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom); /* 适配 iPhone X+ 底部横条 */
    }

    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #b2bec3;
        font-size: 10px;
        flex: 1;
        height: 100%;
    }

    .bottom-nav .nav-item .icon {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .bottom-nav .nav-item.active {
        color: #ff6b35;
    }
    
    .bottom-nav .nav-item.active .icon {
        transform: scale(1.1);
        transition: transform 0.2s;
    }

    /* 表单优化 */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group input, 
    .form-group select {
        font-size: 16px; /* 防止 iOS 自动放大 */
    }

    /* 表格 - 保持横向滚动 */
    .table-responsive {
        border: 1px solid #edf2f7;
        margin: 0 -12px; /* 负边距让表格贴边 */
        width: calc(100% + 24px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    th, td {
        white-space: nowrap;
    }

    /* Tab栏 */
    .tab-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px 20px -12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        padding: 12px 20px;
    }

    /* 筛选栏 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar select, .filter-bar button {
        width: 100%;
    }

    /* 弹窗适配 */
    .modal-content {
        width: 90%;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .carousel-container {
        height: 250px; /* 减小图片高度 */
    }

    /* 登录框 */
    .login-form {
        margin: 20px auto;
        width: 100%;
    }

    /* 商品网格 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* 商品卡片紧凑模式 */
    .product-image {
        height: 140px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-info h3 {
        font-size: 14px;
        height: 40px; /* 限制标题高度 */
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
    }
    
    .product-deduction {
        display: none; /* 移动端列表页隐藏扣款信息，太占位置 */
    }
    
    .product-info .btn {
        padding: 6px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* 小屏手机适配 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 依然保持双列，因为单列太长 */
    }
}
