
body {
    font-family: '微軟正黑體', 'Microsoft JhengHei', Arial, sans-serif;
    background-color: #f4f6f9;
}

/* --- 側邊欄與 RWD 設定 --- */
.sidebar {
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    position: fixed;
    width: 250px;
    padding-top: 20px;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s;
}
.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding-bottom: 20px;
    }
    .main-content {
        margin-left: 0;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .top-bar-right {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .top-bar-right .text-secondary {
        margin-top: 0;
    }
    .mohw-logo {
        height: 28px;
    }
}

.sidebar h3 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #ecf0f1;
    font-weight: bold;
    padding: 0 10px;
}
.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 1rem;
    color: #bdc3c7;
    display: block;
    transition: 0.3s;
    border-left: 4px solid transparent;
}
.sidebar a:hover {
    color: #fff;
    background-color: #34495e;
}
.sidebar a.active {
    background-color: #3498db;
    color: white;
    border-left: 4px solid #fff;
}

/* --- 頂部導覽列 --- */
.top-bar {
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.mohw-logo {
    height: 35px;
    width: auto;
}

/* --- 子主題導航 --- */
.sub-theme-nav {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 5px;
}
.sub-theme-nav .nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.sub-theme-nav .nav-link {
    color: #555;
    border-radius: 20px;
    font-size: 0.95rem;
    padding: 8px 16px;
    background-color: #f8f9fa;
    transition: all 0.2s;
}
.sub-theme-nav .nav-link:hover {
    background-color: #e2e6ea;
}
.sub-theme-nav .nav-link.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.4);
}

/* --- 卡片與圖表 --- */
.badge-year {
    font-size: 0.8rem;
    background-color: #eef2f7;
    color: #555;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}
.info-icon {
    color: #95a5a6;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 5px;
    transition: color 0.3s;
}
.info-icon:hover {
    color: #3498db;
}
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 450px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}
.chart-body {
    flex-grow: 1;
    width: 100%;
    position: relative;
}

/* --- 風險主題專用樣式 --- */
.border-risk {
    border-top: 4px solid #e74c3c;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
}
.text-risk {
    color: #c0392b !important;
}

/* --- 總覽頁卡片樣式 --- */
.overview-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s;
    height: 100%;
    border: 1px solid #eee;
    cursor: pointer;
    text-decoration: none !important;
    color: inherit;
    display: block;
}
.overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}
.overview-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    background-color: #fcfcfc;
    border-radius: 10px 10px 0 0;
}
.overview-icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: #3498db;
}
.overview-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
}
.overview-body {
    padding: 20px;
}
.indicator-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}
.indicator-list li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}
.indicator-list li::before {
    content: "•";
    color: #bdc3c7;
    position: absolute;
    left: 0;
    font-weight: bold;
}
.btn-view {
    font-size: 0.85rem;
    color: #3498db;
    font-weight: bold;
    margin-top: 10px;
    display: inline-block;
}
.overview-card:hover .btn-view {
    text-decoration: underline;
}

/* --- KPI Card --- */
.card-kpi {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    background: white;
}
.card-kpi:hover {
    transform: translateY(-5px);
}
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}
.kpi-label {
    color: #7f8c8d;
    font-size: 1rem;
    font-weight: 600;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4em;
}
.kpi-icon-bg {
    font-size: 4rem;
    opacity: 0.1;
    position: absolute;
    right: -10px;
    bottom: -10px;
    transform: rotate(-15deg);
}
.card-kpi-danger {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-left: 5px solid #e74c3c;
}
.card-kpi-danger .kpi-value {
    color: #c0392b;
}
.card-kpi-danger .kpi-icon-bg {
    color: #e74c3c;
    opacity: 0.15;
}

/* --- 首頁樣式 --- */
.hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}
.hero-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}
.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}
.hero-bg-icon {
    position: absolute;
    right: 20px;
    bottom: -20px;
    font-size: 10rem;
    opacity: 0.1;
    transform: rotate(10deg);
}
.home-stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: 100%;
}
.home-stat-num {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}
.home-stat-label {
    color: #7f8c8d;
    font-weight: bold;
}
.home-category-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
    height: 100%;
    position: relative;
    border: 1px solid #eee;
    text-decoration: none !important;
    display: block;
    color: inherit;
    overflow: hidden;
}
.home-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.theme-health { border-top: 5px solid #2ecc71; }
.theme-health .cat-icon { color: #2ecc71; }
.theme-social { border-top: 5px solid #3498db; }
.theme-social .cat-icon { color: #3498db; }
.theme-liberty { border-top: 5px solid #e74c3c; }
.theme-liberty .cat-icon { color: #e74c3c; }
.theme-opinion { border-top: 5px solid #f39c12; }
.theme-opinion .cat-icon { color: #f39c12; }
.theme-torture { border-top: 5px solid #9b59b6; }
.theme-torture .cat-icon { color: #9b59b6; }
/* ★ V40 新增：居住權主題色 (陶土色/暖赭色) */
.theme-housing { border-top: 5px solid #e17055; }
.theme-housing .cat-icon { color: #e17055; }

.theme-pending { border-top: 5px solid #95a5a6; background: #fdfdfd; }
.theme-pending .cat-icon { color: #95a5a6; }

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.cat-icon {
    font-size: 2.5rem;
}
.cat-status {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
}
.status-live { background-color: #e8f8f5; color: #2ecc71; }
.status-soon { background-color: #f2f3f4; color: #95a5a6; }
.cat-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}
.cat-desc {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 20px;
    min-height: 3em;
}
.cat-btn {
    display: block;
    text-align: center;
    padding: 8px 0;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: #555;
    font-weight: bold;
    transition: all 0.2s;
}
.home-category-card:hover .cat-btn {
    background-color: #3498db;
    color: white;
}
.theme-pending:hover .cat-btn {
    background-color: #95a5a6;
    color: white;
    cursor: default;
}

/* --- 多元族群卡片 --- */
.card-diversity {
    border: 1px solid #eee;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s;
}
.card-diversity:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.div-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.div-title {
    font-weight: bold;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 5px;
}
.div-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}
.progress-slim {
    height: 6px;
    border-radius: 3px;
    margin-top: 10px;
    background-color: #ecf0f1;
}
