@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #717171;
  --dark: #141414;
  --line: #e5e7eb;
  --surface: #f3f4f6;
  --overlay: #41414129;
  --error: #d92d20;
  --pink: #ae3e6a;
  --pink-hover: #933059;
  --pink-soft: #fff1f6;
  --pink-line: #edbfd1;
  --radius-card: 4px;
  --radius-panel: 24px;
  --radius-pill: 9999px;
  --space-xs: 6px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 80px;
  font-family: "M Saans Variable", "M Saans 600", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button, input, textarea {
  font: inherit;
}
button, a, input, textarea, summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  touch-action: manipulation;
}
button:disabled {
  color: var(--muted);
  background: var(--surface);
  cursor: not-allowed;
}
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
.topbar {
  height: 64px;
  max-width: 1280px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.6px;
}
.brand-caption {
  color: var(--pink);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
#progress {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--pink);
  background: var(--pink-soft);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-variant-numeric: tabular-nums;
}
main {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--space-lg);
  row-gap: 56px;
  padding: var(--space-lg) 48px 48px;
}
.hero {
  grid-column: 1 / -1;
}
h1 {
  font-size: clamp(57px, 6.25vw, 80px);
  letter-spacing: -.6px;
  margin: 0 0 var(--space-md);
  font-weight: 650;
  line-height: 1.15;
}
h1 span {
  color: var(--pink);
}
.intro {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.mobile-break {
  display: none;
}
.editor {
  min-width: 0;
}
.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  text-align: left;
  width: 100%;
  min-height: 218px;
  padding: var(--space-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
.slot:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
}
.slot-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.slot-number {
  font-size: 12px;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
}
.slot-label {
  font-size: 16px;
  font-weight: 600;
}
.slot-copy {
  min-width: 0;
}
.slot-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--muted);
  line-height: 20px;
  min-height: 40px;
  padding-right: 20px;
}
.slot-plus {
  position: absolute;
  right: var(--space-sm);
  bottom: 34px;
  font-size: 18px;
  line-height: 20px;
  color: var(--muted);
}
.slot.filled {
  border-color: var(--pink-line);
  background: var(--pink-soft);
}
.slot-media {
  height: 104px;
  background: var(--surface);
  border-radius: var(--radius-card);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 28px;
  font-weight: 300;
  margin-bottom: 12px;
  overflow: hidden;
}
.slot-media img {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.slot.filled .slot-title {
  color: var(--ink);
  font-weight: 600;
}
.helper {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  margin: var(--space-sm) 0 var(--space-md);
}
.personalize {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: var(--space-md);
}
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  font-size: 16px;
  font-weight: 600;
}
summary::-webkit-details-marker {
  display: none;
}
summary > span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: auto;
}
summary::after {
  content: '+';
  font-size: 20px;
  color: var(--muted);
  font-weight: 400;
}
details[open] > summary::after {
  content: '−';
}
label {
  display: block;
  font-size: 14px;
  margin: var(--space-md) 0 8px;
}
input, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
}
textarea {
  border-radius: 16px;
  resize: vertical;
}
input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type=file] {
  border-radius: 8px;
  font-size: 14px;
}
input[type=file]::file-selector-button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  margin-right: 12px;
  background: var(--paper);
  color: var(--ink);
}
.personalize input:last-child {
  margin-bottom: var(--space-md);
}
.primary {
  min-height: 44px;
  border-radius: var(--radius-pill);
  padding: 10px var(--space-sm);
  color: var(--paper);
  background: var(--dark);
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  transition: background .2s;
  white-space: nowrap;
}
.primary:hover:not(:disabled) {
  background: var(--ink);
}
.actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.actions > .primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-inline: var(--space-md);
}
.actions > .primary:not(:disabled) {
  background: var(--pink);
}
.actions > .primary:hover:not(:disabled) {
  background: var(--pink-hover);
}
.primary span {
  font-size: 12px;
  font-weight: 400;
}
.text-button {
  min-height: 44px;
  background: none;
  color: var(--muted);
  padding: 8px 4px;
  font-size: 14px;
}
.text-button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.preview {
  min-width: 0;
  align-self: start;
  position: sticky;
  top: var(--space-md);
  background: var(--surface);
  padding: 0 var(--space-md) var(--space-md);
  border-radius: var(--radius-card);
}
.preview:not([open]) {
  padding-bottom: 0;
}
.preview > summary {
  min-height: 64px;
}
.preview-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 var(--space-sm);
}
.canvas-wrap {
  border: 1px solid var(--line);
  background: var(--paper);
  line-height: 0;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
}
footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-md) 48px 40px;
  font-size: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  width: min(600px, calc(100% - 48px));
  max-height: 90dvh;
  padding: 32px;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: var(--overlay);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.dialog-top h2 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  margin: 0;
}
.icon-button {
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
}
.tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--surface);
  margin-bottom: var(--space-md);
}
.tabs button {
  min-height: 44px;
  background: none;
  border-radius: var(--radius-pill);
  padding: 10px var(--space-sm);
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}
.tabs button[aria-selected=true] {
  background: var(--pink-soft);
  color: var(--ink);
  font-weight: 600;
}
.search-row {
  display: flex;
  gap: 8px;
}
.search-row input {
  min-width: 0;
}
.search-row button {
  flex-shrink: 0;
  padding-inline: 20px;
}
.search-tip {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.example {
  display: inline-block;
  background: none;
  color: var(--pink);
  font-size: 12px;
  min-height: 44px;
  padding: 6px;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}
.example:hover {
  text-decoration-color: var(--ink);
}
#search-intent {
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
}
#search-status {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: var(--space-sm) 0;
}
#results {
  display: grid;
  gap: 8px;
  max-height: 46dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
#results[aria-busy=true] {
  min-height: 60px;
}
.result {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  text-align: left;
  padding: var(--space-sm);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  min-height: 96px;
}
.result:hover {
  border-color: var(--pink);
}
.result img, .result-placeholder {
  width: 44px;
  height: 61px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
  border-radius: var(--radius-card);
}
.result-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 18px;
}
.result strong {
  display: block;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.result small {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  line-height: 1.5;
}
.result .result-copy {
  flex: 1;
  min-width: 0;
}
.result .result-arrow {
  color: var(--muted);
}
.selected-summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  align-items: center;
  background: var(--surface);
  border-radius: 8px;
  padding: 12px var(--space-sm);
  margin: 8px 0 var(--space-md);
}
.selected-summary span {
  font-weight: 600;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.selected-summary button {
  white-space: nowrap;
  flex-shrink: 0;
}
.selected-cover-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.selected-cover-wrap {
  width: 96px;
  height: 136px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-card);
}
.selected-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.selected-cover-copy {
  flex: 1;
  min-width: 0;
}
.selected-cover-copy .helper {
  margin: 8px 0;
}
.selected-cover-copy label {
  margin-top: 12px;
}
.cover-fallback {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
#cover-warning {
  border-left: 2px solid var(--pink);
  padding-left: 12px;
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.danger, .danger:hover, .required {
  color: var(--error);
}
#upload-preview {
  width: 90px;
  max-height: 130px;
  object-fit: cover;
  margin: 10px 0 var(--space-sm);
  border-radius: var(--radius-card);
}
#manual-form > .primary {
  display: block;
  width: 100%;
  margin-top: var(--space-md);
}
#toast {
  position: fixed;
  bottom: var(--space-md);
  left: 50%;
  transform: translate(-50%, 15px);
  background: var(--dark);
  color: var(--paper);
  max-width: 90vw;
  padding: 12px 20px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 5;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#picker-feedback {
  color: var(--ink);
  background: var(--surface);
  padding: 12px var(--space-sm);
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  main {
    column-gap: 40px;
  }
}
@media (max-width: 899px) {
  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .topbar {
    padding: 0 var(--space-md);
  }
  main {
    grid-template-columns: minmax(0, 1fr);
    max-width: 568px;
    padding: 40px var(--space-md) var(--space-md);
    gap: var(--space-md);
  }
  .hero {
    margin-bottom: 8px;
  }
  h1 {
    font-size: 48px;
    line-height: 1.15;
    margin-bottom: 20px;
  }
  h1 span {
    display: block;
  }
  .intro {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
  }
  .mobile-break {
    display: inline;
  }
  .slots {
    gap: 12px;
  }
  .slot {
    min-height: 198px;
    gap: 12px;
    padding: var(--space-sm);
  }
  .slot-top {
    gap: 8px;
  }
  .slot-label {
    font-size: 14px;
  }
  .slot-media {
    height: 84px;
  }
  .helper {
    margin: 12px 0 var(--space-md);
  }
  .personalize {
    margin-top: var(--space-md);
  }
  .preview {
    position: static;
    padding: 0 var(--space-sm) var(--space-sm);
  }
  .preview > summary {
    min-height: 56px;
  }
  .actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    margin: 0;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 12px max(24px, calc((100vw - 520px) / 2)) calc(12px + env(safe-area-inset-bottom));
    gap: var(--space-md);
  }
  .actions > .text-button {
    min-width: 44px;
  }
  footer {
    max-width: 568px;
    padding: 0 var(--space-md) var(--space-md);
  }
  #toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: 90vw;
  }
  dialog {
    width: 100%;
    max-width: none;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
    border-bottom: 0;
    padding: var(--space-md) var(--space-md) max(24px, env(safe-area-inset-bottom));
    scroll-padding-top: var(--space-md);
  }
  .dialog-top {
    margin-bottom: var(--space-sm);
  }
  .dialog-top h2 {
    font-size: 24px;
    line-height: 30px;
  }
  #results {
    max-height: 43dvh;
  }
  .modal-actions .primary {
    min-width: 140px;
  }
}
@media (max-width: 359px) {
  .selected-cover-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .selected-cover-copy {
    width: 100%;
  }
  main {
    padding-inline: var(--space-sm);
  }
  .topbar, dialog {
    padding-inline: var(--space-sm);
  }
  .brand-caption {
    display: none;
  }
  h1 {
    font-size: 40px;
  }
  .slots {
    gap: 10px;
  }
  .slot {
    padding: 12px;
  }
  .slot-top {
    gap: 6px;
  }
  .slot-plus {
    right: 12px;
    bottom: 30px;
  }
  .actions {
    padding-inline: var(--space-sm);
    gap: var(--space-sm);
  }
  .actions > .primary {
    padding-inline: var(--space-sm);
  }
  footer {
    padding-inline: var(--space-sm);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
