:root {
  --sage: #8aa45f;
  --sage-dark: #5e7441;
  --sage-soft: #edf3df;
  --taupe: #c9b99d;
  --ink: #4d463d;
  --muted: #887f71;
  --paper: #fffaf0;
  --line: #ded3bd;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f3efe6;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(420px, 1fr);
  gap: 24px;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.panel {
  background: var(--panel);
  border: 1px solid #e7dfd0;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(95, 83, 62, 0.08);
}

.controls {
  align-self: start;
  padding: 22px;
  position: sticky;
  top: 18px;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 20px;
}

.mini-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--sage-soft);
  border: 1px solid #d9e2c8;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 16px;
}

p,
span {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdf8;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.segmented {
  border: 0;
  padding: 0;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented legend {
  grid-column: 1 / -1;
  font-size: 14px;
  margin-bottom: 2px;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fffdf8;
}

.segmented input:checked + span {
  color: #fff;
  border-color: var(--sage);
  background: var(--sage);
}

.upload-block {
  border: 1px dashed #b9c89a;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf6;
}

.upload-block input,
.photo-section input {
  width: 100%;
}

.upload-block span {
  font-size: 13px;
}

.check-section,
.photo-section {
  display: grid;
  gap: 10px;
}

.checks-grid,
.phrase-list {
  display: grid;
  gap: 14px;
}

.check-group {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #f0eadf;
  padding-bottom: 12px;
}

.check-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
}

.choice-list,
.phrase-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-chip,
.phrase-chip {
  border: 1px solid #e5d6a4;
  border-radius: 999px;
  padding: 7px 12px;
  color: #594f42;
  background: #f4f0e7;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.choice-chip.is-selected,
.phrase-chip {
  border-color: #f1d439;
  background: #ffe246;
}

.wide-label {
  min-width: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title span {
  font-size: 12px;
  color: var(--sage-dark);
}

.section-title b {
  color: var(--sage-dark);
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  background: var(--sage);
  cursor: pointer;
  font-weight: 800;
}

button.secondary {
  color: var(--sage-dark);
  background: var(--sage-soft);
}

button.choice-chip,
button.phrase-chip {
  border: 1px solid #e5d6a4;
  border-radius: 999px;
  padding: 7px 12px;
  color: #594f42;
  background: #f4f0e7;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  font-weight: 800;
}

button.choice-chip.is-selected,
button.phrase-chip {
  border-color: #f1d439;
  background: #ffe246;
}

.save-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(34, 31, 26, 0.62);
}

.save-sheet[hidden] {
  display: none;
}

.save-panel {
  width: min(440px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fffdf8;
  border-radius: 8px;
  padding: 16px;
}

.save-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.save-head p {
  margin-top: 4px;
  font-size: 13px;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

#savePreview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  -webkit-touch-callout: default;
  user-select: auto;
}

.preview-wrap {
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 12px;
}

#poster {
  width: min(100%, 540px);
  height: auto;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(72, 61, 43, 0.18);
}

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

  .controls {
    position: static;
  }

  .preview-wrap {
    padding: 0 0 20px;
  }
}
