/* 全局公共样式 - 确保所有页面样式一致 */

/* 基础样式 */
body {
    min-height: 1024px;
    font-family: 'Noto Sans SC', sans-serif;
}

/* 搜索框焦点样式 */
.search-input:focus {
    outline: none;
}

/* 标题字体样式 */
h1, h2, h3, .font-bold, .font-medium {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 700;
}

/* 分类详情页专用样式 */
.tree-nav li {
    margin: 8px 0;
}

.tree-nav .submenu {
    margin-left: 20px;
}

.class-item:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

/* 响应式样式 - 768px以下 */
@media (max-width: 768px) {
    .max-w-\[1440px\] {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .flex.gap-8 {
        flex-direction: column;
    }
    
    .flex.gap-6 {
        flex-direction: column;
        gap: 1rem;
    }
    
    .w-\[300px\] {
        width: 100%;
    }
    
    .w-\[280px\] {
        width: 100%;
    }
    
    .py-8 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .flex.gap-4 {
        flex-direction: column;
    }
    
    .grid.grid-cols-10 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    
    .category-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    /* 移动端标题样式 */
    header h1 {
        font-size: 1.25rem !important;
        line-height: 1.5 !important;
    }
    
    /* 移动端AI按钮样式 */
    #aiAssistantBtn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    #aiAssistantBtn span:not(.absolute) {
        display: none;
    }
    
    /* 移动端隐藏左侧导航，改为可切换的抽屉 */
    #subcategory-nav-container {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    #subcategory-nav-container.show {
        left: 0;
    }
    
    /* 移动端显示小类导航切换按钮 */
    #mobile-subcategory-toggle {
        display: block;
    }
    
    /* 移动端遮罩层 */
    #mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    
    #mobile-overlay.show {
        display: block;
    }
}

/* 响应式样式 - 769px以上 */
@media (min-width: 769px) {
    #mobile-subcategory-toggle {
        display: none;
    }
    
    #mobile-overlay {
        display: none !important;
    }
}

/* 响应式样式 - 480px以下（超小屏幕） */
@media (max-width: 480px) {
    .text-2xl {
        font-size: 1rem;
    }
    
    .text-lg {
        font-size: 1rem;
    }
    
    .text-sm {
        font-size: 0.75rem;
    }
    
    .category-btn {
        font-size: 0.75rem;
    }
    
    .subcategory-item {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .bg-white.p-6.rounded-lg.shadow-sm {
        font-size: 0.75rem;
    }
    
    .grid-cols-4 {
        font-size: 0.75rem !important;
        line-height: 1.5rem !important;
    }
    
    /* 移动端已选择项目弹窗调整 */
    #selectedItemsPopup {
        width: calc(100% - 2rem) !important;
        left: 1rem !important;
        right: 1rem !important;
        max-width: 320px !important;
        top: auto !important;
        bottom: 1rem !important;
        transform: none !important;
    }
    
    /* 移动端商品卡片间距 */
    .item-card {
        padding: 0.75rem !important;
    }
    
    /* 移动端主内容区域padding */
    .max-w-\[1440px\] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
