/* analyze.css 完整修正版 */

#analyzePage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    padding: 40px;
    box-sizing: border-box;
    background-color: #f4f7f6;
    z-index: 2000;
    display: none;
}

/* 標題與容器對齊 */
.analyze-header {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 30px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    /* 標題最先出來 */
    opacity: 0;
    animation: slideUpFade 0.8s ease-out forwards;
}

.analyze-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.back-btn {
    padding: 10px 20px;
    cursor: pointer;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #5a6268;
}

/* 圖表並排容器 (Line & Pie) */
.charts-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 25px auto;
    box-sizing: border-box;
}

/* 圖表通用樣式 */
#LineChartDiv,
#PieChartDiv,
#BarChartDiv {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    opacity: 0;
    /* 初始透明，靠動畫 forwards 停留在 1 */
    animation: slideUpFade 0.8s ease-out forwards;
}

/* --- 設定一個個出來的延遲時間 --- */

#LineChartDiv {
    width: 60%;
    min-height: 500px;
    animation-delay: 0.2s;
    /* 第二個出 */
}

#PieChartDiv {
    width: 40%;
    min-height: 500px;
    animation-delay: 0.4s;
    /* 第三個出 */
}

#BarChartDiv {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 50px auto;
    min-height: 450px;
    clear: both;
    animation-delay: 0.6s;
    /* 最後出 */
}

/* 確保內部 Grid 卡片高度 */
#barChartsGrid>div {
    min-height: 320px;
}

/* 定義滑入動畫：距離加大到 40px */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



/* 圓餅圖控制項容器 */
.pie-controls-container {
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* 標題區域 */
.pie-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pie-title-bar {
    width: 8px;
    height: 24px;
    background: #059669;
    border-radius: 4px;
}

.pie-title-text {
    margin: 0;
    color: #059669;
    font-size: 20px;
}

/* 篩選選單區域 */
.pie-filter-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pie-select-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pie-select-item select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 圖表容器 */
#echartsPieInnerDiv {
    width: 100%;
    height: 500px;
}