/* 云督伴学 Mobile Experience Architecture V1.0
 * 只在 body.ydb-mobile-shell-v1 且 <=900px 生效；桌面端零侵入。
 */
.ydb-mobile-topbar,
.ydb-mobile-bottom-nav,
.ydb-mobile-hub,
.ydb-mobile-hub-backdrop,
.ydb-feedback-root {
    display: none;
}

@media (max-width: 900px) {
    body.ydb-mobile-shell-v1 {
        --ydb-mobile-brand: #E53935;
        --ydb-mobile-bg: #F5F5F7;
        --ydb-mobile-surface: rgba(255,255,255,.96);
        --ydb-mobile-text: #1D1D1F;
        --ydb-mobile-muted: #6E6E73;
        --ydb-mobile-border: rgba(60,60,67,.12);
        --ydb-mobile-tab-h: 64px;
        --ydb-mobile-top-h: 58px;
        overflow-x: hidden;
        background: var(--ydb-mobile-bg);
        -webkit-tap-highlight-color: transparent;
    }

    body.ydb-mobile-shell-v1.mobile-nav-open,
    body.ydb-mobile-shell-v1.pp-portal-nav-open {
        overflow: auto;
    }

    body.ydb-mobile-shell-v1 .mobile-topbar,
    body.ydb-mobile-shell-v1 #mobile-menu-toggle,
    body.ydb-mobile-shell-v1 .mobile-sidebar-overlay,
    body.ydb-mobile-shell-v1 .aai-mobile-tabbar,
    body.ydb-mobile-shell-v1 .ydb-bottom-nav:not(.ydb-mobile-bottom-nav),
    body.ydb-mobile-shell-v1 #ppPortalMenu,
    body.ydb-mobile-shell-v1 #spPortalMenu,
    body.ydb-mobile-shell-v1 .pp-portal-sidebar,
    body.ydb-mobile-shell-v1 .pp-portal-sidebar-overlay,
    body.ydb-mobile-shell-v1 .pp-header,
    body.ydb-mobile-shell-v1 .sp-portal-header {
        display: none !important;
    }

    body.ydb-mobile-shell-v1 .sidebar {
        display: none !important;
    }

    body.ydb-mobile-shell-v1 .app-shell,
    body.ydb-mobile-shell-v1 .pp-page,
    body.ydb-mobile-shell-v1 .sp-page {
        display: block;
        min-height: 100dvh;
    }

    body.ydb-mobile-shell-v1 .main-content,
    body.ydb-mobile-shell-v1 .pp-main,
    body.ydb-mobile-shell-v1 .sp-main {
        width: 100%;
        min-width: 0;
        margin-left: 0 !important;
        padding-bottom: calc(var(--ydb-mobile-tab-h) + env(safe-area-inset-bottom) + 20px) !important;
    }

    .ydb-mobile-topbar {
        position: sticky;
        z-index: 950;
        top: 0;
        display: grid;
        width: 100%;
        min-height: calc(var(--ydb-mobile-top-h) + env(safe-area-inset-top));
        grid-template-columns: minmax(74px,auto) 1fr minmax(74px,auto);
        align-items: end;
        gap: 6px;
        padding: env(safe-area-inset-top) 12px 8px;
        border-bottom: 1px solid var(--ydb-mobile-border);
        background: var(--ydb-mobile-surface);
        color: var(--ydb-mobile-text);
        backdrop-filter: saturate(180%) blur(18px);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
    }

    .ydb-mobile-topbar-back {
        display: inline-flex;
        min-width: 0;
        min-height: 42px;
        align-items: center;
        gap: 1px;
        padding: 0 4px 0 0;
        border: 0;
        background: transparent;
        color: var(--ydb-mobile-brand);
        font: inherit;
        font-size: 14px;
        cursor: pointer;
    }

    .ydb-mobile-topbar-back[hidden] { display: none !important; }
    .ydb-mobile-topbar-back span { overflow: hidden; max-width: 54px; text-overflow: ellipsis; white-space: nowrap; }
    .ydb-mobile-topbar-heading { align-self: center; min-width: 0; text-align: center; }
    .ydb-mobile-topbar-heading strong,
    .ydb-mobile-topbar-heading small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ydb-mobile-topbar-heading strong { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
    .ydb-mobile-topbar-heading small { margin-top: 1px; color: var(--ydb-mobile-muted); font-size: 10px; }
    .ydb-mobile-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }

    .ydb-mobile-icon-button {
        position: relative;
        display: inline-grid;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--ydb-mobile-text);
        text-decoration: none;
        cursor: pointer;
        transition: transform var(--motion-press-out) var(--motion-ease-standard), background var(--motion-fast) ease;
    }
    .ydb-mobile-icon-button:active { background: rgba(118,118,128,.1); }
    .ydb-mobile-more-dots { margin-top: -5px; font-size: 21px; font-weight: 800; letter-spacing: 2px; }
    .ydb-mobile-notice-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--ydb-mobile-brand); opacity: 0; }
    .ydb-mobile-notice-dot.is-visible { opacity: 1; }

    .ydb-mobile-bottom-nav {
        position: fixed;
        z-index: 940;
        right: 0;
        bottom: 0;
        left: 0;
        display: block;
        min-height: calc(var(--ydb-mobile-tab-h) + env(safe-area-inset-bottom));
        padding: 5px 8px env(safe-area-inset-bottom);
        border-top: 1px solid var(--ydb-mobile-border);
        background: rgba(255,255,255,.94);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }

    .ydb-mobile-bottom-nav-inner {
        display: grid;
        max-width: 620px;
        height: 58px;
        /* V1.8.0：按实际按钮数量均分铺满（原来是写死 5 列，
           家长端改成 4 个后右侧空出一格） */
        grid-auto-flow: column;
        grid-auto-columns: minmax(0,1fr);
        align-items: stretch;
        margin: 0 auto;
    }

    .ydb-mobile-tab {
        position: relative;
        display: flex;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 3px 1px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #8E8E93;
        font: inherit;
        text-decoration: none;
        cursor: pointer;
    }
    .ydb-mobile-tab svg { width: 22px; height: 22px; }
    .ydb-mobile-tab span { overflow: hidden; max-width: 100%; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
    .ydb-mobile-tab.is-active { color: var(--ydb-mobile-brand); }
    .ydb-mobile-tab.is-active::before { position: absolute; top: 1px; width: 25px; height: 3px; border-radius: 99px; background: currentColor; content: ""; }
    .ydb-mobile-bottom-nav[data-role="boss"] .ydb-mobile-tab.is-featured {
        align-self: end;
        min-height: 58px;
        margin: -10px 4px 0;
        border: 1px solid rgba(10,132,255,.2);
        border-radius: 18px;
        background: linear-gradient(145deg,#147efb,#6d5dfc);
        color: #fff;
        box-shadow: 0 8px 22px rgba(40,101,230,.28);
    }
    .ydb-mobile-bottom-nav[data-role="boss"] .ydb-mobile-tab.is-featured svg { width: 24px; height: 24px; }
    .ydb-mobile-bottom-nav[data-role="boss"] .ydb-mobile-tab.is-featured span { font-size: 11px; font-weight: 750; }
    .ydb-mobile-bottom-nav[data-role="boss"] .ydb-mobile-tab.is-featured.is-active::before { display: none; }
    .ydb-mobile-bottom-nav[data-role="boss"] .ydb-mobile-tab.is-featured:active { transform: scale(.96); }

    body.ydb-mobile-immersive .ydb-mobile-bottom-nav { display: none; }
    body.ydb-mobile-immersive .main-content,
    body.ydb-mobile-immersive .pp-main,
    body.ydb-mobile-immersive .sp-main { padding-bottom: 18px !important; }
    body.ydb-mobile-immersive .ydb-mobile-topbar-actions { visibility: hidden; }

    .ydb-mobile-hub-backdrop {
        position: fixed;
        z-index: 980;
        inset: 0;
        display: block;
        opacity: 0;
        background: rgba(0,0,0,.26);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        pointer-events: none;
        transition: opacity var(--motion-sheet) ease;
    }
    .ydb-mobile-hub-backdrop[hidden], .ydb-mobile-hub[hidden] { display: none !important; }
    .ydb-mobile-hub-backdrop.is-open { opacity: 1; pointer-events: auto; }

    .ydb-mobile-hub {
        position: fixed;
        z-index: 990;
        inset: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--ydb-mobile-bg);
        color: var(--ydb-mobile-text);
        opacity: 0;
        transform: translateY(28px);
        transition: transform var(--motion-sheet) var(--motion-ease-standard), opacity var(--motion-base) ease;
    }
    .ydb-mobile-hub.is-open { opacity: 1; transform: translateY(0); }
    .ydb-mobile-hub-head { display: grid; min-height: calc(58px + env(safe-area-inset-top)); grid-template-columns: 46px 1fr 46px; align-items: end; padding: env(safe-area-inset-top) 10px 8px; border-bottom: 1px solid var(--ydb-mobile-border); background: rgba(255,255,255,.94); text-align: center; }
    .ydb-mobile-hub-head strong,.ydb-mobile-hub-head small { display: block; }
    .ydb-mobile-hub-head strong { font-size: 17px; }
    .ydb-mobile-hub-head small { margin-top: 1px; color: var(--ydb-mobile-muted); font-size: 10px; }
    .ydb-mobile-hub-body { flex: 1; overflow: auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }

    .ydb-mobile-profile-card { display: flex; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--ydb-mobile-border); border-radius: 20px; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.04); }
    .ydb-mobile-profile-avatar { display: grid; width: 50px; height: 50px; flex: 0 0 50px; place-items: center; border-radius: 17px; background: rgba(229,57,53,.1); color: var(--ydb-mobile-brand); font-size: 20px; font-weight: 800; }
    .ydb-mobile-profile-card strong,.ydb-mobile-profile-card small { display: block; }
    .ydb-mobile-profile-card strong { font-size: 17px; }
    .ydb-mobile-profile-card small { margin-top: 4px; color: var(--ydb-mobile-muted); font-size: 12px; }

    .ydb-mobile-hub-search { display: flex; min-height: 44px; align-items: center; gap: 8px; margin: 14px 0; padding: 0 12px; border-radius: 13px; background: rgba(118,118,128,.1); color: var(--ydb-mobile-muted); }
    .ydb-mobile-hub-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ydb-mobile-text); font: inherit; font-size: 16px; }
    .ydb-mobile-hub-results { display: grid; gap: 14px; }
    .ydb-mobile-hub-group h3 { margin: 0 0 7px 4px; color: var(--ydb-mobile-muted); font-size: 12px; font-weight: 650; }
    .ydb-mobile-hub-list { overflow: hidden; border: 1px solid var(--ydb-mobile-border); border-radius: 17px; background: #fff; }
    .ydb-mobile-hub-item { display: flex; min-height: 53px; align-items: center; gap: 11px; padding: 8px 13px; border-top: 1px solid var(--ydb-mobile-border); color: var(--ydb-mobile-text); text-decoration: none; }
    .ydb-mobile-hub-item:first-child { border-top: 0; }
    .ydb-mobile-hub-item-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 10px; background: rgba(229,57,53,.09); color: var(--ydb-mobile-brand); }
    .ydb-mobile-hub-item-label { min-width: 0; flex: 1; font-size: 14px; font-weight: 600; }
    .ydb-mobile-hub-item-chevron { color: #C7C7CC; }
    .ydb-mobile-hub-empty { padding: 36px 18px; color: var(--ydb-mobile-muted); text-align: center; }
    .ydb-mobile-logout { display: flex; min-height: 50px; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; border: 1px solid rgba(229,57,53,.16); border-radius: 15px; background: #fff; color: var(--ydb-mobile-brand); font-size: 14px; font-weight: 650; text-decoration: none; }

    body.ydb-mobile-hub-open { overflow: hidden !important; }

    /* 高频后台表格在手机上转为纵向信息卡；桌面表格保持原样。 */
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table,
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table tbody,
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table tr,
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table td { display: block; width: 100%; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table thead { display: none; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table { min-width: 0 !important; border: 0; background: transparent; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table tbody { display: grid; gap: 10px; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table tr { overflow: hidden; padding: 10px 14px; border: 1px solid var(--ydb-mobile-border); border-radius: 17px; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.035); }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table td { display: grid; min-height: 34px; grid-template-columns: minmax(78px,34%) 1fr; align-items: center; padding: 7px 0 !important; border: 0 !important; text-align: right; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table td::before { color: var(--ydb-mobile-muted); font-size: 11px; text-align: left; content: attr(data-ydb-label); }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table td:last-child { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px !important; border-top: 1px solid var(--ydb-mobile-border) !important; }
    body.ydb-mobile-shell-v1 table.ydb-mobile-card-table td:last-child::before { margin-right: auto; }

    .ydb-navigation-skeleton { position: fixed; z-index: 930; inset: calc(var(--ydb-mobile-top-h) + env(safe-area-inset-top)) 0 calc(var(--ydb-mobile-tab-h) + env(safe-area-inset-bottom)) 0; padding: 18px 16px; background: var(--ydb-mobile-bg); }
    .ydb-navigation-skeleton-head,.ydb-navigation-skeleton-card { position: relative; overflow: hidden; border-radius: 15px; background: #EAEAEE; }
    .ydb-navigation-skeleton-head { width: 48%; height: 27px; margin: 5px 0 18px; }
    .ydb-navigation-skeleton-card { height: 128px; margin-top: 12px; }
    .ydb-navigation-skeleton-card.short { height: 82px; }
    .ydb-navigation-skeleton-head::after,.ydb-navigation-skeleton-card::after { position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent); content: ""; transform: translateX(-100%); animation: ydb-skeleton-sweep 1.15s ease-in-out infinite; }
    @keyframes ydb-skeleton-sweep { to { transform: translateX(100%); } }

    /* 统一反馈组件 */
    .ydb-feedback-root { position: fixed; z-index: 1200; inset: 0; display: block; pointer-events: none; }
    .ydb-toast-stack { position: absolute; right: 16px; bottom: calc(var(--ydb-mobile-tab-h) + env(safe-area-inset-bottom) + 14px); left: 16px; display: grid; justify-items: center; gap: 8px; }
    .ydb-toast { max-width: min(420px,100%); padding: 11px 15px; border-radius: 999px; background: rgba(29,29,31,.92); color: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.16); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease-standard); }
    .ydb-toast.is-visible { opacity: 1; transform: translateY(0); }
    .ydb-feedback-layer { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(0,0,0,.28); opacity: 0; pointer-events: auto; transition: opacity var(--motion-base) ease; }
    .ydb-feedback-layer.is-visible { opacity: 1; }
    .ydb-dialog-card,.ydb-sheet-card { width: min(430px,100%); border-radius: 22px; background: #fff; color: var(--ydb-mobile-text); box-shadow: 0 24px 70px rgba(0,0,0,.2); }
    .ydb-dialog-card { align-self: center; padding: 22px; transform: scale(.96); transition: transform var(--motion-base) var(--motion-ease-standard); }
    .ydb-feedback-layer.is-visible .ydb-dialog-card { transform: scale(1); }
    .ydb-sheet-card { max-height: 84dvh; overflow: auto; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(30px); transition: transform var(--motion-sheet) var(--motion-ease-standard); }
    .ydb-feedback-layer.is-visible .ydb-sheet-card { transform: translateY(0); }
    .ydb-sheet-grab { width: 38px; height: 5px; margin: 0 auto 15px; border-radius: 99px; background: #D1D1D6; }
    .ydb-dialog-card h2,.ydb-sheet-card h2 { margin: 0; font-size: 19px; }
    .ydb-dialog-card p,.ydb-sheet-card p { margin: 8px 0 0; color: var(--ydb-mobile-muted); font-size: 14px; line-height: 1.6; }
    .ydb-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
    .ydb-dialog-actions button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 12px; font: inherit; font-weight: 650; }
    .ydb-dialog-cancel { background: #F2F2F7; color: var(--ydb-mobile-text); }
    .ydb-dialog-confirm { background: var(--ydb-mobile-brand); color: #fff; }
    .ydb-loading-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: ydb-spin .7s linear infinite; }
    @keyframes ydb-spin { to { transform: rotate(360deg); } }
    .ydb-success-mark { display: grid; width: 42px; height: 42px; margin: 0 auto; place-items: center; border: 2px solid #34C759; border-radius: 50%; color: #34C759; animation: ydb-success var(--motion-success) var(--motion-ease-standard); }
    @keyframes ydb-success { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }

    .ydb-skeleton { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--ydb-mobile-border); border-radius: 17px; background: #fff; }
    .ydb-skeleton-line { position: relative; display: block; overflow: hidden; width: 100%; height: 16px; border-radius: 7px; background: #EAEAEE; }
    .ydb-skeleton-line.short { width: 58%; }
    .ydb-skeleton.compact { padding: 10px; }
    .ydb-skeleton-line::after { position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent); content: ""; transform: translateX(-100%); animation: ydb-skeleton-sweep 1.15s ease-in-out infinite; }
    .ydb-empty-state,.ydb-error-state { padding: 30px 20px; border: 1px solid var(--ydb-mobile-border); border-radius: 17px; background: #fff; text-align: center; }
    .ydb-empty-state strong,.ydb-error-state strong { display: block; color: var(--ydb-mobile-text); font-size: 16px; }
    .ydb-empty-state p,.ydb-error-state p { margin: 7px 0 0; color: var(--ydb-mobile-muted); font-size: 13px; line-height: 1.55; }
    .ydb-error-state strong { color: #C62828; }
}

/* ===== 试用期红标：强制可见（V1.9.0-b） ===== */
.ydb-probation-badge{display:inline-block !important;visibility:visible !important;margin-left:6px !important;padding:2px 7px !important;border-radius:999px !important;background:#e5342c !important;background-color:#e5342c !important;color:#fff !important;font-size:11px !important;font-weight:700 !important;line-height:1.6 !important;vertical-align:middle !important;white-space:nowrap !important;flex:0 0 auto !important;box-shadow:0 1px 3px rgba(229,52,44,.35) !important;}
