body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* 響應式表格容器 */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

table {
    border-collapse: collapse;
    width: 95%;
    min-width: 1200px; /* 增加最小寬度適應更大的圖片 */
    margin: 30px auto;
    text-align: center;
    font-size: 14px;
    border: 5px solid black;
}

th, td {
    border: 2px solid black;
    padding: 6px;
    vertical-align: middle;
}

thead th {
    border: 2px solid black;
    font-weight: bold;
}

/* 第一列標題：藍底白字 */
thead tr:first-child th {
    background-color: #3366FF;
    color: white;
    font-size: 48px;
    padding: 10px;
    position: relative;
}

/* 單位標籤樣式 */
.unit-label {
    font-size: 18px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* 第二列標題：淺藍底黑字 */
thead tr:nth-child(2) th {
    background-color: #99CDFF;
    color: black;
    font-size: 24px;
    padding: 10px;
}

/* 子欄位行設定 */
.subheader th {
    background-color: #99CDFF;
    color: black;
    font-size: 24px;
    padding: 10px;
    border-top: none;
}

/* 圖片欄設定 - 電腦版加大圖片寬度，高度保持200px */
.outline-cell {
    text-align: left;
    width: 300px; /* 大幅增加寬度容納更大的圖片 */
}

.outline-cell img {
    width: 500px; /* 從350px大幅增加到500px */
    height: 200px; /* 保持200px不變 */
    vertical-align: middle;
    margin-right: 8px;
    cursor: pointer;
    transition: 0.3s;
    max-width: 100%; /* 確保圖片響應式 */
    height: auto; /* 保持比例 */
    object-fit: contain; /* 確保圖片完整顯示，不會變形 */
}

.outline-cell img:hover {
    opacity: 0.7;
    transform: scale(1.05); /* 添加懸停放大效果 */
}

/* 資料內容字型 20px 且加粗 */
tbody td {
    font-size: 20px;
    font-weight: bold;
}

/* 圖片放大Modal樣式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px; /* 進一步增加最大寬度 */
    max-height: 90%;
    margin-top: 2%;
    animation: zoom 0.3s;
    object-fit: contain; /* 確保Modal中的圖片不會變形 */
}

@keyframes zoom {
    from {transform: scale(0.8)}
    to {transform: scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    transform: scale(1.1);
}

/* 大屏幕電腦優化 */
@media (min-width: 1200px) {
    .outline-cell {
        width: 350px; /* 在大屏幕上進一步增加寬度 */
    }
    
    .outline-cell img {
        width: 600px; /* 在大屏幕上圖片更寬 */
        height: 200px; /* 保持200px不變 */
    }
    
    table {
        width: 92%;
        min-width: 1400px; /* 進一步增加最小寬度 */
    }
}

/* 高分辨率屏幕優化 */
@media (min-width: 1400px) {
    table {
        width: 90%;
        max-width: 1600px;
    }
    
    thead tr:first-child th {
        font-size: 52px;
    }
    
    thead tr:nth-child(2) th,
    .subheader th {
        font-size: 26px;
    }
    
    tbody td {
        font-size: 22px;
    }
    
    .outline-cell {
        width: 400px; /* 高分辨率屏幕更大的寬度 */
    }
    
    .outline-cell img {
        width: 700px; /* 高分辨率屏幕更寬的圖片 */
        height: 200px; /* 保持200px不變 */
    }
}

/* 超大屏幕優化 */
@media (min-width: 1920px) {
    .outline-cell {
        width: 450px;
    }
    
    .outline-cell img {
        width: 800px; /* 在超大屏幕上圖片寬度最大化 */
        height: 200px; /* 保持200px不變 */
    }
    
    table {
        min-width: 1800px;
        max-width: 1900px;
    }
}

/* 響應式設計 - 平板設備 */
@media (max-width: 1024px) {
    table {
        width: 98%;
        min-width: 900px;
        margin: 20px auto;
    }
    
    thead tr:first-child th {
        font-size: 36px;
        padding: 8px;
    }
    
    thead tr:nth-child(2) th,
    .subheader th {
        font-size: 20px;
        padding: 8px;
    }
    
    tbody td {
        font-size: 18px;
    }
    
    .outline-cell {
        width: 180px; /* 恢復到原本的寬度 */
    }
    
    .outline-cell img {
        width: 350px; /* 平板設備恢復到原本尺寸 */
        height: 200px;
    }
    
    th, td {
        padding: 5px;
    }
}

/* 響應式設計 - 手機設備 */
@media (max-width: 768px) {
    table {
        width: 100%;
        min-width: 800px;
        margin: 15px 0;
        font-size: 12px;
    }
    
    thead tr:first-child th {
        font-size: 28px;
        padding: 6px;
    }
    
    thead tr:nth-child(2) th,
    .subheader th {
        font-size: 16px;
        padding: 6px;
    }
    
    tbody td {
        font-size: 14px;
    }
    
    .outline-cell {
        width: 120px; /* 手機設備適當縮小 */
    }
    
    .outline-cell img {
        width: 200px; /* 手機設備恢復到適當尺寸 */
        height: 120px; /* 手機設備高度也相應縮小 */
    }
    
    th, td {
        padding: 4px;
    }
    
    .unit-label {
        font-size: 14px;
        right: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin-top: 10%;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

/* 響應式設計 - 小手機設備 */
@media (max-width: 480px) {
    table {
        min-width: 700px;
        margin: 10px 0;
        font-size: 10px;
    }
    
    thead tr:first-child th {
        font-size: 22px;
        padding: 4px;
    }
    
    thead tr:nth-child(2) th,
    .subheader th {
        font-size: 14px;
        padding: 4px;
    }
    
    tbody td {
        font-size: 12px;
    }
    
    .outline-cell {
        width: 100px;
    }
    
    .outline-cell img {
        width: 150px; /* 小手機設備進一步縮小 */
        height: 90px;
    }
    
    th, td {
        padding: 3px;
    }
    
    .unit-label {
        font-size: 12px;
        right: 5px;
    }
}

/* 橫向模式優化 */
@media (max-width: 768px) and (orientation: landscape) {
    .table-container {
        margin: 10px 0;
    }
    
    table {
        min-width: 850px;
    }
    
    .outline-cell img {
        width: 180px; /* 橫向模式寬度稍大 */
        height: 110px;
    }
    
    .modal-content {
        width: 70%;
        margin-top: 2%;
    }
}