:root {
    color-scheme: light;
    --ink: #20342a;
    --muted: #54685b;
    --brand: #285640;
    --brand-dark: #1c4331;
    --line: #dce3d9;
    --pale: #eff2eb;
    --paper: #f9faf6;
    --surface: #fff;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", STSong, SimSun, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 2px; }
.site-main { flex: 1 0 auto; }
.site-container { width: min(1256px, calc(100% - 104px)); margin-inline: auto; }

.site-header { position: relative; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.site-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 1.0625rem; font-weight: 700; letter-spacing: .045em; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 7px; background: #315a43; color: #f2f6e9; font: 700 1.15rem var(--serif); letter-spacing: 0; }
.header-actions { display: flex; align-items: center; flex-shrink: 0; gap: 10px; }
.brand-btn, .secondary-btn, .header-login { font-family: var(--font) !important; font-weight: 650 !important; min-height: 42px; padding-inline: 17px !important; border-radius: 8px !important; }
.brand-btn { --dxbl-btn-bg: var(--brand); --dxbl-btn-hover-bg: var(--brand-dark); background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.brand-btn:hover:not(:disabled) { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.secondary-btn { background: #fff !important; color: var(--ink) !important; border-color: #c9d8cc !important; }
.secondary-btn:hover:not(:disabled) { background: #f3f7f0 !important; border-color: #789584 !important; color: var(--brand-dark) !important; }
.header-login { color: var(--brand-dark) !important; }
.header-login:hover { background: var(--pale) !important; }
.header-actions .header-register { min-height: 38px; color: var(--brand-dark) !important; background: transparent !important; border-color: #c7d5c9 !important; }
.header-actions .header-register:hover { background: var(--pale) !important; border-color: #809988 !important; }

.calculator-page { padding-block: 50px 76px; }
.inner-intro { margin-bottom: 34px; }
.inner-intro h1 { font-size: clamp(2.125rem, 4vw, 3.25rem); line-height: 1.23; letter-spacing: -.055em; font-weight: 760; }
.inner-intro p { margin-top: 11px; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.calculator-tabs { margin-bottom: 24px; }
.calculator-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr); gap: 22px; align-items: start; }
.calculator-panel, .result-panel { border: 1px solid var(--line); border-radius: 17px; padding: 28px; background: #fff; min-width: 0; }
.calculator-panel h2, .result-panel h2 { margin-bottom: 20px; font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em; }
.parameter-form { margin-inline: -8px; }
.parameter-form :is(label, input) { font-family: var(--font); font-size: .97rem; }
.calculator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.field-error { margin-top: 15px; color: #a8233b; line-height: 1.55; }
.result-panel { background: #f1f6ff; border-color: #d9e5f9; }
.result-empty { padding: 14px 0 24px; color: var(--muted); line-height: 1.6; }
.result-value { color: var(--brand-dark); }
.result-value p { margin-block: 3px 0; font-size: 1.2rem; font-weight: 650; }
.result-value strong { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.055em; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result-details { margin-block: 15px 19px; }
.result-details div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 15px; border-top: 1px solid #d8e5f8; padding-block: 7px; }
.result-details dt { color: var(--muted); }
.result-details dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.formula-box { border-top: 1px solid #d8e5f8; padding-top: 16px; color: var(--muted); line-height: 1.7; }
.formula-box h3 { color: var(--ink); font-size: .9375rem; }
.formula-box .formula { margin-block: 5px; color: #224d9e; font: 650 1rem/1.7 "Cascadia Mono", Consolas, monospace; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 66px; padding-block: 16px; color: var(--muted); font-size: .875rem; letter-spacing: .03em; }
.footer-filing { text-decoration: underline; text-underline-offset: .18em; }
.footer-inner a:hover { color: var(--brand); }

@media (max-width: 980px) {
    .site-container { width: calc(100% - 64px); }
}

@media (max-width: 760px) {
    .site-container { width: calc(100% - 36px); }
    .header-inner { min-height: 64px; gap: 7px; }
    .site-brand { gap: 7px; font-size: clamp(.8125rem, 3.55vw, 1rem); letter-spacing: .025em; }
    .brand-mark { width: 30px; height: 30px; font-size: 1rem; }
    .header-actions { gap: 4px; }
    .header-actions :is(.header-register, .header-login) { min-height: 35px; padding-inline: 8px !important; font-size: .875rem; }
    .calculator-page { padding-block: 36px 48px; }
    .calculator-grid { grid-template-columns: 1fr; gap: 14px; }
    .calculator-panel, .result-panel { padding: 20px; }
}
