:root {
  color-scheme: light;
  font-family: "PingFang SC", "Songti SC", "STSong", serif;
  background: #f4f6f8;
  color: #111827;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.workspace,
.preview-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

.preview-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.panel {
  background: #fff;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  padding: 16px;
}

h1,
h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
}

.upload {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border: 1px dashed #64748b;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
}

.upload input {
  display: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

input {
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 15px;
}

button,
.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: #1769aa;
  color: white;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.download {
  margin-top: 10px;
  background: #16794c;
}

.hidden {
  display: none;
}

.status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
  color: #4b5563;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
}

th,
td {
  border: 1px solid #d1d5db;
  padding: 8px;
  text-align: left;
}

td[contenteditable="true"] {
  background: #fffdf2;
}

.preview canvas {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
}

@media (max-width: 820px) {
  .app {
    padding: 12px;
  }

  .workspace,
  .preview-grid {
    grid-template-columns: 1fr;
  }
}
