/* 电子契约两个页面共用 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Segoe UI', 'Noto Sans TC', 'Hiragino Sans', sans-serif; background: #f1f3f7; color: #1f2430; font-size: 15px; line-height: 1.6; }
.top { background: #fff; border-bottom: 1px solid #e0e3ea; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.top a { color: #4a5262; text-decoration: none; font-size: 14px; }
.top select { border: 1px solid #c8ccd6; border-radius: 6px; padding: 6px; font-size: 14px; background: #fff; min-height: 36px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 96px; }
.card { background: #fff; border: 1px solid #e0e3ea; border-radius: 10px; padding: 20px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sub { color: #4a5262; font-size: 14px; margin: 0 0 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
button.btn, a.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; font-size: 15px; font-weight: 600; border-radius: 8px; border: 1px solid #1d4e89; background: #1d4e89; color: #fff; cursor: pointer; text-decoration: none; font-family: inherit; }
button.btn:disabled { background: #7b8596; border-color: #7b8596; cursor: not-allowed; }
button.btn.ghost { background: #fff; color: #1d4e89; }
button.btn.danger { background: #fff; color: #a32716; border-color: #a32716; }
button.btn.seal { background: #c8321e; border-color: #c8321e; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-bottom: 12px; }
.field input, .field select { padding: 10px; font-size: 15px; border: 1px solid #a9b4c4; border-radius: 6px; min-height: 44px; font-family: inherit; background: #fff; width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.msg { color: #a32716; font-size: 14px; min-height: 20px; margin: 8px 0; }
.note { background: #fff6e5; border-radius: 6px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.ok-note { background: #e9f6ef; border-radius: 6px; padding: 10px 12px; font-size: 14px; margin: 12px 0; color: #145a3c; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.steps span { padding: 4px 10px; border-radius: 999px; background: #e7eaf0; color: #3f4858; }
.steps span.on { background: #1d4e89; color: #fff; font-weight: 600; }
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: #4a5262; font-weight: 600; }
th, td { padding: 10px 8px; border-bottom: 1px solid #eceef3; }
tr.link { cursor: pointer; }
tr.link:hover { background: #f6f7fa; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 13px; background: #e7eaf0; color: #3f4858; white-space: nowrap; }
.badge.completed, .badge.signed { background: #e0f2e9; color: #145a3c; }
.badge.declined, .badge.expired, .badge.voided { background: #fbe9e6; color: #a32716; }
.badge.sent, .badge.locked { background: #e3edf8; color: #174172; }
.pdf-stage { background: #e4e7ed; border-radius: 8px; padding: 12px; }
.pdf-page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); max-width: 900px; line-height: 0; }
.pdf-page canvas { width: 100%; height: auto; display: block; }
.pdf-page.placing { cursor: crosshair; }
.pdf-box { position: absolute; border: 2px dashed #1d4e89; background: rgba(29, 78, 137, 0.1); color: #123560; font-size: 12px; line-height: 1.2; font-weight: 600; padding: 2px; border-radius: 4px; cursor: pointer; font-family: inherit; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.pdf-box.other { border-color: #8a5a00; background: rgba(138, 90, 0, 0.1); color: #6b4600; }
.pdf-box.me { border: 2px solid #c8321e; background: rgba(200, 50, 30, 0.1); color: #8f1f0f; }
.pdf-box.stamped { border: 0; background: transparent; }
.pdf-box img { width: 100%; height: 100%; object-fit: contain; }
.seal-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-tab { min-height: 44px; padding: 6px 18px; border: 1px solid #1d4e89; border-radius: 6px; background: #fff; color: #1d4e89; font-size: 15px; cursor: pointer; font-family: inherit; }
.btn-tab.on { background: #1d4e89; color: #fff; }
.seal-shapes { display: flex; flex-wrap: wrap; gap: 12px; }
.seal-shape { padding: 10px; background: #fff; border: 2px solid #d5dbe4; border-radius: 8px; cursor: pointer; }
.seal-shape.on { border-color: #1d4e89; }
.seal-shape canvas { width: 96px; height: 96px; display: block; }
.seal-preview { width: 120px; height: 120px; border: 1px dashed #a9b4c4; border-radius: 6px; display: block; }
.chk { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; }
.chk input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #d5dbe4; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; z-index: 5; }
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: #fff; border-radius: 10px; padding: 20px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
dl.kv { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: #4a5262; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.loading { color: #4a5262; padding: 24px 0; text-align: center; }
