:root {
    --primary: #4a90e2;
    --bg: #f3f6fb;
    --white: #fff;
    --gray: #6c757d;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.calculator {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
    width: 480px;
}

.calculator h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

input[type="number"], select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box; /* 確保填充和邊框不會影響寬度 */
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray);
}

input[type="checkbox"] {
    transform: scale(1.2);
    margin-right: 0.5rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

button {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.1rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #357ab7;
}

.reset {
    background-color: #ccc;
}

.reset:hover {
    background-color: #999;
}

.result {
    margin-top: 1.5rem;
    background: #eef2f7;
    padding: 1rem 1.5rem;
    border-radius: 12px;
}

.result h3 {
    margin-top: 0;
    color: var(--primary);
}

.result p {
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 1rem 0;
}

.fade {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 特別處理 select 標籤，去除下拉框樣式 */
select {
    -webkit-appearance: none; /* 去掉 Safari 和 Chrome 預設的下拉樣式 */
    -moz-appearance: none;    /* 去掉 Firefox 預設的下拉樣式 */
    appearance: none;         /* 去掉其他瀏覽器的預設樣式 */
    padding-right: 30px;      /* 為下拉框增加一些內邊距，避免文字過長 */
}