:root { color-scheme: light; font: 16px/1.55 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; color: #18382f; background: #f5f7f3; --green: #15493b; --line: #dae1da; --muted: #5b6d64 }
* { box-sizing: border-box }
body { margin: 0; min-height: 100vh }
button, input, textarea { font: inherit; color: inherit }
button { cursor: pointer }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #3e947a; outline-offset: 3px }
button:disabled { opacity: .55; cursor: default }
h1,h2,p,dl,dd { margin: 0 }
h2 { font-size: 1.15rem; letter-spacing: -.025em }
button { background: none; border: 0 }
.bar { border-bottom: 1px solid var(--line); background: #fcfdfb }
.bar-inner, main { width: min(1056px, calc(100% - 64px)); margin: auto }
.bar-inner { height: 68px; display: flex; align-items: center; justify-content: space-between }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 1.22rem }
.brand-mark { width: 33px; height: 33px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--green); transform: rotate(-5deg) }
.brand-mark i { width: 4px; height: 12px; background: #bfeec3; transform: skewY(-20deg) }
.brand-mark i:nth-child(2) { height: 18px }
.brand-mark i:last-child { height: 10px }
.settings-link { display: flex; align-items: center; gap: 6px; font-size: .9rem; padding: 8px 13px; border-radius: 7px; border: 1px solid var(--line); background: white }
main { padding: clamp(30px, 5.3vh, 56px) 0 52px }
h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); letter-spacing: -.055em; line-height: 1.25; color: #152f26 }
.panel { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 10px #1d3c2a05 }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px }
.text-action { font-size: .86rem; color: #2b6954; padding: 5px 0 5px 6px; text-decoration: underline; text-underline-offset: 4px }
label { display: block; font-weight: 600; font-size: .94rem }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 19px }
small { display: block; font-size: .81rem; color: var(--muted); font-weight: 400; margin-top: 3px }
.switch { appearance: none; width: 40px; min-width: 40px; height: 24px; margin: 0; border: 0; border-radius: 18px; background: #818d85; position: relative; cursor: pointer }
.switch:checked { background: #287357 }
.switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform .15s }
.switch:checked::before { transform: translateX(16px) }
.primary { background: var(--green); color: white; font-size: .94rem; font-weight: 600; padding: 11px 18px; border-radius: 8px }
.primary:hover:enabled { background: #24644e }
.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px }
.copy-icon { width: 13px; height: 15px; border: 1.6px solid currentColor; border-radius: 2px; position: relative }
.copy-icon::before { content: ''; position: absolute; top: -5px; left: -5px; width: 9px; height: 11px; border-left: 1.6px solid currentColor; border-top: 1.6px solid currentColor; border-radius: 2px }
dialog { width: min(420px, calc(100% - 30px)); max-height: 90dvh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; color: inherit; box-shadow: 0 15px 60px #102f362b }
dialog::backdrop { background: #122b2680 }
dialog .section-title { margin: 0 0 9px }
.modal-intro,dialog p { color: var(--muted); font-size: .9rem; margin-bottom: 18px }
.close { font-size: 1.5rem; line-height: 1; padding: 5px }
.error:not(:empty) { color: #983a26; font-size: .85rem; margin: 4px 0 12px }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #172d24; color: white; border-radius: 8px; padding: 9px 16px; z-index: 2 }
.toast:empty { display: none }
.admin-main { max-width: 500px }
.admin-panel { padding: clamp(20px, 4vw, 32px) }
.admin-panel h1 { font-size: 1.7rem }
.admin-panel .section-title { margin-bottom: 12px }
.admin-panel input:not([type=checkbox]):not([type=hidden]) { width: 100%; display: block; padding: 10px 12px; margin: 6px 0 16px; border: 1px solid #bccac0; border-radius: 7px; background: #fcfdfa }
.admin-panel .primary { margin-top: 20px }
.admin-panel .success { margin-bottom: 16px; color: #256749 }
.admin-panel .password-hint { margin: -10px 0 16px }
a.settings-link { text-decoration: none; color: inherit }

.customer { background: #f2f4ef; color: #1c3028; min-height: 100svh }
#calculator { width: min(900px, calc(100% - 48px)); padding: clamp(24px, 10vh, 96px) 0 20px }
.tool-title { display: flex; align-items: center; gap: 12px; font-size: 1.65rem; line-height: 1.2; margin-bottom: 20px; letter-spacing: -.045em }
.ledger-mark { display: inline-grid; grid-template-columns: repeat(3, 4px); justify-content: center; align-content: center; align-items: end; gap: 3px; width: 35px; height: 35px; border-radius: 10px; background: #144b3d }
.ledger-mark i { background: #dbef9f; height: 9px; border-radius: 1px }
.ledger-mark i:nth-child(2) { height: 14px }
.ledger-mark i:last-child { height: 19px }
.workbench { background: white; border: 1px solid #cfd8ce; border-radius: 20px; box-shadow: 0 8px 28px #223c280a }
.account-line { display: flex; gap: 14px; align-items: center; padding: 18px 28px; border-bottom: 1px solid #dde4da; background: #fafbf7; border-radius: 20px 20px 0 0 }
.account-mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: #fff2c3; border-radius: 12px }
.account-mark i { width: 13px; height: 13px; transform: rotate(45deg); border: 4px solid #8c6914; position: relative }
.account-mark i::before,.account-mark i::after { content: ''; position: absolute; width: 4px; height: 4px; background: #8c6914 }
.account-mark i::before { left: -9px; bottom: -4px }
.account-mark i::after { right: -9px; top: -4px }
.account-identity { flex: 1; min-width: 0; line-height: 1.35 }
.account-identity h2 { color: #5b675c; font-size: .87rem; font-weight: 500; letter-spacing: 0 }
#account-id { display: block; margin-top: 2px; font-size: 1.12rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums }
.id-action,.copy-result { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 650; border-radius: 8px; min-height: 44px }
.id-action { flex: none; padding: 0 13px; font-size: .9rem; border: 1px solid #cbd6ca; background: #fff }
.id-action:hover:enabled { background: #eff5ed }
.workspace { display: grid; grid-template-columns: 1.05fr 1fr; padding: 14px; gap: 14px }
.entry-pane { padding: 15px 16px; min-width: 0 }
.pane-heading,.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.pane-heading h2 { font-size: 1.16rem }
.quiet-action,.detail-action { font-size: .87rem; font-weight: 550; min-height: 40px; padding: 4px 2px }
.quiet-action { color: #47624d }
.quiet-action:hover,.detail-action:hover { text-decoration: underline; text-underline-offset: 4px }
.fields { display: grid; gap: 16px; margin-top: 11px }
.fields > div { min-width: 0 }
.fields label { font-size: .91rem; color: #435347; margin-bottom: 6px }
.number-field { display: flex; align-items: center; gap: 4px; min-height: 49px; background: #fcfdfa; border: 1px solid #bdccbf; border-radius: 8px; padding: 0 13px }
.number-field:focus-within { outline: 2px solid #588665; outline-offset: 1px; background: #fff }
.number-field input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; padding: 5px 0; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 1.3rem }
.number-field input:focus-visible { outline: none }
.number-field input::placeholder { color: #78867d; font-weight: 450 }
.number-field span { color: #526457; font-size: .85rem; font-weight: 550 }
.fee-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; cursor: pointer; min-height: 44px; border-top: 1px solid #e1e7df; margin-top: 18px; padding-top: 6px }
#fee-note { font-size: .85rem; color: #5b6c60; font-weight: 500; margin-left: 3px }
.result-pane { display: flex; flex-direction: column; min-width: 0; border-radius: 12px; padding: 22px 25px; background: #173f34; color: #fff }
.result-head h2 { font-size: .97rem; font-weight: 550; color: #e4f1e8 }
.detail-action { color: #c9dfd0; text-decoration: underline; text-decoration-color: #83a392; text-underline-offset: 4px }
.result-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 0 22px }
.total-number { display: flex; align-items: baseline; gap: 7px; font-variant-numeric: tabular-nums; letter-spacing: -.045em; line-height: 1.15 }
.total-number span { color: #d5e6d9; font-size: 1.6rem }
.total-number strong { min-width: 0; overflow-wrap: anywhere; font-size: clamp(2.4rem, 4.7vw, 3.5rem); font-weight: 620 }
#result-hint { color: #c3d7c8; font-size: .86rem; margin-top: 8px }
.copy-result { width: 100%; padding: 8px 12px; background: #daefab; color: #193e2e; font-size: .95rem }
.copy-result:hover:enabled { background: #e8fac1 }
.copy-result:disabled { background: #365b4d; color: #c6d8cd; opacity: 1 }
.detail-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0 }
.detail-list dt { color: #425a4b }
.detail-list dd { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0 }
.detail-list > div:last-child { border-top: 1px dashed var(--line); margin-top: 5px }
#copy-text { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--line) }
.close { min-width: 40px; min-height: 40px }
@media (max-width: 670px) {
  #calculator { width: min(470px, calc(100% - 24px)); padding: clamp(12px, 4vh, 30px) 0 12px }
  .tool-title { gap: 9px; font-size: 1.33rem; margin-bottom: 12px }
  .ledger-mark { width: 30px; height: 30px; border-radius: 8px }
  .account-line { padding: 12px 15px; gap: 10px }
  .account-mark { width: 34px; height: 34px }
  .workspace { grid-template-columns: 1fr; padding: 10px; gap: 5px }
  .entry-pane { padding: 0 5px 3px }
  .pane-heading h2 { font-size: 1rem }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 3px }
  .number-field { padding: 0 9px; min-height: 44px }
  .fee-line { margin-top: 12px; padding-top: 0 }
  .result-pane { padding: 10px 15px 14px }
  .result-body { padding: 0 0 13px }
  .total-number strong { font-size: 2.35rem }
  #result-hint { margin-top: 3px }
  .admin-main,.bar-inner { width: calc(100% - 28px) }
  .bar-inner { height: 54px }
}
@media (min-width: 521px) and (max-height: 580px) {
  #calculator { padding: 9px 0; width: min(900px, calc(100% - 24px)) }
  .tool-title { font-size: 1.2rem; margin-bottom: 8px }
  .ledger-mark { width: 27px; height: 27px }
  .account-line { padding: 6px 18px }
  .workspace { grid-template-columns: minmax(0,1.08fr) minmax(0,1fr); padding: 8px; gap: 8px }
  .entry-pane { padding: 3px 8px }
  .fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 0 }
  .number-field { padding: 0 8px; min-height: 44px }
  .fee-line { margin-top: 8px }
  .result-pane { padding: 8px 15px 12px }
  .result-body { padding: 0 0 8px }
  .total-number strong { font-size: 2.25rem }
}
@media (max-width: 520px) and (max-height: 600px) {
  #calculator { padding: 4px 0 }
  .tool-title { font-size: 1.05rem; margin-bottom: 4px }
  .ledger-mark { width: 24px; height: 24px }
  .account-line { padding: 4px 12px }
  .account-mark { display: none }
  #account-id { font-size: 1rem }
  .workspace { padding: 6px; gap: 0 }
  .fields label { margin-bottom: 2px }
  .fee-line { margin-top: 4px }
  .result-pane { padding: 3px 12px 8px }
  .result-body { padding: 0 0 5px }
}
@media (max-width: 520px) and (max-height: 470px) {
  .tool-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%) }
  .result-pane { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center; padding: 1px 10px 8px }
  .result-head { grid-column: 1 / -1 }
  .result-body { padding: 0 }
  .total-number strong { font-size: 1.7rem }
  .total-number span { font-size: 1rem }
  #result-hint { display: none }
  .copy-result { padding: 6px 8px; font-size: .85rem }
}
