/* ==================== 布局 ==================== */
.app {
    width: 100%;
    max-width: var(--layout-app-width);
    margin: 0 auto;
    height: 100vh;
    height: var(--viewport-height);
    overflow: hidden;
    background: var(--bg-page);
    position: relative;
}

.page {
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    animation: slideIn 0.25s ease;
    padding-bottom: var(--layout-bottom-gap);
    background: var(--bg-page);
}
.page.active { display: block; }
.page.no-page-animation { animation: none !important; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==================== 手势返回模式 ==================== */
/* 进入手势期间:当前页 + 上一页 同时绝对定位叠加显示 */
.app.swiping .page.swipe-current,
.app.swiping .page.swipe-prev {
    display: block !important;
    animation: none !important;
    position: absolute;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: var(--bg-page);
    will-change: transform;
}
.app.swiping .page.swipe-prev {
    z-index: 1;
    box-shadow: none;
}
.app.swiping .page.swipe-current {
    z-index: 2;
    box-shadow: -7px 0 20px rgba(var(--shadow-card-ink-rgb), 0.055);
}
/* 手势"完成返回"的滑出动画 */
.page.swipe-finish {
    transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.4, 1) !important;
}
/* 手势"取消(弹回)"的回弹动画 */
.page.swipe-cancel {
    transition: transform 0.18s cubic-bezier(0.25, 0.8, 0.4, 1) !important;
}
/* 边缘热区(辅助调试时可加 background 看位置) */
.swipe-edge-hint {
    position: fixed;
    top: 0; left: 0;
    width: 30px; height: 100vh;
    z-index: 999;
    pointer-events: none;
}

/* Older Android WebViews: keep the same spacing without relying on flex gap.
 * The no-flex-gap class comes from the one-time measurement in style-compat.js.
 * Grid containers retain grid-gap; only flex containers belong in these groups. */
.no-flex-gap .cohort-fn-cells > :not(:last-child) { margin-right: 3px; }

.no-flex-gap .dc-source-switch > :not(:last-child),
.no-flex-gap .dc-thread-item > :not(:last-child),
.no-flex-gap .task-position-meta > :not(:last-child) { margin-right: 4px; }

.no-flex-gap .cohort-capsule > :not(:last-child),
.no-flex-gap .position-profit-strip-main > :not(:last-child),
.no-flex-gap .task-symbol > :not(:last-child) { margin-right: 5px; }

.no-flex-gap .quick-task-value > :not(:last-child),
.no-flex-gap .row-title > :not(:last-child),
.no-flex-gap .agent-card-title > :not(:last-child),
.no-flex-gap .agent-think-step > :not(:last-child),
.no-flex-gap .cohort-dsp > :not(:last-child),
.no-flex-gap .cohort-hit-top > :not(:last-child),
.no-flex-gap .cohort-walk > :not(:last-child),
.no-flex-gap .cohort-grp-head > :not(:last-child),
.no-flex-gap .cohort-mem > :not(:last-child),
.no-flex-gap .dc-connection > :not(:last-child),
.no-flex-gap .dc-welcome-foot > :not(:last-child),
.no-flex-gap .dc-code-line > :not(:last-child),
.no-flex-gap .dc-sync-status > :not(:last-child),
.no-flex-gap .nexus-slot > :not(:last-child),
.no-flex-gap .app-download-action > :not(:last-child),
.no-flex-gap #system-status-message > :not(:last-child),
.no-flex-gap .system-status-weight-value > :not(:last-child),
.no-flex-gap .app-back-button > :not(:last-child) { margin-right: 6px; }

.no-flex-gap .home-product > :not(:last-child),
.no-flex-gap .agent-delegate-top > :not(:last-child),
.no-flex-gap .agent-think-flow-head > :not(:last-child),
.no-flex-gap .cohort-time-box > :not(:last-child),
.no-flex-gap .dc-message-head > :not(:last-child),
.no-flex-gap .dc-tool-group > summary > :not(:last-child),
.no-flex-gap .funds-transfer-admin > :not(:last-child) { margin-right: 7px; }

.no-flex-gap .agent-think-top > :not(:last-child),
.no-flex-gap .agent-think-group-header > :not(:last-child),
.no-flex-gap .agent-msg-meta > :not(:last-child),
.no-flex-gap .agent-quote-top > :not(:last-child),
.no-flex-gap .agent-card-meta > :not(:last-child),
.no-flex-gap .agent-entry-value > :not(:last-child),
.no-flex-gap .cohort-search-box > :not(:last-child),
.no-flex-gap .cohort-entry-wrap > :not(:last-child),
.no-flex-gap .cohort-fn-row > :not(:last-child),
.no-flex-gap .cohort-grp-meta > :not(:last-child),
.no-flex-gap .section-refresh-meta > :not(:last-child),
.no-flex-gap .dc-compose-meta > :not(:last-child),
.no-flex-gap .dc-source-switch button > :not(:last-child),
.no-flex-gap .funds-transfer-note > :not(:last-child),
.no-flex-gap .task-row-actions > :not(:last-child),
.no-flex-gap .chart-header > :not(:last-child),
.no-flex-gap .chart-price-wrap > :not(:last-child),
.no-flex-gap .search-page-header > :not(:last-child),
.no-flex-gap .search-input-wrap > :not(:last-child),
.no-flex-gap .system-status-update > :not(:last-child),
.no-flex-gap .top-nav > :not(:last-child) { margin-right: 8px; }

.no-flex-gap .task-queue-tools > :not(:last-child),
.no-flex-gap .eyebrow > :not(:last-child),
.no-flex-gap .secondary-btn > :not(:last-child) { margin-right: 9px; }

.no-flex-gap .search-trigger > :not(:last-child),
.no-flex-gap .row-meta > :not(:last-child),
.no-flex-gap .confirm-actions > :not(:last-child),
.no-flex-gap .agent-msg-row > :not(:last-child),
.no-flex-gap .agent-card-row > :not(:last-child),
.no-flex-gap .cohort-market-head > :not(:last-child),
.no-flex-gap .cohort-market-value > :not(:last-child),
.no-flex-gap .cohort-market-times > :not(:last-child),
.no-flex-gap .dc-approval-actions > :not(:last-child),
.no-flex-gap .action-head > :not(:last-child),
.no-flex-gap .action-meta > :not(:last-child),
.no-flex-gap .task-queue-heading > :not(:last-child),
.no-flex-gap .system-status-connection > :not(:last-child),
.no-flex-gap .floating-card > :not(:last-child),
.no-flex-gap .share-actions > :not(:last-child),
.no-flex-gap .arrow-link > :not(:last-child) { margin-right: 10px; }

.no-flex-gap .brand > :not(:last-child) { margin-right: 11px; }

.no-flex-gap .quick-task-card > :not(:last-child),
.no-flex-gap .list-row > :not(:last-child),
.no-flex-gap .agent-entry-card > :not(:last-child),
.no-flex-gap .cohort-kv > :not(:last-child),
.no-flex-gap .dc-header > :not(:last-child),
.no-flex-gap .dc-task-picker > :not(:last-child),
.no-flex-gap .dc-code-bar > :not(:last-child),
.no-flex-gap .dc-delete-actions > :not(:last-child),
.no-flex-gap .funds-amount-head > :not(:last-child),
.no-flex-gap .nexus-detail-row > :not(:last-child),
.no-flex-gap .settings-row > :not(:last-child),
.no-flex-gap .task-oi-rank > :not(:last-child),
.no-flex-gap .task-row:not(.task-position-row) > :not(:last-child),
.no-flex-gap .task-pnl > :not(:last-child),
.no-flex-gap .task-reduce-footer > :not(:last-child),
.no-flex-gap .system-status-heading > :not(:last-child),
.no-flex-gap .system-status-weight-heading > :not(:last-child),
.no-flex-gap .hero-actions > :not(:last-child),
.no-flex-gap .about-actions > :not(:last-child),
.no-flex-gap .release-meta > :not(:last-child) { margin-right: 12px; }

.no-flex-gap .app-download-entry > :not(:last-child),
.no-flex-gap .primary-btn > :not(:last-child) { margin-right: 13px; }

.no-flex-gap .user-card > :not(:last-child),
.no-flex-gap .settings-user > :not(:last-child),
.no-flex-gap .header-leading > :not(:last-child) { margin-right: 14px; }

.no-flex-gap .dc-image-actions > :not(:last-child),
.no-flex-gap .system-status-summary > :not(:last-child),
.no-flex-gap .trust-strip article > :not(:last-child) { margin-right: 16px; }

.no-flex-gap .section-heading > :not(:last-child) { margin-right: 30px; }

.no-flex-gap .share-panel > :not(:last-child),
.no-flex-gap .about-preview > :not(:last-child),
.no-flex-gap .about-cta > :not(:last-child) { margin-right: 40px; }

.no-flex-gap .system-status-ring > div > :not(:last-child) { margin-bottom: 2px; }

.no-flex-gap .dc-task-label > :not(:last-child) { margin-bottom: 4px; }

.no-flex-gap .system-status-network-peak > :not(:last-child) { margin-bottom: 5px; }

.no-flex-gap .system-status-market > div > :not(:last-child) { margin-bottom: 6px; }

.no-flex-gap .agent-card-stack > :not(:last-child) { margin-bottom: 8px; }

/* Symbol names and tool text are anonymous flex items in the existing markup. */
.no-flex-gap .row-title > :first-child { margin-left: 6px; }
.no-flex-gap .task-symbol > :first-child { margin-left: 5px; }
.no-flex-gap .dc-tool::before { margin-right: 7px; }
.no-flex-gap .dc-primary > span { margin-left: 18px; }
.no-flex-gap .row-meta > span { white-space: nowrap; }
/* Uploads occupy a complete row; only the three visible composer controls have horizontal gaps. */
.no-flex-gap #dc-attach, .no-flex-gap #dc-input { margin-right: 4px; }
.no-flex-gap .dc-thread-row > :not(:last-child) { margin-right: 12px; }
.no-flex-gap .dc-upload-item > :not(:last-child) { margin-right: 10px; }
.no-flex-gap .dc-upload-preview:not([hidden]) { margin-bottom: 4px; }




/* CSS text autosizing must not enlarge individual labels independently of their row. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
