/* 只做能用的样子，先不追求好看。想调外观，改这个文件就行。 */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #f4f5f7;
  color: #15181d;
  font: 16px/1.65 system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  padding-bottom: 40px;
}

.top { padding: 20px 16px 8px; }
.top h1 { margin: 0; font-size: 20px; font-weight: 700; }
.top .sub { margin: 6px 0 0; color: #6b7280; font-size: 13px; }

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

.tab {
  flex: 1;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: #eef2ff;
  color: #1d4ed8;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.tab.active {
  background: #2563eb;
  color: #fff;
}

main {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.no {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eef2ff;
  color: #2563eb;
  font-size: 12px;
  align-items: center;
  justify-content: center;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.hint {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #6b7280;
}

label {
  display: block;
  font-size: 13px;
  color: #4b5563;
}

label.line { margin-top: 10px; }

input[type="number"],
input[type="text"],
input[type="url"],
input[type="password"],
textarea {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: #111;
}

textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 180px;
  resize: vertical;
}

select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: #111;
}

label.line input[type="checkbox"] {
  width: auto;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.file-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  line-height: 22px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}

button.ghost { background: #eef2ff; color: #1d4ed8; }

button:active { opacity: 0.8; }

.status { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: #6b7280; }
.status.ok { color: #15803d; }
.status.err { color: #b91c1c; }

.inspect {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.inspect-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.inspect-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.inspect-list .issue {
  font-size: 12px;
  line-height: 1.7;
  color: #6b7280;
}

.inspect-list .issue.warn { color: #b45309; }
.inspect-list .issue.error { color: #b91c1c; }
.inspect-list .issue.ok { color: #15803d; }

.note {
  margin: 0 0 6px;
  font-size: 12px;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  padding: 8px 10px;
}

.code {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.export-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}

.export-wrap img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  border-radius: 8px;
  background: #fff;
}

.ref-preview {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  margin-top: 8px;
  border-radius: 8px;
  background: #f3f4f6;
}

.foot {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 20px 16px 0;
}
