/**
 * 右側面板上下分割佈局
 * Author: Claude
 * Date: 2026-01-21
 */

.right-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--quote-panel-surface, #ffffff);
    overflow: visible;  /* 允許收合按鈕延伸到面板外 */
}

.right-panel.hidden {
    display: none;
}

/* 控制列 */
.right-panel .panel-controls {
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    border-bottom: 1px solid var(--quote-table-border, #E8E5E0);
    background: var(--quote-table-header-bg, #FAF9F6);
    flex-shrink: 0;
}

/* 上半部：股票表格 */
.stock-table-panel-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
    /* border-bottom 由 splitter.css 的 border-top 取代 */
}

/* 垂直分割器樣式統一在 splitter.css 管理 */

/* 下半部：走勢圖 */
.chart-panel-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 200px;
    background: var(--quote-panel-surface, #ffffff);
}

/* 拖曳中狀態 */
.right-panel.resizing {
    user-select: none;
}

.right-panel.resizing * {
    cursor: row-resize !important;
}

/* ==================== P0-2: 手機版走勢圖全螢幕 Modal (2026-03-06) ==================== */
@media (max-width: 480px) {
    .right-panel {
        position: fixed !important;
        inset: 0 !important;
        z-index: 999 !important;
        opacity: 1;
        overflow-y: auto;
        background: var(--color-bg-primary, #0D1117);
    }

    .right-panel.hidden {
        display: none !important;
    }

    /* 隱藏分割線相關元素 */
    .right-panel .resize-handle,
    .right-panel .vertical-splitter {
        display: none;
    }

    /* 收合按鈕改為全螢幕關閉按鈕 */
    .right-panel .collapse-panel-btn {
        position: fixed;
        top: 12px;
        right: 12px;
        left: auto;
        z-index: 1001;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    /* 股票表格隱藏（聊天區已有 mini cards），只顯示走勢圖 */
    .stock-table-panel-top {
        display: none;
    }

    /* 財報面板模式：上半部需顯示（fsp = Financial Statement Panel） */
    .stock-table-panel-top.fsp-active {
        display: flex;
        overflow-y: auto;
        min-height: 50vh;
    }

    /* 走勢圖佔滿全螢幕 */
    .chart-panel-bottom {
        flex: 1;
        min-height: 100vh;
        padding-top: 56px;
    }

    /* 財報模式：走勢圖縮小為下半部 */
    .stock-table-panel-top.fsp-active ~ .chart-panel-bottom {
        min-height: 50vh;
        padding-top: 0;
    }

    /* 底部導航需在 rightPanel 之上，避免被全螢幕覆蓋擋住 */
    .bottom-nav {
        z-index: 1000 !important;
    }
}

