/* ── Dashboard page tabs & swipe ── */
#dash-tab-bar {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    overflow: hidden;
}

.dash-tab {
    flex: 1;
    padding: 10px 2px 8px;
    text-align: center;
    font-size: 0.68em;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #999;
    transition: color 0.2s;
    border-bottom: 3px solid transparent;
    line-height: 1.4;
    white-space: nowrap;
}

.dash-tab.dash-active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    font-weight: 600;
}

.dash-tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

#dash-track-wrapper {
    overflow-x: clip;
    /* 水平方向截斷，防止水平溢出；垂直方向不限制，避免放大時破版 */
    touch-action: pan-y;
}

#dash-track {
    display: flex;
    align-items: flex-start;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.dash-page {
    min-width: 100%;
    /* 核心修改：設定明確的可用高度並開啟垂直捲動 */
    height: calc(100svh - 130px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    box-sizing: border-box;
    /* 額外底部留白，解決按鈕被遮擋問題 */
}

/* 適應 iOS 與不同瀏覽器的高標籤列 */
@supports (height: 100dvh) {
    .dash-page {
        height: calc(100dvh - 110px);
        /* Adjusted to 110px */
    }
}

.dash-page.hidden-page {
    display: none !important;
}