:root {
    --paper: #f4f1ea;
    --card: #fffefa;
    --ink: #1c1b18;
    --muted: #8b8479;
    --line: #e6e1d6;
    --line-strong: #d8d2c4;
    --accent: #2f4a3f;
    --accent-deep: #24392f;
    --gold: #b08a4f;
    --field: #fbf9f4;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        radial-gradient(1100px 620px at 50% -12%, #fffdf8 0%, rgba(255, 253, 248, 0) 62%),
        linear-gradient(180deg, #f7f4ee 0%, #f1ede5 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.page {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 20px 64px;
}

.card {
    position: relative;
    width: 100%;
    max-width: 540px;
    padding: 44px 44px 32px;
    background: var(--card);
    border: 1px solid rgba(28, 27, 24, 0.06);
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(48, 41, 30, 0.04),
        0 30px 70px -46px rgba(48, 41, 30, 0.32);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 44px;
    right: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), rgba(176, 138, 79, 0));
    border-radius: 2px;
}

/* 顶部标题 */
.head { margin-bottom: 30px; }

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    letter-spacing: 0.38em;
    color: var(--muted);
    text-transform: uppercase;
}

.mark {
    width: 5px;
    height: 5px;
    background: var(--gold);
    transform: rotate(45deg);
}

h1 {
    margin: 14px 0 9px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.05em;
    line-height: 1.35;
}

.lede {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--muted);
    letter-spacing: 0.02em;
}

/* 今日数据条 */
.today {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: -6px 0 26px;
    padding: 12px 16px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.today-figure {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.today-figure b {
    font-size: 19px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.today-figure i {
    font-style: normal;
    font-size: 11.5px;
    color: var(--muted);
}

.today-split {
    width: 1px;
    height: 15px;
    background: var(--line-strong);
}

.today-time {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* 输入区 */
.calc { margin: 0; }

.field-label {
    display: block;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: #5d574d;
    margin-bottom: 10px;
}

.field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 64px;
    padding: 0 18px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field:focus-within {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47, 74, 63, 0.09);
}

.field.is-error {
    border-color: #b4553f;
    box-shadow: 0 0 0 4px rgba(180, 85, 63, 0.08);
}

.currency {
    font-size: 16px;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    position: relative;
    top: -1px;
}

.unit {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    position: relative;
    top: 1px;
}

.field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: Georgia, "Times New Roman", "PingFang SC", serif;
    font-size: 28px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.field input::placeholder {
    color: #c2bbae;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 17px;
    letter-spacing: 0.06em;
}

.hint {
    margin: 10px 2px 0;
    min-height: 18px;
    font-size: 12.5px;
    color: var(--muted);
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.hint.is-error { color: #b4553f; }

.submit {
    width: 100%;
    height: 50px;
    margin-top: 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #f7f5ee;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 18px -14px rgba(47, 74, 63, 0.9);
}

.submit:hover { background: var(--accent-deep); }

.submit:active {
    transform: translateY(1px);
    box-shadow: 0 6px 14px -10px rgba(47, 74, 63, 0.55);
}

.submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(47, 74, 63, 0.16);
}

/* 结果区 */
.result {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.result.is-visible { opacity: 1; transform: none; }

.result-label {
    display: block;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}

.number {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.number.pop { animation: pop 0.32s ease; }

@keyframes pop {
    0% { opacity: 0.35; transform: translateY(4px); }
    100% { opacity: 1; transform: none; }
}

.amount-unit {
    font-size: 15px;
    color: var(--muted);
    letter-spacing: 0.1em;
}

.result-meta {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}

.meta-item {
    padding: 14px 0 2px;
    min-width: 0;
}

.meta-item + .meta-item {
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.meta-label {
    display: block;
    font-size: 11.5px;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 6px;
}

.meta-value {
    font-size: 13.5px;
    color: #3c372f;
    font-variant-numeric: tabular-nums;
}

.meta-value b {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--ink);
}

.formula {
    display: block;
    font-family: "SF Mono", "Cascadia Mono", Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: #4a443a;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 页脚 */
.foot {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.foot p {
    margin: 4px 0;
    font-size: 12px;
    line-height: 1.7;
    color: #9a9386;
    letter-spacing: 0.02em;
}

.foot-link { margin-top: 14px !important; }

.foot-link a {
    color: #6b6459;
    text-decoration: none;
    border-bottom: 1px solid #d8d2c4;
    padding-bottom: 1px;
}

.foot-link a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 560px) {
    .page { padding: 28px 14px 40px; align-items: flex-start; }
    .card { padding: 34px 24px 26px; border-radius: 16px; }
    .card::before { left: 24px; right: 24px; }
    h1 { font-size: 24px; }
    .number { font-size: 46px; }
    .field { height: 58px; padding: 0 14px; }
    .field input { font-size: 24px; }
    .result-meta { grid-template-columns: 1fr; }
    .meta-item + .meta-item {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--line);
        margin-top: 12px;
        padding-top: 14px;
    }
}
