* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f4f6;
  color: #111827;
}
.top { max-width: 1100px; margin: 0 auto; padding: 24px 20px 8px; }
.top h1 { margin: 0 0 4px; font-size: 26px; }
.top p { margin: 0; color: #4b5563; }

.layout {
  max-width: 1100px; margin: 0 auto; padding: 16px 20px 40px;
  display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start;
}
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } }

.panel { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.field { display: block; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field > legend { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
input[type=tel], input[type=text], input[type=url], textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 11px;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; }
.opt { display: block; margin: 6px 0; font-size: 14px; cursor: pointer; }
.opt small, .hint { color: #6b7280; font-size: 12px; }
.hint { display: block; margin-top: 4px; }
.hint.warn { color: #b45309; }
code { font-size: 12px; background: #f3f4f6; padding: 0 3px; border-radius: 3px; }

.swatches { display: flex; gap: 14px; font-size: 14px; }
.swatches label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.swatches i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #9ca3af; display: inline-block; }

.preview { position: sticky; top: 16px; }
#canvas { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.15); background: #e5e7eb; }
.actions { display: flex; gap: 10px; margin: 16px 0 8px; }
button {
  font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid #2563eb; background: #2563eb; color: #fff;
}
button.ghost { background: #fff; color: #2563eb; }
button:disabled { opacity: .45; cursor: not-allowed; }
.error { color: #b91c1c; font-size: 14px; margin: 12px 0 0; }

#printArea { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .top, .layout { display: none; }
  #printArea { display: block; }
  /* width/height set in mm by app.js so the print is true to size */
  #printImg { display: block; }
}
