/* 重置與基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 頁首樣式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(90deg, #2c7be5 0%, #1a5fc1 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(44, 123, 229, 0.2);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 計算器卡片 */
.calculator-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .calculator-card {
        grid-template-columns: 1fr;
    }
}

.input-section, .result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2c7be5;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #495057;
}

/* 輸入區域樣式 */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.input-with-unit:focus-within {
    border-color: #2c7be5;
}

.input-with-unit input {
    flex: 1;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-family: 'Noto Sans TC', sans-serif;
    outline: none;
}

.unit {
    background: #f8f9fa;
    padding: 15px 20px;
    color: #6c757d;
    font-weight: 500;
}

.slider-container {
    margin-top: 15px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2c7be5;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Noto Sans TC', sans-serif;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:focus {
    border-color: #2c7be5;
    outline: none;
}

.city-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.city-info p {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-display {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.rate-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c7be5;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.rate-note {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 按鈕樣式 */
button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(90deg, #2c7be5 0%, #1a5fc1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

button:hover {
    background: linear-gradient(90deg, #1a5fc1 0%, #0f4a9c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 123, 229, 0.3);
}

button:active {
    transform: translateY(0);
}

/* 結果區域樣式 */
.result-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: linear-gradient(90deg, rgba(44, 123, 229, 0.1) 0%, rgba(26, 95, 193, 0.1) 100%);
    border-radius: 8px;
    padding: 15px;
    margin: 10px -10px;
    border: 2px solid #2c7be5;
}

.result-label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c7be5;
}

.highlight .result-value {
    color: #1a5fc1;
    font-size: 1.6rem;
}

.formula-display {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.formula p {
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #2c7be5;
}

/* 數據表格區域 */
.data-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(90deg, #2c7be5 0%, #1a5fc1 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

td {
    padding: 15px;
}

/* 費率表格特殊樣式 */
.tariff-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.tariff-table tbody tr:hover {
    background-color: #e8f4ff;
}

.tariff-value {
    font-weight: 700;
    color: #2c7be5;
    font-size: 1.1rem;
}

.data-note {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    margin-top: 15px;
}

/* 頁尾樣式 */
footer {
    text-align: center;
    padding: 25px;
    background: #495057;
    color: white;
    border-radius: 15px;
    margin-top: 20px;
}

footer p {
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

/* 響應式調整 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .rate-value {
        font-size: 1.8rem;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
    
    .highlight .result-value {
        font-size: 1.4rem;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-section, .result-section, .data-section {
    animation: fadeIn 0.5s ease-out;
}
