:root{color:#17211f;background:#eef2f1;font-family:Noto Sans TC,Microsoft JhengHei,system-ui,sans-serif;font-size:16px;line-height:1.5}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:linear-gradient(180deg,#f7f9f8,#eef2f1 42%,#e8eeee)}button,input,textarea{font:inherit}button{min-height:48px;border:0;border-radius:8px;padding:0 18px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:700;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}button:active{transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.68}.primary{color:#fff;background:#2f5d62;box-shadow:0 10px 22px #2f5d6233}.primary:hover{background:#254c50}.secondary{color:#263238;background:#dfe8e6}.secondary:hover{background:#d2dedb}.danger{color:#fff;background:#9f4636}.danger:hover{background:#87392c}.wide{width:100%}.app-shell{min-height:100vh;padding:20px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 auto 16px;max-width:1440px}.topbar>div:first-child{display:flex;flex-direction:column;gap:2px}.topbar strong{font-size:1.25rem}.topbar span{color:#5d6b68;font-size:.92rem}.topbar-actions{display:flex;align-items:center;gap:10px}.status-badge{min-height:48px;min-width:210px;border-radius:8px;padding:8px 14px;display:flex;flex-direction:column;justify-content:center;color:#17211f;background:#fff;border:1px solid #d4ddda}.status-badge span{font-weight:800}.status-badge small{color:#586764}.status-saved{border-color:#8fc2a3;background:#effaf2}.status-pending,.status-offline{border-color:#ddb77c;background:#fff8e8}.status-saving{border-color:#95aec4;background:#edf5fb}.sync-banner{max-width:1440px;margin:0 auto 16px;padding:12px;border-radius:8px;background:#fff8e8;border:1px solid #ddb77c;display:flex;align-items:center;justify-content:space-between;gap:12px}.workspace{max-width:1440px;margin:0 auto;display:grid;grid-template-columns:minmax(360px,.9fr) minmax(480px,1.1fr);gap:18px;align-items:start}.panel{background:#fff;border:1px solid #d4ddda;border-radius:8px;padding:18px;box-shadow:0 18px 50px #26323814}.section-heading{margin-bottom:16px}.section-heading p,.preview-title span{margin:0 0 4px;color:#9f4636;font-weight:800}.section-heading h1,.section-heading h2{margin:0;color:#263238;font-size:1.55rem;letter-spacing:0}label{display:flex;flex-direction:column;gap:7px;margin-bottom:13px;color:#263238;font-weight:700}label span{font-size:.95rem}input,textarea{width:100%;border:1px solid #bfcbc8;border-radius:8px;color:#17211f;background:#fbfdfc;outline:none}input{min-height:46px;padding:0 13px}textarea{min-height:220px;padding:12px 13px;resize:vertical}input:focus,textarea:focus{border-color:#2f5d62;box-shadow:0 0 0 3px #2f5d6229}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}.button-row{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.button-row button{flex:1 1 150px}.preview-column{min-width:0}.preview-title{margin:2px 0 8px}.document-sheet{width:min(100%,840px);min-height:1120px;margin:0 auto;padding:56px 64px;color:#111827;background:#fff;border:1px solid #d5dadd;box-shadow:0 18px 50px #2632381a}.document-sheet.compact{min-height:760px;padding:42px}.document-sheet h2{margin:0 0 34px;text-align:center;font-size:1.7rem;letter-spacing:0}.document-body{min-height:260px;white-space:pre-wrap;font-size:1.08rem;line-height:1.9}.recipient-block{margin-top:30px;font-size:1.05rem}.recipient-block p{margin:5px 0}.signer-block{margin-top:42px;display:grid;gap:10px;break-inside:avoid}.signer-block p{margin:0;display:flex;gap:8px;flex-wrap:wrap}.signer-block strong{font-weight:500}.signature-output{margin-top:28px;display:grid;grid-template-columns:64px minmax(220px,1fr);gap:12px;align-items:start;break-inside:avoid}.signature-output span{padding-top:20px}.signature-output img,.signature-placeholder{width:min(420px,100%);height:132px;border-bottom:1px solid #111827;object-fit:contain;object-position:left center}.signature-placeholder{background:#fff}.date-line{margin-top:26px;text-align:right;font-size:1.05rem;break-inside:avoid}.signature-pad-wrap{position:relative;min-height:300px;border:2px solid #263238;border-radius:8px;overflow:hidden;background:#fff;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.signature-pad{width:100%;height:300px;display:block;touch-action:none;background:#fff;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:crosshair}.signature-hint{position:absolute;left:16px;bottom:12px;color:#a5afad;pointer-events:none;font-weight:700}.print-layout{max-width:1000px;margin:0 auto}.print-toolbar{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:0 0 16px}.login-shell{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(180deg,#f7f9f8f2,#e8eeeef2),#eef2f1}.login-panel{width:min(100%,460px);border:1px solid #d4ddda;border-radius:8px;padding:28px;background:#fff;box-shadow:0 18px 50px #2632381f}.login-icon{width:60px;height:60px;border-radius:8px;display:grid;place-items:center;color:#fff;background:#2f5d62;margin-bottom:18px}.login-panel p{margin:0 0 4px;color:#9f4636;font-weight:800}.login-panel h1{margin:0 0 12px;color:#263238;font-size:1.7rem;letter-spacing:0}.login-panel span{display:block;margin-bottom:18px;color:#53615f}.login-panel small{display:block;margin-top:14px;color:#667370;line-height:1.6}.login-error{margin:0 0 14px;padding:12px;border-radius:8px;color:#6f2f24;background:#fff2ee;border:1px solid #e2aaa0}.login-error button{width:100%;margin-top:10px}@media(max-width:980px){.app-shell{padding:14px}.topbar,.topbar-actions{align-items:stretch;flex-direction:column}.status-badge{min-width:0}.workspace{grid-template-columns:1fr}.document-sheet,.document-sheet.compact{padding:36px 28px}}@media(max-width:620px){.field-grid{grid-template-columns:1fr}.sync-banner{align-items:stretch;flex-direction:column}.document-sheet,.document-sheet.compact{min-height:auto;padding:28px 20px}.signature-output{grid-template-columns:1fr}.date-line{text-align:left}}@page{size:A4;margin:18mm}@media print{:root,body{background:#fff}.no-print{display:none!important}.app-shell{padding:0}.print-layout,.document-sheet{width:100%;max-width:none;margin:0}.document-sheet{min-height:auto;padding:0;border:0;box-shadow:none}.document-sheet h2{font-size:24px}.document-body{font-size:17px;line-height:1.85}}
