:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f2f2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body.lucky-ecard-progress-page { background: #f2f2f2; color: rgba(0, 0, 0, .9); }

.ecard-progress-shell {
  display: flex;
  width: min(100%, 375px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  flex-direction: column;
  background: #fbfbfb;
  box-shadow: 0 0 24px rgba(0, 0, 0, .08);
}

.ecard-progress-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-height: 48px;
  padding: env(safe-area-inset-top) 16px 0;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  background: #fff;
}

.ecard-progress-nav__back {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
}

.ecard-progress-nav__back img { display: block; width: 24px; height: 24px; }
.ecard-progress-nav__back:focus-visible { outline: 2px solid #f21184; outline-offset: 2px; }
.ecard-progress-nav h1 { margin: 0; font-size: 18px; font-weight: 600; line-height: 24px; text-align: center; }

.ecard-progress-content {
  display: flex;
  padding: 12px 16px;
  flex: 1;
  flex-direction: column;
  gap: 18px;
}

.ecard-progress-summary {
  position: relative;
  min-height: 216px;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 12px;
  background: #fff url("/static/images/lucky-ecard-progress/card-texture.png") center / cover no-repeat;
}

.ecard-progress-summary::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(117deg, #fff 44%, rgba(255, 255, 255, 0) 72%);
  content: "";
  pointer-events: none;
}

.ecard-progress-summary__copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: 196px;
  padding: 16px;
  flex-direction: column;
  align-items: flex-start;
}

.ecard-progress-summary__icon { width: 28px; height: 28px; }
.ecard-progress-summary h2 { margin: 8px 0 0; font-size: 16px; font-weight: 500; line-height: 24px; }
.ecard-progress-summary strong { margin-top: 8px; color: #f21184; font-size: 20px; font-weight: 500; line-height: 28px; white-space: nowrap; }
.ecard-progress-summary p { margin: 8px 0 0; color: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 400; line-height: 18px; }

.ecard-progress-status {
  display: inline-flex;
  min-height: 24px;
  margin-top: 12px;
  padding: 3px 8px;
  align-items: center;
  border-radius: 20px;
  background: #fef1e2;
  color: #b86301;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.ecard-progress-summary__hero {
  position: absolute;
  z-index: 1;
  right: -6px;
  bottom: 28px;
  display: block;
  width: 143px;
  height: 136px;
  object-fit: contain;
}

.ecard-progress-steps {
  position: relative;
  display: grid;
  min-height: 92px;
  padding: 12px 16px;
  border-radius: 12px;
  grid-template-columns: repeat(3, 1fr);
  background: #fff;
}

.ecard-progress-steps__connector { position: absolute; top: 23px; height: 1px; }
.ecard-progress-steps__connector--submitted { left: 60px; width: 94px; background: #12b262; }
.ecard-progress-steps__connector--review { left: 194px; width: 89px; background: url("/static/images/lucky-ecard-progress/step-line.svg") center / 89px 1px no-repeat; }

.ecard-progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  color: rgba(0, 0, 0, .9);
  text-align: center;
}

.ecard-progress-step__marker {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .05);
  color: rgba(0, 0, 0, .35);
}

.ecard-progress-step__marker img { display: block; width: 24px; height: 24px; }
.ecard-progress-step__marker em { font-size: 12px; font-style: normal; font-weight: 500; line-height: 18px; }
.ecard-progress-step b { margin-top: 4px; font-size: 12px; font-weight: 400; line-height: 18px; white-space: nowrap; }
.ecard-progress-step small { min-height: 20px; margin-top: 2px; padding: 2px 4px; border-radius: 100px; background: rgba(255, 45, 85, .1); color: #f21184; font-size: 10px; line-height: 16px; white-space: nowrap; }
.ecard-progress-step:not(.is-active) small { visibility: hidden; }
.ecard-progress-step.is-active .ecard-progress-step__marker { background: #f21184; color: #fff; }
.ecard-progress-step.is-done .ecard-progress-step__marker { background: #12b262; color: #fff; }

.ecard-progress-details { padding: 12px; border-radius: 12px; background: #fff; }
.ecard-progress-details h2 { margin: 0; font-size: 16px; font-weight: 500; line-height: 22px; }
.ecard-progress-details dl { margin: 8px 0 0; }
.ecard-progress-details dl > div { display: flex; min-height: 52px; align-items: center; justify-content: space-between; border-bottom: .5px solid rgba(0, 0, 0, .1); }
.ecard-progress-details dl > div:last-child { border-bottom: 0; }
.ecard-progress-details dt,
.ecard-progress-details dd { margin: 0; font-size: 14px; line-height: 20px; }
.ecard-progress-details dt { font-weight: 400; }
.ecard-progress-details dd { max-width: 210px; overflow-wrap: anywhere; font-weight: 500; text-align: right; }
.ecard-progress-details__status { color: #f21184; }

.ecard-progress-error { padding: 32px 20px; border-radius: 12px; background: #fff; text-align: center; }
.ecard-progress-error strong { font-size: 16px; line-height: 24px; }
.ecard-progress-error p { margin: 8px 0 20px; color: rgba(0, 0, 0, .55); font-size: 13px; line-height: 20px; }
.ecard-progress-error button { min-width: 120px; height: 40px; border: 0; border-radius: 999px; background: #f21184; color: #fff; font-size: 14px; }

.ecard-progress-actions {
  position: sticky;
  z-index: 10;
  bottom: 0;
  display: grid;
  padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: #fff;
}

.ecard-progress-actions a {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  text-align: center;
  text-decoration: none;
}

.ecard-progress-actions__secondary { border: 1px solid #f21184; color: #f21184; background: #fff; }
.ecard-progress-actions__primary {
  overflow: hidden;
  border: 1px solid #fff;
  background: linear-gradient(180deg, rgba(229, 0, 92, .94), rgba(255, 34, 174, .94)), url("/static/images/lucky-ecard-progress/button-texture.png") center / cover;
  box-shadow: inset 0 1px 18px #ffd9e8, inset 0 1px 4px #ffd9e8;
  color: #fff;
}

.ecard-progress-actions a:focus-visible { outline: 2px solid #246bfd; outline-offset: 2px; }
body[data-progress-status="issued"] .ecard-progress-status,
body[data-progress-status="issued"] .ecard-progress-details__status { color: #08773f; }
body[data-progress-status="issued"] .ecard-progress-status { background: #e8f8ef; }
body[data-progress-status="issued"] .ecard-progress-steps__connector--review { background: #12b262; }
body[data-progress-status="rejected"] .ecard-progress-status,
body[data-progress-status="closed"] .ecard-progress-status { color: rgba(0, 0, 0, .55); background: rgba(0, 0, 0, .05); }

@media (max-width: 374px) {
  .ecard-progress-content { padding-inline: 12px; }
  .ecard-progress-summary__copy { width: 58%; padding-left: 14px; }
  .ecard-progress-summary__hero { right: -22px; }
  .ecard-progress-steps__connector--submitted { left: 52px; width: calc(33.333% - 24px); }
  .ecard-progress-steps__connector--review { left: calc(50% + 8px); width: calc(33.333% - 24px); background-size: 100% 1px; }
  .ecard-progress-actions { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ecard-progress-shell * { scroll-behavior: auto !important; transition: none !important; }
}
