:root {
  --bg: #f4f1ea;
  --ink: #1c1916;
  --muted: #5c564e;
  --line: #d9d0c3;
  --card: #fffdf8;
  --accent: #1f5c4d;
  --accent-2: #163f36;
  --danger: #9b2c2c;
  --ok: #1f5c4d;
  --shadow: 0 10px 30px rgba(28, 25, 22, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, #efe6d6 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100%;
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
h1 { font-size: 1.6rem; margin: 0 0 8px; letter-spacing: 0.04em; }
.lead, .hint, .consent, .status { color: var(--muted); line-height: 1.6; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type="text"], input[type="tel"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
.pad-wrap {
  border: 1px dashed #b7aa96;
  border-radius: 16px;
  background:
    linear-gradient(#fff, #fff),
    repeating-linear-gradient(0deg, transparent, transparent 27px, #f0e8da 28px);
  background-clip: padding-box;
  overflow: hidden;
  touch-action: none;
  position: relative;
}
canvas {
  display: block;
  width: 100%;
  height: 220px;
  touch-action: none;
}
.pad-caption {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 12px;
  color: #8a8174;
  pointer-events: none;
}
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 650;
  cursor: pointer;
}
button.primary { background: var(--accent); color: #fff; flex: 1; }
button.primary:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost { background: #efe8db; color: var(--ink); }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13px; }
.consent input { margin-top: 3px; }
.status { margin-top: 14px; min-height: 1.5em; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }
.success-box {
  display: none;
  background: #eef6f2;
  border: 1px solid #cfe3da;
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}
.success-box.show { display: block; }
.fine { font-size: 12px; color: var(--muted); margin-top: 18px; line-height: 1.6; }
@media (min-width: 720px) {
  canvas { height: 260px; }
}
