:root {
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #172b24;
  background: #f4f6f1;
  --green: #245440;
  --mist: #edf3ea;
  --muted: #586860;
  --line: #dce4d9;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; }
:focus-visible { outline: 2px solid #397f5c; outline-offset: 3px; }
.frame { width: min(1320px, calc(100% - 88px)); margin-inline: auto; }
.site-head { background: #193c32; color: #fff; }
.header-row { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.1rem; font-weight: 750; letter-spacing: .06em; }
.brand .icon { color: #f5d492; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 16px; min-height: 41px; border: 1px solid #cbd8cc; border-radius: 8px; background: #fff; color: var(--green); font-weight: 700; font-size: .91rem; white-space: nowrap; }
.button:hover { background: #eff5ed; }
.button.primary { color: #fff; border-color: var(--green); background: var(--green); }
.button.primary:hover { background: #193d30; }
.button.quiet { background: transparent; }
.button.quiet:hover { background: #e9efe6; }
.google { color: #326cc3; font: 800 1.05rem Arial, sans-serif; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 36px 0 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.95rem, 4vw, 2.8rem); letter-spacing: .035em; line-height: 1.22; }
h2 { font-size: 1.08rem; letter-spacing: .025em; }
.intro p { margin-top: 9px; color: var(--muted); }
.contact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px 8px; flex-wrap: wrap; }
.workspace { display: grid; grid-template-columns: minmax(360px, 415px) minmax(0, 1fr); align-items: start; gap: 22px; }
.editor, #parties { display: grid; gap: 13px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.settings, .contact { padding: 16px 17px; }
.settings-grid, .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px 12px; margin-top: 13px; }
.contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .62fr); margin-top: 11px; }
.custom { row-gap: 5px; }
.template-choices { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.template-choice { display: grid; place-items: center; gap: 4px; padding: 4px 1px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: .77rem; background: #fff; }
.template-choice[aria-pressed=true] { border-color: #5b8b72; color: #244c39; background: #eef5ed; font-weight: 750; }
.template-choice:hover { background: #eef5ed; }
.swatch { display: grid; place-items: center; width: min(100%, 40px); height: 23px; border: 1px solid #c4cec6; border-radius: 3px; background: #fff; }
.swatch-classic { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px #b27465; }
.swatch-botanical { background: radial-gradient(ellipse at 11% 83%, #a3bca8 8%, transparent 44%), #fff; }
.swatch-airmail { border: 3px solid transparent; background: linear-gradient(#fff, #fff) padding-box, repeating-linear-gradient(135deg,#9f6158 0 3px,#fff 3px 6px,#577d97 6px 9px,#fff 9px 12px) border-box; }
.swatch-upload { border-style: dashed; font-size: 1rem; }
.template-save { justify-items: end; }
.copyright { margin: 10px 0; font-size: .83rem; color: #694e36; }
.permission { font-size: .84rem; display: flex; align-items: center; gap: 7px; }
.upload-field { margin-top: 9px; }
.dialog-actions { margin-top: 12px; text-align: right; }
.postage-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; }
.postage-total output { color: var(--green); font-weight: 750; }
.postage-total a { color: var(--green); font-size: .82rem; flex: 0 0 auto; text-underline-offset: 3px; }
.postage #postage-note { margin-top: 5px; }
.preview-options { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; color: var(--green); font-size: .9rem; }
.preview-options a { text-underline-offset: 3px; }
.stamp-option { display: inline-flex; gap: 6px; align-items: center; }
.field { min-width: 0; display: grid; gap: 5px; }
.full, #size-error { grid-column: 1 / -1; }
.field label { font-size: .875rem; font-weight: 650; }
.field :is(input, select, textarea) { width: 100%; color: #20342a; background-color: #fbfcfa; border: 1px solid #d5ded3; border-radius: 6px; padding: 8px 10px; min-height: 38px; line-height: 1.35; font-size: .92rem; }
.field input::placeholder, .field textarea::placeholder { color: #68786e; }
.field textarea { resize: vertical; }
.field select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, #567263 50%), linear-gradient(135deg, #567263 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.contact-head, .contact-title, .contact-foot, .preview-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contact-foot { margin-top: 8px; align-items: baseline; }
.contact-title { justify-content: flex-start; }
.contact-title h2 { white-space: nowrap; }
.contact-summary { color: var(--muted); margin: 7px 0 0 40px; font-size: .88rem; overflow-wrap: anywhere; }
.contact-foot .finish { min-height: 34px; padding: 4px 10px; font-size: .83rem; }
.quick-form { margin-top: 11px; }
.quick-text { min-height: 80px; }
.quick-footer { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.quick-footer .button { margin-left: auto; padding: 5px 15px; min-height: 34px; }
.person-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--mist); color: var(--green); }
.contact[data-role="recipient"] .person-mark { background: #f8eedb; color: #825b23; }
.text-button { border: 0; background: none; color: var(--green); padding: 4px 1px; font-size: .86rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.text-button.muted, .zip-status { color: var(--muted); }
.zip-status { font-size: .81rem; }
.editor-foot { text-align: right; }
.preview { min-width: 0; position: sticky; top: 16px; overflow: hidden; }
.preview-head { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.size-label { color: var(--green); background: #ebf2e8; padding: 5px 9px; border-radius: 5px; font-size: .8rem; font-weight: 650; text-align: right; }
.preview-stage { display: grid; place-items: center; min-height: 390px; padding: 33px; background-color: #e9efe6; background-image: radial-gradient(#bacbbc 1px, transparent 1px); background-size: 15px 15px; }
.paper-wrap { width: 100%; display: grid; place-items: center; }
.paper { position: relative; flex: none; overflow: hidden; background: #fff; box-shadow: 0 15px 26px #263d3024, 0 0 0 1px #cbd6cb; color: #202621; }
#paper-background { position: absolute; inset: 0; width: 100%; height: 100%; print-color-adjust: exact; }
.postal-block { position: absolute; overflow-wrap: anywhere; font-family: Arial, "Microsoft JhengHei", "PingFang TC", sans-serif; }
.postal-block p { white-space: pre-wrap; }
.postal-block .recipient-name { font-size: var(--screen-name-font); line-height: var(--screen-name-line); }
.postal-block.placeholder { color: #6c7d72; }
.stamp { position: absolute; top: 8%; right: 7%; width: 10%; height: 23%; min-width: 25px; display: grid; place-items: center; font-size: clamp(.55rem, 1vw, .72rem); color: #6b796f; border: 1px dashed #a2afa4; }
.preview-foot { padding: 16px 20px 17px; }
.actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.print-help { color: var(--muted); text-align: right; font-size: .82rem; margin-top: 10px; }
.field-message { color: #9b421f; font-size: .86rem; }
.field-message:empty { display: none; }
#preview-note:not(:empty) { margin-bottom: 12px; }
.footer { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); border-top: 1px solid var(--line); padding: 16px 0 24px; margin-top: 25px; font-size: .84rem; }
.footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { text-underline-offset: 3px; }
.icon { display: inline-block; position: relative; width: 16px; height: 16px; flex: 0 0 auto; }
.envelope { width: 24px; height: 17px; border: 2px solid; border-radius: 3px; overflow: hidden; }
.envelope::after { content: ""; position: absolute; width: 14px; height: 14px; top: -8px; left: 3px; border: solid; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.person::before, .person::after, .sample::before, .sample::after, .download::before, .download::after, .printer::before, .printer::after { content: ""; position: absolute; }
.person::before { width: 6px; height: 6px; border: 1.5px solid; border-radius: 50%; left: 5px; top: 0; }
.person::after { width: 12px; height: 7px; border: 1.5px solid; border-radius: 6px 6px 3px 3px; bottom: 1px; left: 2px; }
.sample::before { inset: 1px 3px; border: 1.5px solid; border-radius: 2px; }
.sample::after { inset: 6px 6px; border-block: 1px solid; }
.download { border: solid; border-width: 0 1.5px 1.5px; height: 7px; align-self: center; margin-top: 8px; border-radius: 2px; }
.download::before { left: 6px; top: -8px; width: 1.5px; height: 9px; background: currentColor; }
.download::after { left: 4px; top: -4px; width: 6px; height: 6px; border: solid; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.printer { border: 1.5px solid; border-radius: 3px; height: 10px; }
.printer::before, .printer::after { left: 2px; width: 10px; border: 1.5px solid; background: var(--green); }
.printer::before { top: -5px; height: 4px; border-bottom: 0; }
.printer::after { top: 5px; height: 6px; }
dialog { width: min(500px, calc(100% - 36px)); max-height: 85dvh; border-radius: 13px; border: 1px solid var(--line); color: inherit; padding: 18px; box-shadow: 0 18px 50px #132c2455; }
dialog::backdrop { background: #16292275; }
.dialog-head { margin-bottom: 12px; }
.close { padding: 1px 10px; min-height: 33px; font-size: 1.3rem; }
#account-message { margin-bottom: 12px; overflow-wrap: anywhere; }
.book-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding-block: 10px; border-top: 1px solid var(--line); }
.book-item p { color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
#toast { position: fixed; z-index: 10; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 26px); padding: 10px 15px; border-radius: 7px; background: #193c32; color: #fff; }
#toast:empty { display: none; }
@media (max-width: 940px) {
  .frame { width: calc(100% - 40px); }
  .workspace { grid-template-columns: minmax(330px, .88fr) minmax(0, 1fr); gap: 14px; }
  .preview-stage { padding: 22px; min-height: 300px; }
}
@media (max-width: 700px) {
  .frame { width: calc(100% - 28px); }
  .header-row { height: 61px; }
  .intro { padding-top: 24px; flex-wrap: wrap; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
  .preview-stage { min-height: 240px; }
  .footer { flex-direction: column; }
}
@media print {
  html, body { margin: 0 !important; padding: 0 !important; width: var(--page-width); height: var(--page-height); background: #fff; overflow: hidden; }
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .paper .placeholder, .paper .placeholder *, .paper .stamp { visibility: hidden; }
  .paper { position: fixed; inset: 0 auto auto 0; width: var(--page-width) !important; height: var(--page-height) !important; box-shadow: none; }
  .postal-block { font-size: var(--print-font) !important; line-height: var(--print-line) !important; }
  .postal-block .recipient-name { font-size: var(--print-name-font) !important; line-height: var(--print-name-line) !important; }
  .site-head, .intro, .editor, .footer, .preview-head, .preview-foot, dialog, #toast { display: none !important; }
  .frame, .workspace, .preview, .preview-stage, .paper-wrap { display: block; position: static; width: auto; height: 0; min-height: 0; margin: 0; padding: 0; border: 0; overflow: visible; }
}
