/* --- 全局設定 --- */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 20px;
}

/* --- Header --- */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.header-content {
    width: 100%;
    max-width: 1200px;
    position: relative;
    text-align: center;
    padding: 10px 0;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.main-logo {
    width: 60px;
    height: auto;
    border-radius: 10px;
}

.logo-text {
    text-align: left;
}

.logo-text h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.logo-text .subtitle {
    margin: 5px 0 0;
    color: #888;
    font-size: 0.9rem;
}

/* --- 右上角圖示 --- */
.icon-group {
    position: absolute;
    top: 10px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
}

/* 通用按鈕樣式 */
.icon-link, #settingsBtn, #pricingBtn, #guideBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.icon-link img {
    width: 28px;
    height: 28px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.icon-link:hover img, #settingsBtn:hover, #pricingBtn:hover, #guideBtn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#settingsBtn { font-size: 1.8rem; opacity: 0.7; }
#pricingBtn { opacity: 0.8; }
#guideBtn { opacity: 0.8; } /* 📖 按鈕 */

/* --- 狀態顯示 --- */
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    background: #1e1e1e;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #888;
    transition: all 0.3s;
}
.dot.green { background-color: #4CAF50; box-shadow: 0 0 5px #4CAF50; }
.dot.orange { background-color: #FF9800; box-shadow: 0 0 5px #FF9800; }
.dot.red { background-color: #F44336; }

/* --- 列表容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.section {
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid #333;
}

.section.bull { border-top: 4px solid #4CAF50; }
.section.bear { border-top: 4px solid #F44336; }
.section.neut { border-top: 4px solid #2196F3; }

.section h3 {
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    color: #eee;
}

ul { list-style: none; padding: 0; margin: 0; }

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}
li:last-child { border-bottom: none; }

.coin-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #fff;
}

.badges { display: flex; gap: 5px; }

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #fff;
}
.msg-badge { background-color: #333; color: #ccc; }
.score-badge { background-color: #444; font-weight: bold; min-width: 25px; text-align: center; }
.fire { color: #FF5722; font-weight: bold; }

/* --- 通知 Toast --- */
#notificationContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-alert {
    background: #252525;
    border-left: 5px solid #888;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    color: #fff;
}

.toast-alert.bull { border-left-color: #4CAF50; }
.toast-alert.bear { border-left-color: #F44336; }

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.toast-title-text { font-weight: bold; font-size: 1.1em; }
.toast-time { font-size: 0.8em; color: #888; }
.toast-close { cursor: pointer; color: #666; font-size: 1.2em; }
.toast-close:hover { color: #fff; }

.toast-body span.added { color: #4CAF50; }
.toast-body span.removed { color: #F44336; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- Modal 通用 --- */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
}

.modal-content {
    background-color: #1e1e1e;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #444;
    width: 90%; max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    color: #ddd;
    position: relative;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover { color: #fff; }

.setting-item {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.setting-item.column { flex-direction: column; align-items: flex-start; gap: 10px; }

input[type="text"], select {
    background: #333; border: 1px solid #555; color: white; padding: 8px; border-radius: 4px; width: 100%;
}

.action-btn {
    width: 100%;
    padding: 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
.action-btn:hover { background: #1976D2; }

.secondary-btn {
    padding: 8px 16px;
    background: #444;
    color: #ddd;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.secondary-btn:hover { background: #555; }

.switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: #2196F3; }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

hr { border: 0; border-top: 1px solid #444; margin: 20px 0; }
.status-small { font-size: 0.85em; margin: 0; }

/* --- 圖表 Modal 樣式 --- */
.chart-modal-content {
    background: #1a1a2e;
    color: #fff;
    border: 1px solid #333;
}
.chart-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.chart-logo-text { font-weight: bold; color: #4CAF50; font-style: italic; }
.chart-summary {
    display: flex; gap: 15px; margin-bottom: 15px; font-size: 0.9em;
    color: #ccc; background: #252547; padding: 10px; border-radius: 8px;
}
.highlight-score { color: #FFD700; }
.chart-container { height: 300px; }
.save-btn {
    width: 100%; margin-top: 15px; background: #2196F3;
    display: flex; justify-content: center; align-items: center; gap: 5px;
    border: none; padding: 10px; color: white; border-radius: 5px;
    cursor: pointer; font-size: 1rem;
}
.save-btn:hover { background: #1976D2; }

/* --- Tab 按鈕樣式 --- */
.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-btn:hover {
    color: #fff;
    background-color: #333;
}

.tab-btn.active {
    color: #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
}

/* --- 價目表 (Pricing) --- */
.pricing-content {
    max-width: 800px;
    background: #1a1a1a;
    margin-bottom: 50px; 
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.plan-card {
    background: #252525;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.plan-card.free { border-top: 4px solid #888; }
.plan-card.pro {
    border: 1px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
    transform: scale(1.02);
}
.plan-card.ultra {
    border: 1px solid #E040FB;
    box-shadow: 0 0 15px rgba(224, 64, 251, 0.15);
}

.popular-tag {
    position: absolute; top: -12px; left: 50%;
    transform: translateX(-50%);
    background: #FFD700; color: #000;
    font-size: 0.8rem; font-weight: bold;
    padding: 4px 10px; border-radius: 20px;
}

.plan-header h3 { margin: 10px 0; font-size: 1.5rem; }
.plan-header .price { font-size: 1.4rem; font-weight: bold; margin-bottom: 20px; }
.plan-header .price span { font-size: 0.8rem; color: #888; font-weight: normal; }

.plan-features {
    text-align: left; margin-bottom: 20px; flex-grow: 1;
}
.plan-features li {
    border-bottom: 1px solid #333; padding: 8px 0; font-size: 0.9rem;
}
.plan-features li:last-child { border: none; }
.plan-features li.limit { color: #aaa; font-size: 0.85em; }

.plan-btn {
    display: block; width: 100%; padding: 10px;
    border-radius: 6px; text-decoration: none;
    font-weight: bold; margin-top: auto;
    border: none; cursor: pointer;
}

.plan-btn.disabled { background: #333; color: #666; cursor: default; }
.plan-btn.pro-btn { background: #FFD700; color: #000; }
.plan-btn.pro-btn:hover { background: #FFC107; }
.plan-btn.ultra-btn { background: linear-gradient(45deg, #7C4DFF, #E040FB); color: white; }
.plan-btn.ultra-btn:hover { opacity: 0.9; }

/* --- 🔥 使用手冊 (Guide) 專用樣式 🔥 --- */
.guide-content {
    max-width: 700px;
    background: #1a1a1a;
}

.guide-scroll-area {
    padding: 10px;
}

.guide-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}
.guide-section:last-child {
    border-bottom: none;
}

.guide-section h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.guide-section p {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 10px;
}

.guide-list li {
    margin-bottom: 8px;
    padding-left: 10px;
    border-bottom: none; /* 覆蓋全域設定 */
    display: block;      /* 覆蓋全域 flex */
}

.score-explain p {
    background: #252525;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #4CAF50;
}

.faq-item {
    background: #252525;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.faq-item h4 {
    margin: 0 0 10px 0;
    color: #FFD700;
}

.faq-item .answer {
    color: #ddd;
    margin: 0;
}

/* --- 手機 RWD --- */
@media (max-width: 600px) {
    .icon-group { position: static; justify-content: center; margin-top: 15px; }
    .logo-area { flex-direction: column; gap: 10px; }
    .logo-text { text-align: center; }
    .main-logo { width: 80px; }
    
    .plan-card.pro { transform: none; }
    
    .modal-content {
        margin: 20px auto; 
        width: 95%; 
        max-height: 90vh; 
    }
}

/* ... (保留上面的所有代碼) ... */

/* --- 🔥 日誌 (Log) 專用樣式 🔥 --- */
#logBtn { opacity: 0.8; }
#logBtn:hover { opacity: 1; transform: scale(1.1); }

.log-content {
    max-width: 500px;
    background: #1a1a1a;
    max-height: 80vh; /* 限制高度 */
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.log-header h2 { margin: 0; font-size: 1.3rem; }

.clear-btn {
    background: none; border: 1px solid #444; 
    color: #888; padding: 4px 8px; border-radius: 4px; 
    cursor: pointer; font-size: 0.8rem;
}
.clear-btn:hover { background: #333; color: #fff; }

.log-list-container {
    flex-grow: 1;
    overflow-y: auto; /* 讓列表可以捲動 */
    padding-right: 5px; /* 預留捲軸空間 */
}

/* 捲軸美化 */
.log-list-container::-webkit-scrollbar { width: 6px; }
.log-list-container::-webkit-scrollbar-track { background: #1a1a1a; }
.log-list-container::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

.log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.95rem;
}
.log-row:last-child { border-bottom: none; }

.log-time {
    color: #666;
    font-size: 0.8rem;
    min-width: 50px;
}

.log-info {
    flex-grow: 1;
    margin: 0 10px;
    color: #ddd;
}

.log-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    white-space: nowrap;
}

/* 標籤顏色 */
.tag-bull-add { background: rgba(76, 175, 80, 0.2); color: #4CAF50; border: 1px solid #4CAF50; }
.tag-bull-del { color: #666; font-style: italic; }
.tag-bear-add { background: rgba(244, 67, 54, 0.2); color: #F44336; border: 1px solid #F44336; }
.tag-bear-del { color: #666; font-style: italic; }
.tag-surge { background: linear-gradient(45deg, #FFD700, #FF9800); color: #000; font-weight: bold; box-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }

.empty-log {
    text-align: center;
    color: #555;
    padding: 30px 0;
    font-style: italic;
}

/* 強制去除日誌按鈕背景 */
#logBtn {
    background: transparent !important;
    border: none !important;
}
