@font-face {
  font-family: "NanoOldSong-A";
  src: url("./assets/fonts/NanoOldSongA-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NanoOldSongA";
  src: url("./assets/fonts/NanoOldSongA-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ui-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --ink: #2b241c;
  --muted: #766b5b;
  --panel: #fffdf7;
  --line: #ded4c2;
  --accent: #bb2f21;
  --field: #f7f1e4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui-font);
  color: var(--ink);
  background: #d7cdb8;
}

button,
input,
select,
option,
textarea {
  font-family: var(--ui-font);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  min-height: 100vh;
}

.preview-area {
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: auto;
}

.canvas-wrap {
  width: min(68vh, calc(100vw - 440px));
  min-width: 390px;
  aspect-ratio: 3 / 4;
  box-shadow: 0 26px 64px rgba(53, 43, 29, 0.28);
  background: #efe8d8;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

canvas.dragging {
  cursor: grabbing;
}

.control-panel {
  border-left: 1px solid rgba(87, 70, 44, 0.18);
  background: var(--panel);
  padding: 28px 24px;
  overflow-y: auto;
  font-family: var(--ui-font);
}

.control-panel *,
.file-picker span,
.tool-row button,
.primary-action {
  font-family: var(--ui-font);
}

.control-panel header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.panel-section {
  display: grid;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid #cdbf9f;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 86px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span,
button {
  min-height: 40px;
  border: 1px solid #bcae91;
  border-radius: 6px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fbf6e8;
  text-align: center;
  cursor: pointer;
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action {
  width: 100%;
  margin-top: 20px;
  min-height: 46px;
  border-color: #9c241b;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.status-line {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .preview-area {
    padding: 18px;
  }

  .canvas-wrap {
    width: min(100%, 520px);
    min-width: 0;
  }

  .control-panel {
    border-left: 0;
    border-top: 1px solid rgba(87, 70, 44, 0.18);
  }
}
