/* ==========================================
   电脑端专用样式 - 桌面和大屏幕优化
   ========================================== */

/* ==========================================
   桌面设备 (1024px - 1439px)
   ========================================== */
@media screen and (min-width: 1024px) and (max-width: 1439px) {
    /* 页面容器 */
    body {
        background: linear-gradient(to right, #f5f5f5 0%, #ffffff 50%, #f5f5f5 100%);
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    /* 头部优化 */
    header.header-fixed {
        height: var(--headerH);
        padding: 0 30px;
        background: linear-gradient(135deg, #131921 0%, #1a1f2e 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .header-center h1 {
        font-size: 22px;
        font-weight: 700;
    }
    
    /* 搜索栏优化 */
    .header-search {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .header-search input {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    /* 导航栏优化 */
    nav.bg-\[\#37475A\] {
        padding: 0 30px;
        height: auto;
    }
    
    nav.bg-\[\#37475A\] a {
        padding: 16px 20px;
        font-size: 15px;
        font-weight: 600;
    }
    
    /* 轮播图优化 */
    #heroCarousel {
        margin: 20px 30px;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    }
    
    #carouselTrack {
        height: 240px;
    }
    
    #carouselPrev,
    #carouselNext {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }
    
    #carouselPrev:hover,
    #carouselNext:hover {
        background: #fff;
        transform: scale(1.1);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    }
    
    /* 内容区域优化 */
    section.p-3 {
        margin: 0 30px;
        padding: 25px !important;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        margin-bottom: 20px;
    }
    
    section.p-3 h2 {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 20px;
        color: #232F3E;
    }
    
    /* 商品网格优化 */
    #reco-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
    
    /* 桌面端全屏内容：去除盒子外边距与背景，留左右内边距 */
    section.p-3,
    .responsive-section {
        margin: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
    
    #reco-grid > div {
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    #reco-grid > div:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    }
    
    #reco-grid img {
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    #reco-grid .add-to-cart {
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
    }
    
    /* 今日特价优化 */
    #deals-list {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding: 0;
        scroll-behavior: smooth;
    }
    
    #deals-list > div {
        flex-shrink: 0;
        width: 200px;
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
    }
    
    #deals-list > div:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }
    
    #deals-list img {
        width: 100%;
        height: 160px;
        object-fit: cover;
    }
    
    /* 底部栏优化 */
    .tabbar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 64px !important;
        padding: 8px 0 !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08) !important;
        transform: none !important;
        max-width: none !important;
        overflow: visible !important;
    }
    
    .tabbar-item {
        padding: 10px 20px !important;
    }
    
    .tabbar-item span {
        display: block !important;
        font-size: 12px;
        margin-top: 6px;
    }
    
    .tabbar-item img,
    .tabbar-item svg {
        width: 36px !important;
        height: 36px !important;
    }
    
    /* 分页优化 */
    .pagination-btn-prev,
    .pagination-btn-next {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #f5f5f5;
        border: 2px solid #e0e0e0;
        transition: all 0.3s ease;
        font-size: 18px;
        font-weight: 600;
        color: #232F3E;
        cursor: pointer;
    }
    
    .pagination-btn-prev:hover,
    .pagination-btn-next:hover {
        background: #232F3E;
        color: #fff;
        border-color: #232F3E;
        transform: scale(1.05);
    }
    
    .pagination-btn-prev:active,
    .pagination-btn-next:active {
        transform: scale(0.95);
    }
}

/* ==========================================
   大屏幕 (1440px+)
   ========================================== */
@media screen and (min-width: 1440px) {
    /* 页面容器 */
    body {
        background: linear-gradient(to right, #f5f5f5 0%, #ffffff 50%, #f5f5f5 100%);
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    /* 头部优化 */
    header.header-fixed {
        height: 80px;
        padding: 0 40px;
        background: linear-gradient(135deg, #131921 0%, #1a1f2e 100%);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    }
    
    .header-center h1 {
        font-size: 24px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
    
    /* 搜索栏优化 */
    .header-search {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .header-search input {
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    /* 导航栏优化 */
    nav.bg-\[\#37475A\] {
        padding: 0 40px;
        height: auto;
    }
    
    nav.bg-\[\#37475A\] a {
        padding: 18px 24px;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: 0.3px;
    }
    
    /* 轮播图优化 */
    #heroCarousel {
        margin: 25px 40px;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    #carouselTrack {
        height: 280px;
    }
    
    #carouselPrev,
    #carouselNext {
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    #carouselPrev:hover,
    #carouselNext:hover {
        background: #fff;
        transform: scale(1.15);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    }
    
    #carouselPrev svg,
    #carouselNext svg {
        width: 24px;
        height: 24px;
    }
    
    /* 内容区域优化 */
    section.p-3 {
        margin: 0 40px;
        padding: 30px !important;
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        margin-bottom: 25px;
    }
    
    section.p-3 h2 {
        font-size: 22px;
        font-weight: 700;
        margin-bottom: 24px;
        color: #232F3E;
        letter-spacing: 0.3px;
    }
    
    /* 商品网格优化 */
    #reco-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
    
    #reco-grid > div {
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 3px 16px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }
    
    #reco-grid > div::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #reco-grid > div:hover {
        transform: translateY(-10px);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    }
    
    #reco-grid > div:hover::before {
        opacity: 1;
    }
    
    #reco-grid img {
        width: 100%;
        height: 220px;
        object-fit: cover;
    }
    
    #reco-grid .add-to-cart {
        padding: 14px 18px;
        font-size: 15px;
        font-weight: 600;
        background: linear-gradient(135deg, #FFB72B 0%, #FF9900 100%);
        border: none;
        border-radius: 8px;
        color: #232F3E;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    #reco-grid .add-to-cart:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 153, 0, 0.3);
    }
    
    /* 今日特价优化 */
    #deals-list {
        display: flex;
        gap: 18px;
        overflow-x: auto;
        padding: 0;
        scroll-behavior: smooth;
    }
    
    #deals-list > div {
        flex-shrink: 0;
        width: 220px;
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 3px 16px rgba(0, 0, 0, 0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }
    
    #deals-list > div::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    #deals-list > div:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    }
    
    #deals-list > div:hover::before {
        opacity: 1;
    }
    
    #deals-list img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }
    
    /* 底部栏优化 */
    .tabbar {
        height: 64px !important;
        padding-top: 14px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important; left: 0 !important; right: 0 !important; transform: none !important; max-width: none !important;
        max-width: calc(100% - 60px) !important;
        border-radius: 24px 24px 0 0 !important;
        background: linear-gradient(180deg, 
            rgba(255, 255, 255, 1) 0%, 
            rgba(255, 255, 255, 0.98) 50%,
            rgba(255, 255, 255, 0.95) 100%) !important;
        box-shadow: 
            0 -12px 48px rgba(102, 126, 234, 0.18),
            0 -6px 20px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
    }
    
    .tabbar-item {
        padding: 12px 30px !important;
    }
    
    .tabbar-item span {
        display: block !important;
        font-size: 13px;
        margin-top: 8px;
        font-weight: 600;
        letter-spacing: 0.2px;
    }
    
    .tabbar-item img,
    .tabbar-item svg {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* 分页优化 */
    .pagination-btn-prev,
    .pagination-btn-next {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
        border: 2px solid #d0d0d0;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 20px;
        font-weight: 700;
        color: #232F3E;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .pagination-btn-prev:hover,
    .pagination-btn-next:hover {
        background: linear-gradient(135deg, #232F3E 0%, #1a1f2e 100%);
        color: #fff;
        border-color: #232F3E;
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .pagination-btn-prev:active,
    .pagination-btn-next:active {
        transform: scale(0.95);
    }
}

/* ==========================================
   超宽屏 (2560px+)
   ========================================== */
@media screen and (min-width: 2560px) {
    body {
        max-width: 1800px;
        margin: 0 auto;
    }
    
    header.header-fixed {
        height: 90px;
        padding: 0 50px;
    }
    
    .header-center h1 {
        font-size: 28px;
    }
    
    section.p-3 {
        margin: 0 50px;
        padding: 40px !important;
        margin-bottom: 30px;
    }
    
    section.p-3 h2 {
        font-size: 26px;
        margin-bottom: 30px;
    }
    
    #reco-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
    }
    
    #reco-grid img {
        height: 260px;
    }
    
    .tabbar {
        height: 100px !important;
        width: 1800px !important;
        border-radius: 28px 28px 0 0 !important;
    }
    
    .tabbar-item {
        padding: 14px 40px !important;
    }
    
    .tabbar-item img,
    .tabbar-item svg {
        width: 48px !important;
        height: 48px !important;
    }
}

/* ==========================================
   电脑端通用优化
   ========================================== */
@media screen and (min-width: 1024px) {
    /* 全屏与底部导航统一 */
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important; }
    .tabbar,
    body.profile-page .tabbar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
        height: 64px !important;
        padding: 8px 0 !important;
        border-radius: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08) !important;
        border-top: 1px solid #eaeaea !important;
        z-index: 999999 !important;
    }
    .tabbar::before { display: none !important; }
    .tabbar-item { padding: 6px 0 !important; }
    .tabbar-item img, .tabbar-item svg { width: 28px !important; height: 28px !important; }
    .tabbar-item span { display: inline-block !important; font-size: 12px; line-height: 1; margin-top: 4px; }

    /* 平滑滚动 */
    html {
        scroll-behavior: smooth;
    }
    
    /* 自定义滚动条 */
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        border-radius: 5px;
        transition: all 0.3s ease;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #764ba2 0%, #667eea 100%);
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    }
    
    /* 链接悬停效果 */
    a {
        transition: all 0.3s ease;
    }
    
    a:hover {
        text-decoration: none;
    }
    
    /* 按钮悬停效果 */
    button {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    button:hover {
        transform: translateY(-2px);
    }
    
    button:active {
        transform: translateY(0);
    }
    
    /* 卡片悬停效果 */
    .card,
    [data-product] {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* 文本选择优化 */
    ::selection {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff;
    }
    
    /* 焦点样式 */
    *:focus-visible {
        outline: 2px solid #667eea;
        outline-offset: 2px;
        border-radius: 4px;
    }
    
    /* 禁用 Tailwind 的响应式隐藏 */
    .hidden {
        display: none !important;
    }
    
    /* 显示类 */
    .show {
        display: block !important;
    }
    
    /* 光标样式 */
    button,
    a[role="button"],
    [onclick] {
        cursor: pointer;
    }
    
    /* 禁用状态 */
    button:disabled,
    a:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
    }
}

/* ==========================================
   页面级优化：订单、个人中心、登录注册、客服
   ========================================== */
@media screen and (min-width: 1024px) {
    /* 订单页 - 双列栅格 */
    .order-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        padding: 24px 24px calc(140px + env(safe-area-inset-bottom, 0px));
        margin-bottom: 140px;
        background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    }
    .order-item { margin: 0; }
    .order-image { width: 96px; height: 96px; }
    .order-no { font-size: 12px; }
    .order-quantity { font-size: 15px; }

    /* 个人中心 - 主体居中与间距提升 */
    .amz-profile-header,
    .amz-header-content,
    .asset-card { max-width: none; width: 100%; margin: 0 auto; }
    .asset-layout { gap: 18px; }

    /* 登录 / 注册 - 表单更大更易读 */
    .amz-auth-wrap { max-width: 480px; }
    .amz-box h1 { font-size: 22px; }
    .amz-field input { font-size: 15px; padding: 12px 40px 12px 12px; }

    /* 客服页 - 会话区最大宽 */
    .service-container,
    .chat-container { max-width: 1100px; margin: 0 auto; }
}

/* 统一兜底（≥1024px）：确保任何页面底部导航全宽统一 */
@media screen and (min-width: 1024px) {
  .tabbar { left:0!important; right:0!important; width:100%!important; max-width:none!important; margin:0!important; }
  .tabbar > * { flex: 1 1 0% !important; min-width: 0 !important; }
}

/* 电脑端隐藏底部导航文字 */
@media screen and (min-width: 1024px) {
  .tabbar-item span { display: none !important; }
}

/* ==========================================
   电脑端打印样式
   ========================================== */
@media print {
    header,
    .tabbar,
    nav,
    .pagination-btn-prev,
    .pagination-btn-next {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
        margin: 0 !important;
        background: #fff !important;
    }
    
    section.p-3 {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #e0e0e0;
    }
    
    #reco-grid > div {
        page-break-inside: avoid;
    }
}

