body {
    font-family: "Microsoft JhengHei", Arial;
    background: #fef8f1;
    margin: 0;
    padding: 20px;
}

.container {
    margin: auto;
}

.container-main {
    margin-bottom: 80px;
}

.field-label {
    padding-top: 12px;
}

.stock-hint {
    display: block;
    margin-top: 6px;
    color: #04327a;
}

.candidate-panel {
    margin-top: 8px;
}

.align-middle {
    vertical-align: middle;
}

.card {
    max-width: 640px;
    border-radius: 0;
    padding: 16px;
    margin: 0 auto 20px;
    margin-top: 40px;
}

h2,
h3 {
    text-align: center;
    margin-top: 0;
}

.txt_18 {
    font-size: 18px;
}

.txt-org {
    color: #ff623e;
}

table {
    border-collapse: collapse;
}

.form-table {
    max-width: 640px;
    margin: 0 auto;
}

td {
    padding: 10px 0;
    vertical-align: top;
}

.form-table td:first-child,
.result-table td:first-child {
    width: 160px;
    white-space: nowrap;
    padding-right: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #04327a;
}

input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #c6cfdd;
    border-radius: 0;
    background: #fff;
    color: #172b4d;
    font-size: 18px;
    line-height: 44px;
    box-sizing: border-box;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: #04327a;
}

.btn-primary {
    background: #04327a;
    color: #fff;
    border: 1px solid #04327a;
    padding: 10px;
    width: 100%;
    border-radius: 0;
    margin-top: 10px;
    font-size: 18px;
    cursor: pointer;
    letter-spacing: .12em;
    font-weight: 500;
}

.btn-secondary {
    background: #fff;
    border: 1px solid #04327a;
    padding: 10px;
    width: 100%;
    border-radius: 0;
    margin-top: 10px;
    font-size: 18px;
    color: #04327a;
    cursor: pointer;
    letter-spacing: .12em;
    font-weight: 500;
}

.btn-clear {
    background: #fff;
    color: #04327a;
    border: 1px solid #04327a;
    padding: 10px;
    width: 100%;
    border-radius: 0;
    margin-top: 10px;
    font-size: 18px;
    cursor: pointer;
    letter-spacing: .12em;
    font-weight: 500;
    margin-left: 16px;
    margin-right: 16px;
}

.btn-secondary:hover,
.btn-clear:hover {
    background: #04327a;
    color: #fff;
}

.btn-apply {
    background: #fff;
    color: #ff623e;
    border: 1px solid #ff623e;
    padding: 10px;
    width: 100%;
    border-radius: 0;
    margin-top: 10px;
    font-size: 18px;
    cursor: pointer;
    letter-spacing: .12em;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-apply:hover {
    background: #ff623e;
    color: #fff;
}

.error {
    color: #ff623e;
    font-size: 14px;
}

.error-hidden {
    display: none;
}

.income-unit {
    padding-left: 8px;
}

.txt_output {
    font-size: 36px;
    font-weight: bold;
    color: #ff623e;
}

input.input-fixed {
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

select.input-fixed {
    width: 100%;
    max-width: 264px;
    height: 44px;
    padding: 0 36px 0 12px;
    border: 1px solid #c6cfdd;
    border-radius: 0;
    background: #fff;
    color: #172b4d;
    font-size: 16px;
    line-height: 44px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #5f6f8a 50%), linear-gradient(135deg, #5f6f8a 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

.action-row {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.result-table {
    max-width: 420px;
    margin: 0 auto;
}

.result-actions {
    max-width: 420px;
    margin: 14px auto 0;
    gap: 24px;
}

.action-row .btn-primary,
.action-row .btn-clear {
    margin-top: 10px;
}

.unit-input {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 320px;
}

.unit-input .input-fixed {
    flex: 1;
    min-width: 0;
}

.unit-label {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 16px;
}

.intro-title {
    margin-top: 80px;
    margin-bottom: 6px;
    font-size: 40px;
    font-weight: 550;
    color: #2f2f2f;
    letter-spacing: .02em;
    line-height: 1.5;
}

.intro-subtitle {
    margin: 0 0 36px;
    text-align: center;
    font-size: 20px;
    color: #2f2f2f;
    line-height: 1.4;
}

.result-title {
    font-size: 26px;
    margin-bottom: 16px;
}

.calc-note {
    margin-top: 24px;
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    max-width: 1000px;
    margin: 0 auto;
}

.field-label-top {
    padding-top: 12px;
}

.stock-name-hint {
    display: block;
    margin-top: 6px;
    color: #04327a;
}

.stock-candidates-panel {
    margin-top: 8px;
}

.va-middle {
    vertical-align: middle;
}

.income-unit {
    padding-left: 8px;
}

@media (max-width: 640px) {
    body {
        padding: 8px;
    }

    .container {
        max-width: 100%;
    }

    .card {
        padding: 12px;
    }

    .form-table,
    .form-table tbody,
    .form-table tr,
    .form-table td {
        display: block;
        width: 100%;
    }

    .form-table tr {
        margin-bottom: 6px;
    }

    .form-table td:first-child {
        width: 100%;
        padding-right: 0;
        padding-bottom: 2px;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.3;
        white-space: normal;
    }

    .form-table td {
        padding: 3px 0;
    }

    .result-table {
        width: 100%;
    }

    .result-table tr {
        display: table-row;
    }

    .result-table td {
        display: table-cell;
        width: auto;
        padding: 6px 0;
        vertical-align: middle;
    }

    .result-table td:first-child {
        width: 46%;
        padding-right: 8px;
        padding-bottom: 0;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.4;
        white-space: nowrap;
    }

    .error {
        font-size: 12px;
        line-height: 1.3;
    }

    .intro-title {
        font-size: 28px;
        margin-bottom: 4px;
        margin-top: 60px;
    }

    .intro-subtitle {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .result-title {
        font-size: 26px;
    }

    input.input-fixed,
    select.input-fixed,
    .unit-input {
        max-width: 100%;
    }

    .action-row {
        display: block;
    }

    .result-table,
    .result-actions {
        max-width: 100%;
        margin: 0;
    }

    .btn-clear {
        margin-left: 0;
        margin-right: 0;
    }

    .calc-note {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
}
