/**
 * 全站移动端 APP 风格壳层（≤768px）
 * 用于 index / admin / home / login 等页面
 */
@media (max-width: 768px) {
    :root {
        --app-brand: var(--ds-brand, #1e3c72);
        --app-brand-light: var(--ds-brand-light, #eef2ff);
        --app-bg: var(--ds-bg-alt, #f0f2f5);
        --app-surface: var(--ds-surface, #ffffff);
        --app-text: var(--ds-text, #1e293b);
        --app-text-muted: var(--ds-text-muted, #64748b);
        --app-border: var(--ds-border, #e8edf3);
        --app-radius-lg: 10px;
        --app-radius-md: 8px;
        --app-radius-sm: 6px;
        --app-header-h: 40px;
        --app-subnav-h: 34px;
        --app-bottom-nav-h: calc(48px + env(safe-area-inset-bottom, 0px));
        --app-touch-min: 36px;
        --app-gap: 6px;
        --app-pad-x: 8px;
        --app-pad-y: 6px;
        --app-shadow-card: none;
        --app-shadow-nav: 0 -1px 0 rgba(15, 23, 42, 0.06);
    }

    html {
        -webkit-tap-highlight-color: transparent;
    }

    body.app-mobile-shell {
        background: var(--app-bg);
        padding-bottom: var(--app-bottom-nav-h);
        -webkit-overflow-scrolling: touch;
        font-size: 13px;
        line-height: 1.4;
    }

    body.app-mobile-shell .header {
        padding: 0 var(--app-pad-x) !important;
        padding-top: env(safe-area-inset-top, 0px) !important;
        min-height: calc(var(--app-header-h) + env(safe-area-inset-top, 0px));
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    }

    body.app-mobile-shell .header-content {
        flex-wrap: nowrap;
        gap: 6px;
        min-height: var(--app-header-h);
    }

    body.app-mobile-shell .logo img {
        width: 26px;
        height: 26px;
    }

    body.app-mobile-shell .app-mobile-header-title {
        display: block;
        flex: 1;
        min-width: 0;
        text-align: center;
        font-size: 15px;
        font-weight: 600;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 2px;
    }

    body.app-mobile-shell .header-actions {
        gap: 4px;
        flex-shrink: 0;
    }

    body.app-mobile-shell .header-tools .header-tool-btn:not(#app-mobile-more-btn),
    body.app-mobile-shell .header-tools .header-admin-menu,
    body.app-mobile-shell .header-tools #support-bell-btn,
    body.app-mobile-shell .header-divider {
        display: none !important;
    }

    body.app-mobile-shell #app-mobile-more-btn {
        display: inline-flex !important;
    }

    body.app-mobile-shell .user-menu-name,
    body.app-mobile-shell .user-menu-caret {
        display: none;
    }

    body.app-mobile-shell .user-menu-trigger {
        padding: 2px;
        border: none;
        background: transparent;
        max-width: none;
    }

    body.app-mobile-shell .user-menu-trigger .user-avatar-hit img,
    body.app-mobile-shell .user-menu-trigger .user-avatar-hit {
        width: 28px;
        height: 28px;
    }

    body.app-mobile-shell .app-nav-shell > .tabs,
    body.app-mobile-shell .app-top-chrome .tabs {
        display: none !important;
    }

    body.app-mobile-shell .app-nav-shell,
    body.app-mobile-shell .app-main-shell,
    body.app-mobile-shell .container {
        padding: 0 !important;
        max-width: 100%;
    }

    body.app-mobile-shell .app-top-chrome .app-subnav.is-visible {
        position: static;
        top: auto;
    }

    body.app-mobile-shell .tab-content {
        padding: var(--app-pad-y) var(--app-pad-x) var(--app-gap);
    }

    .app-subnav {
        display: none;
        position: sticky;
        top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px));
        z-index: 90;
        background: var(--app-bg);
        border-bottom: 1px solid var(--app-border);
        padding: 4px var(--app-pad-x);
    }

    body.app-mobile-shell .app-subnav.is-visible {
        display: block;
    }

    .app-subnav-scroll {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .app-subnav-chip {
        flex: 0 0 auto;
        border: none;
        background: transparent;
        color: var(--app-text-muted);
        font-size: 12px;
        font-weight: 500;
        padding: 5px 10px;
        border-radius: 999px;
        cursor: pointer;
        white-space: nowrap;
        min-height: 28px;
        line-height: 1.2;
    }

    .app-subnav-chip.active {
        background: var(--app-brand);
        color: #fff;
        box-shadow: none;
    }

    .app-bottom-nav {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        height: var(--app-bottom-nav-h);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--app-surface);
        border-top: 1px solid var(--app-border);
        box-shadow: var(--app-shadow-nav);
    }

    .app-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        border: none;
        background: transparent;
        color: var(--app-text-muted);
        font-size: 9px;
        font-weight: 500;
        padding: 4px 2px 2px;
        cursor: pointer;
        min-height: 0;
        position: relative;
    }

    .app-bottom-nav-item .app-bottom-nav-icon {
        font-size: 18px;
        line-height: 1;
    }

    body.app-mobile-shell .app-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: stretch;
    }

    .app-bottom-nav-item.active {
        color: var(--app-brand);
    }

    .app-bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 2px;
        border-radius: 0 0 2px 2px;
        background: var(--app-brand);
    }

    /* —— 更多操作 Bottom Sheet —— */
    .app-action-sheet-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 300;
        background: rgba(15, 23, 42, 0.45);
        animation: app-fade-in 0.2s ease;
    }

    .app-action-sheet-backdrop.show {
        display: block;
    }

    .app-action-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 301;
        background: var(--app-surface);
        border-radius: 16px 16px 0 0;
        padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.12);
    }

    .app-action-sheet-backdrop.show .app-action-sheet {
        transform: translateY(0);
    }

    .app-action-sheet-handle {
        width: 36px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 999px;
        margin: 4px auto 12px;
    }

    .app-action-sheet-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--app-text-muted);
        padding: 0 8px 10px;
    }

    .app-action-sheet-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        border: none;
        background: var(--app-bg);
        color: var(--app-text);
        font-size: 15px;
        padding: 14px 16px;
        border-radius: var(--app-radius-sm);
        margin-bottom: 8px;
        cursor: pointer;
        min-height: var(--app-touch-min);
        text-decoration: none;
        text-align: left;
    }

    .app-action-sheet-item:last-child {
        margin-bottom: 0;
    }

    .app-action-sheet-item-icon {
        font-size: 20px;
        width: 28px;
        text-align: center;
        flex-shrink: 0;
    }

    @keyframes app-fade-in {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* —— 卡片基础（紧凑模式在文件末尾覆盖） —— */
    body.app-mobile-shell .user-menu-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: calc(var(--app-bottom-nav-h) + 8px);
        min-width: 0;
        border-radius: var(--app-radius-lg);
        box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    }

    /* —— Admin 页增强 —— */
    body.app-mobile-shell.admin-page {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    body.app-mobile-shell.admin-page .header {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    body.app-mobile-shell.admin-page .card {
        border-radius: var(--app-radius-md);
        box-shadow: var(--app-shadow-card);
    }

    body.app-mobile-shell.admin-page .admin-menu-toggle {
        min-width: var(--app-touch-min);
        min-height: var(--app-touch-min);
    }

    /* —— Home 落地页 —— */
    body.app-mobile-shell.landing-page {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    body.app-mobile-shell.landing-page .nav {
        position: sticky;
        top: 0;
        z-index: 120;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding-top: max(8px, env(safe-area-inset-top));
    }

    body.app-mobile-shell.landing-page .nav-toggle,
    body.app-mobile-shell.landing-page .nav-actions .btn {
        min-height: var(--app-touch-min);
    }

    body.app-mobile-shell.landing-page .nav-drawer-panel {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    body.app-mobile-shell.landing-page .hero-cta .btn,
    body.app-mobile-shell.landing-page .btn {
        min-height: var(--app-touch-min);
    }

    body.app-mobile-shell.landing-page section {
        scroll-margin-top: 64px;
    }

    /* —— Login 登录页 —— */
    body.app-mobile-shell.auth-page-body .auth-page {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    body.app-mobile-shell.auth-page-body .auth-shell {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    }

    body.app-mobile-shell.auth-page-body .btn-submit,
    body.app-mobile-shell.auth-page-body .auth-tab {
        min-height: var(--app-touch-min);
    }

    /* —— 合规页脚：手机主应用内隐藏，见上方紧凑布局 —— */

    /* —— 弹层统一 Bottom Sheet —— */
    body.app-mobile-shell #support-chat-modal,
    body.app-mobile-shell #user-home-modal,
    body.app-mobile-shell #register-welcome-modal {
        align-items: flex-end;
        padding: 0;
    }

    body.app-mobile-shell .support-chat-panel,
    body.app-mobile-shell .user-home-panel,
    body.app-mobile-shell .register-welcome-panel {
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 16px 16px 0 0;
    }

    body.app-mobile-shell .support-chat-messages,
    body.app-mobile-shell .user-home-body {
        -webkit-overflow-scrolling: touch;
    }

    body.app-mobile-shell .support-chat-compose textarea,
    body.app-mobile-shell .support-chat-compose button,
    body.app-mobile-shell .register-welcome-actions button {
        min-height: var(--app-touch-min);
    }

    body.app-mobile-shell .support-chat-compose textarea {
        font-size: 16px;
    }

    /* —— 表单防 iOS 缩放 —— */
    body.app-mobile-shell input[type="text"],
    body.app-mobile-shell input[type="number"],
    body.app-mobile-shell input[type="date"],
    body.app-mobile-shell input[type="search"],
    body.app-mobile-shell input[type="tel"],
    body.app-mobile-shell input[type="email"],
    body.app-mobile-shell select,
    body.app-mobile-shell textarea {
        font-size: 16px;
    }

    /* —— 模拟实盘 APP 化 —— */
    body.app-mobile-shell .sim-trade-layout {
        grid-template-columns: 1fr;
    }

    body.app-mobile-shell .st-dash-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    body.app-mobile-shell .st-dash-head {
        flex-direction: column;
    }

    body.app-mobile-shell .st-dash-status {
        text-align: left;
    }

    body.app-mobile-shell .st-dash-refresh-row {
        justify-content: flex-start;
    }

    /* —— 条件筛选：筛选器置顶 —— */
    body.app-mobile-shell .ss-layout {
        display: flex;
        flex-direction: column;
    }

    body.app-mobile-shell .ss-sidebar {
        order: -1;
        position: static;
        max-height: none;
    }

    body.app-mobile-shell .ss-filter-toolbar {
        position: sticky;
        top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px) + var(--app-subnav-h, 0px));
        z-index: 40;
        background: var(--app-bg);
        padding-bottom: 8px;
        margin-bottom: 4px;
    }

    body.app-mobile-shell .watchlist-table-wrap,
    body.app-mobile-shell .sim-trade-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -4px;
    }

    /* —— 全市场手机卡片列表 —— */
    .fm-mobile-list {
        display: none;
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
    }

    body.app-mobile-shell #full-market-tab .fm-table-panel {
        display: none !important;
    }

    body.app-mobile-shell #full-market-tab .fm-mobile-list {
        display: flex !important;
    }

    .fm-mobile-card {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-md);
        padding: 14px;
        box-shadow: var(--app-shadow-card);
        -webkit-tap-highlight-color: transparent;
    }

    .fm-mobile-card.fm-strong {
        border-color: #ffe082;
        background: #fffde7;
    }

    .fm-m-head {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 8px;
    }

    .fm-m-title {
        flex: 1;
        min-width: 0;
        cursor: pointer;
    }

    .fm-m-title strong {
        display: block;
        font-size: 16px;
        color: var(--app-brand);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fm-m-title span {
        font-size: 12px;
        color: var(--app-text-muted);
    }

    .fm-m-price {
        text-align: right;
        white-space: nowrap;
    }

    .fm-m-price .price-val {
        display: block;
        font-size: 17px;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

    .fm-m-price .chg-val {
        font-size: 13px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .fm-m-price .chg-val.up { color: #e53935; }
    .fm-m-price .chg-val.down { color: #10c469; }

    .fm-m-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        font-size: 12px;
        color: var(--app-text-muted);
        margin-top: 6px;
    }

    .fm-m-actions {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--app-border);
    }

    .fm-m-actions .filter-btn {
        flex: 1;
        min-height: var(--app-touch-min);
        border-radius: var(--app-radius-sm);
    }

    .fm-m-actions .favorite-btn {
        width: var(--app-touch-min);
        height: var(--app-touch-min);
        flex-shrink: 0;
        font-size: 18px;
    }

    /* —— 策略分析 / 个股分析横向滚动提示 —— */
    body.app-mobile-shell #strategy-analysis-result,
    body.app-mobile-shell #search-result,
    body.app-mobile-shell #backtest-result {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        border-radius: var(--app-radius-sm);
    }

    /* —— 首页仪表盘 —— */
    body.app-mobile-shell .dash-grid-4,
    body.app-mobile-shell .dash-grid-3,
    body.app-mobile-shell .dash-grid-6 {
        grid-template-columns: 1fr;
    }

    body.app-mobile-shell .dash-card:hover {
        transform: none;
    }

    /* —— 协议 / 更新日志等内容页 —— */
    body.app-mobile-shell:not(.landing-page):not(.auth-page-body):not(.admin-page) {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    body.app-mobile-shell .wrap {
        padding: 16px 12px 24px;
        border-radius: var(--app-radius-md);
        margin-left: max(8px, env(safe-area-inset-left));
        margin-right: max(8px, env(safe-area-inset-right));
    }

    /* —— 通用手机卡片列表（紧凑样式见文件末尾） —— */
    body.app-mobile-shell .read-progress {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .app-m-list {
        display: none;
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
    }

    body.app-mobile-shell .app-m-list {
        display: flex;
    }

    .app-m-card {
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-md);
        padding: 14px;
        box-shadow: var(--app-shadow-card);
        -webkit-tap-highlight-color: transparent;
    }

    .app-m-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
    }

    .app-m-card-title {
        flex: 1;
        min-width: 0;
    }

    .app-m-card-title strong {
        display: block;
        font-size: 16px;
        color: var(--app-brand);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-m-card-title span {
        font-size: 12px;
        color: var(--app-text-muted);
    }

    .app-m-card-price {
        text-align: right;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    .app-m-card-price .val {
        display: block;
        font-size: 17px;
        font-weight: 700;
    }

    .app-m-card-price .chg {
        font-size: 13px;
        font-weight: 600;
    }

    .app-m-card-price .chg.up { color: #e53935; }
    .app-m-card-price .chg.down { color: #10c469; }

    .app-m-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        font-size: 12px;
        color: var(--app-text-muted);
        margin-top: 4px;
    }

    .app-m-card-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--app-border);
    }

    .app-m-card-actions .filter-btn,
    .app-m-card-actions .watchlist-link-btn,
    .app-m-card-actions .ss-btn-sm {
        flex: 1 1 auto;
        min-height: 36px;
        min-width: 64px;
        font-size: 12px;
        border-radius: var(--app-radius-sm);
    }

    /* 手机端隐藏表格，显示卡片 */
    body.app-mobile-shell .watchlist-table-wrap,
    body.app-mobile-shell .ss-table-wrap,
    body.app-mobile-shell .ms-table-wrap,
    body.app-mobile-shell .sd-table-wrap,
    body.app-mobile-shell .ta-data-table,
    body.app-mobile-shell #sim-trade-tab .watchlist-table-wrap {
        display: none !important;
    }

    body.app-mobile-shell #strategy-analysis-result .sa-table-desktop,
    body.app-mobile-shell #backtest-result .sa-table-desktop {
        display: none !important;
    }

    body.app-mobile-shell #strategy-analysis-result .sa-mobile-list,
    body.app-mobile-shell #backtest-result .sa-mobile-list {
        display: flex !important;
    }

    body.app-mobile-shell .rising-filter-panel > summary {
        display: flex;
        align-items: center;
        min-height: var(--app-touch-min);
        padding: 10px 14px;
        margin-bottom: 8px;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-sm);
        font-size: 14px;
        font-weight: 600;
        color: var(--app-brand);
        cursor: pointer;
        list-style: none;
    }

    body.app-mobile-shell .rising-filter-panel > summary::-webkit-details-marker {
        display: none;
    }

    body.app-mobile-shell .rising-filter-panel:not([open]) .filter-bar {
        display: none;
    }

    /* 板块排行 */
    body.app-mobile-shell .sb-boards-row {
        grid-template-columns: 1fr;
    }

    body.app-mobile-shell #sector-boards-tab.sb-page-layout {
        overflow: visible;
    }

    body.app-mobile-shell .sb-boards-row {
        overflow: visible;
    }

    body.app-mobile-shell .sb-panel {
        min-height: 260px;
        max-height: 380px;
    }

    body.app-mobile-shell .sb-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.app-mobile-shell .sb-grid--panel {
        grid-template-columns: 1fr;
    }

    /* 涨跌榜 */
    body.app-mobile-shell #rising-list {
        grid-template-columns: 1fr !important;
    }

    /* 个股分析 */
    body.app-mobile-shell .search-layout {
        grid-template-columns: 1fr !important;
    }

    body.app-mobile-shell #search-history-sidebar {
        order: 2;
        max-height: 200px;
        overflow-y: auto;
    }

    body.app-mobile-shell .sd-tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-bottom: 4px;
    }

    body.app-mobile-shell .sd-tab-bar::-webkit-scrollbar { display: none; }

    body.app-mobile-shell .sd-tab-bar button {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 36px;
        padding: 8px 14px;
        border-radius: 999px;
        font-size: 13px;
    }

    /* 技术分析图表 */
    body.app-mobile-shell .ta-charts-row {
        grid-template-columns: 1fr !important;
    }

    body.app-mobile-shell .ta-kline-chart-wrap svg,
    body.app-mobile-shell #ta-kline-chart svg,
    body.app-mobile-shell .ta-ind-chart svg {
        min-width: 100% !important;
        width: 100% !important;
        height: min(240px, 38dvh) !important;
    }

    body.app-mobile-shell .ta-indicator-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.app-mobile-shell .ta-indicator-tabs::-webkit-scrollbar { display: none; }

    body.app-mobile-shell .ta-ind-tab {
        flex: 0 0 auto;
        min-width: 72px;
    }

    /* 分析规则 */
    body.app-mobile-shell .rules-tier-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body.app-mobile-shell .rules-strategy-grid {
        grid-template-columns: 1fr !important;
    }

    /* 帮助页定时任务 */
    body.app-mobile-shell .help-cron-table thead {
        display: none;
    }

    body.app-mobile-shell .help-cron-table tbody tr {
        display: block;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-md);
        padding: 12px;
        margin-bottom: 8px;
        box-shadow: var(--app-shadow-card);
    }

    body.app-mobile-shell .help-cron-table td {
        display: block;
        padding: 3px 0;
        border: none;
        font-size: 13px;
    }

    body.app-mobile-shell .help-cron-table td:first-child {
        font-weight: 600;
        color: var(--app-brand);
        font-size: 14px;
        margin-bottom: 4px;
    }

    /* 行情总览 breadth */
    body.app-mobile-shell .fm-breadth-row {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    body.app-mobile-shell .fm-breadth-row .fm-breadth-sep {
        display: none;
    }

    body.app-mobile-shell .fm-breadth-row > span {
        flex: 0 0 calc(50% - 5px);
    }

    /* ========== 紧凑布局：去冗余、统一尺寸 ========== */

    body.app-mobile-shell .logo {
        font-size: 0;
        gap: 0;
        flex-shrink: 0;
    }

    /* 底栏已导航，隐藏合规长文（帮助页可查） */
    body.app-mobile-shell .app-main-shell > .app-compliance-footer {
        display: none !important;
    }

    /* 流程引导条占高，手机端隐藏 */
    body.app-mobile-shell .workflow-banner,
    body.app-mobile-shell .sd-workflow-bar {
        display: none !important;
    }

    /* 首页：压缩 hero，隐藏长文案与新手流程块 */
    body.app-mobile-shell .dash-hero-icon,
    body.app-mobile-shell .dash-hero-sub {
        display: none !important;
    }

    body.app-mobile-shell .workflow-path-section {
        display: none !important;
    }

    /* 底栏已有入口，隐藏首页重复的大块策略介绍 */
    body.app-mobile-shell section[aria-labelledby="dash-strategy-title"] {
        display: none !important;
    }

    body.app-mobile-shell .dash-hero {
        padding: 8px var(--app-pad-x) !important;
        margin-bottom: var(--app-gap) !important;
        gap: 6px !important;
        border-radius: var(--app-radius-md) !important;
        display: block !important;
    }

    body.app-mobile-shell .dash-hero h1 {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }

    body.app-mobile-shell .dash-market-pill {
        margin-top: 4px !important;
        gap: 4px !important;
    }

    body.app-mobile-shell .dash-market-pill span {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    body.app-mobile-shell .dash-hero-cta {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        overflow-x: auto !important;
        margin-top: 6px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.app-mobile-shell .dash-hero-cta::-webkit-scrollbar {
        display: none;
    }

    body.app-mobile-shell .dash-hero-btn {
        min-height: 30px !important;
        padding: 5px 10px !important;
        font-size: 12px !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    body.app-mobile-shell .dash-section {
        margin-bottom: 10px !important;
    }

    body.app-mobile-shell .dash-section-title {
        font-size: 13px !important;
        margin-bottom: 6px !important;
        padding-left: 8px !important;
        border-left-width: 3px !important;
    }

    /* 功能入口：横向一行，去掉大图标和长描述 */
    body.app-mobile-shell .dash-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        padding: 8px 10px !important;
        gap: 8px !important;
        border-radius: var(--app-radius-md) !important;
        box-shadow: none !important;
        border: 1px solid var(--app-border) !important;
    }

    body.app-mobile-shell .dash-card-icon {
        font-size: 1.1rem !important;
        margin: 0 !important;
        flex-shrink: 0;
    }

    body.app-mobile-shell .dash-card h3 {
        font-size: 13px !important;
        margin: 0 !important;
        flex: 1;
        min-width: 0;
    }

    body.app-mobile-shell .dash-card p {
        display: none !important;
    }

    body.app-mobile-shell .dash-card .dash-btn {
        width: auto !important;
        max-width: none !important;
        padding: 4px 10px !important;
        font-size: 11px !important;
        margin: 0 0 0 auto !important;
        flex-shrink: 0;
    }

    body.app-mobile-shell .dash-grid,
    body.app-mobile-shell .dash-stats {
        gap: var(--app-gap) !important;
    }

    body.app-mobile-shell .dash-stat {
        padding: 10px 8px !important;
    }

    body.app-mobile-shell .dash-stat strong {
        font-size: 1.25rem !important;
    }

    body.app-mobile-shell .dash-feature {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    body.app-mobile-shell .dash-feature-icon {
        font-size: 1.2rem !important;
    }

    body.app-mobile-shell .dash-feature p {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    /* 各 Tab 内层白盒去双边距 */
    body.app-mobile-shell .tab-content > div[style*="padding: 20px"],
    body.app-mobile-shell .tab-content > div[style*="padding:20px"] {
        padding: var(--app-pad-y) var(--app-pad-x) !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    body.app-mobile-shell .tab-content h2 {
        font-size: 15px !important;
        margin-bottom: 6px !important;
    }

    body.app-mobile-shell .watchlist-hint,
    body.app-mobile-shell .ss-page-head p {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        line-height: 1.4 !important;
    }

    /* 列表卡片：分组列表，减少单卡阴影与留白 */
    body.app-mobile-shell .app-m-list,
    body.app-mobile-shell .fm-mobile-list {
        gap: 0 !important;
        background: var(--app-surface);
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius-md);
        overflow: hidden;
    }

    body.app-mobile-shell .app-m-card,
    body.app-mobile-shell .fm-mobile-card,
    body.app-mobile-shell #market-radar-tab .mr-mobile-card {
        padding: 8px 10px !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border-bottom: 1px solid var(--app-border) !important;
    }

    body.app-mobile-shell .app-m-card:last-child,
    body.app-mobile-shell .fm-mobile-card:last-child,
    body.app-mobile-shell #market-radar-tab .mr-mobile-card:last-child {
        border-bottom: none !important;
    }

    body.app-mobile-shell .app-m-card-title strong,
    body.app-mobile-shell .fm-m-title strong {
        font-size: 14px !important;
    }

    body.app-mobile-shell .app-m-card-title span,
    body.app-mobile-shell .fm-m-title span {
        font-size: 11px !important;
    }

    body.app-mobile-shell .app-m-card-price .val,
    body.app-mobile-shell .fm-m-price .price-val {
        font-size: 14px !important;
    }

    body.app-mobile-shell .app-m-card-head,
    body.app-mobile-shell .fm-m-head {
        margin-bottom: 4px !important;
        gap: 6px !important;
    }

    body.app-mobile-shell .app-m-card-meta,
    body.app-mobile-shell .fm-m-meta {
        font-size: 11px !important;
        gap: 4px 8px !important;
        margin-top: 2px !important;
    }

    body.app-mobile-shell .app-m-card-actions,
    body.app-mobile-shell .fm-m-actions {
        margin-top: 6px !important;
        padding-top: 0 !important;
        border-top: none !important;
        gap: 4px !important;
    }

    body.app-mobile-shell .app-m-card-actions .filter-btn,
    body.app-mobile-shell .app-m-card-actions .watchlist-link-btn,
    body.app-mobile-shell .app-m-card-actions .ss-btn-sm,
    body.app-mobile-shell .fm-m-actions .filter-btn {
        min-height: 30px !important;
        padding: 4px 8px !important;
        font-size: 11px !important;
        flex: 1 1 auto;
    }

    body.app-mobile-shell .fm-m-actions .favorite-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }

    /* 工具栏、按钮统一高度 */
    body.app-mobile-shell .filter-btn,
    body.app-mobile-shell .search-btn,
    body.app-mobile-shell .sort-btn,
    body.app-mobile-shell .page-btn {
        min-height: 32px !important;
        padding: 5px 10px !important;
        font-size: 12px !important;
    }

    body.app-mobile-shell .filter-bar,
    body.app-mobile-shell .sort-bar {
        gap: 4px !important;
        padding: 4px 0 !important;
    }

    body.app-mobile-shell .pagination {
        padding: 6px 0 !important;
        gap: 4px !important;
    }

    body.app-mobile-shell .stock-card {
        padding: 8px !important;
    }

    /* 模拟盘仪表盘压缩 */
    body.app-mobile-shell .st-dash {
        padding: 10px 12px !important;
        margin-bottom: 8px !important;
    }

    body.app-mobile-shell .st-dash-title {
        font-size: 16px !important;
    }

    body.app-mobile-shell .st-dash-metric {
        padding: 8px !important;
        min-height: 0 !important;
    }

    body.app-mobile-shell .st-dash-metric .value {
        font-size: 15px !important;
    }

    /* 个股分析 */
    body.app-mobile-shell .search-section,
    body.app-mobile-shell .forecast-section {
        padding: 8px !important;
    }

    body.app-mobile-shell #search-history-sidebar {
        max-height: 120px !important;
        font-size: 12px;
    }

    body.app-mobile-shell .sd-header-card,
    body.app-mobile-shell .sd-panel {
        padding: 8px 10px !important;
    }

    /* 行情雷达 */
    body.app-mobile-shell #market-radar-tab {
        padding: var(--app-pad-y) var(--app-pad-x) !important;
    }

    body.app-mobile-shell #market-radar-tab .mr-dashboard {
        padding: 4px !important;
    }

    body.app-mobile-shell .rising-filter-panel > summary {
        min-height: 32px !important;
        padding: 6px 10px !important;
        margin-bottom: 4px !important;
        font-size: 12px !important;
    }

    /* 法律/更新页顶栏（仅页面级 header 元素） */
    body.app-mobile-shell > header {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-top: max(12px, env(safe-area-inset-top));
    }

    body.app-mobile-shell .tab-content {
        animation: none;
    }

    /* 全市场筛选区横向滑动，避免纵向堆叠占屏 */
    body.app-mobile-shell #full-market-tab .fm-filter-main {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 4px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.app-mobile-shell #full-market-tab .fm-filter-main > * {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
    }

    body.app-mobile-shell #full-market-tab .fm-input-keyword {
        min-width: 100px !important;
    }

    body.app-mobile-shell #full-market-tab .fm-quick-chips {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 4px !important;
        padding: 4px 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    body.app-mobile-shell .fm-chip {
        padding: 4px 8px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }

    body.app-mobile-shell #full-market-tab .fm-breadth-strip {
        margin-bottom: 4px !important;
    }

    body.app-mobile-shell .ss-page-head h2 {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }

    body.app-mobile-shell .ss-card {
        padding: 8px 10px !important;
    }

    body.app-mobile-shell .ss-filter-toolbar {
        top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 4px !important;
    }
}

/* 桌面端隐藏 APP 专用元素 */
.app-mobile-header-title,
.app-bottom-nav,
.app-action-sheet-backdrop,
#app-mobile-more-btn,
.fm-mobile-list,
.app-m-list {
    display: none;
}

/* 桌面端保持原有宽屏布局 */
@media (min-width: 769px) {
    .rising-filter-panel > summary {
        display: none;
    }

    .rising-filter-panel .filter-bar {
        display: flex !important;
    }

    body:not(.app-mobile-shell) .app-nav-shell,
    body:not(.app-mobile-shell) .app-main-shell {
        max-width: min(1680px, 99vw);
        margin: 0 auto;
        padding: 0 16px 12px;
    }

    body:not(.app-mobile-shell) .app-nav-shell {
        padding-bottom: 0;
    }
}
