* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f3f4f6;
  color: #111827;
  line-height: 1.6;
}
header {
  background: #1f2937;
  color: #fff;
  padding: 20px 16px 16px;
  text-align: center;
}
header h1 { margin: 0 0 4px; font-size: 22px; }
header .subtitle { margin: 0; font-size: 14px; color: #d1d5db; }
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.card h2 { margin: 0 0 12px; font-size: 18px; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 0 18px;
  min-height: 44px;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.wide { width: 100%; margin-top: 10px; }
.hint { color: #6b7280; font-size: 14px; margin: 8px 0 0; }
.hint-inline { color: #6b7280; font-size: 13px; }
.canvas-box {
  position: relative;
  background: #111827;
  border-radius: 10px;
  overflow: hidden;
}
.canvas-box canvas {
  display: block;
  width: 100%;
  height: auto;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 999px;
}
.current { font-weight: 600; margin: 12px 0 4px; }
.row-label { display: block; margin-top: 12px; font-weight: 600; }
input[type="range"] { width: 100%; min-height: 32px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid label { font-weight: 600; font-size: 14px; }
select, input[type="search"] {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  margin-top: 4px;
}
.count { font-size: 14px; color: #6b7280; font-weight: 400; }
.tabs { display: flex; gap: 8px; margin-top: 12px; }
.tab {
  flex: 1;
  min-height: 44px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.tab.active { background: #1f2937; color: #fff; border-color: #1f2937; }
.preset-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 8px 10px 12px;
  min-height: 48px;
  cursor: pointer;
  background: #fafafa;
}
.preset.active { border-color: #2563eb; background: #eff6ff; }
.pname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.star {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  color: #9ca3af;
  flex-shrink: 0;
}
.star.on { color: #f59e0b; }
.empty { color: #6b7280; }
footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 4px 16px 24px;
  color: #6b7280;
  font-size: 13px;
}
footer p { margin: 4px 0; }
