/* ==========================================================================
    CFA 獨立專屬樣式表 (獨立 ID 與 Class，僅返回鍵與捲軸紫色)
   ========================================================================== */

/* --------------------------------------------------------------------------
    1. CFA 操作彈窗佈局 (cfaModal 內部 - 維持 Google 藍色系)
   -------------------------------------------------------------------------- */
.cfa-layout {
    display: flex;
    gap: 20px;
    background-color: #fff;
}

.cfa-sidebar {
    background-color: #fcfcfc;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#cfaVariablePool {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    min-height: 100px;
}

/* 變數項目 - 維持藍色系 */
.cfa-var-item {
    padding: 8px 12px;
    background-color: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: grab;
    font-size: 14px;
    color: #3c4043;
    transition: all 0.2s ease;
    user-select: none;
}

.cfa-var-item:hover {
    background-color: #f1f3f4;
    border-color: #bdc1c6;
}

.cfa-var-item.selected {
    background-color: #e8f0fe;
    border-color: #4285f4;
    box-shadow: 0 0 0 1px #4285f4;
}

/* 拖放區 - 維持藍色視覺回饋 */
.factor-drop-zone {
    background-color: #fdfdfd;
    transition: background-color 0.3s, border-color 0.3s;
    border: 2px dashed #dadce0;
    border-radius: 8px;
}

.factor-drop-zone.drag-over {
    background-color: #e8f0fe;
    border-color: #4285f4 !important;
}

/* 變數標籤 (Tag) - 維持藍色系 */
.cfa-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background-color: #e8f0fe;
    color: #1967d2;
    border: 1px solid #d2e3fc;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.cfa-tag span:hover {
    color: #d93025;
}

/* --------------------------------------------------------------------------
    2. CFA 報表頁面樣式 (cfaResultPage - 結構對齊共用標準)
   -------------------------------------------------------------------------- */

/* 頁面外殼 - 對齊信度/效度 (#f4f7f6) */
#cfaResultPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 40px;
    box-sizing: border-box;
    background-color: #f4f7f6;
    z-index: 3000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

#cfaResultContent {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding-bottom: 50px;
}

/* CFA 專屬卡片 - 結構對齊 .analysis-card 與 .validity-card */
.cfa-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    animation: cfaSlideUpFade 0.8s ease-out forwards;
}

.cfa-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

/* 標題條 - 維持全站一致的藍色 (#1a73e8) */
.cfa-title-bar {
    width: 8px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    display: block !important;
    /* background-color: #1a73e8;  <- 刪掉或註解掉 */
}


.cfa-card-title h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

/* 表格容器 - 結構對齊 .table-responsive */
.cfa-table-wrapper {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin-top: 15px;
    border: 1px solid #f1f3f4;
    border-radius: 4px;
}

.cfa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cfa-table th {
    background-color: #f8f9fa;
    color: #5f6368;
    padding: 12px;
    text-align: center;
    border: 1px solid #f1f3f4;
    border-bottom: 2px solid #e8eaed;
    white-space: nowrap;
}

.cfa-table td {
    padding: 12px;
    border: 1px solid #f1f3f4;
    color: #3c4043;
    text-align: center;
    background-color: #ffffff;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
    3. 🎯 核心特色：返回按鈕與捲軸 (紫色系專屬)
   -------------------------------------------------------------------------- */
.cfa-footer {
    text-align: center;
    width: 100%;
    margin-top: 40px;
    padding-bottom: 20px;
}

/* 返回按鈕改為紫色 (#673ab7) 以示區別 */
.cfa-btn-back {
    background-color: #ffffff;
    color: #673ab7;
    border: 1px solid #673ab7;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-block;
}

.cfa-btn-back:hover {
    background-color: #f3e5f5;
    /* 懸停變淡紫色 */
    border-color: #512da8;
    color: #512da8;
    box-shadow: 0 1px 4px rgba(103, 58, 183, 0.3);
}

/* 報表捲軸改為紫色系 (符合返回鍵視覺) */
.cfa-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.cfa-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cfa-table-wrapper::-webkit-scrollbar-thumb {
    background: #d1c4e9;
    border-radius: 4px;
}

.cfa-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #b39ddb;
}

/* 對齊 slideUpFade 動畫數值 */
@keyframes cfaSlideUpFade {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}