/**
 * 响应式适配 - IT资产管理系统前台
 * 支持：手机竖屏、手机横屏、平板、PC、大屏幕
 */

/* ============================================================
   1. 移动端优化 (< 768px)
   ============================================================ */

/* 防止iOS点击延迟 */
.device-touch {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 优化移动端滚动 */
.device-mobile .main {
    -webkit-overflow-scrolling: touch;
}

/* 微信内置浏览器优化 */
.device-wechat .header {
    padding-top: env(safe-area-inset-top);
}

.device-wechat .main {
    padding-top: calc(56px + env(safe-area-inset-top));
}


/* ============================================================
   2. 平板端适配 (768px - 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    .stats-row {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .quick-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
    
    /* 列表项增大点击区域 */
    .list-item {
        padding: 16px 12px;
    }
    
    /* 搜索框优化 */
    .search-bar {
        max-width: 600px;
    }
}


/* ============================================================
   3. PC端适配 (≥ 1024px)
   ============================================================ */
@media (min-width: 1024px) {
    /* 侧边栏导航 */
    body {
        padding-left: 200px !important;
        padding-bottom: 0 !important;
    }
    
    .header {
        left: 200px !important;
    }
    
    .tab-bar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 200px !important;
        height: auto !important;
        background: var(--card);
        border-top: none !important;
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        padding: 0;
        z-index: 100;
    }
    
    .tab-item {
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center;
        padding: 14px 20px;
        gap: 12px;
        border-radius: 0;
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }
    
    .tab-item:hover {
        background: var(--bg);
        border-left-color: var(--primary-light);
    }
    
    .tab-item.active {
        background: rgba(79, 70, 229, 0.05);
        border-left-color: var(--primary) !important;
        color: var(--primary) !important;
    }
    
    .tab-item i {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }
    
    .tab-item span {
        font-size: 14px;
    }
    
    /* 主内容区置中 */
    .main {
        margin-top: 56px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* 卡片悬停效果 */
    .card {
        transition: box-shadow 0.2s;
    }
    
    .card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    /* 列表项优化 */
    .list-item {
        border-radius: 8px;
        padding: 12px 16px;
        transition: background 0.2s;
    }
    
    .list-item:hover {
        background: var(--bg);
    }
    
    /* 按钮组 */
    .btn-group {
        display: flex;
        gap: 12px;
    }
}


/* ============================================================
   4. 大屏幕适配 (≥ 1440px)
   ============================================================ */
@media (min-width: 1440px) {
    body {
        padding-left: 240px !important;
    }
    
    .header {
        left: 240px !important;
    }
    
    .tab-bar {
        width: 240px !important;
        padding-top: 20px;
    }
    
    .tab-item {
        padding: 16px 24px;
        font-size: 15px;
    }
}


/* ============================================================
   5. 横屏手机优化
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        height: 48px;
    }
    
    .main {
        margin-top: 48px !important;
    }
    
    .tab-bar {
        height: 50px !important;
    }
    
    .tab-item {
        flex-direction: row !important;
        gap: 6px;
        padding: 8px 12px;
    }
    
    .tab-item i {
        font-size: 16px;
    }
}


/* ============================================================
   6. 打印样式
   ============================================================ */
@media print {
    .header, .tab-bar, .btn, .toast {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
        background: #fff !important;
    }
    
    .main {
        margin: 0 !important;
        padding: 20px !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}


/* ============================================================
   7. 工具类
   ============================================================ */
/* 仅在移动端显示 */
@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}

/* 仅在PC端显示 */
@media (max-width: 1023px) {
    .desktop-only {
        display: none !important;
    }
}

/* 响应式隐藏 */
.hide-mobile {
    display: initial;
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}
