/* --- 保留所有先前的 CSS 樣式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.calculator-container {
    background-color: #ffffff;
    padding: 25px 35px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 550px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.description {
    text-align: center;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.5;
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

legend {
    font-weight: bold;
    color: #3498db;
    padding: 0 10px;
    font-size: 1.1em;
}

.input-group, .target-group {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.target-group {
    grid-template-columns: 100px 1fr 120px;
}

label, .param-label {
    font-weight: 500;
    color: #555;
    text-align: right;
}

.param-control {
    position: relative;
}

select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fcfcfc;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.auto-result {
    display: none;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #e9f5ff;
    color: #2980b9;
    font-weight: bold;
    border: 1px dashed #aed6f1;
    min-height: 21px;
    box-sizing: border-box;
    width: 100%;
    text-align: center;
}

.auto-result.out-of-range {
    color: #e74c3c;
    border-color: #f5b7b1;
    background-color: #fdedec;
}

.param-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.param-mode label {
    cursor: pointer;
    padding: 5px;
}

.param-mode input[type="radio"] {
    margin-right: 5px;
}

.input-group:last-child, .target-group:last-child {
    margin-bottom: 0;
}


/* --- 新增的上傳模組樣式 --- */
.upload-section {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.upload-button:hover {
    background-color: #2980b9;
}

.exif-status {
    font-size: 0.9em;
    margin: 10px 0 0 0;
    min-height: 1.2em;
}
.exif-status.success {
    color: #27ae60;
}
.exif-status.error {
    color: #e74c3c;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: none; /* 預設隱藏 */
}