:root {
  color: #192822;
  background: #f3f5f1;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #192822;
  --muted: #53665b;
  --line: #d9e1d9;
  --green: #174e38;
  --soft: #e8f0e8;
  --white: #fff;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #327453; outline-offset: 3px; }
.topbar { background: #f9faf7; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; padding: 0 32px; min-height: 70px; margin: auto; display: flex; gap: 32px; align-items: center; }
.brand { text-decoration: none; font-weight: 750; display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; }
.brand-icon { display: flex; align-items: center; justify-content: center; gap: 3px; width: 29px; height: 29px; border-radius: 7px; background: var(--green); }
.brand-icon i { width: 2px; height: 13px; background: #e5f2e9; }
.brand-icon i:nth-child(2) { width: 3px; }
nav { display: flex; gap: 23px; color: var(--muted); font-size: .875rem; }
nav a { text-decoration: none; }
nav a:hover { text-decoration: underline; }
.mode { margin-left: auto; background: var(--soft); color: var(--green); border-radius: 6px; padding: 4px 9px; white-space: nowrap; font-size: .84rem; font-weight: 650; }
main { max-width: 1200px; margin: auto; padding: 48px 32px 64px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.35rem, 5.4vw, 4rem); letter-spacing: -.07em; line-height: 1.14; font-weight: 760; }
.intro p { margin-top: 11px; color: var(--muted); }
.route { color: var(--green); font-size: .875rem; font-weight: 650; display: grid; text-align: right; gap: 3px; padding-bottom: 1px; }
.route span:empty { display: none; }
#sender { color: var(--muted); font-weight: 450; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 68px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.25rem; line-height: 1.35; letter-spacing: -.025em; }
fieldset { border: 0; padding: 0; margin: 18px 24px 0; min-width: 0; }
legend { color: var(--green); font-size: .875rem; font-weight: 750; padding: 0; margin-bottom: 8px; }
label { display: block; color: var(--ink); font-size: .875rem; font-weight: 550; min-width: 0; }
label span { color: var(--muted); font-size: .78rem; font-weight: 450; padding-left: 2px; }
input, select, textarea { display: block; width: 100%; min-height: 40px; margin-top: 4px; padding: 7px 10px; border: 1px solid #b9c7bc; border-radius: 6px; background: #fcfdfa; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #637268; }
select { appearance: none; padding-right: 24px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 17px, calc(100% - 9px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.grid { display: grid; gap: 9px 12px; }
.grid + label, .grid + .grid { margin-top: 9px; }
.address-book { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 10px; }
.address-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.address-actions .quiet { min-height: 40px; }
.address-paste { margin-bottom: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7faf5; }
.address-paste summary { cursor: pointer; color: var(--green); font-size: .875rem; font-weight: 700; }
.address-paste-body { display: grid; gap: 5px; margin-top: 7px; }
.address-paste-body textarea { resize: vertical; }
.address-paste-body button { justify-self: end; }
#address-status, #size-status { margin: -3px 0 8px; }
#recipient-form label, #size-form label { margin-top: 14px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: 1.1fr .72fr 1fr; }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; padding: 18px 24px 24px; }
.primary, .quiet { border: 1px solid var(--green); border-radius: 7px; padding: 8px 13px; min-height: 38px; font-size: .875rem; font-weight: 700; }
.primary { color: #fff; background: var(--green); }
.primary:hover:enabled { background: #0f402d; }
.quiet { color: var(--green); background: #fff; border-color: var(--line); }
.quiet:hover:enabled { background: var(--soft); }
.form-actions .primary { flex: 1; min-height: 46px; }
.form-actions .quiet { white-space: nowrap; }
.parcel-title { margin: 0 0 8px; font-size: .9rem; color: var(--green); }
.parcel-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 9px; }
.parcel-heading .parcel-title { margin: 0; }
.extra-parcel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.parcel-units, .add-parcel { margin-top: 9px; }
.chit-breakdown { margin: 13px 0 3px; padding: 9px 11px; background: #f1f5ef; border-radius: 6px; }
.chit-breakdown ul { margin: 4px 0 0; padding-left: 18px; }
.chit-breakdown li { margin: 3px 0; }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 20px 0; }
.provider { display: grid; gap: 2px; align-content: start; border-left: 3px solid #87a992; background: #f1f5ef; padding: 8px 9px 8px 11px; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.provider strong { font-size: .875rem; }
.provider span, .muted { font-size: .84rem; color: var(--muted); }
.results { padding: 3px 20px 16px; }
.empty { text-align: center; padding: 50px 3px; }
.empty p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.scan { display: flex; justify-content: center; align-items: center; gap: 5px; width: 50px; height: 42px; margin: 0 auto 12px; border-radius: 7px; border: 1px solid #c8d8cb; background: var(--soft); }
.scan i { width: 2px; height: 19px; background: var(--green); }
.scan i:nth-child(2) { width: 4px; }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rate:last-child { border-bottom: 0; }
.rate h3 { margin: 2px 0; font-size: .96rem; line-height: 1.4; overflow-wrap: anywhere; }
.rate p { font-size: .84rem; color: var(--muted); overflow-wrap: anywhere; }
.rate-end { display: grid; justify-items: end; gap: 5px; font-variant-numeric: tabular-nums; }
.rate-end strong { white-space: nowrap; }
.best { color: var(--green); font-size: .78rem; font-weight: 750; }
.notice { background: #eaf0e7; color: #334a3b; font-size: .875rem; padding: 10px 14px; border-radius: 6px; margin-bottom: 15px; }
.results .notice { margin: 12px 0 0; }
.history { margin-top: 20px; }
.batch-body { padding: 14px 24px 18px; }
.batch-body textarea { resize: vertical; }
.batch-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
#batch-message { min-height: 1.4em; margin-top: 7px; }
.batch-entry { border-top: 1px solid var(--line); padding: 9px 0; }
.batch-entry summary { cursor: pointer; padding: 3px 0; overflow-wrap: anywhere; }
.batch-entry summary .muted { margin-left: 9px; }
.batch-entry .rate { padding-inline: 8px; }
.batch-tools { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
#orders { padding: 14px 24px 18px; }
.order { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.order:last-child { border-bottom: 0; }
.order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.order-actions a, .batch-tools a { display: inline-flex; align-items: center; text-decoration: none; }
.result-actions { justify-content: center; margin-top: 10px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); max-width: min(460px, calc(100% - 24px)); color: var(--ink); padding: 0; }
dialog::backdrop { background: #10241b88; }
.dialog-content { padding: 22px; }
.dialog-content p { margin: 10px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  .intro { align-items: flex-start; flex-direction: column; gap: 8px; }
  .route { text-align: left; }
}
@media (max-width: 480px) {
  main { padding: 24px 12px 40px; }
  .topbar-inner { padding: 0 12px; gap: 10px; flex-wrap: wrap; min-height: 58px; }
  nav { gap: 8px; font-size: .78rem; }
  .brand { gap: 5px; font-size: .9rem; }
  .brand-icon { width: 22px; height: 23px; }
  .mode { font-size: .74rem; }
  .section-head { padding-inline: 14px; }
  fieldset { margin-inline: 14px; }
  .form-actions { padding-inline: 14px; }
  .grid { gap: 8px; }
  .providers { margin-inline: 12px; }
  .results, #orders, .batch-body { padding-inline: 12px; }
  .address-book { grid-template-columns: 1fr; }
  .order { grid-template-columns: 1fr; gap: 5px; }
}
