/* ═══════════════════════════════════════════════════════
   移动端公共适配样式 · mobile.css
   抽取各页面通用的响应式规则，统一断点与行为
   断点：1024px (平板) / 767px (手机) / 480px (小屏手机)
   ═══════════════════════════════════════════════════════ */

/* ══ 平板适配 (≤1024px) ══ */
@media (max-width: 1024px) {
    /* 搜索输入区：3列 → 2列（输入框占满 + 按钮换行） */
    .search-input-zone {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .search-input-zone .btn-search,
    .search-input-zone .btn-reset,
    .search-input-zone .btn-primary {
        height: 36px;
        min-width: 72px;
        padding: 0 14px;
        font-size: 13px;
    }

    /* 搜索按钮行：横排 */
    .search-input-zone .search-input-group {
        order: -1;
    }

    /* 筛选区缩小间距 */
    .filter-zone {
        gap: 8px !important;
        padding: 12px !important;
    }

    .filter-item {
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    /* 页面内边距缩小 */
    .page-wrap {
        padding: 12px !important;
    }

    .work-content {
        padding: 12px 16px !important;
    }

    /* 面板/卡片内边距 */
    .search-panel {
        padding: 12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .section-card {
        padding: 16px 18px !important;
    }

    /* 表格区域边距 */
    .table-area {
        margin-left: 12px !important;
        margin-right: 12px !important;
    }
}

/* ══ 手机适配 (≤767px) ══ */
@media (max-width: 767px) {
    /* ── 全局排版 ── */
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
    }

    /* ── 搜索输入区：完全堆叠 ── */
    .search-input-zone {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .search-input-zone .search-input-group {
        width: 100%;
        order: -1;
    }

    .search-input-zone .btn-search,
    .search-input-zone .btn-reset {
        flex: 1;
        min-width: 0;
    }

    /* 搜索按钮横排 */
    .search-btn-row {
        display: flex;
        gap: 8px;
    }

    /* ── 筛选区 ── */
    .filter-zone {
        gap: 6px !important;
        padding: 10px !important;
        margin-top: 10px !important;
    }

    .filter-group {
        gap: 6px;
        min-height: 28px;
    }

    .filter-label {
        font-size: 12px;
        width: 100%;
        margin-bottom: 2px;
    }

    .filter-item {
        height: 28px;
        padding: 0 8px;
        font-size: 12px;
    }

    /* ── 表格：横向滚动 ── */
    .table-area {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 10px 0 0 !important;
        border-radius: 8px;
    }

    .data-table,
    .res-table,
    .notice-table {
        min-width: 640px;
    }

    .data-table th,
    .data-table td,
    .res-table th,
    .res-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* ── 分页条：堆叠 ── */
    .pagination-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        padding: 10px 12px;
    }

    .pagination-btns {
        flex-wrap: wrap;
    }

    /* ── 抽屉：全屏 ── */
    .detail-drawer {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* ── 面板/卡片 ── */
    .search-panel {
        padding: 12px !important;
        margin: 10px 0 0 !important;
        border-radius: 10px;
    }

    .section-card {
        padding: 14px !important;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .page-wrap {
        padding: 10px !important;
        overflow: visible !important;
    }

    .work-content {
        padding: 10px 12px !important;
        overflow: visible !important;
    }

    .work-content-inner {
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        gap: 12px !important;
    }

    /* ── 多列网格 → 单列 ── */
    .metrics-board {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .report-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* ── 多列网格 → 2列 ── */
    .daily-metrics-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── 按钮 ── */
    .btn-search, .btn-reset, .btn-primary, .primary {
        height: 36px !important;
        min-width: 0 !important;
        font-size: 13px !important;
    }

    /* ── 页面头部 ── */
    .page-header-row {
        padding: 12px 12px 0 !important;
        flex-wrap: wrap;
    }

    .page-header-row h1 {
        font-size: 18px;
    }

    .page-header-row p {
        font-size: 12px;
    }

    /* ── 信号头部 ── */
    .signal-header {
        padding: 16px 18px 14px !important;
    }

    .signal-title {
        font-size: 18px !important;
    }

    .meta-bar {
        padding-right: 0 !important;
    }

    .favorite-btn {
        position: static !important;
        margin-top: 8px;
    }

    /* ── Tab 导航 ── */
    .main-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .sv-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
    }

    /* ── 指标卡片 ── */
    .metric-card {
        padding: 14px 16px !important;
    }

    .metric-val {
        font-size: 22px !important;
    }

    /* ── KV 网格 ── */
    .kv-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    .kv-key {
        font-weight: 600;
    }

    /* ── 传导路径 ── */
    .transmission-flow {
        font-size: 12px;
    }

    /* ── 返回顶部 ── */
    .back-to-top {
        right: 16px;
        bottom: 24px;
        width: 36px;
        height: 36px;
    }

    /* ── 页面正文 ── */
    .page-body {
        padding: 16px 12px 40px !important;
    }

    /* ── 详情区域 ── */
    .detail-section-header {
        padding: 12px 16px !important;
    }

    .detail-section-body {
        padding: 12px 16px !important;
    }

    .sv-table-wrap {
        padding: 10px 12px 16px !important;
    }

    /* ── workspace 布局：单列 ── */
    .workspace-layout {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }

    .workspace-insight {
        width: 100% !important;
        position: static !important;
        height: auto !important;
        max-height: 50vh !important;
    }

    /* ── profile 页 ── */
    .profile-layout {
        padding: 8px 10px !important;
        gap: 10px !important;
    }

    .profile-nav-tabs {
        padding: 0 10px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .profile-nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .pf-body {
        padding: 0 !important;
    }

    .pf-header {
        flex-wrap: wrap;
        gap: 10px !important;
    }

    .pf-view-grid {
        grid-template-columns: 1fr !important;
    }

    .pf-checkbox-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .pf-section-card {
        padding: 14px !important;
    }

    .pf-row {
        flex-direction: column;
        gap: 0;
    }

    /* ── 首页 ── */
    .home-hero-fixed {
        padding: 12px 12px 0 !important;
    }

    .home-content-row {
        padding: 0 12px 12px !important;
    }

    .home-main-scroll {
        flex-direction: column;
        overflow: visible;
    }

    .home-main-left {
        overflow: visible;
        padding-right: 0;
    }

    .home-sidebar-fixed {
        width: 100% !important;
        overflow: visible;
    }

    .hot-table-header,
    .hot-row {
        grid-template-columns: 60px 1fr 14% 14% !important;
        font-size: 12px;
        padding: 8px 10px;
    }

    .hot-table-header > :nth-child(5),
    .hot-row > :nth-child(5),
    .hot-table-header > :nth-child(6),
    .hot-row > :nth-child(6) {
        display: none;
    }
}

/* ══ 小屏手机 (≤480px) ══ */
@media (max-width: 480px) {
    .search-input-zone .btn-search,
    .search-input-zone .btn-reset {
        font-size: 12px !important;
        padding: 0 10px !important;
    }

    .filter-item {
        height: 26px;
        padding: 0 6px;
        font-size: 11px;
    }

    .signal-title {
        font-size: 16px !important;
    }

    .metric-val {
        font-size: 20px !important;
    }

    .main-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page-header-row h1 {
        font-size: 16px;
    }

    .pf-checkbox-grid {
        grid-template-columns: 1fr !important;
    }
}
