:root {
  color-scheme: dark;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: #292b30;
  color: #f1f2f4;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(circle at 50% 20%, #55585f 0%, #363940 44%, #23252a 100%);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 760;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 6px;
  color: #c8ccd2;
  font-size: 14px;
}

.status {
  min-width: 86px;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 6px;
  background: rgb(35 37 42 / 72%);
  color: #d9dde3;
  font-size: 13px;
  text-align: center;
}

.status.busy {
  border-color: #d0b572;
  color: #ffe6a6;
}

.status.ok {
  border-color: #80c79a;
  color: #bff0ce;
}

.status.fail {
  border-color: #e18a8a;
  color: #ffd0d0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
}

.panel {
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 8px;
  background: rgb(35 37 42 / 78%);
  box-shadow: 0 18px 52px rgb(0 0 0 / 24%);
}

form.panel {
  min-height: 520px;
  padding: 16px;
}

.side-panel {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}

.undress-button {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  width: auto;
  min-width: 82px;
  margin: 0;
  padding: 8px 14px;
  border-color: rgb(255 255 255 / 18%);
  background: rgb(21 23 27 / 72%);
  color: #eef2f6;
  font-size: 13px;
}

.body-viewer {
  position: relative;
  width: 100%;
  height: 520px;
  min-height: 520px;
  background: radial-gradient(circle at 50% 35%, #5a5d64 0%, #393c43 50%, #24262b 100%);
}

.body-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.body-viewer canvas:active {
  cursor: grabbing;
}

.body-loading {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #d7dbe1;
  font-size: 14px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 14px;
}

.fields label {
  display: grid;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.fields span {
  color: #bfc4cb;
  font-size: 12px;
  font-weight: 700;
}

.fields input,
.fields select {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 6px;
  background: rgb(14 16 20 / 60%);
  color: #f5f6f8;
}

button {
  width: 100%;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid #97bbdc;
  border-radius: 7px;
  background: #c5d9ea;
  color: #1f252b;
  font-weight: 780;
  cursor: pointer;
}

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

.try-on-button {
  width: min(260px, 100%);
  margin-top: 12px;
  border-color: #8fd0a5;
  background: #bdeac9;
}

.inline-result {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.gallery {
  min-height: 180px;
  margin-top: 12px;
  display: block;
  color: #cfd3d8;
}

.cloth-card {
  display: grid;
  width: min(260px, 100%);
  gap: 10px;
  margin-top: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #d7dbe1;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.cloth-card.selected {
  border-color: #9bd2ff;
  box-shadow: 0 0 0 2px rgb(155 210 255 / 18%);
}

.cloth-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 7px;
  background: #1c1e22;
  object-fit: contain;
}

.cloth-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
