/* --- 自訂 CSS --- */
.tooltip { position: relative; display: inline-block; vertical-align: middle; }
.tooltip .tooltiptext { visibility: hidden; width: 250px; background-color: #333; color: #fff; text-align: left; border-radius: 6px; padding: 10px; position: absolute; z-index: 50; bottom: 135%; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.3s; font-size: 13px; line-height: 1.5; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }
#chart-container { height: 500px; }
@media (max-width: 768px) { #chart-container { height: 350px; } }
.optimization-table th { position: sticky; top: 0; z-index: 1; background-color: #f9fafb; }
.optimization-table th.sortable-header { cursor: pointer; position: relative; padding-right: 1.5rem; }
.optimization-table th.sortable-header::after { content: ''; position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); border: 4px solid transparent; opacity: 0.3; transition: opacity 0.2s; }
.optimization-table th.sortable-header:hover::after { opacity: 0.6; }
.optimization-table th.sortable-header.sort-asc::after { border-bottom-color: #374151; opacity: 1; margin-top: -2px; }
.optimization-table th.sortable-header.sort-desc::after { border-top-color: #374151; opacity: 1; margin-top: 2px; }
.progress-bar { height: 4px; background-color: #e5e7eb; border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progress { height: 100%; background-color: #f59e0b; width: 0%; transition: width 0.3s; }
.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.tab-content { display: none; }
.tab-content.active { display: block; }
.strategy-params { border: 1px solid #d1d5db; padding: 0.75rem; border-radius: 0.375rem; margin-top: 0.5rem; background-color: #f9fafb; }
.optimize-param-select { margin-left: 0.5rem; padding-right: 2rem; }
.trade-list::-webkit-scrollbar { width: 6px; }
.trade-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.trade-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.trade-list::-webkit-scrollbar-thumb:hover { background: #aaa; }
html, body { overflow-x: hidden; }

/* Suggestion Area Style */
#today-suggestion-area {
     margin-top: 1rem;
     margin-bottom: 1rem;
     padding: 1rem;
     background-color: #fffbeb; /* bg-yellow-50 */
     border-left-width: 4px;
     border-color: #f59e0b; /* border-yellow-500 */
     color: #92400e; /* text-yellow-800 */
     border-radius: 0.375rem; /* rounded-md */
     text-align: center;
 }
 #today-suggestion-area.loading {
     background-color: #f0f9ff; /* bg-sky-50 */
     border-color: #0ea5e9; /* border-sky-500 */
     color: #0369a1; /* text-sky-800 */
 }
 #today-suggestion-area h4 {
      font-weight: 600;
      font-size: 1.125rem; /* text-lg */
      line-height: 1.75rem;
      margin-bottom: 0.25rem; /* mb-1 */
  }
 #suggestion-text {
     font-size: 1.25rem; /* text-xl */
     line-height: 1.75rem;
     font-weight: 700; /* font-bold */
 }
 #today-suggestion-area.hidden {
     display: none;
 }

/* 批量策略優化樣式 */
.batch-optimization-tab {
    transition: all 0.3s ease;
}

.batch-optimization-tab:hover {
    transform: translateY(-2px);
}

#batch-optimization-progress {
    animation: fadeIn 0.5s ease-in-out;
}

#batch-optimization-results {
    animation: slideUp 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 策略選擇區域樣式 */
#buy-strategies-list,
#sell-strategies-list {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

#buy-strategies-list::-webkit-scrollbar,
#sell-strategies-list::-webkit-scrollbar {
    width: 6px;
}

#buy-strategies-list::-webkit-scrollbar-track,
#sell-strategies-list::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

#buy-strategies-list::-webkit-scrollbar-thumb,
#sell-strategies-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

#buy-strategies-list::-webkit-scrollbar-thumb:hover,
#sell-strategies-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 進度條動畫 */
#batch-progress-bar {
    transition: width 0.3s ease-in-out;
}

/* 結果表格樣式 */
#batch-results-table tbody tr {
    transition: background-color 0.2s ease;
}

#batch-results-table tbody tr:hover {
    background-color: #f8fafc;
}

/* 按鈕樣式增強 */
#start-batch-optimization {
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
    transition: all 0.3s ease;
}

#start-batch-optimization:hover {
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #batch-optimization-content {
        padding: 0 1rem;
    }
    
    #start-batch-optimization {
        width: 100%;
        max-width: 300px;
    }
}

/* 載入動畫 */
.batch-loading {
    position: relative;
    overflow: hidden;
}

.batch-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}