/* 手机端卡组工作台：桌面端完全不参与。 */
.mobile-deck-status,
.mobile-deck-bottom,
.mobile-deck-library { display: none; }

@media (max-width: 767px) {
    #page-deck-editor.mobile-deck-workbench-active .deck-workbench {
        background: #090a12;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-columns {
        display: block !important;
        overflow: hidden !important;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-left {
        display: flex !important;
        width: 100%;
        height: 100%;
        border: 0;
        max-height: none;
    }
    #page-deck-editor.mobile-deck-workbench-active > .deck-workbench > .dwb-columns > .dwb-right,
    #page-deck-editor.mobile-deck-workbench-active .dwb-tabs,
    #page-deck-editor.mobile-deck-workbench-active #dwb-add-fab,
    #page-deck-editor.mobile-deck-workbench-active #deck-grid {
        display: none !important;
    }
    #page-deck-editor.mobile-deck-workbench-active .mobile-deck-library .dwb-right {
        display: flex !important;
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        transform: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-header {
        min-height: 48px;
        padding: 6px 8px;
        gap: 7px;
    }
    #page-deck-editor.mobile-deck-workbench-active .sub-page-title { display: none; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-name {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        height: 34px;
        font-size: 14px;
        padding: 0 9px;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-save {
        flex: 0 0 auto;
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-menu-btn { width: 34px; height: 34px; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-pane-title {
        min-height: 35px;
        padding: 7px 12px 5px;
        font-size: 13px;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-left > .deck-stats-bar,
    #page-deck-editor.mobile-deck-workbench-active .dwb-left > .dwb-curve {
        display: none;
    }
    #page-deck-editor.mobile-deck-workbench-active .deck-validity-panel { position: absolute; z-index: 8; left: 8px; right: 8px; top: 92px; }
    #page-deck-editor.mobile-deck-workbench-active #deck-grid-grouped {
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 2px 0 92px;
        -webkit-overflow-scrolling: touch;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row {
        min-height: 64px;
        margin: 5px 10px;
        padding: 8px 8px 8px 10px;
        border-radius: 8px;
        gap: 8px;
    }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-img,
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-noimg { width: 48px; height: 48px; flex-basis: 48px; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-name { font-size: 14px; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-meta { font-size: 10.5px; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-count { min-width: 27px; font-size: 14px; }
    #page-deck-editor.mobile-deck-workbench-active .dwb-grp-row .grp-btn { width: 36px; height: 36px; flex-basis: 36px; }

    .mobile-deck-status {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 54px;
        padding: 7px 12px;
        border-bottom: 1px solid rgba(139,92,246,.22);
        background: rgba(13,14,25,.96);
    }
    .mobile-deck-status .mds-main { min-width: 62px; }
    .mobile-deck-status .mds-count { color: var(--brand-bright); font-size: 18px; font-weight: 800; line-height: 1; }
    .mobile-deck-status .mds-label { display: block; margin-top: 3px; color: var(--text-dim); font-size: 9px; }
    .mobile-deck-status .mds-types { display: grid; grid-template-columns: repeat(4, minmax(36px, 1fr)); gap: 3px; flex: 1; }
    .mobile-deck-status .mds-type { padding: 3px 2px; border-left: 1px solid rgba(139,92,246,.2); text-align: center; color: var(--text-dim); font-size: 9px; }
    .mobile-deck-status .mds-type b { display: block; color: #e0d8c8; font-size: 12px; }
    .mobile-deck-status .mds-valid { flex: 0 0 auto; max-width: 86px; color: #f4b942; font-size: 10px; text-align: right; }
    .mobile-deck-status .mds-valid.ok { color: #4ade80; }

    .mobile-deck-bottom {
        display: flex;
        position: absolute;
        left: 0; right: 0; bottom: 0;
        z-index: 20;
        gap: 7px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(139,92,246,.3);
        background: rgba(8,9,17,.98);
    }
    .mobile-deck-bottom button { height: 42px; border-radius: 7px; font-size: 13px; font-weight: 700; }
    .mobile-deck-bottom .mdb-overview { flex: 0 0 35%; border: 1px solid rgba(139,92,246,.4); background: rgba(139,92,246,.1); color: #d8c6ff; }
    .mobile-deck-bottom .mdb-add { flex: 1; border: 1px solid #a879ff; background: linear-gradient(145deg,#a879ff,#713de0); color: #101018; }

    .mobile-deck-library {
        position: fixed;
        inset: 0;
        z-index: 80;
        flex-direction: column;
        background: #090a12;
    }
    .mobile-deck-library.open { display: flex; }
    .mobile-deck-library .mdl-head { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 7px 10px; border-bottom: 1px solid rgba(139,92,246,.3); }
    .mobile-deck-library .mdl-close { width: 36px; height: 36px; border: 1px solid rgba(139,92,246,.4); border-radius: 7px; background: transparent; color: #d8c6ff; font-size: 22px; }
    .mobile-deck-library .mdl-title { flex: 1; color: #d8c6ff; font-size: 15px; font-weight: 800; }
    .mobile-deck-library .mdl-count { color: var(--brand-bright); font-size: 12px; }
    .mobile-deck-library .mdl-search { padding: 8px 10px 4px; }
    .mobile-deck-library .mdl-search input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid rgba(139,92,246,.35); border-radius: 7px; background: #111322; color: #eee8de; font-size: 16px; }
    .mobile-deck-library .mdl-filters { display: flex; gap: 5px; padding: 5px 10px; overflow-x: auto; }
    .mobile-deck-library .mdl-filters button { flex: 0 0 auto; height: 30px; padding: 0 10px; border: 1px solid rgba(139,92,246,.3); border-radius: 15px; background: rgba(139,92,246,.08); color: var(--text-dim); font-size: 11px; }
    .mobile-deck-library .mdl-filters button.active { color: #111; background: #b487ff; border-color: #b487ff; }
    .mobile-deck-library .mdl-pool { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 16px; }
    .mobile-deck-library .mdl-pool .dwb-pool { display: grid !important; min-height: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 0 !important; overflow-y: auto !important; overflow-x: hidden !important; }
    .mobile-deck-library .mdl-pool .dwb-pool-card { min-width: 0; }
    .mobile-deck-library .mdl-pool .search-card-item { min-width: 0; }
    .mobile-deck-library .dwb-right > #dwb-sheet-head,
    .mobile-deck-library .dwb-right > .dwb-pane-title,
    .mobile-deck-library .dwb-right > .dwb-filters { display: none !important; }
    .mobile-deck-library .dwb-right > .dwb-pool { display: grid !important; flex: 1 1 auto; min-height: 0; }
}

@media (min-width: 768px) {
    #mobile-deck-library { display: none !important; }
}
