@font-face {
  font-family: "Geist";
  src: url("./assets/geist-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("./assets/geist-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("./assets/geist-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("./assets/ibm-plex-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("./assets/noto-sans-sc-ui.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --ground: #f4f3f1;
  --surface: #ffffff;
  --raised: #f0efed;
  --border: #e4e2df;
  --rule: #eeeeec;
  --control: #cfccc8;
  --text: #0d0d0d;
  --muted: #625f5b;
  --faint: #706d68;
  --primary: #151515;
  --negative: #b52831;
  --radius-card: 8px;
  --radius-control: 6px;
  --font: "Geist", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--surface);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(390px, 0.72fr);
  min-height: 100vh;
}

.visual-panel {
  position: relative;
  min-width: 0;
  min-height: 720px;
  overflow: hidden;
  background: var(--ground);
}

.brand {
  position: absolute;
  z-index: 30;
  top: 30px;
  left: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
}

.brand-mark path:first-child,
.auth-symbol path:first-child {
  fill: var(--text);
}

.brand-mark path:last-child,
.auth-symbol path:last-child {
  fill: var(--ground);
}

.wardrobe-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0 30px;
  --card-w: 118px;
  --deck-h: 266px;
}

.model-view {
  position: relative;
  z-index: 8;
  flex: none;
  background: var(--ground);
  height: round(nearest, min(calc(100% - var(--deck-h) + 28px), 902px), 7px);
  aspect-ratio: 1152 / 2016;
}

/* 静图和两段视频都是透明背景，直接叠在网页底色上，不用正片叠底
   （带颜色校正的屏幕上，正片叠底会把白色算偏，人物周围出现浅色方框） */
.model-layers {
  position: absolute;
  inset: 0;
}

/* Safari 不支持透明 webm，用白底 mp4：这时才给整个图层组加正片叠底 */
.model-layers.is-blend {
  mix-blend-mode: multiply;
  background: #fff;
}

.look-still,
.turn-clip {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.look-still.is-fading {
  transition: opacity 280ms ease;
}

.turn-clip {
  opacity: 0;
  background: transparent;
}

.turn-clip.is-visible {
  opacity: 1;
}

.card-deck {
  position: relative;
  z-index: 18;
  flex: none;
  width: 100%;
  height: var(--deck-h);
  margin-top: -28px;
}

.garment-card {
  position: absolute;
  top: 59px; /* 卡片顶部留白 35px + 往下移 24px */
  left: 50%;
  width: var(--card-w);
  aspect-ratio: 3 / 4;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.05),
    0 6px 16px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transform-origin: 50% 120%;
  will-change: transform, opacity;
  transition:
    transform 620ms cubic-bezier(0.22, 0.8, 0.2, 1),
    box-shadow 300ms ease,
    opacity 240ms ease;
}

.garment-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #faf9f7;
  pointer-events: none;
}

.garment-card.is-active {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 14px 28px rgba(0, 0, 0, 0.14);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes loading-pulse {
  to { opacity: 0.25; }
}

.auth-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  min-height: 720px;
  padding: 42px 34px 26px;
  border-left: 1px solid var(--border);
  background: var(--surface);
}

.auth-content {
  align-self: center;
  width: min(100%, 410px);
  margin: auto;
}

.auth-symbol {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--raised);
}

.auth-symbol svg {
  width: 34px;
  height: 34px;
}

.auth-symbol path:last-child {
  fill: var(--raised);
}

.auth-heading {
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.auth-heading p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 184px;
  margin: 32px auto 0;
  padding: 4px;
  border-radius: 8px;
  background: var(--raised);
}

.auth-tab {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--text);
}

#auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color 140ms ease;
}

.field input::placeholder {
  color: var(--faint);
}

.field input:hover {
  border-color: #aaa6a0;
}

.field input:focus {
  border-color: var(--text);
  outline: 2px solid #dad8d4;
  outline-offset: 1px;
}

.field input[aria-invalid="true"] {
  border-color: var(--negative);
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 66px;
}

.reveal-button {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.reveal-button:hover {
  background: var(--raised);
  color: var(--text);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
}

.check-control {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.check-control input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--text);
}

.terms-control {
  max-width: 360px;
}

.text-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #aaa7a3;
  text-underline-offset: 4px;
}

.text-button:hover {
  text-decoration-color: var(--text);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease;
}

.primary-button {
  margin-top: 2px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: #303030;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.secondary-button {
  border: 1px solid var(--control);
  background: var(--surface);
  color: var(--text);
}

.secondary-button:hover {
  border-color: var(--text);
}

.form-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.form-status.is-error {
  color: var(--negative);
}

.account-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--faint);
  font-size: 12px;
}

.account-divider::before,
.account-divider::after {
  height: 1px;
  flex: 1;
  background: var(--rule);
  content: "";
}

.prototype-note {
  margin: 22px auto 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.3fr) minmax(370px, 0.8fr);
  }

  .wardrobe-stage {
    --card-w: 111px;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    display: block;
  }

  .visual-panel {
    min-height: 627px;
  }

  .brand {
    top: 22px;
    left: 24px;
  }

  .visual-panel {
    height: min(130vw, 836px);
  }

  .wardrobe-stage {
    --card-w: 107px;
    --deck-h: 213px;
  }

  .wardrobe-stage {
    padding-top: 60px;
  }

  .auth-panel {
    min-height: auto;
    padding: 70px 24px 26px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .auth-content {
    width: min(100%, 460px);
  }
}

@media (max-width: 520px) {
  .visual-panel {
    min-height: 484px;
  }

  .brand {
    top: 18px;
    left: 16px;
    font-size: 16px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .visual-panel {
    height: 660px;
  }

  .wardrobe-stage {
    --card-w: 85px;
    --deck-h: 171px;
  }

  .wardrobe-stage {
    padding-top: 50px;
  }

  .garment-card {
    top: 45px;
    padding: 3px;
    border-radius: 10px;
  }

  .garment-card img {
    border-radius: 7px;
  }

  .auth-panel {
    padding: 56px 16px 24px;
  }

  .auth-symbol {
    width: 62px;
    height: 62px;
    margin-bottom: 20px;
  }

  .auth-heading h1 {
    font-size: 26px;
  }

  .auth-tabs {
    margin-top: 28px;
  }

  .form-options {
    min-height: 44px;
  }

  .text-button,
  .reveal-button {
    min-height: 44px;
  }

  .primary-button,
  .secondary-button {
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.demo-code-control{display:flex;gap:8px}.demo-code-control input{min-width:0;flex:1}.demo-code-control button{flex:none;border:1px solid #d9d6d1;border-radius:10px;padding:0 12px;background:#fff;color:#222;cursor:pointer}.demo-code-control button:disabled{opacity:.5}
