/* 圖表相關樣式 */

/* 圖表容器樣式 */
.charts-container {
    padding: 0 !important;
    margin: 0 0 12px 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
}

/* 圖表項目樣式 */
.chart-item {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: relative !important;
}

/* 圖表標題 */
.chart-item h3 {
    margin: 0 0 3px 0 !important;
    padding: 5px 8px !important;
    font-size: 1.1rem !important;
    color: #2c3e50 !important;
    background-color: #f8fafc !important;
    border-radius: 6px 6px 0 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* 圖表容器內的畫布容器 */
.chart-canvas-container {
    background-color: #f8fafc !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    padding: 8px !important;
    width: 100% !important;
    height: 560px !important;
    margin: 0 !important;
    position: relative !important;
}

/* 圖表項目樣式 - 特別針對三張主要圖表 */
#area-chart-container, #median-group-chart-container, #mdd-chart-container {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 0 25px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: relative !important;
}

/* 主要三張圖表的標題 */
#area-chart-container h4, #median-group-chart-container h4, #mdd-chart-container h4 {
    text-align: center !important;
    font-size: 1.2em !important;
    margin-bottom: 10px !important;
}

/* 特別強化淨資產全景圖的顯示 */
#areaChart, #medianGroupChart, #mddHistogram {
    width: 100% !important;
    height: 100% !important;
    max-height: 800px !important;
}

/* 資訊提示樣式 */
.info-note {
    margin: 0 0 15px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-note i {
    color: #3498db;
    font-size: 16px;
}

.info-note small {
    font-size: inherit;
}

/* 圖表分頁容器樣式 */
.chart-tabs-container {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
}

.chart-tabs-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 0;
}

.chart-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    overflow-x: auto;
    gap: 5px;
}

.chart-tab-btn {
    padding: 12px 20px;
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.chart-tab-btn:hover {
    background-color: rgba(0,0,0,0.03);
}

.chart-tab-btn.active {
    color: #2e86de;
    border-bottom-color: #2e86de;
    background-color: rgba(46, 134, 222, 0.05);
}

.chart-tabs-content {
    padding: 20px;
}

.chart-tab-panel {
    display: none;
}

.chart-tab-panel.active {
    display: block;
}

/* 圖表組容器樣式 */
.chart-group-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* 修改為上下排列的佈局 */
.chart-group-container.vertical-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 25px;
}

/* 圖表項目內部樣式 - 用於分頁容器內的圖表 */
.chart-tab-panel .chart-item {
    position: relative;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 20px;
}

.chart-tab-panel .chart-item h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.chart-tab-panel .chart-item canvas {
    flex: 1;
    width: 100% !important;
    height: auto !important;
    min-height: 250px;
}

/* 圖表擴展按鈕 */
.chart-expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-expand-btn:hover {
    background-color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 添加圖標樣式 */
.chart-expand-btn i {
    font-size: 14px;
    color: #3498db;
}

.chart-expand-btn i:first-child {
    display: none;
}

.chart-expand-btn i:nth-child(2) {
    display: block;
    font-size: 15px;
}

/* 全屏圖表樣式已移至 main_simulation.css 以避免重複定義 */

/* 圖表設定容器樣式 */
.chart-settings-container {
    margin: 15px 0;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* 設定頭部 */
.chart-settings-header {
    padding: 15px 20px;
    background-color: #f8fafb;
    border-bottom: 1px solid #eaedf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-settings-header h4 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
}

/* 設定標籤按鈕 */
.chart-settings-tabs {
    display: flex;
    gap: 8px;
}

.chart-settings-tabs .tab-btn {
    padding: 8px 16px;
    border: none;
    background-color: transparent;
    color: #6c757d;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-settings-tabs .tab-btn i {
    font-size: 14px;
}

.chart-settings-tabs .tab-btn:hover {
    background-color: rgba(0, 123, 255, 0.05);
    color: #0056b3;
}

.chart-settings-tabs .tab-btn.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: #0056b3;
}

/* 設定內容 */
.chart-settings-content {
    padding: 20px;
}

/* 設定面板 */
.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

/* 設定選項 */
.settings-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 選項按鈕 */
.option-btn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.option-btn.large {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
    padding: 15px 10px;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e0;
}

.option-btn.active {
    background-color: #ebf5ff;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.option-icon {
    font-size: 22px;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background-color: #f7fafc;
    border-radius: 50%;
    color: #2c3e50;
}

.option-btn.active .option-icon {
    background-color: #3498db;
    color: white;
}

.option-label {
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 12px;
    color: #718096;
}

.option-btn.active .option-label {
    color: #2c3e50;
}

.option-btn.active .option-desc {
    color: #4a5568;
}

/* 設定分隔線 */
.settings-divider {
    height: 1px;
    background-color: #edf2f7;
    margin: 15px 0;
    width: 100%;
}

/* 比例尺選項 */
.scale-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .chart-group-container {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    
    .chart-item {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .chart-item canvas {
        height: 250px !important;
    }
    
    .chart-tab-buttons {
        flex-wrap: wrap;
    }
    
    .chart-tab-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .chart-settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .chart-settings-tabs {
        width: 100%;
    }
    
    .chart-settings-tabs .tab-btn {
        flex: 1;
        justify-content: center;
    }
    
    .option-btn.large {
        flex: 1 1 calc(50% - 8px);
        min-width: 100px;
    }
    
    .chart-expand-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .settings-options {
        flex-direction: column;
    }
    
    .option-btn.large {
        flex: 1;
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .chart-item canvas {
        height: 250px !important;
    }
}

/* 特別加大三張主要圖表的高度 */
#area-chart-container .chart-canvas-container,
#median-group-chart-container .chart-canvas-container,
#mdd-chart-container .chart-canvas-container {
    height: 800px !important;
}

/* 為圖表容器內所有按鈕統一設置樣式 */
.chart-settings-container .control-btn,
.chart-settings-container .option-btn {
    padding: 8px 15px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #4b5563;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
}

/* 按鈕活動狀態 - 用於切換時的視覺反饋 */
.chart-settings-container .control-btn.active,
.chart-settings-container .option-btn.active {
    background-color: #ebf5ff;
    color: #2376cf;
    border-color: #93c5fd;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.1);
    font-weight: 600;
}

/* 單位和比例尺按鈕中的圖標樣式 */
.chart-settings-container .option-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    transition: all 0.2s ease;
}

/* 懸停效果 */
.chart-settings-container .control-btn:hover,
.chart-settings-container .option-btn:hover {
    background-color: #ebf5ff;
    border-color: #93c5fd;
}

/* 圖表鎖定覆蓋層樣式 */
.chart-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 247, 250, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 6px;
    text-align: center;
    padding: 20px;
}

.chart-lock-overlay i {
    font-size: 40px;
    color: #f39c12;
    margin-bottom: 15px;
}

.chart-lock-overlay p {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 20px;
    max-width: 300px;
    line-height: 1.5;
}

.chart-lock-overlay .upgrade-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chart-lock-overlay .upgrade-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 動畫控制面板樣式 */
.animation-control-panel {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.animation-control-panel:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 播放控制按鈕區域 */
.animation-control-panel .control-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.animation-control-panel button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
    justify-content: center;
}

.animation-control-panel button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.animation-control-panel button:active {
    transform: translateY(0);
}

.animation-control-panel button#area-chart-play-btn {
    background: #28a745;
}

.animation-control-panel button#area-chart-play-btn:hover {
    background: #218838;
}

.animation-control-panel button#area-chart-play-btn.playing {
    background: #dc3545;
}

.animation-control-panel button#area-chart-play-btn.playing:hover {
    background: #c82333;
}

.animation-control-panel button#area-chart-reset-btn {
    background: #6c757d;
}

.animation-control-panel button#area-chart-reset-btn:hover {
    background: #5a6268;
}

/* 速度控制區域 */
.animation-speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.animation-speed-control label {
    font-size: 14px;
    color: #495057;
    white-space: nowrap;
    font-weight: 500;
}

.animation-speed-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.animation-speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.animation-speed-control input[type="range"]::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.animation-speed-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.animation-speed-control input[type="range"]::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.animation-speed-value {
    font-size: 14px;
    color: #495057;
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 年份顯示區域 */
.animation-year-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.animation-year-display span {
    font-size: 14px;
    color: #495057;
}

.animation-year-display .current-year {
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    text-align: center;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.animation-year-display .separator {
    font-size: 14px;
    color: #6c757d;
    font-weight: normal;
}

.animation-year-display .max-year {
    font-size: 14px;
    color: #6c757d;
    font-weight: normal;
}

/* 響應式設計 */
/* 速度滑桿範圍說明：100ms = 10x, 1000ms = 1x, 3000ms = 0.33x */
@media (max-width: 768px) {
    .animation-control-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .animation-control-panel .control-buttons {
        justify-content: center;
    }
    
    .animation-speed-control {
        min-width: auto;
        width: 100%;
    }
    
    .animation-year-display {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .animation-control-panel {
        margin: 10px 0;
        padding: 10px;
        gap: 10px;
    }
    
    .animation-control-panel button {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .animation-speed-control {
        padding: 6px 10px;
    }
    
    .animation-speed-control label {
        font-size: 13px;
    }
    
    .animation-year-display {
        padding: 6px 10px;
    }
    
    .animation-year-display span {
        font-size: 13px;
    }
} 
/* 存檔功能樣式 */
.saved-files-container, 
.records-container {
    overflow-y: visible; /* 改為 visible，使用外層容器的滾動條 */
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

/* 存檔功能樣式 */
.saved-files-container {
    /* 所有共享樣式已移到上面 */
}

/* 檔案名稱輸入框樣式 */
.file-name-input {
    width: 100% !important;
    max-width: 300px !important;
    min-width: 250px !important;
    font-size: 14px !important;
}

/* 自定義滾動條 */
.saved-files-container::-webkit-scrollbar {
    width: 5px;
}

.saved-files-container::-webkit-scrollbar-thumb {
    background-color: rgba(136, 176, 222, 0.7);
    border-radius: 3px;
}

.saved-files-container::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 存檔數量顯示 */
.save-count-info {
    font-size: 0.75rem;
    color: #666;
    text-align: right;
    margin-bottom: 8px;
    padding: 2px 5px;
    background-color: #f8f9fa;
    border-radius: 3px;
    font-weight: 500;
}

/* 存檔已滿時的警告樣式 */
.save-count-info.save-count-full {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    font-weight: 600;
    animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* 存檔類型區分 - 統一使用藍色 */
.file-item {
    border-left: 3px solid #42a5f5; /* 普通檔案使用藍色邊框 */
}

/* 置頂關注檔案樣式 */
.file-item-pinned {
    border-left: 3px solid #1565c0 !important; /* 置頂檔案使用深藍色邊框 */
    background: linear-gradient(135deg, #f3f7ff 0%, #ffffff 100%) !important;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.2) !important;
}

.file-item-pinned:hover {
    background: linear-gradient(135deg, #e8f2ff 0%, #f0f7ff 100%) !important;
    border-left-color: #0d47a1 !important;
    transform: translateX(8px) !important;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3) !important;
}

/* 置頂圖標樣式 */
.pinned-icon {
    color: #1565c0;
    margin-right: 6px;
    font-size: 0.8rem;
    transform: rotate(45deg);
    display: inline-block;
    animation: gentle-glow 2s ease-in-out infinite alternate;
}

@keyframes gentle-glow {
    0% { 
        opacity: 0.8; 
        transform: rotate(45deg) scale(1);
    }
    100% { 
        opacity: 1; 
        transform: rotate(45deg) scale(1.1);
    }
}

/* 置頂標籤樣式 */
.pinned-label {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: top;
    box-shadow: 0 1px 3px rgba(21, 101, 192, 0.4);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 1px 3px rgba(21, 101, 192, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 2px 6px rgba(21, 101, 192, 0.6);
    }
}

/* 檔案項目樣式調整，統一與紀錄區塊匹配 */
.file-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    width: calc(100% - 10px); /* 調整寬度，配合容器內邊距 */
    box-sizing: border-box;
    min-height: 60px; /* 保證足夠高度以容納垂直排列的元素 */
}

/* 選中的存檔項目樣式 - 淡藍色背景 */
.file-item.selected-file {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%) !important;
    border: 2px solid #42a5f5 !important;
    box-shadow: 0 3px 10px rgba(66, 165, 245, 0.3) !important;
    transform: translateX(3px);
}

.file-item.selected-file:hover {
    background: linear-gradient(135deg, #d1e7dd 0%, #e8f4fd 100%) !important;
    transform: translateX(5px);
}

/* 載入中禁用的檔案項目樣式 */
.file-item.loading-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 刪除按鈕樣式，統一與紀錄區塊 */
.file-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background-color: #b6d9fa; /* 淺藍色背景 */
    color: #6495ED; /* 藍色文字 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0.6;
    border: 1px solid #e1f0ff;
}

.file-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: #90c3f9;
    color: white;
}

.file-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #f0f7ff; /* 鼠標懸停時的淺藍色背景，與紀錄區塊相同 */
    border-left-color: #1976d2; /* 懸停時使用深藍色 */
}

/* 檔案資訊佈局 */
.file-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-right: 20px; /* 防止與刪除按鈕重疊 */
}

/* 檔案名稱與斷行效果 */
.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-right: 15px; /* 增加右側間距，避免與刪除按鈕重疊 */
    /* 修改為在3/4寬度處換行 */
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* 檔案名稱內部容器 */
.file-name-inner {
    display: inline;
    position: relative;
    transition: transform 0.5s ease;
}

/* 檔案項目底部信息行 */
.file-item-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: 4px;
}

.file-date {
    color: #666;
    font-size: 0.7rem;
    margin-bottom: 4px;
}

/* 檔案狀態樣式，統一與紀錄區塊 */
.file-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    white-space: nowrap;
    align-self: flex-start;
}

.status-0 {
    background-color: #fff3cd;
    color: #856404;
}

.status-1 {
    background-color: #cce5ff;
    color: #004085;
}

.status-2 {
    background-color: #d4edda;
    color: #155724;
}

.status-3 {
    background-color: #f8d7da;
    color: #721c24;
}

/* 標題行樣式 - 用於存檔和紀錄標題 */
.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* 展開/收起按鈕樣式 - 同時用於存檔和紀錄 */
.expand-btn {
    font-size: 0.8rem;
    color: #2196F3; /* 藍色按鈕文字 */
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 3px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background-color: rgba(33, 150, 243, 0.1); /* 藍色背景 */
    color: #1565C0; /* 深藍色 */
}

.expand-btn i {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* 空存檔提示 */
.no-files-message {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 15px 0;
    font-style: italic;
}

/* 載入中訊息 */
.loading-message {
    font-size: 0.8rem;
    color: #2196F3; /* 藍色文字 */
    text-align: center;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.loading-message i {
    font-size: 1rem;
    color: #2196F3; /* 藍色圖標 */
}

/* 會員等級限制樣式 */
.save-section-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
}

.save-section-disabled::before {
    content: '存檔功能需要提升會員等級';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(240, 240, 240, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    z-index: 10;
    pointer-events: none;
    font-weight: 500;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
}

/* 錯誤訊息 */
.error-message {
    color: #d32f2f;
    background-color: #fbe9e7;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

.error-message small {
    display: block;
    margin-top: 5px;
    color: #666;
}

/* 側邊欄整體樣式調整 */
.sidebar {
    max-height: 100vh; /* 修改：從calc(100vh - 60px)改為100vh，使其延伸至整個視窗高度 */
    overflow-y: auto;
}

/* 側邊欄滾動條樣式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(136, 176, 222, 0.7);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 紀錄項目樣式統一 - 移除左邊藍色條 */
.record-item {
    border-left: none !important; /* 確保沒有左邊框 */
    padding: 10px 12px !important;
    width: calc(100% - 10px) !important;
    box-sizing: border-box !important;
    min-height: 40px !important; /* 縮小最小高度，因為不顯示名稱 */
}

/* 紀錄項目懸停效果 */
.record-item:hover {
    border-left: none !important;
    transform: translateX(5px) !important;
}

/* 紀錄資訊佈局 */
.record-info {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding-right: 20px !important;
}

/* 紀錄底部資訊行 */
.record-item-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin-top: 0 !important; /* 移除頂部間距，因為沒有名稱 */
}

/* 隱藏紀錄名稱樣式 */
.record-name {
    display: none !important; /* 隱藏紀錄名稱 */
}

/* 紀錄日期樣式 */
.record-date {
    color: #666 !important;
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
}

/* 記錄列表加載和錯誤信息樣式 */
.loading-records {
    text-align: center;
    padding: 20px 10px;
    color: #666;
    font-size: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.records-error {
    text-align: center;
    padding: 20px 10px;
    color: #721c24;
    font-size: 0.8rem;
    background-color: #f8d7da;
    border-radius: 4px;
    margin-bottom: 8px;
}

.no-records {
    text-align: center;
    padding: 20px 10px;
    color: #666;
    font-size: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* 測試記錄樣式 */
.test-record {
    border-left-color: #9c27b0;
    background-color: #f3e5f5;
    position: relative;
}

.test-record::after {
    content: "測試數據";
    position: absolute;
    top: -8px;
    right: 10px;
    font-size: 10px;
    padding: 2px 6px;
    background-color: #9c27b0;
    color: white;
    border-radius: 3px;
    z-index: 2;
}

/* Loading/Deleting Animations */
.loading-item, .deleting-item {
    position: relative;
    pointer-events: none;
    transition: all 0.3s ease;
}

.loading-item {
    background-color: rgba(240, 247, 255, 0.9) !important;
    border-color: #c0d7f1 !important;
}

.deleting-item {
    background-color: rgba(255, 240, 240, 0.9) !important;
    border-color: #f1c0c0 !important;
}

.loading-animation, .deleting-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 15px;
    text-align: center;
}

.loading-animation i, .deleting-animation i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #3498db;
    animation: spin 1s linear infinite;
}

.deleting-animation i {
    color: #e74c3c;
}

.loading-animation span, .deleting-animation span {
    font-size: 14px;
    color: #555;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 針對文件項和記錄項的特殊樣式 */
.file-item.loading-item,
.record-item.loading-item {
    background-color: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.file-item.deleting-item,
.record-item.deleting-item {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* 側邊欄標題區域樣式 */
.sidebar-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 重新整理按鈕樣式 */
.refresh-btn {
    background: linear-gradient(135deg, #90caf9, #81c784);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
}

.refresh-btn:hover {
    background: linear-gradient(135deg, #81c784, #66bb6a);
    transform: translateY(-1px) scale(0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.refresh-btn:active {
    transform: translateY(0) scale(0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 展開時顯示重新整理按鈕 */
.sidebar-section.expanded .refresh-btn {
    opacity: 1;
    transform: scale(0.8);
    visibility: visible;
}

/* 重新整理按鈕載入狀態 */
.refresh-btn.loading {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
    cursor: not-allowed;
    pointer-events: none;
}

.refresh-btn.loading i {
    animation: refresh-spin 1s linear infinite;
}

/* 旋轉動畫 */
@keyframes refresh-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 重新整理按鈕禁用狀態 */
.refresh-btn:disabled {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    cursor: not-allowed;
    opacity: 0.6;
}



/* 響應式設計 */
@media (max-width: 768px) {
    .sidebar-header-buttons {
        gap: 4px;
    }
    
    .refresh-btn {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
        padding: 3px 4px;
    }
    

} 
/* 資產查詢功能樣式 */
:root {
    --query-btn-color: #4285f4;
    --query-btn-hover-color: #2a75f3;
    --light-bg: #f8fafc;
    --border-color: #e0e4e8;
    --text-color: #333;
    --secondary-text: #666;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 6px;
}

/* 輸入框與按鈕組合容器 */
.input-with-button {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    gap: 8px; /* 輸入框和按鈕之間的間距 */
}

.input-with-button .standard-input {
    width: 150px !important; /* 與其他標準輸入框保持一致的寬度 */
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

.input-with-button .standard-input:focus {
    border-color: var(--query-btn-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.input-with-button .query-btn {
    position: static;
    transform: none;
    width: 36px;
    height: 36px;
    border: none;
    background-color: var(--query-btn-color);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0; /* 防止按鈕被擠壓 */
}

.input-with-button .query-btn:hover {
    background-color: var(--query-btn-hover-color);
}

.input-with-button .query-btn i {
    pointer-events: none;
}

/* 資產查詢面板樣式 */
.asset-query-panel {
    position: absolute;
    right: 0;
    top: 100%;
    width: 380px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 8px;
    display: none;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.asset-query-panel.active {
    display: block;
}

.asset-query-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f7f9fc;
}

.asset-query-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 16px;
}

.asset-query-container {
    padding: 15px;
}

.asset-type-section {
    margin-bottom: 15px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.asset-type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.asset-type-btn {
    padding: 6px 12px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-color);
}

.asset-type-btn:hover {
    background-color: #edf1f7;
}

.asset-type-btn.active {
    background-color: var(--query-btn-color);
    color: white;
    border-color: var(--query-btn-color);
}

.search-section {
    display: none;
    margin-top: 15px;
}

.search-section.active {
    display: block;
}

.search-bar {
    display: flex;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 14px;
}

.search-btn {
    padding: 10px 15px;
    background-color: var(--query-btn-color);
    color: white;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background-color: var(--query-btn-hover-color);
}

/* 新增下拉選單相關樣式 */
.dropdown-section {
    margin-top: 15px;
    margin-bottom: 15px;
}

.dropdown-label {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 5px;
    display: block;
}

.etf-dropdown {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2716%27 height=%2716%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23666%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpolyline points=%276 9 12 15 18 9%27%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

.etf-dropdown:focus {
    outline: none;
    border-color: var(--query-btn-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}

.etf-dropdown option {
    padding: 5px;
}

.etf-dropdown optgroup {
    font-weight: 600;
    color: var(--text-color);
}

.period-tags {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.period-tag {
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 12px;
    background-color: #E3F2FD;
    color: #1565C0;
    font-weight: 500;
}

.period-tag.years-5 {
    background-color: #E3F2FD;
    color: #1565C0;
}

.period-tag.years-10 {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.period-tag.years-15 {
    background-color: #FFF8E1;
    color: #F57F17;
}

.results-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
}

.result-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background-color: #f5f8ff;
}

.result-symbol {
    font-weight: 600;
    margin-right: 10px;
}

.result-return {
    color: var(--secondary-text);
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.result-return span {
    font-weight: 500;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: var(--secondary-text);
}

.asset-selection-info {
    background-color: #f7f9fc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: none;
}

.asset-selection-info.active {
    display: block;
}

.selected-asset-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-asset-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
}

.selected-asset-detail {
    flex: 1;
    min-width: 120px;
}

.detail-label {
    color: var(--secondary-text);
    margin-bottom: 2px;
}

.detail-value {
    font-weight: 500;
}

.import-button-container {
    text-align: right;
    margin-top: 15px;
}

.import-button {
    background-color: var(--query-btn-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.import-button:hover {
    background-color: var(--query-btn-hover-color);
}

.close-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.close-panel:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.close-panel i {
    font-size: 14px;
    color: #666;
}

/* 響應式設計 */
@media screen and (max-width: 768px) {
    .asset-query-panel {
        width: 320px;
    }
    
    .input-with-button .query-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .asset-type-buttons {
        gap: 6px;
    }
    
    .asset-type-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .search-input, .search-btn {
        padding: 8px 12px;
    }
}

@media screen and (max-width: 480px) {
    .asset-query-panel {
        width: 280px;
        right: -70px;
    }
    
    .asset-type-buttons {
        gap: 5px;
    }
    
    .asset-type-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
} 
/* Account Popup Styling */
.account-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.account-popup {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.account-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.account-popup-header h3 {
    margin: 0;
    color: #333;
}

.account-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.account-popup-close:hover {
    color: #333;
}

.account-popup-content {
    margin-bottom: 20px;
}

.account-info-item {
    margin-bottom: 15px;
}

.account-info-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.account-info-value {
    font-size: 16px;
    color: #333;
}

/* Special colors for different membership levels */
.membership-level-0 {
    color: #b83939; /* Red for frozen/deactivated level */
}

.membership-level-1 {
    color: #5c8a36; /* Green for free level */
}

.membership-level-2 {
    color: #c27a0e; /* Gold for premium level */
}

.account-popup-footer {
    text-align: right;
}

.account-popup-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.account-popup-button:hover {
    background-color: #3367d6;
}

/* New styles for upgrade button */
.account-upgrade-section {
    text-align: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
}

.account-upgrade-button {
    display: inline-block;
    background: linear-gradient(to right, #f6d365, #fda085);
    color: #333;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.account-upgrade-button:hover {
    background: linear-gradient(to right, #fda085, #f6d365);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
} 
/* 進階投資模組樣式 */

/* 主要容器樣式 */
.advanced-investment-container {
    margin-bottom: 20px;
}

/* 行項目樣式 */
.portfolio-item {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* 欄位標題樣式 */
.portfolio-headers {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-weight: bold;
    padding: 0 5px;
}

.item-number-header, .category-header, .code-header, .ratio-header, .search-header {
    text-align: center;
}

.item-number-header {
    width: 40px;
}

.category-header {
    flex: 1;
    width: 50%; /* Adjusted to 50% as requested */
    max-width: 50%;
}

.code-header {
    flex: 1;
    width: 25%;
    max-width: 25%;
}

.ratio-header {
    flex: 1;
    width: 15%;
    max-width: 100px;
}

.search-header {
    width: 36px;
}

/* 項目編號樣式 */
.item-number {
    width: 40px;
    text-align: center;
    font-weight: bold;
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 8px 0;
}

/* 下拉式選單樣式 */
.category-select {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 10px;
    background-color: #fff;
    width: 50%; /* Adjusted to 50% as requested */
    max-width: 50%;
}

/* 輸入欄位樣式 */
.code-input, .ratio-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 10px;
}

/* 代號欄位樣式 */
.code-input {
    width: 25%;
    max-width: 25%;
}

/* 比例欄位樣式 */
.ratio-input {
    width: 15%;
    max-width: 100px;
    font-weight: bold; /* Make the ratio text bold for better visibility */
}

/* 確保比例數值顏色樣式能被正確應用 */
.ratio-input[style*="color"] {
    color: inherit !important; /* Use the inline style color */
}

/* 使用特殊類別標記有顏色的比例欄位 */
.colored-ratio {
    color: attr(data-ratio-color) !important;
}

/* 針對不同比例值的特定顏色設置 */
.ratio-input[value="0"] { color: rgb(0, 0, 0) !important; }
.ratio-input[value="10"] { color: rgb(0, 0, 17) !important; }
.ratio-input[value="20"] { color: rgb(0, 0, 34) !important; }
.ratio-input[value="30"] { color: rgb(0, 0, 51) !important; }
.ratio-input[value="40"] { color: rgb(0, 0, 68) !important; }
.ratio-input[value="50"] { color: rgb(0, 0, 85) !important; }
.ratio-input[value="60"] { color: rgb(0, 0, 102) !important; }
.ratio-input[value="70"] { color: rgb(0, 0, 119) !important; }
.ratio-input[value="80"] { color: rgb(0, 0, 136) !important; }
.ratio-input[value="90"] { color: rgb(0, 0, 153) !important; }
.ratio-input[value="100"] { color: rgb(0, 0, 170) !important; }

/* 搜尋按鈕樣式 */
.search-btn {
    background-color: var(--gradient-start);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.search-btn:hover {
    background-color: var(--gradient-end);
}

/* 刪除按鈕樣式 */
.remove-item-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.remove-item-btn:hover {
    background-color: #d32f2f;
}

/* 添加按鈕和操作按鈕樣式 */
.portfolio-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 15px;
    gap: 10px;
}

.add-item-btn {
    background-color: var(--gradient-start);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.add-item-btn:hover {
    background-color: var(--gradient-end);
}

/* 總計百分比樣式 */
.total-percentage {
    margin-top: 15px;
    margin-bottom: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.percentage-value {
    color: var(--gradient-start);
}

.percentage-warning {
    color: #f44336;
    display: none;
}

.percentage-warning.show {
    display: inline;
}

/* 切換投資模式按鈕組 */
.investment-toggle-group {
    display: flex;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.investment-toggle-btn {
    flex: 1;
    background-color: #f5f5f5;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: normal;
}

.investment-toggle-btn.active {
    background-color: var(--gradient-start);
    color: white;
    font-weight: bold;
}

/* 投資模式容器 */
.investment-mode-container {
    display: none;
}

.investment-mode-container.active {
    display: block;
}

/* 圆饼图样式 */
.portfolio-pie-chart-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.portfolio-pie-chart-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.pie-chart-container {
    position: relative;
    width: 100%;
    max-width: 100%; /* 确保不超过父容器 */
    min-height: 400px;
    max-height: 400px; /* 桌面版限制最大高度 */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    gap: 20px;
    overflow: hidden; /* 桌面版防止内容溢出 */
}

.individual-chart-section, .category-chart-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 50%;
    max-height: 100%; /* 限制最大高度 */
}

.individual-chart-section h5, .category-chart-section h5 {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

#advanced-portfolio-pie-chart, #advanced-category-pie-chart {
    max-width: 100%;
    max-height: 320px; /* 限制图表最大高度 */
    width: auto;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
    border-radius: 50%;
}

#advanced-portfolio-pie-chart:hover, #advanced-category-pie-chart:hover {
    transform: scale(1.02);
}

/* 圆饼图空状态样式 */
.pie-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.1rem;
    height: 350px;
}

.pie-chart-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

/* 響應式設計 - 增加更多斷點以更好處理不同屏幕尺寸 */

/* 大桌面屏幕 (1200px+) - 保持默認佈局 */
@media (min-width: 1200px) {
    .pie-chart-container {
        padding: 25px;
        gap: 25px;
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        max-height: 350px;
    }
}

/* 中等桌面屏幕 (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
    .pie-chart-container {
        padding: 20px;
        gap: 18px;
        min-height: 380px;
        max-height: 380px;
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        max-height: 300px;
    }
    
    .individual-chart-section h5, .category-chart-section h5 {
        font-size: 0.85rem;
    }
}

/* 平板橫向 (768px - 991px) */
@media (max-width: 991px) and (min-width: 768px) {
    .pie-chart-container {
        padding: 18px;
        gap: 15px;
        min-height: 360px;
        max-height: 360px;
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        max-height: 280px;
    }
}

/* 平板直向和大手機 (576px - 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .pie-chart-container {
        flex-direction: column;
        align-items: center;
        min-height: auto;
        max-height: none; /* 移除高度限制 */
        gap: 25px;
        padding: 20px;
        overflow: visible; /* 允許內容顯示 */
    }
    
    .individual-chart-section, .category-chart-section {
        max-width: 100%;
        width: 100%;
        max-height: none; /* 移除高度限制 */
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        width: 300px;
        height: 300px;
        max-height: none;
    }
    
    .individual-chart-section h5, .category-chart-section h5 {
        font-size: 1rem;
        margin-bottom: 20px;
    }
}

/* 小手機 (最大 575px) */
@media (max-width: 575px) {
    .pie-chart-container {
        flex-direction: column;
        align-items: center;
        min-height: auto;
        max-height: none; /* 移除高度限制 */
        gap: 20px;
        padding: 15px;
        overflow: visible; /* 允許內容顯示 */
    }
    
    .individual-chart-section, .category-chart-section {
        max-width: 100%;
        width: 100%;
        max-height: none; /* 移除高度限制 */
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        width: 260px;
        height: 260px;
        max-height: none;
    }
    
    .individual-chart-section h5, .category-chart-section h5 {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .portfolio-pie-chart-section h4 {
        font-size: 1rem;
        text-align: center;
    }
}

/* 超小手機 (最大 400px) */
@media (max-width: 400px) {
    .pie-chart-container {
        padding: 10px;
        gap: 15px;
        max-height: none; /* 移除高度限制 */
        overflow: visible; /* 允許內容顯示 */
    }
    
    .individual-chart-section, .category-chart-section {
        max-height: none; /* 移除高度限制 */
    }
    
    #advanced-portfolio-pie-chart, #advanced-category-pie-chart {
        width: 220px;
        height: 220px;
    }
    
    .individual-chart-section h5, .category-chart-section h5 {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
}

/* 验证错误信息美化样式 */
.validation-error-container {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #f44336;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.1);
}

.validation-error-container .error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #c62828;
    margin-bottom: 8px;
}

.validation-error-container .error-header i {
    font-size: 1rem;
    color: #f44336;
}

.validation-error-container .error-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.validation-error-container .error-list li {
    position: relative;
    margin-bottom: 4px;
    padding-left: 16px;
    line-height: 1.4;
    color: #d32f2f;
}

.validation-error-container .error-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #f44336;
    font-weight: bold;
}

.validation-error-container .error-item {
    font-weight: 600;
    color: #b71c1c;
}

.validation-error-container .error-message {
    color: #d32f2f;
}

.validation-error-container .error-list li:last-child {
    margin-bottom: 0;
}

/* 移动设备响应式样式 */
@media (max-width: 480px) {
    .validation-error-container {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .validation-error-container .error-list {
        padding-left: 16px;
    }
    
    .validation-error-container .error-list li {
        padding-left: 12px;
    }
}

/* 投资组合回测结果美化样式 */
.backtest-results {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e3f2fd !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.backtest-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1976d2, #42a5f5, #64b5f6);
    border-radius: 12px 12px 0 0;
}

.backtest-results h4 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #e3f2fd !important;
    color: #1976d2;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.backtest-results h4::before {
    content: '📊';
    font-size: 1.1rem;
}

.backtest-metrics {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e8f4fd;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #1976d2;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 4px;
}

.metric-value.positive {
    color: #2e7d32;
}

.metric-value.negative {
    color: #d32f2f;
}

.metric-period {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

.backtest-disclaimer {
    font-size: 0.8em;
    color: #666;
    margin-top: 10px;
}

.backtest-disclaimer-text {
    /* 保持简单的文字样式 */
}

/* 移动设备响应式样式 */
@media (max-width: 768px) {
    .backtest-results {
        padding: 20px !important;
        margin-top: 16px;
    }
    
    .backtest-metrics {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .metric-card {
        padding: 12px;
    }
    
    .metric-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .backtest-results {
        padding: 16px !important;
        border-radius: 8px !important;
    }
    
    .backtest-results h4 {
        font-size: 1.1rem;
    }
    
    .metric-value {
        font-size: 1.1rem;
    }
    
    .metric-label {
        font-size: 0.85rem;
    }
    
    .backtest-disclaimer {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
}

/* 投资组合净值走势图样式 - 与回测结果容器保持一致 */
.chart-container-wrapper {
    margin-top: 20px;
    display: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
}

.chart-container-wrapper h4 {
    margin-top: 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.backtest-chart-section {
    width: 100%;
}

.backtest-chart-container {
    width: 100%;
    max-width: 100%;
} 
/* 收入事件模組專用樣式 */
.income-events-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 8px 0;
}

.income-events-controls {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    margin-bottom: 10px;
}

/* 參照custom-income.css的按鈕樣式 */
.add-point-btn, .remove-point-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.add-point-btn {
    background-color: #3498db;
    color: white;
}

.remove-point-btn {
    background-color: #e74c3c;
    color: white;
}

.add-point-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.remove-point-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 移除虛線，減少間距 */
.income-event-row {
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.income-event-row:last-child {
    margin-bottom: 0;
}

.income-event {
    display: flex;
    gap: 15px;
}

.income-event .form-group {
    flex: 1;
}

/* 數字輸入框樣式覆蓋 */
.income-event-year,
.income-event-amount {
    width: 100%;
} 
/* 支出事件模組專用樣式 */
.expense-events-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 8px 0;
}

.expense-event-row {
    margin-bottom: 6px;
    padding-bottom: 6px;
}

.expense-event-row:last-child {
    margin-bottom: 0;
}

.expense-events-controls {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    margin-bottom: 10px;
}

/* 參照custom-expense.css的按鈕樣式 */
.add-point-btn, .remove-point-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.add-point-btn {
    background-color: #3498db;
    color: white;
}

.remove-point-btn {
    background-color: #e74c3c;
    color: white;
}

.add-point-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.remove-point-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.expense-event {
    display: flex;
    gap: 15px;
}

.expense-event .form-group {
    flex: 1;
}

/* 數字輸入框樣式覆蓋 */
.expense-event-year,
.expense-event-amount {
    width: 100%;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .expense-event {
        flex-direction: column;
        gap: 10px;
    }
} 
.curve-editor-container {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
}

.curve-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.curve-editor-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.point-controls {
    display: flex;
    gap: 5px;
}

.add-point-btn, .remove-point-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.add-point-btn {
    background-color: #3498db;
    color: white;
}

.remove-point-btn {
    background-color: #e74c3c;
    color: white;
}

.add-point-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.remove-point-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.curve-editor-canvas-container {
    width: 100%;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#income-curve-editor {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.curve-editor-points-container {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.points-table {
    width: 100%;
    border-collapse: collapse;
}

.points-table th,
.points-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.points-table th {
    background-color: #f5f7fa;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.point-row:hover {
    background-color: #f5f5f5;
}

.point-year, .point-income {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.3s ease;
    font-size: 14px;
}

.point-year:focus, .point-income:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .curve-editor-container {
        padding: 10px;
    }
    
    .curve-editor-canvas-container {
        height: 250px;
    }
    
    .points-table th,
    .points-table td {
        padding: 8px;
    }
    
    .point-year, .point-income {
        padding: 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .curve-editor-header h4 {
        font-size: 14px;
    }
    
    .add-point-btn, .remove-point-btn {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
    
    .curve-editor-canvas-container {
        height: 200px;
    }
    
    .points-table th,
    .points-table td {
        padding: 6px;
    }
    
    .point-year, .point-income {
        padding: 4px;
        font-size: 12px;
    }
} 
.expense-curve-editor-container {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
}

.curve-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.curve-editor-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.point-controls {
    display: flex;
    gap: 5px;
}

.curve-control-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 5px;
    color: white;
    font-weight: 500;
}

.add-point-btn {
    background-color: #3498db;
}

.add-point-btn:hover {
    background-color: #2980b9;
}

.remove-point-btn {
    background-color: #e74c3c;
}

.remove-point-btn:hover {
    background-color: #c0392b;
}

.expense-curve-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-top: 15px;
    padding: 0 5px;
    box-sizing: border-box;
}

.chart-canvas-container {
    width: 100%;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#expense-curve-editor {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.curve-points-editor {
    width: 100%;
}

.curve-editor-points-container {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.points-table {
    width: 100%;
    border-collapse: collapse;
}

.points-table th,
.points-table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.points-table th {
    background-color: #f5f7fa;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

.point-row:hover {
    background-color: #f5f5f5;
}

.point-year, .point-expense {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.3s ease;
    font-size: 14px;
}

.point-year:focus, .point-expense:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.25);
}

/* 響應式設計 */
@media (min-width: 992px) {
    .expense-curve-layout {
        flex-direction: row;
    }
    
    .chart-canvas-container {
        flex: 7;
        min-height: 350px;
    }
    
    .curve-points-editor {
        flex: 3;
    }
}

@media (max-width: 768px) {
    .expense-curve-editor-container {
        padding: 10px;
    }
    
    .chart-canvas-container {
        height: 250px;
    }
    
    .points-table th,
    .points-table td {
        padding: 8px;
    }
    
    .point-year, .point-expense {
        padding: 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .curve-editor-header h4 {
        font-size: 14px;
    }
    
    .curve-control-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .chart-canvas-container {
        height: 200px;
    }
    
    .points-table th,
    .points-table td {
        padding: 6px;
    }
    
    .point-year, .point-expense {
        padding: 4px;
        font-size: 12px;
    }
} 
/**
 * 導引設定樣式 - Guided Setup Styles
 * 文件名: guided-setup.css
 * 功能: 提供導引設定界面的樣式設計
 */

/* 導引設定按鈕 */
.guided-setup-trigger-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
}

.guided-setup-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.guided-setup-trigger-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.guided-setup-trigger-btn i {
    font-size: 18px;
}

/* 導引設定系統樣式 */

/* 模態框樣式 */
.guided-setup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guided-setup-modal.show {
    display: block;
    opacity: 1;
}

.guided-setup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.guided-setup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 標題區域 */
.guided-setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.guided-setup-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.guided-setup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.guided-setup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 進度顯示 */
.guided-setup-progress {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.progress-text-large {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

#progressPercentage {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

#progressStage {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* 內容區域 */
.guided-setup-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    max-height: 70vh;
    min-height: 400px;
}

.question-container {
    width: 100%;
}

.question-header h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
}

.question-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.question-explanation {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    font-size: 0.9rem;
    color: #555;
}

/* 選項卡片 */
.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.option-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.option-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea10, #764ba210);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.option-icon {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.option-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #333;
    font-weight: 600;
}

.option-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.option-check {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

.option-card.selected .option-check {
    display: flex;
}

/* 輸入框樣式 */
.number-input-container,
.amount-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.guided-number-input,
.guided-amount-input {
    width: 200px;
    max-width: 300px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: border-color 0.2s ease;
    text-align: center;
}

/* 針對特定類型的寬度調整 */
.guided-number-input {
    width: 160px;
    max-width: 200px;
}

.guided-amount-input {
    width: 220px;
    max-width: 300px;
}

.guided-number-input:focus,
.guided-amount-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-unit {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
    min-width: 30px;
}

/* 輸入反饋樣式 */
.input-feedback-text {
    margin-top: 12px;
    color: #667eea;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    transition: all 0.3s ease;
}

.input-feedback-text:empty {
    display: none;
}

/* 歡迎頁面樣式 */
.welcome-container {
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 30px;
}

.welcome-actions {
    margin-top: 30px;
}

.welcome-start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.welcome-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.welcome-start-btn:active {
    transform: translateY(0);
}

.welcome-auto-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #667eea;
    font-size: 1.1rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

.welcome-auto-next i {
    font-size: 1.2rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(0); }
    40% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
}

/* 投資設定樣式 */
.investment-setup-container {
    width: 100%;
}

.investment-instruction {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.investment-instruction p {
    margin: 5px 0;
    color: #555;
    font-size: 0.9rem;
}

.investment-help-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.investment-help-info h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
}

.investment-help-info ul {
    margin: 0;
    padding-left: 20px;
}

.investment-help-info li {
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.investment-help-info li strong {
    color: #495057;
}

.investment-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    background: #fafafa;
}

.investment-row {
    display: grid;
    grid-template-columns: 1fr 1fr 150px 120px;
    gap: 15px;
    align-items: center;
}

.investment-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.investment-field label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    min-width: 50px;
    text-align: left;
}

.investment-category,
.investment-code,
.investment-name,
.investment-ratio {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
    flex: 1;
}

.investment-ratio-field {
    justify-content: flex-start;
}

.investment-ratio-field .ratio-input-container {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 100px;
}

.investment-ratio-field .investment-ratio {
    flex: 1;
    padding-right: 25px;
    text-align: center;
}

.investment-ratio-field .ratio-unit {
    position: absolute;
    right: 8px;
    font-size: 0.9rem;
    color: #666;
    pointer-events: none;
}

.investment-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

.add-investment-btn,
.remove-investment-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s ease;
}

.add-investment-btn {
    background: #28a745;
    color: white;
}

.add-investment-btn:hover {
    background: #218838;
}

.remove-investment-btn {
    background: #dc3545;
    color: white;
}

.remove-investment-btn:hover:not(:disabled) {
    background: #c82333;
}

.remove-investment-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.investment-summary {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 20px;
}

.total-allocation {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.pie-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

#portfolio-pie-chart {
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 完成步驟樣式 */
.completion-container {
    text-align: center;
    padding: 20px;
}

.completion-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 20px;
}

.completion-container h3 {
    color: #28a745;
    margin-bottom: 15px;
}

.completion-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: left;
}

.completion-summary h4 {
    margin-top: 0;
    color: #333;
}

.completion-summary ul {
    list-style: none;
    padding: 0;
}

.completion-summary li {
    padding: 5px 0;
    border-bottom: 1px solid #e0e0e0;
}

.completion-summary li:last-child {
    border-bottom: none;
}

/* 按鈕樣式 */
.guided-setup-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    gap: 15px;
}

.guided-setup-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guided-setup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.guided-setup-btn.secondary {
    background: #6c757d;
    color: white;
}

.guided-setup-btn.secondary:hover:not(:disabled) {
    background: #5a6268;
}

.guided-setup-btn.primary {
    background: #667eea;
    color: white;
}

.guided-setup-btn.primary:hover:not(:disabled) {
    background: #5a6fd8;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.guided-setup-btn.primary.enabled {
    background: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

.guided-setup-btn.primary.enabled:hover {
    background: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.guided-setup-btn.success {
    background: #28a745;
    color: white;
}

.guided-setup-btn.success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .investment-row {
        grid-template-columns: 1fr 1fr 80px;
    }
    
    .pie-chart-container {
        min-height: 250px;
    }
    
    #portfolio-pie-chart {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .guided-setup-container {
        width: 98%;
        max-height: 98vh;
    }
    
    .guided-setup-content {
        max-height: 60vh;
        min-height: 300px;
    }
    
    .option-cards {
        grid-template-columns: 1fr;
    }
    
    .investment-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .guided-setup-actions {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
    }
    
    .guided-setup-btn {
        width: 100%;
        justify-content: center;
    }
    
    .pie-chart-container {
        min-height: 200px;
    }
    
    #portfolio-pie-chart {
        width: 200px;
        height: 200px;
    }
    
    /* 手機版輸入欄位寬度調整 */
    .guided-number-input {
        width: 140px;
        max-width: 160px;
        font-size: 1rem;
        padding: 12px 14px;
    }
    
    .guided-amount-input {
        width: 180px;
        max-width: 220px;
        font-size: 1rem;
        padding: 12px 14px;
    }
    
    .number-input-container,
    .amount-input-container {
        gap: 10px;
    }
    
    .input-unit {
        font-size: 1rem;
        min-width: 25px;
    }
}

/* 動畫效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-container {
    animation: slideIn 0.3s ease;
}

/* 滾動條樣式 */
.guided-setup-content::-webkit-scrollbar {
    width: 8px;
}

.guided-setup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.guided-setup-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.guided-setup-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 輔助類別 */
.guided-setup-hidden {
    display: none !important;
}

.guided-setup-loading {
    position: relative;
    pointer-events: none;
}

.guided-setup-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 錯誤狀態 */
.guided-setup-error {
    border-color: #dc3545 !important;
    background: #fff5f5 !important;
}

.guided-setup-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* 成功狀態 */
.guided-setup-success {
    border-color: #28a745 !important;
    background: #f8fff8 !important;
}

.guided-setup-success-message {
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8fff8;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
}

/* 模擬進度和結果相關樣式 */
.completion-actions {
    margin-top: 20px;
    text-align: center;
}

.guided-setup-btn.large {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
}

.simulation-progress {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.progress-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 1rem;
}

.progress-info i {
    font-size: 1.2rem;
    color: #667eea;
}

.simulation-results {
    margin-top: 20px;
    animation: slideIn 0.5s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.results-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.results-header p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.4;
}

.results-header i {
    margin-right: 8px;
    font-size: 1.2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.result-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.result-card.primary {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-card.primary:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.result-card.primary .result-icon {
    color: rgba(255, 255, 255, 0.9);
}

.result-card .result-icon {
    color: #667eea;
}

.result-content h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    color: inherit;
}

.result-card.primary .result-value {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.result-content p {
    margin: 10px 0 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.8;
}

.result-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.range-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.range-label {
    font-size: 0.9rem;
    color: #666;
}

.range-value {
    font-weight: 600;
    color: #333;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.welcome-ready {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.welcome-ready i {
    font-size: 1.3rem;
    color: #28a745;
}

/* 響應式設計 - 模擬結果 */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .guided-setup-btn.large {
        width: 100%;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .range-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* 機率條樣式 */
.probability-bars {
    margin-top: 15px;
}

.prob-bar {
    margin-bottom: 10px;
}

.prob-bar span {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 10px;
    position: relative;
    transition: width 0.3s ease;
}

.bar.success {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

.bar.failure {
    background: linear-gradient(90deg, #F44336, #FF9800);
}

.percentage {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* 風險指標樣式 */
.risk-indicators {
    margin-top: 10px;
}

.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.risk-label {
    font-weight: 500;
    color: #666;
}

.risk-value {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.risk-value.low {
    background: #4CAF50;
}

.risk-value.medium {
    background: #FF9800;
}

.risk-value.high {
    background: #F44336;
}

/* 圖表區域樣式 */
.results-chart-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.results-chart-section h4 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-chart-section p {
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.chart-container-small {
    position: relative;
    height: 300px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container-small canvas {
    max-width: 100%;
    max-height: 100%;
}

#guidedSetupAreaChart {
    width: 100% !important;
    height: 100% !important;
}

/* 響應式設計擴展 */
@media (max-width: 768px) {
    .chart-container-small {
        height: 250px;
    }
    
    .risk-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .risk-value {
        align-self: flex-end;
    }
    
    .probability-bars {
        margin-top: 10px;
    }
    
    .bar-container {
        height: 18px;
    }
    
    .percentage {
        font-size: 11px;
    }
}

/* 全螢幕圖表樣式已移至 main_simulation.css 以避免重複定義和樣式衝突 */

/* 會員升級相關樣式 */
.option-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.option-card.membership-required {
    border: 2px solid #f39c12;
    background: linear-gradient(135deg, #fff9e6, #ffeaa7);
}

.membership-notice {
    margin-top: 10px;
    padding: 10px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 6px;
    border: 1px solid #f39c12;
    text-align: center;
}

.membership-notice i {
    color: #f39c12;
    margin-right: 5px;
}

.membership-notice span {
    font-size: 14px;
    color: #d68910;
    font-weight: 500;
}

.upgrade-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
}

.option-check.disabled {
    background: #bdc3c7;
    border-color: #bdc3c7;
}

.option-check.disabled i {
    color: #7f8c8d;
}

/* 升級會員模態框 */
.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upgrade-modal-overlay.show {
    opacity: 1;
}

.upgrade-modal {
    background: white;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.upgrade-modal-overlay.show .upgrade-modal {
    transform: scale(1);
}

.upgrade-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border-radius: 12px 12px 0 0;
}

.upgrade-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.upgrade-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.upgrade-modal-content {
    padding: 25px;
}

.upgrade-modal-content p {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

.upgrade-modal-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.upgrade-modal-content li {
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.upgrade-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
}

.upgrade-btn-primary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn-primary:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
}

.upgrade-btn-secondary {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #bbb;
}

/* 群組輸入容器樣式 */
.group-inputs-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: visible; /* 確保下拉選單可見 */
}

.group-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-field label {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    margin-bottom: 5px;
}

.group-field-explanation {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.group-field-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-field-input input,
.group-field-input select,
.group-field-input .guided-amount-input,
.group-field-input .guided-number-input,
.group-field-input .guided-select-input,
.group-field-input .guided-text-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: white;
    flex: 1;
    min-width: 0; /* 確保在flex容器中可以縮小 */
}

/* 投資組合報酬率和風險設定 - 特定寬度控制 */
.group-field-input .guided-number-input[id*="portfolio-return"],
.group-field-input .guided-number-input[id*="return-std"],
.group-field-input .guided-number-input[id*="non-investment-return"],
.group-field-input .guided-number-input[id*="non-investment-std"] {
    max-width: 120px;
    min-width: 100px;
    flex: none; /* 不要自動伸縮 */
    text-align: center; /* 數字置中顯示 */
}

/* ETF 選擇器寬度控制 */
.group-field-input .guided-select-input[id*="etf-selector"] {
    min-width: 250px;
    max-width: 400px;
    flex: 1; /* 允許適度伸縮 */
    position: relative;
    z-index: 100; /* 確保選單在最上層 */
}

/* 投資參數組合排版優化 */
.group-field:has(.guided-number-input[id*="portfolio-return"]),
.group-field:has(.guided-number-input[id*="return-std"]),
.group-field:has(.guided-number-input[id*="non-investment-return"]),
.group-field:has(.guided-number-input[id*="non-investment-std"]) {
    flex: 0 0 auto; /* 不要自動伸縮，保持固定寬度 */
}

.group-field-input input:focus,
.group-field-input select:focus,
.group-field-input .guided-amount-input:focus,
.group-field-input .guided-number-input:focus,
.group-field-input .guided-select-input:focus,
.group-field-input .guided-text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.group-field-unit,
.input-unit {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
    min-width: 30px;
    white-space: nowrap; /* 防止單位換行 */
}

.group-field-select,
.guided-select-input {
    min-width: 200px;
    padding: 8px 12px;
    min-height: 40px;
    position: relative;
    z-index: 10;
}

.group-field-select option,
.guided-select-input option {
    padding: 12px 8px;
    min-height: 40px;
    line-height: 1.5;
}

/* ETF 選擇器特殊樣式 */
.etf-selector-field {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
    margin-bottom: 20px; /* 增加底部邊距防止被切到 */
    position: relative;
    z-index: 50;
}

.etf-selector-field label {
    color: #28a745;
    font-weight: 600;
}

.etf-selector-field .group-field-explanation {
    border-left-color: #28a745;
    background: #f8fff8;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .group-field-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .group-field-input input,
    .group-field-input select,
    .group-field-input .guided-amount-input,
    .group-field-input .guided-number-input,
    .group-field-input .guided-select-input,
    .group-field-input .guided-text-input {
        width: 100%;
    }
    
    /* 平板上投資參數輸入框保持固定寬度 */
    .group-field-input .guided-number-input[id*="portfolio-return"],
    .group-field-input .guided-number-input[id*="return-std"],
    .group-field-input .guided-number-input[id*="non-investment-return"],
    .group-field-input .guided-number-input[id*="non-investment-std"] {
        width: auto;
        max-width: 150px;
        align-self: center; /* 置中顯示 */
    }
    
    .group-field-unit,
    .input-unit {
        text-align: center;
        margin-top: 5px;
    }
    
    .group-field-select,
    .guided-select-input {
        min-width: auto;
    }
    
    /* ETF 選擇器在平板上保持合適寬度 */
    .group-field-input .guided-select-input[id*="etf-selector"] {
        min-width: 200px;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .group-inputs-container {
        padding: 15px;
        gap: 15px;
    }
    
    .group-field-input input,
    .group-field-input select,
    .group-field-input .guided-amount-input,
    .group-field-input .guided-number-input,
    .group-field-input .guided-select-input,
    .group-field-input .guided-text-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    /* 手機上投資參數輸入框的特殊處理 */
    .group-field-input .guided-number-input[id*="portfolio-return"],
    .group-field-input .guided-number-input[id*="return-std"],
    .group-field-input .guided-number-input[id*="non-investment-return"],
    .group-field-input .guided-number-input[id*="non-investment-std"] {
        width: auto;
        max-width: 120px;
        min-width: 80px;
        align-self: center;
        padding: 8px 10px;
    }
    
    /* ETF 選擇器在手機上的寬度 */
    .group-field-input .guided-select-input[id*="etf-selector"] {
        min-width: auto;
        max-width: 100%;
    }
    
    .group-field-explanation {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* 投資組合驗證樣式 */
.investment-validation {
    margin-top: 8px;
    min-height: 20px;
}

.validation-message {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
}

.validation-message.valid {
    color: #28a745;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.validation-message.invalid {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.validation-message.warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

/* 投資項目樣式增強 */
.investment-code {
    position: relative;
}

.investment-code[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* 總配置比例樣式 */
.total-allocation {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.total-allocation span {
    font-weight: bold;
    transition: color 0.3s ease;
}

/* 投資項目行增強 */
.investment-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fafafa;
    transition: box-shadow 0.2s ease;
}

.investment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.investment-field {
    flex: 1;
    margin-right: 10px;
}

.investment-field:last-child {
    margin-right: 0;
}

.investment-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.investment-category,
.investment-code,
.investment-ratio {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.investment-category:focus,
.investment-code:focus,
.investment-ratio:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* 響應式調整 */
@media (max-width: 768px) {
    .investment-row {
        flex-direction: column;
    }
    
    .investment-field {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .investment-validation {
        margin-top: 5px;
    }
}

/* 全螢幕圖表功能現在使用 main_simulation.css 中的共用樣式 */

/* 四群組結果卡片樣式 */
.goal1-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
    padding: 0;
}

.group-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.group-card.top10 {
    background: linear-gradient(145deg, #e8f5e8 0%, #f0f9f0 100%);
    border-left: 5px solid #4CAF50;
}

.group-card.top10:hover {
    background: linear-gradient(145deg, #d4f2d4 0%, #e8f5e8 100%);
    border-left-color: #2E7D32;
}

.group-card.middle50 {
    background: linear-gradient(145deg, #e3f2fd 0%, #f0f8ff 100%);
    border-left: 5px solid #2196F3;
}

.group-card.middle50:hover {
    background: linear-gradient(145deg, #bbdefb 0%, #e3f2fd 100%);
    border-left-color: #1565C0;
}

.group-card.worst10 {
    background: linear-gradient(145deg, #fff3e0 0%, #fff8f0 100%);
    border-left: 5px solid #FF9800;
}

.group-card.worst10:hover {
    background: linear-gradient(145deg, #ffe0b2 0%, #fff3e0 100%);
    border-left-color: #E65100;
}

.group-card.worst1 {
    background: linear-gradient(145deg, #ffebee 0%, #fff5f5 100%);
    border-left: 5px solid #F44336;
}

.group-card.worst1:hover {
    background: linear-gradient(145deg, #ffcdd2 0%, #ffebee 100%);
    border-left-color: #C62828;
}

.group-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.group-header i {
    font-size: 1.4rem;
    width: 24px;
    text-align: center;
}

.group-card.top10 .group-header i {
    color: #4CAF50;
}

.group-card.middle50 .group-header i {
    color: #2196F3;
}

.group-card.worst10 .group-header i {
    color: #FF9800;
}

.group-card.worst1 .group-header i {
    color: #F44336;
}

.group-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}

.group-amount {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 10px 0;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.group-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-top: 8px;
}

/* 圖表放大按鈕現在使用 main_simulation.css 中的 .chart-expand-btn 樣式 */

/* 響應式設計 - 四群組卡片 */
@media (max-width: 768px) {
    .goal1-groups-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin: 20px 0;
    }
    
    .group-card {
        padding: 15px;
    }
    
    .group-amount {
        font-size: 1.3rem;
    }
    
    .group-title {
        font-size: 1rem;
    }
    
    .group-header i {
        font-size: 1.2rem;
    }
    
    /* 圖表放大按鈕響應式樣式在 main_simulation.css 中處理 */
}

@media (max-width: 480px) {
    .goal1-groups-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 15px 0;
    }
    
    .group-card {
        padding: 12px;
    }
    
    .group-amount {
        font-size: 1.2rem;
    }
    
    .group-title {
        font-size: 0.95rem;
    }
    
    .group-description {
        font-size: 0.85rem;
    }
    
    /* 圖表放大按鈕響應式樣式在 main_simulation.css 中處理 */
}

/* 結果說明文字樣式 */
.results-notes {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.results-notes p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.results-help-text {
    margin: 20px 0;
    text-align: center;
}

.results-help-text p {
    margin: 0;
    padding: 10px;
    background: #f0f7ff;
    border-radius: 6px;
    border: 1px solid #e3f2fd;
}


