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

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f7fb;
  color: #1f2937;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

header {
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.subtitle {
  margin: 0;
  color: #6b7280;
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.button.small {
  padding: 6px 12px;
  font-size: 12px;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.drop-zone {
  border: 2px dashed #cbd5f5;
  padding: 24px;
  text-align: center;
  border-radius: 12px;
  color: #6b7280;
  background: #f8fafc;
}

.drop-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: center;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.controls input,
.controls select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

canvas {
  width: 100%;
  background: #111827;
  border-radius: 8px;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.label {
  font-weight: 600;
}

.value {
  background: #eef2ff;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 100%;
  word-break: break-all;
}

.meta {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}

.error {
  color: #dc2626;
}

.hidden {
  display: none;
}
