:root {
  --success: #08c568;
  --page-bg: #f0f0f0;
  --line: #eeeeee;
  --text: #111111;
  --muted: #8a8f99;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.phone-page {
  min-height: 100vh;
  background: var(--page-bg);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.intro {
  background: #ffffff;
  padding: 18px 20px 18px;
}

.intro h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

.intro p {
  margin: 0;
  color: #7a818c;
  font-size: 16px;
  line-height: 1.35;
}

.upload-form {
  padding: 14px 14px 0;
}

.panel {
  margin-bottom: 14px;
  padding: 14px 12px 10px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
}

.panel-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.ratio-tag {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 13px;
  background: #f2f3f5;
  color: #9aa0aa;
  font-size: 13px;
}

.field-row {
  margin-top: 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}

.field-row span {
  flex: 0 0 118px;
  padding-left: 14px;
  font-size: 18px;
}

.field-row input {
  min-width: 0;
  flex: 1;
  height: 38px;
  border: 0;
  outline: none;
  color: #222222;
  font-size: 18px;
  background: transparent;
}

.field-row input::placeholder {
  color: #9aa0aa;
}

.image-grid {
  min-height: 112px;
  padding: 16px 14px 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: start;
}

.add-tile,
.preview-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.add-tile {
  border: 2px dashed #d3d3d3;
  background: #eeeeee;
  color: #a0a4ac;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
}

.plus {
  font-size: 30px;
  line-height: 24px;
  font-weight: 300;
}

.preview-tile {
  position: relative;
  overflow: hidden;
  background: #f2f2f2;
}

.preview-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  line-height: 22px;
  font-size: 20px;
}

.file-input {
  display: none;
}

.upload-count {
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--line);
  color: #a1a6af;
  text-align: center;
  font-size: 14px;
}

.submit-btn {
  display: block;
  width: 230px;
  height: 54px;
  margin: 36px auto 0;
  border: 0;
  border-radius: 8px;
  background: var(--success);
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 7px 14px rgba(8, 197, 104, 0.22);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn[disabled] {
  background: #b9bec6;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  z-index: 50;
  max-width: calc(100vw - 48px);
  padding: 13px 18px;
  border-radius: 9px;
  background: rgba(20, 20, 20, 0.86);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.success-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.34);
}

.success-mask[hidden] {
  display: none;
}

.success-dialog {
  width: min(320px, 100%);
  padding: 28px 22px 24px;
  border-radius: 10px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.success-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
  line-height: 54px;
  font-size: 32px;
  font-weight: 700;
}

.success-title {
  font-size: 21px;
  font-weight: 800;
  color: #111111;
}

.success-desc {
  margin-top: 10px;
  color: #596273;
  font-size: 16px;
  line-height: 1.45;
}

.success-sub {
  margin-top: 12px;
  color: #9aa0aa;
  font-size: 14px;
}

@media (min-width: 520px) {
  body {
    background: #2d2d2d;
    display: flex;
    justify-content: center;
    padding: 22px 0;
  }

  .phone-page {
    width: 489px;
    min-height: calc(100vh - 44px);
    border-radius: 32px;
    overflow: hidden;
  }
}

@media (max-width: 380px) {
  .field-row span {
    flex-basis: 100px;
    padding-left: 8px;
    font-size: 16px;
  }

  .field-row input {
    font-size: 16px;
  }

  .image-grid {
    padding-left: 8px;
    padding-right: 8px;
    gap: 8px;
  }
}
