/* ========================================
   蓝云智慧运维 - 移动端 H5 样式
   设计规范：以 Vant 4 为基础，卡片式布局
   ======================================== */

:root {
    --primary: #1a73e8;
    --primary-light: #e8f0fe;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #323233;
    --text-secondary: #969799;
    --text-light: #c8c9cc;
    --border: #ebedf0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

#app { min-height: 100vh; padding-bottom: calc(50px + var(--safe-bottom)); }

/* ===== 页面容器 ===== */
.m-page {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 16px;
}

/* ===== 顶部导航替代：自定义 NavBar 增强 ===== */
.van-nav-bar {
    background: var(--primary) !important;
}
.van-nav-bar .van-nav-bar__title,
.van-nav-bar .van-nav-bar__text,
.van-nav-bar .van-icon { color: #fff !important; }
.van-nav-bar::after { border-color: transparent !important; }

/* ===== 底部标签栏 ===== */
.m-tabbar {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -1px 8px rgba(0,0,0,0.06);
}

/* ===== 统计卡片行 ===== */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 12px 0;
}
.stat-card {
    flex: 1 1 calc(50% - 4px);
    min-width: calc(50% - 4px);
    max-width: calc(50% - 4px);
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 12px;
    text-align: center;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card .stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.stat-card .stat-icon {
    position: absolute;
    right: 10px;
    top: 14px;
    font-size: 28px;
    opacity: 0.12;
}
.stat-card.success .stat-num { color: var(--success); }
.stat-card.warning .stat-num { color: var(--warning); }
.stat-card.danger .stat-num { color: var(--danger); }

/* 三列统计 */
.stat-row-3 .stat-card {
    flex: 1 1 calc(33.33% - 6px);
    min-width: calc(33.33% - 6px);
    max-width: calc(33.33% - 6px);
}

/* ===== 内容卡片 ===== */
.m-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 10px 12px;
    padding: 14px;
    box-shadow: var(--shadow);
}
.m-card .m-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.m-card .m-card-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* ===== 菜单网格（二级页面入口） ===== */
.menu-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}
.menu-item {
    flex: 1 1 calc(33.33% - 6px);
    min-width: calc(33.33% - 6px);
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}
.menu-item:active { transform: scale(0.96); }
.menu-item .menu-icon {
    font-size: 28px;
    margin-bottom: 6px;
}
.menu-item .menu-label {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
}

/* ===== 搜索筛选栏 ===== */
.m-filter {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    flex-wrap: wrap;
}
.m-filter .van-search { flex: 1; min-width: 140px; padding: 0; background: transparent; }
.m-filter .van-search__content { background: #fff; border-radius: 20px; }

/* ===== 列表项增强 ===== */
.van-cell {
    font-size: 14px;
    padding: 12px 14px;
}
.van-cell__title { flex: 1.2; }
.van-cell__value { flex: 2; text-align: right; color: var(--text); }
.van-cell__label { font-size: 12px; margin-top: 3px; }

/* 信息卡片行（详情页） */
.info-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}
.info-row:last-child { border-bottom: none; }
.info-label {
    width: 80px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.info-value {
    flex: 1;
    color: var(--text);
    font-size: 13px;
    word-break: break-all;
}
.info-value.primary { color: var(--primary); font-weight: 600; }
.info-value.danger { color: var(--danger); }
.info-value.success { color: var(--success); }

/* ===== 状态标签 ===== */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.status-tag.success { background: #f0fff4; color: var(--success); }
.status-tag.warning { background: #fff7e6; color: var(--warning); }
.status-tag.danger { background: #fff1f0; color: var(--danger); }
.status-tag.info { background: var(--primary-light); color: var(--primary); }

/* ===== 图表容器 ===== */
.chart-box {
    width: 100%;
    height: 220px;
    margin: 8px 0;
}

/* ===== 进度条增强 ===== */
.flow-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.flow-progress .van-progress { flex: 1; }

/* ===== 空状态 ===== */
.m-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.m-empty .van-icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 加载、刷新 ===== */
.van-pull-refresh { min-height: 60vh; }

/* ===== 弹窗按钮组 ===== */
.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.dialog-actions .van-button { flex: 1; }

/* ===== 表单增强 ===== */
.van-field__label { font-weight: 500; color: var(--text); }
.van-field__control { font-size: 14px; }
.van-field__control::placeholder { color: var(--text-light); }

/* ===== Tab 标签页 ===== */
.van-tabs__nav { background: #fff; }
.van-tab { font-size: 14px; }

/* ===== 列表加载更多提示 ===== */
.load-more {
    text-align: center;
    padding: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== 图标颜色快捷类 ===== */
.c-blue { color: #1a73e8; }
.c-green { color: #52c41a; }
.c-orange { color: #faad14; }
.c-red { color: #ff4d4f; }
.c-gray { color: #969799; }

/* ===== 滑动手势行 ===== */
.swipe-cell-btns {
    display: flex;
    height: 100%;
}
.swipe-cell-btns .van-button {
    height: 100%;
    border-radius: 0;
    min-width: 64px;
}

/* ===== 流量详情页 - 全屏布局 ===== */
.flow-detail-page {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f7fa;
}
.flow-detail-page .van-tabs {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.flow-detail-page .van-tabs__wrap {
    flex-shrink: 0;
}
.flow-detail-page .van-tabs__content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.flow-detail-page .van-tab__pane {
    height: 100%;
}
.flow-detail-page .van-tab__pane--active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
}

/* 固定区 + 滚动区 */
.fd-fixed { flex-shrink: 0; }
.fd-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding-bottom: 24px;
}

/* 紧凑日期选择栏 */
.fd-date-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 5px 12px;
    background: #fff;
}
.fd-date-btn {
    flex: 1;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    text-align: center;
    color: #323233;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 列表头+分页固定栏 */
.fd-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}
.fd-list-title {
    font-size: 13px;
    font-weight: 600;
    color: #323233;
}
.fd-pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}
.fd-pagination .van-button {
    min-width: 28px;
    height: 24px;
    padding: 0 4px;
    font-size: 12px;
}
.fd-pagination span {
    font-size: 11px;
    color: #969799;
}

/* 表头行 */
.fd-table-head {
    display: flex;
    background: #f0f2f5;
    padding: 5px 0;
    font-size: 11px;
    color: #666;
}

/* 照片网格 */
.fd-photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
}
.fd-photo-item {
    flex: 1 1 calc(33.33% - 4px);
    max-width: calc(33.33% - 4px);
}

/* ===== 响应式小屏优化 ===== */
@media (max-width: 360px) {
    .stat-card .stat-num { font-size: 20px; }
    .stat-card { padding: 10px 8px; }
    .menu-item { padding: 12px 4px; }
}
