/* ─── Header ───────────────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 24px 0 20px;
}
.page-header .badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}
.page-header p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.btn[hidden] {
  display: none !important;
}

.btn:active { transform: scale(0.97); }
.btn-primary {
  width: min(76.9vw, 420px);
  margin: 28px auto 0;
  background: #fff;
  color: #F70101;
}
.btn-primary:disabled,
.btn-primary.btn-locked {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-gold {
  background: var(--gold);
  color: #7B4000;
  box-shadow: 0 4px 15px rgba(255,165,0,0.4);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Upload Screen ─────────────────────────────────────────────── */
.upload-progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.upload-dot {
  width: 34px;
  height: 34px;
  border: 1px solid #ead7cc;
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,107,53,0.28);
}

.upload-dot.uploaded:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}

.upload-steps {
  margin: 20px auto 0;
  width: 76.9vw;
  max-width: 480px;
  position: relative;
}

.upload-step {
  display: none;
  width: 100%;
  aspect-ratio: 300 / 397.22;
}

.upload-step.active {
  display: block;
}

.upload-bg {
  width: 100%;
  height: 100%;
  position: relative;
  background-image: url("../img/bk-img-card.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.upload-frame {
  position: absolute;
  top: 6%;
  left: 50%;
  width: 85%;
  aspect-ratio: 300 / 397.22;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}

.upload-slot {
  position: absolute;
  top: 6%;
  left: 50%;
  width: 85%;
  aspect-ratio: 300 / 397.22;
  transform: translateX(-50%);
  z-index: 3;

  overflow: hidden;

  clip-path: polygon(
    0 0,
    calc(100% - 38px) 0,
    100% 38px,
    100% 100%,
    0 100%
  );
}

.upload-slot.is-locked {
  pointer-events: none;
}

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 5;
  cursor: pointer;
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.upload-slot.has-image .upload-preview {
  display: block;
}

.upload-change {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 6;
  display: none;
  width: auto;
  min-width: 88px;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.upload-slot.has-image .upload-change {
  display: block;
}

.upload-slot.is-locked .upload-change {
  display: none;
}

.upload-description {
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.upload-description span {
  flex-shrink: 0;
  margin-top: 3px;
}

.upload-description span img {
  display: block;
  width: 24px;
}

.upload-description p {
  font-size: 12px;
  margin: 0;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.upload-plus {
  font-size: 38px;
  line-height: 1;
  font-weight: 300;
  color: #ccc;
}

.upload-label {
  font-size: 13px;
  color: #bbb;
}

.upload-tip {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

#btn-generate {
  max-width: 420px;
  margin: 28px auto 0;
}

.btn-upload {
  width: min(76.9vw, 420px);
  margin: 28px auto 0;
  background: #fff;
  color: #F70101;
}

.btn-upload:disabled,
#btn-generate:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.upload-pass {
  display: none;
}

.upload-pass button {
  border: 0;
  padding: 24px 0px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.upload-pass.is-visible {
  display: block;
}

/* ─── Report Screen ─────────────────────────────────────────────── */
.reportimg-bg {
  width: 100%;
  position: relative;
  padding: 28px var(--content-padding) 8px;
  background: #cc0000;
}

.reportimg--free {
  width: min(100%, 520px);
  margin: 0 auto;
}

.report-title-img {
  width: 76%;
  margin: 0 auto 12px;
}

.report-photo-grid {
  display: grid;
  gap: 16px;
  position: relative;
}

.report-photo-grid[data-count="1"] {
  grid-template-columns: 72%;
  justify-content: center;
}

.report-photo-grid[data-count="2"],
.report-photo-grid[data-count="3"],
.report-photo-grid[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-photo-grid[data-count="3"] .report-photo-card:nth-child(3) {
  grid-column: 1 / 3;
  width: calc((100% - 16px) / 2);
  justify-self: center;
}

.report-photo-grid[data-count="2"]::before,
.report-photo-grid[data-count="3"]::before,
.report-photo-grid[data-count="4"]::before,
.report-photo-grid[data-count="4"]::after {
  content: "";
  position: absolute;
  left: 50%;
  z-index: 2;
  width: 1px;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.9) 0 8px,
    transparent 8px 16px
  );
  pointer-events: none;
}

.report-photo-grid[data-count="2"]::before {
  top: 0;
  height: 100%;
}

.report-photo-grid[data-count="3"]::before,
.report-photo-grid[data-count="4"]::before {
  top: 0;
  height: calc((100% - 16px) / 2);
}

.report-photo-grid[data-count="4"]::after {
  top: calc((100% + 16px) / 2);
  height: calc((100% - 16px) / 2);
}

.report-photo-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 160 / 211.85;
  background-image: url("../img/bk-img-card.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.report-photo-card img {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  object-fit: cover;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
}

.report-copy {
  margin-top: 28px;
  text-align: center;
  color: #fff;
}

.report-copy-title {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 7px 24px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 20px;
  line-height: 1.2;
  min-width: 220px;
}

.report-copy-body {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 300;
}

.report-page-logo {
  width: 52%;
  margin: 28px auto 0;
}

.report-wrapper {
  width: 100%;
  padding: 0 var(--content-padding) 42px;
  background: #cc0000;
  margin: 0 auto;
  text-align: center;
}

.report-img-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#report-img {
  width: 1px;
  height: auto;
}

#btn-go-share {
  margin: 0 auto;
}

.corner-bottom-small,.corner-top-small{
  font-size: 10px;
}

.nextevent{
  background-color: #ffffff;
  color: #e10600;
  padding: 20px 16px;
  font-size: 13px;
  border-radius: 20px;
  font-weight: 400;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

.extevent-group{
  padding: 0;
}

.nextevent-item{
  text-align: left;
  margin-bottom: 16px;
}

.nextevent-01{
  margin: 0;
  display: flex;
  font-size: 14px;
  font-weight: 400;
  align-items: center;
}

.nextevent-02{
  margin: 0;
}

.section-title-p2{
  position: relative;
  margin: 0 auto -20px;
  z-index: 99;
  width: fit-content;
}

.section-title-p3{
  padding: 8px;
  font-size: 14px;
  width: fit-content;
  margin: 20px auto 16px;
  color: #ffffff;
  line-height: 110%;
  min-width: 260px;
  border-radius: 24px;
}

.psmemo{
  margin: 8px auto 0;
  background-color: #ffffff;
  padding: 8px;
  font-size: 11px;
  border-radius: 8px;
  text-align: left;
}

.ps-01{
  color: #000000;
}

.ps-02{
  color: #434343;
}

.psmemo-small{
  margin: 16px 0 0;
  text-align: left;
  font-size: 10px;
}

.to-extevent{
  font-size: 14px;
  font-weight: 300;
  margin: 20px auto 40px;
}

/* ─── Share Screen ──────────────────────────────────────────────── */
.share-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.share-icon { font-size: 56px; margin-bottom: 16px; }
.share-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.share-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

.share-steps {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-top: 16px;
}
.share-steps h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.step-item:last-child { margin-bottom: 0; }
.step-num {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.step-text { font-size: 14px; line-height: 1.5; }

/* ─── Scratch Card Screen ───────────────────────────────────────── */
.site-logo {
  margin: 0 auto 24px;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}

.hero-media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  width: calc(100% + (var(--content-padding) * 2));
  margin: 0 calc(var(--content-padding) * -1);
}

.hero-image {
  width: 100%;
  height: auto;
}

.draw-area {
  position: absolute;
  left: 37.69%;
  top: 71.8%;
  z-index: 4;
  width: 40.64%;
  height: 12.58%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.draw-loading {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}

.draw-loading.is-visible {
  display: grid;
}

.draw-loading__text {
  min-width: 148px;
  padding: 14px 22px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.prize-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 24px;
}

.prize-modal.is-visible {
  display: grid;
}

.prize-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.prize-modal__content {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
}


.prize-modal__close {
  position: absolute;
  top: -14px;
  right: -10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: var(--page-red);
  color: var(--page-white);
  font-size: 24px;
  line-height: 28px;
}

.section-title-small {
  margin: 0 auto 12px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.prize-list-band {
  width: 100vw;
  min-height: calc(100vw * 578 / 780);
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding: 0px var(--content-padding) 24px;
  background-image: url("../img/bk-redchange.png");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: 100vw auto;
}

.connected-prizes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  margin: 0 auto 8px;
  gap: 8px;
}

.prize-card {
  display: grid;
  overflow: hidden;
  border-radius: 8px;
}

.prize-card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 1.28;
  background: #ffffff;
  width: 100%;
  height: 64px;
  overflow: hidden;
  position: relative;
  border-radius: 8px 8px 0 0;
}

.prize-card__media img {
  width: auto;
  height: auto;
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
  position: absolute;
}

.prize-card__text {
  display: grid;
  place-items: center;
  min-height: 40px;
  margin: 0;
  padding: 8px;
  background: var(--page-red);
  color: var(--page-white);
  font-size: 10px;
  line-height: 1.25;
}

.feature-grid {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.feature-grid__main {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
}

.feature-grid__stack {
  display: flex;
  flex: 2 1 0;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.feature-grid .prize-card__media {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  height: auto;
  max-height: 64px;
  aspect-ratio: auto;
  border-radius: 8px 8px 0 0;
}

.feature-grid .prize-card__media img {
  position: static;
  width: auto;
  height: auto;
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
}

.prize-card3 .prize-card__text{
  flex: 0 0 52px;
  min-height: 52px;
  border-radius: 0 0 8px 8px;
}

.feature-grid__stack-item {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--page-white);
}

.feature-grid__stack img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.jingdong-link {
  position: relative;
  margin-top: 32px;
  padding: 24px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
}

.jingdong-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%) border-box;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.jingdong-wrap-white {
  position: relative;
  border-radius: 20px;
  padding: 16px;
  background: #ffffff;
}

.jingdong-title {
  position: relative;
  z-index: 1;
  --jingdong-title-extra-offset: 12px;
  width: fit-content;
  margin: 0 auto calc((var(--jingdong-title-offset, 0px) + var(--jingdong-title-extra-offset)) * -1);
  transform: translateY(calc((16px + var(--jingdong-title-offset, 0px) + var(--jingdong-title-extra-offset)) * -1));
}

.jingdong-title img {
  width: 100%;
}

.jingdong-title + .jingdong-gray {
  padding-top: var(--jingdong-title-offset, 0px);
}

.jingdong-gray {
  margin: 0 0 8px;
  color: #787878;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.jingdong001,
.jingdong002,
.jingdong003 {
  display: block;
  width: 100%;
}

.jingdong002,
.jingdong003 {
  margin-top: 8px;
}

.jingdong--01 {
  margin: 12px 0 0;
  color: #000000;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

.jingdong--02,
.jingdong-p02 {
  margin: 8px 0 0;
  color: #787878;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

.section-title-small{
  font-size: 14px;
  margin: 0 auto 8px 16px;
}

/* 已参与提示 */

.already-card {
  width: min(calc(100% - 32px), 420px);
  margin: 56px auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.already-card .icon {
  width: 100%;
  margin: 0 auto 18px;
  background: transparent;
}

.already-card .icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.already-title {
  margin: 0 0 14px;
  color: #ffffff;
  line-height: 1.35;
}

.already-title span {
  display: inline-block;
  position: relative;
  padding: 4px 18px 6px;
  color: #ffffff;
  font-size: 24px;
  font-weight: 500;
}

.already-title span::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--button-blue), var(--button-pink));
}

.already-title small {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

#btn-already-action {
  width: min(100%, 300px) !important;
  min-height: 52px;
  margin: 22px auto 0 !important;
  border-radius: 999px;
  background: #fff;
  color: #F70101;
  box-shadow: 0 10px 24px rgba(225, 6, 0, 0.18);
}

.already-event-divider {
  display: flex;
  align-items: center;
  width: 100vw;
  margin: 34px calc(50% - 50vw) 22px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.already-event-divider::before,
.already-event-divider::after {
  content: "";
  flex: 1 1 auto;
  border-top: 1px dashed rgba(255, 255, 255, 0.78);
}

.already-event-divider span {
  flex: 0 0 auto;
  padding: 0 12px;
}

.already-event-content {
  width: 100%;
}

/* ─── Loading Overlay ───────────────────────────────────────────── */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 16px;
  color: #fff;
}
#loading-overlay.show { display: flex; }
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Shipping Screen ───────────────────────────────────────────── */
.shipping-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.shipping-prize-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.shipping-success {
  text-align: center;
  padding: 40px 20px;
}

.shipping-success-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.shipping-success h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.shipping-success p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}


/* ─── Confetti ──────────────────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 100;
}
