.jk-editor, .jk-editor * { box-sizing: border-box; }
.jk-editor {
  --jk-ink: #383b28;
  --jk-muted: #71634e;
  --jk-border: #d9cbb4;
  width: min(1200px, calc(100% - 32px));
  max-width: none;
  max-height: 92dvh;
  margin: auto;
  padding: 26px;
  color: var(--jk-ink);
  background: #fbf6eb;
  border: 1px solid var(--jk-border);
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 24px 70px #25201450;
}
.jk-editor::backdrop { background: #2823188c; }
.jk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--jk-border);
}
.jk-header h2 {
  margin: 0;
  color: inherit;
  font: 500 clamp(23px, 3vw, 32px)/1.25 "Songti SC", SimSun, serif;
}
.jk-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--jk-border);
  border-radius: 50%;
  color: var(--jk-ink);
  font: 25px/1 sans-serif;
}
.jk-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
}
.jk-editor .jk-form {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}
.jk-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.jk-wide { grid-column: 1 / -1; }
.jk-editor .jk-fields label { display: block; min-width: 0; margin: 0; font-size: 13px; line-height: 1.5; }
.jk-editor .jk-fields label[hidden] { display: none; }
.jk-fields small, .jk-counter, .jk-photo-status, .jk-status { color: var(--jk-muted); font-size: 12px; }
.jk-fields small { margin-left: 4px; }
.jk-editor .jk-fields :is(input, select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin: 5px 0 0;
  padding: 9px 10px;
  border: 1px solid var(--jk-border);
  border-radius: 5px;
  background: #fffdf7;
  color: var(--jk-ink);
  font: 16px/1.45 system-ui, sans-serif;
}
.jk-fields textarea { resize: vertical; }
.jk-palette { min-width: 0; margin: 0; padding: 0; border: 0; }
.jk-palette legend { padding: 0; margin-bottom: 5px; font-size: 13px; }
.jk-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.jk-editor .jk-swatches label { position: relative; cursor: pointer; }
.jk-editor .jk-swatches input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
}
.jk-swatches span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 5px;
  background: #f0e1ca;
  color: #5c482f;
}
.jk-swatches [value="blue"] + span { background: #dbeafa; color: #284862; }
.jk-swatches [value="purple"] + span { background: #eaddf6; color: #51375e; }
.jk-swatches [value="green"] + span { background: #e0eed9; color: #365239; }
.jk-swatches input:checked + span { border-color: currentColor; font-weight: 700; }
.jk-swatches input:focus-visible + span { outline: 2px solid #526141; outline-offset: 2px; }
.jk-counter { display: block; margin-top: 4px; text-align: right; }
.jk-photo-status:not(:empty) { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.jk-preview {
  position: sticky;
  top: 0;
  padding: 12px;
  border: 1px solid var(--jk-border);
  border-radius: 6px;
  background: #e9ddc9;
}
.jk-preview canvas {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 18px #3d2d2528;
}
.jk-sheet {
  position: relative;
  --jk-preview-height: 58dvh;
  width: min(100%, calc(var(--jk-preview-height) * 4 / 3));
  margin-inline: auto;
}
.jk-sheet[data-orientation="portrait"] {
  width: min(100%, calc(var(--jk-preview-height) * 3 / 4));
}
.jk-sticker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.jk-editor .jk-sticker-target {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}
.jk-editor .jk-sticker-target:active { cursor: grabbing; }
.jk-editor .jk-sticker-target:is([aria-pressed="true"], :focus-visible) {
  outline: 2px dashed #526141;
  outline-offset: 3px;
}
.jk-sticker-status {
  margin: 8px 0 0;
  color: var(--jk-muted);
  font-size: 12px;
}
.jk-sticker-status:empty { display: none; }
.jk-actions { margin-top: 12px; }
.jk-editor .jk-save, .jk-entry-link {
  display: inline-block;
  border: 1px solid #526141;
  border-radius: 4px;
  background: #526141;
  color: #fffdf7;
  padding: 10px 16px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.jk-status { margin: 6px 0 0; line-height: 1.5; }
.jk-status:empty { display: none; }
.jk-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  grid-column: 1 / -1;
  margin: 24px 0 32px;
  padding: 22px 24px;
  border: 1px solid #dbcfb8;
  background: #f5ecda;
  color: #3d4932;
  border-radius: 7px;
}
.jk-entry h3 { margin: 0 0 4px; font: 500 22px/1.4 "Songti SC", SimSun, serif; }
.jk-entry p { margin: 0; color: #615541; font-size: 13px; line-height: 1.6; }
.jk-entry .jk-entry-link { font-size: 13px; }
@media (max-width: 740px) {
  .jk-editor { width: calc(100% - 20px); padding: 16px; }
  .jk-workspace { display: flex; flex-direction: column-reverse; gap: 18px; }
  .jk-preview, .jk-form { width: 100%; }
  .jk-preview { position: static; }
  .jk-sheet { --jk-preview-height: 54dvh; }
  .jk-header { margin-bottom: 14px; }
  .jk-entry { padding: 16px 18px; }
}
