/* SVG 轉 PNG：單欄版面、系統字型、無外部資源。 */
:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 880px;
  padding: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.55;
  color: #1a1a1a;
  background: #ffffff;
}
.site-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
h1 { font-size: 1.6rem; margin: 0.2em 0; }
h2 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
.note {
  border-left: 4px solid #b45309;
  background: #fef3c7;
  padding: 0.5rem 0.75rem;
}
textarea {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.85rem;
}
.input-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; margin-top: 0.5rem; }
.drop-zone {
  flex: 1 1 260px;
  border: 2px dashed #6b7280;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
}
.drop-zone.dragging { border-color: #1d4ed8; background: #eff6ff; }
button {
  font: inherit;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #ffffff;
  cursor: pointer;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
#sample-button, #clear-button { background: #ffffff; color: #1f2937; }
#error {
  border: 1px solid #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}
#status { min-height: 1.4em; color: #065f46; }
.facts { margin: 0.25rem 0; padding-left: 1.2rem; }
fieldset { border: 1px solid #d1d5db; border-radius: 8px; margin: 0.75rem 0; }
fieldset > label { margin-right: 1rem; }
.size-inputs { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }
.size-inputs input, #color-input { margin-left: 0.35rem; }
input:focus-visible, button:focus-visible, textarea:focus-visible, .drop-zone:focus-within {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}
.preview-wrap {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow: auto;
}
.preview-wrap[data-bg="transparent"] {
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #ffffff 0% 50%) 0 0 / 24px 24px;
}
.preview-wrap[data-bg="white"] { background: #ffffff; }
#preview-img { max-width: 100%; height: auto; }
footer { margin-top: 2rem; font-size: 0.9rem; color: #374151; }
@media (max-width: 480px) {
  body { padding: 0.75rem; }
  .size-inputs { flex-direction: column; gap: 0.5rem; }
}
