﻿/* _SharedStyles.css */
/* 這是所有知識庫文章頁面共用的樣式檔案 */

/* 1. 根變數與基礎設定 */
:root {
    --primary-color: #1E3A8A; /* 主色調 - 深藍 */
    --accent-color: #FACC15; /* 強調色 - 黃色 */
    --light-bg-color: #F3F4F6; /* 淺色背景 */
    --dark-bg-color: #111827; /* 深色背景 (用於圖表等) */
    --text-dark: #374151; /* 深色文字 */
    --text-light: #F9FAFB; /* 淺色文字 */
    --text-muted: #6c757d;
    --text-muted-custom: #6B7280; /* 輔助文字顏色 */
    --danger-color: #c0392b; /* 危險/警示色 */
    --success-color: #27ae60; /* 成功色 */
}

body {
    font-family: 'Noto Serif TC', 'Open Sans', serif;
    background-color: var(--light-bg-color);
    color: var(--text-dark);
    line-height: 2.1;
    font-size: 1.15rem;
    margin: 0;
    padding-top: 80px; /* 為固定導覽列預留空間 */
}

/* 2. 排版樣式 (標題、段落等) */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', 'Noto Sans TC', sans-serif;
    font-weight: 700;
    line-height: 1.5;
}

h1 {
    font-size: 3rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2em;
    color: var(--primary-color);
    margin-top: 50px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

h3 {
    font-size: 1.5em;
    color: #333;
    margin-top: 40px;
    border-left: 4px solid var(--accent-color);
    padding-left: 15px;
}

p {
    font-size: 1.1em;
    margin-bottom: 1.8em;
    text-indent: 2em;
}

/* 3. 頁面主要容器 */
.article-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 50px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-header h1 {
    margin: 0;
    text-align: center;
}

.article-header p, .article-header h2 { /* h2 用於舊版頁面兼容 */
    font-size: 1.3rem;
    text-align: center;
    color: var(--text-muted-custom);
    font-family: 'Open Sans', sans-serif;
    font-style: italic;
    font-weight: 400;
    margin-top: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 25px;
}

.article-body {
    margin-top: 30px;
}

    .article-body h4 {
        background-color: #eaf2f8; /* 使用與引用區塊相似的淡藍色背景 */
        color: var(--primary-color); /* 文字使用主色調 */
        padding: 12px 20px; /* 增加內邊距，使其有呼吸空間 */
        margin-top: 40px;
        margin-bottom: 25px; /* 調整與下方段落的間距 */
        border-left: 5px solid var(--accent-color); /* 使用強調色的左邊框 */
        border-radius: 5px; /* 圓角使其更柔和 */
        font-size: 1.4em; /* 設定合適的字體大小 */
        font-weight: 700; /* 加粗 */
    }

/* 4. 固定式章節導覽列 */
.chapter-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    height: 60px;
}

.nav-item {
    flex: 1;
    text-align: center;
}

    .nav-item.title {
        font-family: 'Montserrat', sans-serif;
        font-weight: 700;
        font-size: 1.2rem;
        color: var(--accent-color);
        text-decoration: none;
    }

.nav-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .nav-link.disabled {
        color: rgba(255, 255, 255, 0.4);
        cursor: not-allowed;
        pointer-events: none;
    }

/* 5. 特殊內容區塊 */
blockquote {
    font-size: 1.3em;
    font-style: italic;
    margin: 50px;
    padding: 25px;
    border-left: 5px solid var(--primary-color);
    background-color: #eaf2f8;
    color: var(--primary-color);
}


/* 里歐的分析日誌 */
.narrator-thought {
    background-color: #fff9e6;
    border: 1px solid var(--accent-color);
    padding: 25px;
    margin: 40px 0;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
}

    .narrator-thought h3 {
        margin-top: 0;
        color: #b7950b;
        font-family: 'Noto Serif TC', serif;
        border-left: none; /* 覆寫 h3 預設樣式 */
        padding-left: 0;
    }


.example-box {
    background-color: #f0f4f8;
    border: 1px solid #d3e0ea;
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
}

    .example-box h4 {
        margin-top: 0;
        color: var(--primary-color);
        font-size: 1.3em;
        border-left: none;
        padding-left: 0;
        border-bottom: 2px solid var(--accent-color);
        padding-bottom: 8px;
    }

    .example-box ul {
        padding-left: 20px;
        font-size: 1em;
    }

.definition-box {
    background-color: #e6f7ff; /* Light blue background */
    border-left: 5px solid #007bff; /* Blue left border */
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

    .definition-box h3 {
        color: #007bff;
        margin-top: 0;
    }

    .definition-box p {
        margin-bottom: 0;
    }

/* 行為經濟學透鏡 (theory-box) */
.theory-box { /* 新增一個類別，視覺上模擬 psychology-insight 但可單獨控制 */
    background-color: #fffbeb;
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    margin-top: 30px; /* 確保與上方內容有間距 */
    border-radius: 4px;
}

    .theory-box .theory-title { /* 心理學透鏡的標題 */
        font-family: 'Noto Serif TC', serif;
        color: #b7950b; /* 與 _SharedStyles.css 中的 .psychology-insight strong 顏色一致 */
        font-size: 1.3em;
        margin-top: 0;
        margin-bottom: 10px;
        border-left: none; /* 覆寫 _SharedStyles.css 的 h3 預設樣式 */
        padding-left: 0; /* 覆寫 _SharedStyles.css 的 h3 預設樣式 */
    }

    .theory-box p {
        font-size: 1.1em; /* 與外層 p 一致 */
        line-height: 1.8;
        text-indent: 0; /* 取消縮排 */
        margin-bottom: 0; /* 移除額外間距 */
    }

    .theory-box strong {
        color: #b7950b; /* 與 _SharedStyles.css 中的 .psychology-insight strong 顏色一致 */
        font-family: 'Noto Serif TC', serif;
    }

/* 修改後的 .psychology 樣式 */
.psychology {
    /* 調整底色為更淺的藍色，與 .scenario (淡藍) 和 .theory-box (淺米黃) 區分 */
    background-color: #e6f7ff; /* 更淺、更清爽的淡藍色 */
    padding: 15px;
    border-left: 5px solid var(--accent-color);
    margin-top: 20px;
    border-radius: 5px;
    font-style: italic;
    color: #4a6c8e; /* 調整文字顏色以配合新底色，使其更清晰可讀 */
}

/* 為了確保與 .scenario (淺藍色) 呼應，且不衝突 */
.scenario {
    background-color: #eaf2f8; /* 保持不變，淺藍色 */
    padding: 15px;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 20px;
    border-radius: 5px;
}

.analysis {
    margin-top: 15px;
    padding: 15px;
    background: #eaf2f8;
    border-radius: 5px;
    border: 1px solid #aed6f1;
}

.scenario-header {
    background-color: rgba(30, 58, 138, 0.1); /* 使用 var(--primary-color) 的 rgba 透明度 */
    padding: 20px;
    margin: -35px -35px 25px -35px; /* 擴展到父容器邊緣 */
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid var(--primary-color);
}

    .scenario-header h4 {
        margin: 0;
        color: var(--text-dark);
        font-size: 1.4em;
        font-weight: bold;
    }

.scenario-summary {
    background-color: #fff3cd; /* 特定顏色 */
    border: 1px solid #ffeaa7; /* 特定顏色 */
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
}

/* 網格佈局 */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* 參與者分析卡片 */
.participant-analysis {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    display: flex; /* 讓內部內容垂直排列 */
    flex-direction: column;
}

    .participant-analysis:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .participant-analysis h4 { /* 將 h5 改為 h4，與標題層級保持一致 */
        margin-top: 0;
        color: var(--text-dark);
        font-size: 1.3em;
        border-bottom: 2px solid #ecf0f1;
        padding-bottom: 12px;
        margin-bottom: 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

.status-tag {
    font-size: 0.75em;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 15px;
    color: white;
    margin-left: 10px;
}

.status-neutral {
    background-color: var(--text-muted-custom);
}

.status-loss {
    background-color: var(--danger-color);
}

.status-profit {
    background-color: var(--success-color);
}

.status-high-conviction {
    background-color: var(--primary-color);
}

.status-low-conviction {
    background-color: var(--text-muted-custom);
}

.status-testing {
    background-color: var(--accent-color);
}

.status-reversal {
    background-color: #6f42c1;
}
/* 紫色表示反轉 */

.behavior-pattern {
    border-left: 3px solid #17a2b8;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 0;
    border-radius: 0 5px 5px 0;
}

    .behavior-pattern strong {
        color: #17a2b8;
        display: block;
        margin-bottom: 5px;
    }

/* 將舊的 status-tag 顏色映射到變數 */
.status-neutral {
    background-color: var(--text-muted-custom);
}

.status-loss {
    background-color: var(--danger-color);
}

.status-profit {
    background-color: var(--success-color);
}

.status-mixed {
    background-color: var(--accent-color);
}

/* 行為模式區塊 */
.behavior-pattern {
    /* 移除背景色，使其與父容器融合 */
    border-left: 3px solid #17a2b8; /* 特定顏色 */
    padding: 15px;
    margin-top: 20px; /* 統一間距 */
    margin-bottom: 0;
    border-radius: 0 5px 5px 0;
}

    .behavior-pattern strong {
        color: #17a2b8; /* 特定顏色 */
        display: block; /* 讓標題獨佔一行 */
        margin-bottom: 5px;
    }

    .behavior-pattern p, .behavior-pattern ul {
        font-size: 1rem; /* 略小於主內容字體 */
        line-height: 1.7;
        text-indent: 0; /* 取消首行縮排 */
        margin-bottom: 0.8em;
    }

    .behavior-pattern ul {
        padding-left: 20px;
    }

    .behavior-pattern li {
        margin-bottom: 5px;
    }

/* 風險警示區塊 */
.risk-warning {
    background-color: #fff5f5; /* 特定顏色 */
    border: 2px solid #fed7d7; /* 特定顏色 */
    border-left: 6px solid var(--danger-color);
    padding: 20px;
    margin-top: 20px; /* 統一間距 */
    margin-bottom: 0;
    border-radius: 8px;
}

    .risk-warning strong {
        color: var(--danger-color);
        display: block; /* 讓標題獨佔一行 */
        margin-bottom: 5px;
    }

    .risk-warning p {
        font-size: 1rem;
        line-height: 1.7;
        text-indent: 0;
        margin-bottom: 0;
    }

/* 策略建議區塊 */
.strategy-suggestion {
    background-color: #f0fff4; /* 特定顏色 */
    border: 2px solid #c6f6d5; /* 特定顏色 */
    border-left: 6px solid var(--success-color);
    padding: 20px;
    margin-top: 20px; /* 統一間距 */
    margin-bottom: 0;
    border-radius: 8px;
}

    .strategy-suggestion strong {
        color: var(--success-color);
        display: block; /* 讓標題獨佔一行 */
        margin-bottom: 5px;
    }

    .strategy-suggestion p, .strategy-suggestion ul {
        font-size: 1rem;
        line-height: 1.7;
        text-indent: 0;
        margin-bottom: 0;
    }

    .strategy-suggestion ul {
        padding-left: 20px;
    }

    .strategy-suggestion li {
        margin-bottom: 5px;
    }


/* 響應式設計 */
@@media (max-width: 768px) {
    .article-container {
        padding: 20px;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8em;
    }
}