* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f6f8;
  color: #222;
}

.container {
  max-width: 720px;
  margin: 32px auto;
  padding: 24px 28px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

h1 { font-size: 1.4rem; margin-top: 0; }

/* 表单页帮助/导航提示 */
.help-box {
  padding: 14px 18px;
  background: #f7f9fb;
  border: 1px solid #e2e8ef;
  border-radius: 8px;
  margin-bottom: 22px;
  line-height: 1.7;
  font-size: 0.94rem;
  color: #44556b;
}
.help-box p { margin: 0 0 10px; }
.help-box p:last-child { margin-bottom: 0; }
.help-box a {
  color: #3a7bd5;
  text-decoration: none;
  word-break: break-all;
}
.help-box a:hover { text-decoration: underline; }

.field { margin-bottom: 16px; flex: 1; }

.row { display: flex; gap: 16px; }

label { display: block; font-weight: 600; margin-bottom: 6px; }

input[type="text"], input[type="date"], input[type="number"],
input[type="tel"], input[type="email"], textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccd2d8;
  border-radius: 5px;
  font-size: 1rem;
}

input:focus, textarea:focus { outline: 2px solid #3a7bd5; border-color: transparent; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: none;
  border-radius: 5px;
  background: #3a7bd5;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: #2f66b3; }

.btn-secondary { background: #8a97a3; }

.btn-secondary:hover { background: #707d89; }

.actions { display: flex; gap: 12px; margin-top: 12px; }

.pad-wrap {
  border: 1px dashed #98a4ae;
  border-radius: 6px;
  background: #fff;
}

.info-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }

.info-table th, .info-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e9ee;
}

.info-table th { width: 110px; color: #55606b; font-weight: 600; }

.alert {
  padding: 12px 14px;
  background: #fff4e5;
  border-left: 4px solid #e8a33d;
  border-radius: 4px;
}

.steps { list-style: none; padding: 0; margin: 20px 0; }

.steps li {
  position: relative;
  padding: 10px 0 10px 34px;
  color: #98a4ae;
}

.steps li .dot {
  position: absolute;
  left: 6px;
  top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ccd2d8;
  background: #fff;
}

.steps li::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e9ee;
}

.steps li:first-child::before { top: 22px; }
.steps li:last-child::before { bottom: calc(100% - 22px); }

.steps li.done { color: #2e7d32; }
.steps li.done .dot { background: #2e7d32; border-color: #2e7d32; }
.steps li.active { color: #3a7bd5; font-weight: 600; }
.steps li.active .dot { border-color: #3a7bd5; box-shadow: 0 0 0 4px rgba(58,123,213,.15); }

.sig-preview {
  max-width: 300px;
  border: 1px solid #e5e9ee;
  border-radius: 4px;
  background: #fff;
}

.sign-entry {
  text-align: center;
  margin-top: 20px;
}

.sign-open-btn {
  width: 100%;
  max-width: 280px;
  padding: 16px 22px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 6px;
}

.sign-entry-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: #8a97a3;
}

.sign-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9000;
  background: #fff;
  display: flex;
}

.sign-overlay[hidden] { display: none; }

.sign-overlay form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  margin: 0;
}

.sign-tools {
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 8px;
  background: #f0f4fa;
  border-right: 1px solid #dde4ec;
}

.sign-tool-btn {
  flex: 1 1 0;
  min-height: 0;
  border: none;
  border-radius: 8px;
  background: #8a97a3;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 8px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  cursor: pointer;
}

.sign-tool-btn:hover { background: #707d89; }

.sign-tool-btn:disabled { opacity: .6; cursor: wait; }

.sign-tool-submit { background: #3a7bd5; }

.sign-tool-submit:hover { background: #2f66b3; }

.sign-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sign-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: #fff;
  overflow: hidden;
}

#sign-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

.sign-guide {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  z-index: 10;
}

.sign-guide-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 4vh 0;
}

.sign-guide-line {
  flex: 1 1 auto;
  width: 0;
  border-left: 3px dashed rgba(0, 0, 0, 0.25);
}

.sign-guide-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 72px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.12);
  letter-spacing: 10px;
  line-height: 1;
  padding: 14px 0;
  white-space: nowrap;
}

#sign-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

#sign-loading[hidden] { display: none; }

.sign-loading-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.sign-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d7e3f5;
  border-top-color: #3a7bd5;
  border-radius: 50%;
  animation: sign-spin 0.8s linear infinite;
}

.sign-loading-text {
  font-size: 15px;
  color: #334;
  font-weight: 600;
}

@keyframes sign-spin {
  to { transform: rotate(360deg); }
}

.sign-done { text-align: center; }

.sign-done-icon { font-size: 3rem; margin-bottom: 8px; }

.sign-done-tip { color: #667; font-size: 0.92rem; margin-top: 24px; }

@media (max-width: 560px) {
  .container { margin: 0; border-radius: 0; }
  .row { flex-direction: column; gap: 0; }
}
