@font-face {
  font-family: "QihuangLiShu";
  src: url("/assets/fonts/title-lisu-home-v2.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "QihuangLiShu";
  src: url("/assets/fonts/title-lisu-home-v2.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "QihuangLiShu";
  src: url("/assets/fonts/title-lisu-home-v2.woff2") format("woff2");
  font-display: block;
  font-style: normal;
  font-weight: 800;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
button,
input,
select,
textarea {
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #21170f;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 252, 240, 0.92), transparent 42%),
    linear-gradient(180deg, rgba(247, 239, 217, 0.94), rgba(241, 226, 193, 0.96)),
    #f4ead1;
  letter-spacing: 0;
}

body::before {
  content: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 18px 132px;
  border-bottom: 2px solid rgba(181, 142, 74, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 250, 234, 0.82) 0%, rgba(255, 250, 234, 0.36) 34%, rgba(255, 250, 234, 0.28) 50%, rgba(255, 250, 234, 0.38) 66%, rgba(255, 250, 234, 0.86) 100%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.24), rgba(239, 223, 190, 0.2)),
    url("/assets/header-mountain-bg.webp");
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, cover;
  background-position: center, center, center;
}

.brand-seal {
  position: absolute;
  left: clamp(18px, 6vw, 72px);
  top: 50%;
  transform: translateY(-50%);
  width: 77px;
  height: 77px;
}

.brand-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  text-align: center;
  font-family: "QihuangLiShu", serif;
}

.brand-title strong {
  display: block;
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
  font-weight: 400;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1;
  color: #1f160f;
  text-shadow:
    0 1px 0 rgba(255, 248, 226, 0.82),
    0 2px 0 rgba(194, 164, 104, 0.22),
    0 0 12px rgba(255, 246, 220, 0.68);
}

.brand-title span {
  display: block;
  margin-top: 8px;
  color: #7a6244;
  font-size: 24px;
  text-shadow: 0 1px 0 rgba(255, 248, 226, 0.74), 0 0 10px rgba(255, 246, 220, 0.52);
}

.page {
  position: relative;
  z-index: 1;
}

.upload-page {
  min-height: calc(100vh - 132px);
  display: grid;
  place-items: center;
  padding: 44px 20px 64px;
}

.home-scroll {
  position: relative;
  width: min(100%, 920px);
  padding: clamp(28px, 5vw, 64px);
}

.home-kicker {
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.16;
  text-align: center;
}

.home-kicker > span {
  display: block;
}

.kicker-year {
  color: #d99838;
  font-size: clamp(40px, 4vw, 56px);
}

.kicker-line {
  color: #a43325;
  font-size: clamp(31px, 2.95vw, 43px);
  white-space: nowrap;
}

.kicker-line .kicker-inline-dot {
  display: inline-block;
  color: #20170f;
  margin: 0 0.16em;
  font-size: 0.52em;
  vertical-align: 0.12em;
}

.home-subtitle {
  margin: 16px auto 34px;
  max-width: 720px;
  color: #8a765b;
  font-size: 21px;
  line-height: 1.58;
  text-align: center;
}

.upload-box {
  position: relative;
  display: grid;
  gap: 14px;
  align-items: center;
  justify-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 0 auto;
  padding: 28px;
  border: 2px dashed rgba(143, 106, 47, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.9), rgba(237, 220, 184, 0.62)),
    #fff8e8;
  cursor: pointer;
  overflow: hidden;
}

.upload-box input {
  display: none;
}

.upload-prompt {
  display: grid;
  gap: 14px;
  align-content: center;
  align-items: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.upload-box.has-preview {
  padding: 12px;
  background: #fff8e8;
  cursor: default;
}

.upload-box.has-preview .upload-prompt {
  display: none;
}

.upload-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 170px);
  gap: 18px;
  align-items: center;
  justify-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.floorplan-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  justify-self: start;
  padding: 4px 0 4px 8px;
  overflow: hidden;
  cursor: pointer;
}

.upload-preview {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.direction-panel {
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  justify-self: end;
  width: 100%;
  min-width: 0;
}

.direction-control {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: start;
  justify-content: center;
  row-gap: 8px;
  width: 100%;
  color: #a43325;
  text-align: center;
  font-size: 19px;
}

.direction-control span {
  color: #a43325;
  white-space: nowrap;
}

.direction-control select {
  width: 128px;
  height: 40px;
  padding-left: 11px;
  padding-right: 30px;
  font-size: 18px;
  line-height: 40px;
  background-position: right 10px center;
  background-size: 10px 7px;
}

.direction-compass {
  --compass-angle: 0deg;
  --label-angle: 0deg;
  --pointer-height: 52px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(148px, 24vw, 220px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(166, 123, 57, 0.86);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.compass-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform: rotate(var(--compass-angle));
  transition: transform 180ms ease;
}

.compass-face::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(157, 111, 44, 0.48);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(157, 111, 44, 0.38) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(180deg, transparent calc(50% - 0.5px), rgba(157, 111, 44, 0.38) 50%, transparent calc(50% + 0.5px));
}

.compass-label {
  position: absolute;
  z-index: 2;
  color: #d01818;
  font-family: "QihuangLiShu", serif;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 226, 0.88), 0 0 6px rgba(255, 246, 220, 0.5);
  pointer-events: none;
  transition: transform 180ms ease;
}

.compass-south {
  top: 8px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--label-angle));
}

.compass-west {
  top: 50%;
  right: 10px;
  transform: translateY(-50%) rotate(var(--label-angle));
}

.compass-north {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--label-angle));
}

.compass-east {
  top: 50%;
  left: 10px;
  transform: translateY(-50%) rotate(var(--label-angle));
}

.compass-pointer {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 50%;
  width: 4px;
  height: var(--pointer-height);
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  border-radius: 999px;
  background: #c01818;
  box-shadow: 0 0 0 2px rgba(255, 246, 220, 0.68);
  opacity: 1;
  transition: opacity 180ms ease;
}

.compass-pointer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 14px solid #c01818;
}

.compass-center {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #8f160f;
  box-shadow: 0 0 0 3px rgba(255, 246, 220, 0.8);
}

.upload-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #201812;
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
  transform: translateY(6px);
}

.upload-title img {
  width: 68px;
  height: 52px;
  object-fit: contain;
  transform: translateY(0.03em);
}

.upload-box small {
  position: absolute;
  left: 50%;
  bottom: 1.58em;
  display: block;
  width: min(560px, calc(100% - 48px));
  max-width: 560px;
  color: #8a765b;
  font-size: 21px;
  line-height: 1.58;
  text-align: center;
  transform: translateX(-50%);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(128px, 0.85fr);
  gap: 16px;
  margin: 24px 0;
}

label {
  display: grid;
  gap: 8px;
  color: #5d4730;
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
  font-weight: 400;
  font-size: 23px;
}

input,
select {
  width: 100%;
  height: 52px;
  border: 1px solid #caa96b;
  background: rgba(255, 252, 238, 0.76);
  padding: 0 13px;
  color: #251d16;
  font: 400 21px "QihuangLiShu", serif;
  font-synthesis: none;
  line-height: 52px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  padding-right: 34px;
  background-color: rgba(255, 252, 238, 0.76);
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.25 2.75C1.95 2.35 2.24 1.78 2.74 1.78H11.26C11.76 1.78 12.05 2.35 11.75 2.75L7.49 8.02C7.24 8.33 6.76 8.33 6.51 8.02L2.25 2.75Z' fill='%239b7b43'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 11px 8px;
}

select:required:invalid {
  color: rgba(94, 78, 56, 0.62);
}

option {
  color: #251d16;
}

option[value=""] {
  color: rgba(94, 78, 56, 0.62);
}

.select-row {
  display: grid;
  gap: 8px;
}

.birth-selects {
  grid-template-columns: 1.35fr 1fr 1fr;
}

input::placeholder {
  color: rgba(94, 78, 56, 0.62);
}

button {
  border: 1px solid #9e1b13;
  padding: 14px 18px;
  font: 30px "QihuangLiShu", serif;
  cursor: pointer;
}

.primary,
.secondary {
  width: 100%;
}

.primary {
  color: #fff7e6;
  background: linear-gradient(180deg, #bd2b21, #8f160f);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 184, 0.22);
}

.secondary,
.ghost {
  margin-top: 12px;
  color: #703c18;
  background: rgba(255, 248, 232, 0.78);
  border-color: #bd9653;
}

.ghost {
  width: auto;
  margin: 0;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#downloadButton {
  color: #fff7e6;
  background: linear-gradient(180deg, #bd2b21, #8f160f);
  border-color: #9e1b13;
  box-shadow: inset 0 0 0 1px rgba(255, 222, 184, 0.25);
}

#downloadButton,
#backButton {
  font-family: "QihuangLiShu", serif;
}

#downloadButton:disabled {
  color: #7a6244;
  background: rgba(255, 248, 232, 0.72);
  border-color: #bd9653;
  box-shadow: none;
}

.status,
.issues {
  font-family: "QihuangLiShu", serif;
  font-synthesis: none;
  margin-top: 18px;
  color: #5d4730;
  font-size: 22px;
  line-height: 1.7;
  text-align: center;
}

.issues {
  color: #9e1b13;
}

.report-page {
  min-height: calc(100vh - 132px);
  padding: 36px 20px 64px;
}

.report-shell {
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 238, 0.88), rgba(240, 224, 188, 0.8)),
    #fff8e8;
  box-shadow: 0 34px 90px rgba(83, 54, 20, 0.14);
}

.preview-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.poster-preview {
  display: grid;
  place-items: center;
  min-height: 760px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 252, 238, 0.9), transparent 55%),
    linear-gradient(180deg, #ead9ad, #d8bd7f);
  overflow: auto;
}

.poster-preview span {
  color: #806b48;
  font-size: 24px;
}

.poster-preview svg {
  display: block;
  width: min(100%, 640px);
  height: auto;
  box-shadow: 0 22px 70px rgba(66, 42, 15, 0.24);
}

@media (min-width: 761px) {
  .topbar {
    min-height: 116px;
    padding: 14px 110px;
  }

  .brand-seal {
    width: 66px;
    height: 66px;
  }

  .brand-title strong {
    font-size: clamp(36px, 4.25vw, 58px);
  }

  .brand-title span {
    margin-top: 6px;
    font-size: 20px;
  }

  .upload-page {
    min-height: calc(100vh - 116px);
    padding: 36px 20px 52px;
  }

  .home-scroll {
    width: min(100%, 820px);
    padding: clamp(24px, 2.75vw, 34px) clamp(24px, 4.25vw, 52px);
  }

  .kicker-year {
    font-size: clamp(36px, 3.5vw, 48px);
  }

  .kicker-line {
    font-size: clamp(28px, 2.55vw, 36px);
  }

  .home-subtitle {
    margin: 13px auto 28px;
    max-width: 640px;
    font-size: 18px;
  }

  .upload-box {
    aspect-ratio: 32 / 11;
  }

  .upload-title {
    gap: 12px;
    font-size: 36px;
  }

  .upload-title img {
    width: 58px;
    height: 44px;
  }

  .upload-box small {
    width: min(500px, calc(100% - 40px));
    max-width: 500px;
    font-size: 18px;
  }

  .field-grid {
    gap: 12px;
    margin: 20px 0;
  }

  label {
    gap: 6px;
    font-size: 20px;
  }

  input,
  select {
    height: 46px;
    padding: 0 11px;
    font-size: 18px;
    line-height: 46px;
  }

  button {
    padding: 12px 16px;
    font-size: 26px;
  }

  .status,
  .issues {
    margin-top: 14px;
    font-size: 19px;
  }

  .report-page {
    min-height: calc(100vh - 116px);
    padding: 30px 20px 52px;
  }

  .report-shell {
    width: min(100%, 980px);
    padding: clamp(20px, 3.5vw, 36px);
  }

  .poster-preview {
    min-height: 680px;
    padding: 24px;
  }

  .poster-preview span {
    font-size: 21px;
  }

  .poster-preview svg {
    width: min(100%, 600px);
  }
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    place-items: center;
    min-height: 98px;
    padding: 10px 62px;
  }

  .brand-seal {
    position: absolute;
    left: clamp(12px, 4vw, 18px);
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
  }

  .brand-title {
    width: 100%;
    min-width: 0;
  }

  .brand-title strong {
    font-size: clamp(26px, 7.2vw, 42px);
    white-space: nowrap;
  }

  .brand-title span {
    display: block;
    margin-top: 6px;
    font-size: clamp(17px, 4vw, 22px);
    line-height: 1.15;
    white-space: nowrap;
  }

  .upload-page {
    min-height: calc(100dvh - 98px);
    padding: 12px 10px 14px;
    place-items: start center;
  }

  .home-scroll {
    width: min(100%, 520px);
    padding: 18px 16px;
  }

  .home-kicker {
    line-height: 1.08;
  }

  .kicker-year {
    font-size: 29px;
  }

  .kicker-line {
    font-size: 24px;
  }

  .home-subtitle {
    margin-top: 8px;
    margin-bottom: 14px;
    font-size: 16px;
    line-height: 1.45;
  }

  .upload-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    gap: 7px;
    padding: 12px 14px;
  }

  .upload-box.has-preview {
    padding: 8px;
  }

  .upload-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 126px);
    gap: 8px;
  }

  .floorplan-stage {
    padding: 2px 0 2px 4px;
  }

  .direction-panel {
    gap: 5px;
    width: 100%;
  }

  .direction-control {
    grid-template-columns: 1fr;
    row-gap: 5px;
  }

  .direction-control span {
    font-size: 14px;
    line-height: 1.1;
  }

  .direction-control select {
    width: 112px;
    height: 32px;
    padding-left: 8px;
    padding-right: 24px;
    font-size: 14px;
    line-height: 32px;
    background-position: right 8px center;
    background-size: 9px 6px;
  }

  .direction-compass {
    --pointer-height: 33px;
    width: 128px;
  }

  .compass-face::before {
    inset: 12px;
  }

  .compass-label {
    font-size: 16px;
  }

  .compass-south {
    top: 5px;
  }

  .compass-west {
    right: 6px;
  }

  .compass-north {
    bottom: 5px;
  }

  .compass-east {
    left: 6px;
  }

  .compass-pointer {
    width: 3px;
  }

  .compass-pointer::before {
    top: -9px;
    border-left-width: 7px;
    border-right-width: 7px;
    border-bottom-width: 11px;
  }

  .compass-center {
    width: 9px;
    height: 9px;
  }

  .upload-title {
    gap: 10px;
    font-size: 26px;
    transform: translateY(5px);
  }

  .upload-title img {
    width: 48px;
    height: 36px;
  }

  .upload-box small {
    bottom: 1.45em;
    width: min(360px, calc(100% - 24px));
    max-width: 360px;
    font-size: 16px;
    line-height: 1.45;
  }

  .field-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(108px, 0.8fr);
    gap: 10px 12px;
    margin: 12px 0;
  }

  label {
    gap: 5px;
    font-size: 18px;
  }

  input,
  select {
    height: 38px;
    padding: 0 9px;
    font-size: 17px;
    line-height: 38px;
  }

  select {
    padding-right: 27px;
    background-position: right 10px center;
    background-size: 10px 7px;
  }

  button {
    padding: 9px 12px;
    font-size: 22px;
  }

  .secondary {
    margin-top: 8px;
  }

  .status,
  .issues {
    margin-top: 8px;
    font-size: 17px;
    line-height: 1.35;
  }

  .report-page {
    min-height: calc(100dvh - 98px);
    padding: 0;
  }

  .report-shell {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .poster-preview {
    place-items: start center;
    min-height: calc(100dvh - 98px);
    padding: 0;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .poster-preview svg {
    width: 100%;
    max-width: none;
    box-shadow: none;
  }

  .preview-toolbar {
    flex-direction: column;
    gap: 10px;
    margin: 12px 10px 16px;
  }

  .ghost,
  .preview-toolbar button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .topbar {
    min-height: 78px;
    padding: 6px 48px;
  }

  .brand-seal {
    left: 10px;
    width: 41px;
    height: 41px;
  }

  .upload-page {
    min-height: calc(100dvh - 78px);
    padding: 5px 6px;
  }

  .home-scroll {
    padding: 8px 10px;
  }

  .home-kicker {
    line-height: 1.04;
  }

  .kicker-year {
    font-size: 22px;
  }

  .kicker-line {
    font-size: 17px;
  }

  .home-subtitle {
    margin-top: 5px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.28;
  }

  .upload-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
    gap: 4px;
    padding: 8px;
  }

  .upload-box.has-preview {
    padding: 6px;
  }

  .upload-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 104px);
    gap: 5px;
  }

  .floorplan-stage {
    padding: 2px 0 2px 2px;
  }

  .direction-panel {
    gap: 4px;
    width: 100%;
  }

  .direction-control {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }

  .direction-control span {
    font-size: 11px;
    line-height: 1.05;
  }

  .direction-control select {
    width: 96px;
    height: 28px;
    padding-left: 7px;
    padding-right: 20px;
    font-size: 12px;
    line-height: 28px;
    background-position: right 7px center;
    background-size: 8px 6px;
  }

  .direction-compass {
    --pointer-height: 24px;
    width: 96px;
  }

  .compass-face::before {
    inset: 9px;
  }

  .compass-label {
    font-size: 13px;
  }

  .compass-pointer::before {
    top: -7px;
    border-left-width: 6px;
    border-right-width: 6px;
    border-bottom-width: 9px;
  }

  .compass-south {
    top: 4px;
  }

  .compass-west {
    right: 5px;
  }

  .compass-north {
    bottom: 4px;
  }

  .compass-east {
    left: 5px;
  }

  .compass-center {
    width: 7px;
    height: 7px;
  }

  .upload-title {
    gap: 7px;
    font-size: 20px;
    transform: translateY(3px);
  }

  .upload-title img {
    width: 36px;
    height: 28px;
  }

  .upload-box small {
    bottom: 1.28em;
    width: min(100%, calc(100% - 16px));
    font-size: 13px;
    line-height: 1.28;
  }

  .report-page {
    min-height: calc(100dvh - 78px);
  }

  .poster-preview {
    min-height: calc(100dvh - 78px);
  }

  .field-grid {
    gap: 6px;
    margin: 8px 0;
  }

  label {
    font-size: 15px;
    gap: 4px;
  }

  input,
  select {
    height: 30px;
    padding: 0 6px;
    font-size: 14px;
    line-height: 30px;
  }

  select {
    padding-right: 20px;
    background-position: right 8px center;
    background-size: 9px 6px;
  }

  button {
    padding: 6px 8px;
    font-size: 17px;
  }

  .secondary {
    margin-top: 6px;
  }
}
