@import url("https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@700;900&family=Noto+Serif+SC:wght@700;900&family=ZCOOL+KuaiLe&family=ZCOOL+QingKe+HuangYou&display=swap");

:root {
  --ink: #0b0b0b;
  --paper: #f5eedf;
  --paper-deep: #e5d7bd;
  --green: #b8ff1a;
  --pink: #ff4fb6;
  --yellow: #ffe352;
  --white: #ffffff;
  --muted: #5c564d;
  --shadow: 0 18px 0 rgba(0, 0, 0, 0.88);
  --radius: 8px;
  color-scheme: light;
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(11, 11, 11, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(11, 11, 11, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image:
    repeating-linear-gradient(20deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(95deg, rgba(255, 255, 255, 0.4) 0 2px, transparent 2px 13px);
  mix-blend-mode: multiply;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 22px;
}

.brand-mark {
  min-width: 72px;
  height: 48px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 1000;
  font-size: 1.2rem;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-2deg);
}

.step-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 8px;
  flex: 1;
}

.step-rail span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.step-rail span.is-active,
.step-rail span.is-done {
  background: var(--green);
  color: var(--ink);
}

main {
  position: relative;
}

.screen {
  display: none;
  min-height: calc(100vh - 120px);
  align-content: center;
  padding: 16px 0 34px;
}

.screen.is-active {
  display: grid;
  animation: paste-in 240ms ease-out;
}

@keyframes paste-in {
  from {
    opacity: 0;
    transform: translateY(16px) rotate(-0.5deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

.screen-home {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 44px;
  align-items: center;
}

.home-copy,
.screen-copy {
  max-width: 620px;
}

.stamp {
  display: inline-block;
  margin: 0 0 14px;
  padding: 7px 11px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--pink);
  color: var(--ink);
  font-weight: 1000;
  line-height: 1;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-2deg);
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  font-family:
    "Arial Black", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-weight: 1000;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 {
  font-size: 4.8rem;
  max-width: 7em;
  text-shadow: 5px 5px 0 var(--green), 9px 9px 0 var(--ink);
}

h2 {
  font-size: 3.2rem;
  max-width: 9em;
  text-shadow: 4px 4px 0 var(--yellow);
}

.lead,
.sublead,
.screen-copy p:not(.stamp) {
  max-width: 600px;
  margin: 20px 0 0;
  font-size: 1.18rem;
  line-height: 1.7;
  font-weight: 800;
}

.sublead,
.screen-copy p:not(.stamp) {
  color: var(--muted);
  font-weight: 700;
}

.home-actions,
.button-row,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-top: 28px;
}

.primary-action,
.secondary-action,
.ghost-action,
.convert-action {
  min-height: 56px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 1000;
  line-height: 1.2;
  box-shadow: 6px 6px 0 var(--ink);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.primary-action {
  padding: 0 24px;
  background: var(--green);
  font-size: 1.05rem;
}

.secondary-action,
.ghost-action,
.convert-action {
  padding: 0 18px;
  background: var(--white);
  font-size: 0.98rem;
}

.convert-action {
  background: var(--pink);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.convert-action:hover {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 var(--ink);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.ghost-action:focus-visible,
.convert-action:focus-visible,
.brand-mark:focus-visible,
.identity-chip:focus-visible,
.quick-chip:focus-visible,
.result-card:focus-visible,
.tone-switch button:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 3px;
}

.hero-board {
  position: relative;
  min-height: 610px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(-10deg, rgba(0, 0, 0, 0.05) 0 12px, transparent 12px 24px),
    #f9f2e2;
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.shirt-card {
  position: absolute;
  inset: 54px 70px 52px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: #d9d0bd;
  overflow: hidden;
}

.hero-preview {
  position: relative;
  z-index: 1;
  width: min(88%, 420px);
  height: auto;
  max-height: 520px;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.22));
}

.hero-example-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.shirt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.64), transparent 62%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.09) 0 2px, transparent 2px 18px);
  opacity: 0.58;
}

.css-shirt {
  position: relative;
  width: 268px;
  height: 360px;
  border: 3px solid rgba(0, 0, 0, 0.3);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.07)),
    #fffefa;
  clip-path: polygon(32% 0, 68% 0, 82% 18%, 100% 25%, 88% 45%, 76% 37%, 76% 100%, 24% 100%, 24% 37%, 12% 45%, 0 25%, 18% 18%);
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.24));
}

.css-shirt::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 72px;
  height: 48px;
  border: 7px solid rgba(0, 0, 0, 0.12);
  border-top: 0;
  border-radius: 0 0 48px 48px;
  transform: translateX(-50%);
}

.css-shirt span {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 58%;
  transform: translate(-50%, -50%) rotate(-2deg);
  color: var(--ink);
  font-family:
    "Arial Black", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
}

.sticker {
  position: absolute;
  z-index: 2;
  max-width: 148px;
  padding: 9px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  font-weight: 1000;
  box-shadow: 5px 5px 0 var(--ink);
}

.sticker.hot {
  top: 32px;
  left: 34px;
  background: var(--pink);
  transform: rotate(-7deg);
}

.sticker.worker {
  right: 26px;
  top: 96px;
  background: var(--green);
  transform: rotate(5deg);
}

.sticker.print {
  left: 38px;
  bottom: 88px;
  transform: rotate(4deg);
}

.sticker.save {
  right: 34px;
  bottom: 42px;
  background: #fff;
  transform: rotate(-4deg);
}

.tape {
  position: absolute;
  z-index: 3;
  width: 120px;
  height: 28px;
  background: rgba(255, 227, 82, 0.76);
  border: 2px solid rgba(11, 11, 11, 0.34);
}

.tape-a {
  top: 20px;
  left: 45%;
  transform: rotate(-8deg);
}

.tape-b {
  right: 32px;
  bottom: 152px;
  transform: rotate(11deg);
}

.identity-grid,
.quick-grid,
.result-stack {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.identity-grid {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.identity-chip,
.quick-chip {
  min-height: 62px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 1000;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(var(--tilt, 0deg));
}

.identity-chip.is-selected,
.quick-chip:hover {
  background: var(--green);
  box-shadow: 0 0 0 6px var(--yellow), 5px 5px 0 var(--ink);
}

.sticky-action {
  width: fit-content;
  margin-top: 32px;
}

.text-box {
  display: block;
  max-width: 760px;
  margin-top: 34px;
}

.text-box span,
.text-box small {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

textarea {
  width: 100%;
  min-height: 172px;
  resize: none;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  background: #fffdf5;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 1000;
  line-height: 1.35;
  box-shadow: 8px 8px 0 var(--ink);
}

textarea::placeholder {
  color: rgba(11, 11, 11, 0.38);
}

.field-error {
  min-height: 28px;
  margin: 14px 0 0;
  color: #ad004c;
  font-weight: 1000;
}

.field-error:empty,
.inline-status:empty {
  display: none;
}

.inline-status {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.5;
}

.inline-status.is-error,
.generation-status.is-error {
  color: #ad004c;
}

.generation-status {
  margin-top: 20px;
}

.quick-grid {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  max-width: 760px;
}

.quick-chip {
  min-height: 48px;
  background: var(--yellow);
  font-size: 0.95rem;
}

.result-stack {
  max-width: 880px;
}

.result-card {
  position: relative;
  width: 100%;
  min-height: 118px;
  padding: 24px 72px 24px 26px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf5;
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  text-align: left;
  transform: rotate(var(--tilt, 0deg));
}

.result-card strong {
  display: block;
  font-family:
    "Arial Black", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 1000;
  line-height: 1.16;
}

.result-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 900;
}

.result-card.is-selected {
  background: var(--green);
}

.result-card.is-selected::after {
  content: "就它了";
  position: absolute;
  right: 16px;
  top: 16px;
  padding: 7px 9px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--pink);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 1000;
  transform: rotate(8deg);
}

.note {
  max-width: 720px;
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 3px dashed var(--ink);
  background: rgba(255, 227, 82, 0.72);
  color: var(--ink);
  font-weight: 900;
}

.font-library {
  width: min(100%, 920px);
  margin-top: 28px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf5;
  padding: 14px;
  box-shadow: 7px 7px 0 var(--ink);
}

.font-library-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 2px 12px;
}

.font-library-head strong {
  font-size: 1.08rem;
  font-weight: 1000;
}

.font-library-head span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.font-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.font-template-chip {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 1000;
  line-height: 1.15;
}

.font-template-chip.is-selected {
  background: var(--green);
  box-shadow: inset 0 0 0 4px var(--yellow);
}

.art-preview,
.mockup-preview {
  display: grid;
  width: min(100%, 520px);
  min-height: 360px;
  place-items: center;
  margin-top: 34px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(0, 0, 0, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.06) 75%),
    #fffdf5;
  background-position:
    0 0,
    0 16px,
    16px -16px,
    -16px 0;
  background-size: 32px 32px;
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}

.art-preview img {
  width: min(82%, 420px);
  height: auto;
}

.mockup-preview {
  width: min(100%, 580px);
  min-height: 620px;
  background: #d8c8aa;
}

.mockup-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.tone-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: min(100%, 360px);
  margin-top: 28px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf5;
  box-shadow: 5px 5px 0 var(--ink);
}

.tone-switch button {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-weight: 1000;
}

.tone-switch button[aria-pressed="true"] {
  background: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(11, 11, 11, 0.72);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(100%, 520px);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 28px;
  box-shadow: 10px 10px 0 var(--green);
}

.modal-panel h2 {
  font-size: 2.4rem;
}

.modal-panel p:not(.stamp) {
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

@media (max-width: 860px) {
  body {
    background-size: 22px 22px;
  }

  .app-shell {
    width: 100%;
    padding: 10px 12px 32px;
  }

  .topbar {
    align-items: stretch;
    gap: 12px;
  }

  .brand-mark {
    min-width: 58px;
    height: 42px;
    font-size: 1rem;
  }

  .step-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-rail span {
    min-height: 30px;
    font-size: 0.72rem;
  }

  .screen {
    min-height: auto;
    align-content: start;
    padding-bottom: 26px;
  }

  .screen-home {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  h1 {
    max-width: none;
    font-size: 2.35rem;
    text-shadow: 3px 3px 0 var(--green), 5px 5px 0 var(--ink);
  }

  h2 {
    max-width: none;
    font-size: 2rem;
    text-shadow: 3px 3px 0 var(--yellow);
  }

  .lead,
  .sublead,
  .screen-copy p:not(.stamp) {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 14px;
  }

  .hero-board {
    min-height: 380px;
    box-shadow: 9px 9px 0 var(--ink);
  }

  .shirt-card {
    inset: 42px 26px 42px;
  }

  .hero-preview {
    width: min(96%, 330px);
    max-height: 330px;
  }

  .css-shirt {
    width: 192px;
    height: 270px;
  }

  .css-shirt span {
    font-size: 0.95rem;
  }

  .sticker {
    max-width: 116px;
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .sticker.worker {
    right: 12px;
  }

  .sticker.print {
    bottom: 58px;
  }

  .sticker.save {
    right: 14px;
    bottom: 22px;
  }

  .identity-grid,
  .quick-grid,
  .font-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .identity-chip {
    min-height: 56px;
  }

  textarea {
    min-height: 126px;
    padding: 16px;
    font-size: 1.12rem;
  }

  .result-card {
    padding: 20px 18px;
  }

  .result-card strong {
    font-size: 1.46rem;
  }

  .result-card.is-selected::after {
    position: static;
    display: inline-block;
    margin-top: 14px;
  }

  .primary-action,
  .secondary-action,
  .ghost-action,
  .convert-action {
    width: 100%;
  }

  .button-row,
  .home-actions,
  .modal-actions {
    width: 100%;
  }

  .sticky-action {
    width: 100%;
  }

  .art-preview {
    min-height: 300px;
  }

  .mockup-preview {
    min-height: 430px;
  }

  .modal-panel {
    padding: 22px;
  }

  .modal-panel h2 {
    font-size: 2rem;
  }
}

@media (max-width: 430px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .step-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .identity-grid,
  .quick-grid,
  .font-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.82rem;
  }

  .stamp {
    margin-bottom: 10px;
  }

  .home-actions,
  .button-row,
  .modal-actions {
    margin-top: 22px;
  }

  .hero-board {
    min-height: 330px;
  }

  .shirt-card {
    inset: 38px 18px 36px;
  }

  .hero-preview {
    max-height: 288px;
  }

  .sticker {
    max-width: 100px;
    font-size: 0.72rem;
  }

  .sticker.hot {
    left: 18px;
  }

  .sticker.worker {
    top: 76px;
  }

  .sticker.print {
    left: 18px;
    bottom: 46px;
  }

  .sticker.save {
    bottom: 18px;
  }
}
