:root {
  --ink: #17232a;
  --muted: #6f7d80;
  --line: #dce5e1;
  --paper: #ffffff;
  --green: #16805b;
  --green-dark: #0b6848;
  --green-soft: #e8f5ee;
  --amber: #b56b17;
  --amber-soft: #fff3df;
  --red: #b94e43;
  --shadow: 0 18px 50px rgba(33, 56, 48, .08);
}
* { box-sizing: border-box; }
html { background: #edf3ef; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at top right, #f8fbf8 0, #edf3ef 42%, #e7efea 100%); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1220px; margin: 0 auto; padding: 34px 28px 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 30px; }
.eyebrow, .section-kicker { margin: 0; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin: 8px 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; letter-spacing: 0; }
.version-tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 5px 8px; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.subtitle { max-width: 560px; color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 0; }
.topbar-note { display: flex; align-items: center; gap: 9px; padding: 10px 13px; color: var(--muted); font-size: 12px; white-space: nowrap; border: 1px solid rgba(220, 229, 225, .95); background: rgba(255,255,255,.7); border-radius: 999px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #30a26e; box-shadow: 0 0 0 4px #d9f1e3; }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 22px; align-items: start; }
.panel { background: rgba(255,255,255,.94); border: 1px solid rgba(220, 229, 225, .9); border-radius: 8px; box-shadow: var(--shadow); }
.input-panel { padding: 28px 30px 24px; }
.result-panel { position: sticky; top: 20px; padding: 26px; overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 21px; }
.panel-heading.compact { margin-bottom: 16px; }
h2 { margin: 7px 0 0; font-size: 21px; letter-spacing: 0; }
.step-count, .pill { color: var(--green-dark); background: var(--green-soft); border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 15px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.wide { grid-column: span 1; }
.field > span { font-size: 13px; font-weight: 700; }
.field em { color: var(--green); font-size: 11px; font-style: normal; font-weight: 600; margin-left: 4px; }
.field small { color: var(--muted); line-height: 1.4; font-size: 11px; min-height: 16px; }
input, select { width: 100%; min-height: 44px; border: 1px solid #d6e0db; border-radius: 6px; background: #fbfdfc; color: var(--ink); outline: none; padding: 0 12px; transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus, select:focus { border-color: #45a57d; background: #fff; box-shadow: 0 0 0 3px rgba(69,165,125,.13); }
input::placeholder { color: #a8b4b0; }
.input-wrap { display: flex; align-items: center; min-height: 44px; border: 1px solid #d6e0db; border-radius: 6px; background: #fbfdfc; color: var(--muted); padding: 0 12px; }
.input-wrap:focus-within { border-color: #45a57d; background: #fff; box-shadow: 0 0 0 3px rgba(69,165,125,.13); }
.input-wrap input { min-height: 40px; padding: 0 8px; border: 0; background: transparent; box-shadow: none; }
.input-wrap input:focus { box-shadow: none; }
.divider { height: 1px; background: var(--line); margin: 28px 0 25px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.button { border: 0; border-radius: 6px; min-height: 42px; padding: 0 17px; font-size: 13px; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); box-shadow: 0 7px 16px rgba(22,128,91,.16); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--muted); background: #eef3f0; }
.button.secondary:hover { background: #e4ebe7; }
.form-footnote { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.logic-callout { display: flex; gap: 10px; align-items: baseline; margin-top: 19px; padding: 12px 14px; border-left: 3px solid #56a67d; background: #f2f9f4; color: var(--muted); font-size: 11px; line-height: 1.55; }
.logic-callout strong { flex: 0 0 auto; color: var(--green-dark); font-size: 11px; }
.result-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-state { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.result-state.pending { color: var(--amber); background: var(--amber-soft); }
.result-state.ready { color: var(--green-dark); background: var(--green-soft); }
.result-state.warning { color: var(--red); background: #ffebe8; }
.result-hero { padding: 34px 0 30px; border-bottom: 1px solid var(--line); }
.result-hero span { display: block; color: var(--muted); font-size: 13px; }
.result-hero strong { display: block; margin: 8px 0 5px; color: var(--green-dark); font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: 0; }
.result-hero small { color: var(--muted); font-size: 11px; }
.breakdown { padding: 17px 0 11px; }
.breakdown-row { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; color: #48585a; font-size: 13px; }
.breakdown-row strong { color: var(--ink); font-size: 14px; }
.breakdown-row.positive strong { color: var(--green-dark); }
.breakdown-row.negative strong { color: var(--red); }
.breakdown-row.subtotal { margin-top: 4px; padding-top: 11px; border-top: 1px solid #edf1ee; color: #526361; font-weight: 700; }
.breakdown-row.info { padding-top: 5px; padding-bottom: 5px; color: var(--muted); font-size: 11px; }
.breakdown-row.info strong { color: var(--muted); font-size: 12px; }
.breakdown-row.total { margin-top: 7px; padding-top: 15px; color: var(--ink); border-top: 1px dashed #cad8d1; font-weight: 800; }
.breakdown-row.total strong { color: var(--green-dark); font-size: 18px; }
.formula-card { padding: 15px; border-left: 3px solid var(--green); background: #f4faf6; }
.formula-label { color: var(--green-dark); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.formula-card p { margin: 8px 0 6px; color: var(--ink); font-size: 13px; line-height: 1.55; }
.formula-detail { color: var(--muted); font-size: 11px; line-height: 1.55; }
.copy-button { width: 100%; margin-top: 20px; color: var(--green-dark); background: #e5f3eb; }
.copy-button:hover { background: #d7eedf; }
.copy-feedback { min-height: 16px; margin: 9px 0 -2px; text-align: center; color: var(--green); font-size: 11px; }
.footer-note { display: flex; justify-content: space-between; gap: 18px; padding: 18px 2px 0; color: #899692; font-size: 11px; }
.access-gate { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 24px; background: #edf3ef; }
.access-gate-panel { width: min(100%, 400px); padding: 34px; border: 1px solid #dce5e1; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.access-gate-panel h1 { margin: 10px 0 9px; font-size: 28px; }
.access-gate-panel p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.6; }
.access-gate-panel label { display: block; margin-top: 24px; font-size: 13px; font-weight: 700; }
.access-gate-panel input { margin-top: 9px; }
.access-gate-panel button { width: 100%; min-height: 46px; margin-top: 18px; border: 0; border-radius: 6px; color: #fff; background: var(--green); font: inherit; font-weight: 750; }
.access-gate-panel small { display: block; min-height: 20px; margin-top: 12px; color: var(--red); font-size: 12px; text-align: center; }
@media (max-width: 820px) { .app-shell { padding: 24px 18px 18px; } .topbar { flex-direction: column; gap: 18px; margin-bottom: 22px; } .layout-grid { grid-template-columns: 1fr; } .result-panel { position: static; } }
@media (max-width: 520px) { .input-panel, .result-panel { padding: 22px 18px; } .field-grid { grid-template-columns: 1fr; gap: 15px; } .field.wide { grid-column: auto; } .form-actions { justify-content: stretch; } .form-actions .button { flex: 1; padding: 0 10px; } .footer-note { flex-direction: column; gap: 5px; } h1 { font-size: 34px; } .logic-callout { align-items: flex-start; flex-direction: column; gap: 4px; } }
