body {
    font-family: Arial, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    line-height: 1.6;
}
h1 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 30px;
}
.tabs {
    display: flex;
    justify-content: center;  /* 新增這行：水平置中 */
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 5px;
}
.tab {
    padding: 12px 24px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 5px 5px 0 0;
    background-color: #e9e9e9;
    font-weight: bold;
    transition: all 0.3s;
    flex: 0 0 auto;         /* 防止 tab 被拉伸 */
    margin: 0 2px;          /* 微調間距 */
}
.tab.active {
    background-color: #4CAF50;
    color: white;
    border-bottom: none;
}
.converter {
    border: 1px solid #ccc;
    padding: 25px;
    border-radius: 0 5px 5px 5px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.conversion-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}
input, select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 120px;
}
button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #45a049;
}
.result-container {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.result-box {
    padding: 15px;
    background-color: #e9f7ef;
    border-radius: 5px;
    font-size: 16px;
}
.comparison-result {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    font-size: 18px;
}
.price-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.price-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.highlight {
    color: #e74c3c;
    font-weight: bold;
}
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}
.unit-item {
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
}
.additional-results {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 15px;
}
/* 手機版 */
@media (max-width: 768px) {
    .tab {
        padding: 12px 8px;  /* 手機版：左右 8px */
    }
    .conversion-group {
        flex-direction: column;
        align-items: flex-start;
    }
    input, select, button {
        width: 100%;
    }
    .price-inputs {
        grid-template-columns: 1fr;
    }
    .result-container {
        grid-template-columns: 1fr;
    }
}
/* 頁腳樣式 */
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 12px;
}

.footer-left {
    text-align: left;
    margin: 0;
    color: #666;
}

.footer-center {
    text-align: center;
    margin: 0;
    color: #666;
}

.footer-right {
    text-align: right;
    margin: 0;
    color: #666;
}