/**
 * Responsive Styles - 移动端适配
 * 
 * 断点：
 * - ≤576px:  手机竖屏
 * - ≤768px:  手机横屏 / 小平板
 * - ≤992px:  平板
 */

/* === 通用移动端优化 === */
@media (max-width: 768px) {
    /* 登录页面 */
    .login-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 16px;
        padding: 24px 16px;
        border-radius: 8px;
    }

    .login-title {
        font-size: 20px;
    }

    /* 隐藏桌面端侧边栏 */
    .desktop-sider {
        display: none !important;
    }

    /* 显示移动端底部导航 */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Dashboard Header 紧凑化 */
    .dashboard-header {
        padding: 0 12px !important;
    }

    .dashboard-header .ant-typography {
        font-size: 16px !important;
    }

    /* 内容区域减少内边距 */
    .mobile-content-layout {
        padding: 12px !important;
    }

    /* 页脚紧凑化 */
    .dashboard-footer {
        margin-top: 24px !important;
        padding: 16px 0 !important;
        font-size: 12px !important;
    }

    /* 底部导航占位空间 */
    .mobile-nav-spacer {
        height: 60px;
    }

    /* Card 组件适配 */
    .ant-card {
        border-radius: 8px;
    }

    .ant-card-head-title {
        font-size: 14px;
    }

    .ant-card-extra {
        font-size: 12px;
    }

    /* 表格横向滚动 */
    .ant-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Statistic 组件紧凑化 */
    .ant-statistic-title {
        font-size: 12px !important;
    }

    .ant-statistic-content {
        font-size: 18px !important;
    }

    .ant-statistic-content-value {
        font-size: 18px !important;
    }

    /* Modal 宽度适配 */
    .ant-modal {
        max-width: calc(100vw - 32px) !important;
        margin: 16px auto !important;
    }

    .ant-modal-body {
        padding: 16px !important;
    }

    /* Descriptions 在移动端单列显示 */
    .ant-descriptions-item-label {
        font-size: 12px;
    }

    .ant-descriptions-item-content {
        font-size: 12px;
    }

    /* Timeline 紧凑化 */
    .ant-timeline-item-content p {
        margin-bottom: 2px;
        font-size: 13px;
    }

    /* Tabs 适配 */
    .ant-tabs-nav {
        margin-bottom: 8px !important;
    }

    /* Space 间距调整 */
    .ant-space-vertical > .ant-space-item {
        margin-bottom: 8px !important;
    }
}

/* === 手机竖屏特殊处理 === */
@media (max-width: 576px) {
    .login-container {
        margin: 8px;
        padding: 20px 12px;
    }

    /* 更紧凑的表格 */
    .ant-table-cell {
        padding: 8px 4px !important;
        font-size: 12px;
    }

    /* Tag 更小 */
    .ant-tag {
        font-size: 11px;
        padding: 0 4px;
    }

    /* Button 紧凑化 */
    .ant-btn-sm {
        font-size: 11px;
        padding: 0 4px;
    }
}

/* === 平板适配 === */
@media (min-width: 769px) and (max-width: 992px) {
    /* 平板上侧边栏变窄 */
    .desktop-sider {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
    }

    .mobile-bottom-nav {
        display: none !important;
    }

    .mobile-content-layout {
        padding: 16px !important;
    }
}

/* === 桌面端保持默认 === */
@media (min-width: 993px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    .mobile-nav-spacer {
        display: none;
    }
}

/* === 底部导航栏样式 === */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 56px;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 2px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #999;
    font-size: 10px;
    line-height: 1.2;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active {
    color: #1890ff;
}

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

.mobile-nav-item .nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

/* === 指标监控图表移动端适配 === */
@media (max-width: 768px) {
    /* 图表区域改为单列 */
    .metrics-chart-grid {
        grid-template-columns: 1fr !important;
    }

    .metrics-chart-item {
        height: 220px !important;
    }

    /* 带宽监控的策略说明文字 */
    .bandwidth-strategy-info {
        font-size: 12px !important;
    }
}
