/* 基本重置與字體設定 */
body {
    font-family: '微軟正黑體', 'Microsoft JhengHei', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    /* 依據您的要求設定底色 C8EBFA */
    background-color: #C8EBFA; 
    color: #333;
}

.container {
    max-width: 1200px; /* 限制網頁最大寬度 */
    margin: 0 auto;
    padding: 20px;
    background-color: #fff; /* 內容區塊背景保留為白色，突出內容 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 標題與區塊樣式 */
header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 3px solid #0056b3;
    margin-bottom: 20px;
}

header h1 {
    color: #0056b3;
    font-size: 2em;
}

h2 {
    color: #0056b3;
    border-left: 5px solid #0056b3;
    padding-left: 10px;
    margin-top: 30px;
    margin-bottom: 15px;
}

h3.table-title {
    color: #555;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    /* 移除標題框線 */
    border: none; 
    padding: 0;
}

.section-block p, .section-block li {
    margin-bottom: 15px;
    text-align: justify;
}

/* 表格樣式 */
.table-container {
    margin: 20px 0;
    overflow-x: auto; /* RWD 關鍵: 啟用水平滾動，避免表格在手機上溢出 */
    
    /* 讓表格靠左居中，並只佔據所需寬度 */
    display: table; /* 讓容器寬度只包住內容 */
    margin-left: 0; /* 靠左對齊 */
}

.responsive-table {
    /* 設置為 auto 讓表格只佔用內容所需的寬度 */
    width: auto; 
    border-collapse: collapse; /* 確保框線是單一線條 */
    margin: 0;
}

.responsive-table th, .responsive-table td {
    /* *** 調整欄高的關鍵：減少 padding 的上下間距 *** */
    border: 1px solid #333; 
    padding: 8px 8px; /* 上下 8px，左右 8px */
    text-align: center;
}

.responsive-table th[scope="row"] {
    background-color: #f1f7ff;
    color: #0056b3;
    font-weight: bold;
}

.responsive-table th:not(:first-child), .responsive-table td:not(:first-child) {
    width: 80px; /* 稍微限定數值欄位的最大寬度 */
}

.responsive-table th:first-child,
.responsive-table td:first-child {
    min-width: 90px; /* 讓標題欄寬一些以免擠壓 */
    white-space: nowrap;
}


.responsive-table th {
    background-color: #e0f2ff; /* 淺藍色表頭，與主體顏色呼應 */
    color: #0056b3;
    font-weight: bold;
}

.responsive-table tr:nth-child(even) {
    background-color: #f9f9f9; /* 斑馬紋樣式 */
}

/* 移除表格底部空白 */
.table-container + p {
    margin-top: 20px;
}

/* 讓多張表格橫向排列，手機時自動換行 */
.table-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.table-card {
    flex: 1 1 320px;
    min-width: 280px;
}


/* 頁尾樣式 */
footer {
    border-top: 1px solid #ccc;
    padding-top: 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.contact-info a {
    color: #0056b3;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* RWD 響應式設計：媒體查詢 (Media Queries) */

/* 針對小螢幕設備 (如手機) 進行調整，最大寬度 768px */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5em; /* 縮小主標題字體 */
    }

    /* 在小螢幕上，讓表格容器佔滿寬度，以確保滾動條可用 */
    .table-container {
        width: 100%;
    }

    /* 調整表格字體和內距，使其在小螢幕上更緊湊 */
    .responsive-table th, .responsive-table td {
        padding: 6px 5px; /* 在手機上進一步減少內距 */
        font-size: 0.9em;
    }
}

/* 針對極小螢幕設備 (如窄版手機) 進行調整，最大寬度 480px */
@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.2em;
    }
    
    h2 {
        font-size: 1.5em;
    }

    .responsive-table th, .responsive-table td {
        font-size: 0.8em;
    }
}
