:root {
  --gift-bg0: #0c0c0c;
  --gift-ink: #f3faf6;
  --gift-muted: #9bb0a4;
  --gift-accent: #4caf50;
  --gift-accent-2: #7dba8c;
  --gift-line: rgba(125, 186, 140, 0.22);
  --gift-danger: #e57373;
  --gift-radius: 22px;
  --gift-font: "Kanit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.gift-page {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--gift-ink);
  background:
    radial-gradient(circle at 82% 12%, rgba(45, 90, 61, 0.28), transparent 34%),
    radial-gradient(circle at 12% 88%, rgba(215, 226, 234, 0.07), transparent 36%),
    var(--gift-bg0);
  font-family: var(--gift-font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Match homepage / landing dark grid */
.gift-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(215, 226, 234, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(215, 226, 234, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
}

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

.gift-page a {
  color: var(--gift-accent-2);
}

.gift-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
}

.gift-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.gift-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--gift-ink);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gift-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.gift-lang {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.gift-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas:
    "copy visual"
    "buy visual";
  gap: 1.25rem 2.5rem;
  align-items: start;
}

.gift-copy {
  grid-area: copy;
}

.gift-buy-block {
  grid-area: buy;
}

.gift-kicker {
  display: inline-block;
  margin-bottom: 0.9rem;
  color: var(--gift-accent-2);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gift-hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
  font-weight: 700;
}

.gift-hero .lead {
  margin: 0 0 1.5rem;
  color: var(--gift-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 36rem;
}

.gift-price {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
}

.gift-price .amount {
  font-size: 2.4rem;
  font-weight: 700;
}

.gift-price .note {
  color: var(--gift-muted);
  font-size: 0.95rem;
}

.gift-buy-hint {
  margin: 0.55rem 0 0.9rem;
  color: var(--gift-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.gift-buy-block .gift-cta {
  margin-bottom: 0.35rem;
}

.gift-page a.gift-cta,
.gift-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0 1.6rem;
  border: 0;
  border-radius: 999px;
  background: #4caf50;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 28px rgba(76, 175, 80, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.gift-page a.gift-cta:hover,
.gift-page a.gift-cta:focus-visible,
.gift-cta:hover,
.gift-cta:focus-visible {
  transform: translateY(-2px);
  background: #5cbc60;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 14px 34px rgba(76, 175, 80, 0.5);
}

.gift-page a.gift-cta:active,
.gift-cta:active {
  transform: translateY(0);
  background: #43a047;
  color: #ffffff;
}

.gift-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.25);
  box-shadow: none;
}

.gift-terms {
  margin-top: 1.2rem;
  padding: 0;
  list-style: none;
  color: var(--gift-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.gift-terms li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.55rem;
}

.gift-terms li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--gift-accent-2);
}

.gift-visual {
  grid-area: visual;
  position: sticky;
  top: 1.5rem;
  width: 100%;
  min-width: 0;
}

.gift-card-frame {
  position: relative;
  border-radius: var(--gift-radius);
  overflow: hidden;
  border: 1px solid var(--gift-line);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: rotate(-1.5deg);
  animation: gift-float 5.5s ease-in-out infinite;
}

.gift-card-frame img,
.gift-card-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}

.gift-glow {
  position: absolute;
  inset: auto -10% -20% 20%;
  height: 40%;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.35), transparent 70%);
  filter: blur(18px);
  pointer-events: none;
  animation: gift-pulse 3.2s ease-in-out infinite;
}

@keyframes gift-float {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50% { transform: rotate(-0.5deg) translateY(-10px); }
}

@keyframes gift-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.gift-success {
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}

.gift-success h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
}

.gift-success .lead {
  color: var(--gift-muted);
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

.gift-success .card-wrap {
  margin: 0 auto 1.25rem;
  max-width: 420px;
  border-radius: var(--gift-radius);
  overflow: hidden;
  border: 1px solid var(--gift-line);
  background: rgba(255, 255, 255, 0.03);
}

.gift-code {
  margin: 0.5rem auto 1.25rem;
  padding: 0.9rem 1rem;
  width: min(100%, 420px);
  border-radius: 14px;
  border: 1px dashed var(--gift-line);
  background: rgba(0, 0, 0, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.gift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.gift-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--gift-line);
  background: transparent;
  color: var(--gift-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.gift-email-box {
  margin: 1.5rem auto 0;
  width: min(100%, 420px);
  text-align: left;
  padding: 1.1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--gift-line);
  background: rgba(255, 255, 255, 0.03);
}

.gift-email-box label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gift-muted);
  font-size: 0.9rem;
}

.gift-email-box input {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.7rem;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--gift-line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gift-ink);
  font: inherit;
  margin-bottom: 0.75rem;
}

.gift-status {
  min-height: 1.4rem;
  margin-top: 0.75rem;
  color: var(--gift-muted);
  font-size: 0.92rem;
}

.gift-status.error {
  color: var(--gift-danger);
}

.gift-status.ok {
  color: var(--gift-accent-2);
}

.gift-howto {
  margin: 2rem auto 0;
  width: min(100%, 560px);
  text-align: left;
  color: var(--gift-muted);
  line-height: 1.7;
}

.gift-howto h2 {
  margin: 0 0 0.6rem;
  color: var(--gift-ink);
  font-size: 1.1rem;
}

.gift-expire-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(229, 115, 115, 0.35);
  background: rgba(229, 115, 115, 0.08);
  color: #f0c2c2;
  font-size: 0.92rem;
  line-height: 1.55;
}

.gift-compare {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--gift-line);
}

.gift-compare h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.3;
}

.gift-compare-lead {
  margin: 0 0 1.4rem;
  color: var(--gift-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 40rem;
}

.gift-compare-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--gift-line);
  background: rgba(255, 255, 255, 0.03);
}

.gift-compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.95rem;
}

.gift-compare-table th,
.gift-compare-table td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid rgba(125, 186, 140, 0.12);
  vertical-align: middle;
}

.gift-compare-table thead th {
  color: var(--gift-ink);
  background: rgba(125, 186, 140, 0.08);
  font-weight: 600;
}

.gift-compare-table thead th:nth-child(2),
.gift-compare-table thead th:nth-child(3),
.gift-compare-table td {
  text-align: center;
}

.gift-compare-table tbody th {
  text-align: left;
}

.gift-compare-table tbody th {
  color: var(--gift-ink);
  font-weight: 500;
  width: 42%;
}

.gift-compare-table td {
  color: var(--gift-muted);
}

.gift-compare-table td.is-vip {
  color: var(--gift-accent-2);
  font-weight: 600;
}

.gift-compare-table td.is-off {
  color: rgba(155, 176, 164, 0.45);
}

.gift-compare-table tr.gift-compare-group th {
  padding: 0.85rem 1.1rem;
  color: var(--gift-accent-2);
  background: rgba(125, 186, 140, 0.1);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  width: auto;
  border-bottom: 1px solid rgba(125, 186, 140, 0.16);
}

.gift-compare-table tbody tr:last-child th,
.gift-compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.gift-compare-table tbody th {
  width: 52%;
}

.gift-page .landing-site-footer {
  position: relative;
  isolation: isolate;
  margin-top: 2rem;
  border-top: 1px solid rgba(215, 226, 234, 0.12);
  background: #0c0c0c;
  color: #d7e2ea;
  padding: clamp(3.5rem, 8vw, 5rem) 0;
  text-align: center;
}

.gift-page .landing-site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: min(64rem, calc(100% - 2rem));
  margin: 0 auto;
}

.gift-page .landing-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.75rem;
}

.gift-page .landing-footer-nav a {
  color: #aeb9b2;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.gift-page .landing-footer-nav a:hover {
  color: #f5f5f7;
}

.gift-page .landing-footer-email {
  color: #86868b;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.gift-page .landing-footer-email:hover {
  color: #d7e2ea;
}

.gift-page .landing-footer-copy {
  margin: 0;
  color: #6e6e73;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.gift-page .landing-footer-social-label {
  margin: 0.35rem 0 0;
  color: #6e6e73;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gift-page .landing-footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 1.35rem;
}

.gift-page .landing-footer-social a,
.gift-page .landing-footer-social button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #aeb9b2;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.gift-page .landing-footer-social a:hover,
.gift-page .landing-footer-social button:hover {
  color: #f5f5f7;
}

.footer-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 10, 9, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.footer-qr-overlay[hidden] {
  display: none;
}

.footer-qr-card {
  position: relative;
  width: min(100%, 360px);
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: 24px;
  background: #f5f5f7;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.footer-qr-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.footer-qr-close:hover {
  color: #1d1d1f;
}

.footer-qr-title {
  margin: 0 0 0.85rem;
  color: #1d1d1f;
  font-size: 1.05rem;
  font-weight: 600;
}

.footer-qr-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  background: #fff;
}

.footer-qr-hint {
  margin: 0.85rem 0 0;
  color: #6e6e73;
  font-size: 0.88rem;
}

@media (max-width: 860px) {
  .gift-shell {
    width: min(1080px, calc(100% - 1.25rem));
    padding: 1.15rem 0 calc(3rem + env(safe-area-inset-bottom, 0px));
  }

  .gift-nav {
    margin-bottom: 1.35rem;
  }

  .gift-brand span {
    font-size: 0.98rem;
  }

  .gift-brand img {
    width: 32px;
    height: 32px;
  }

  .gift-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "visual"
      "buy";
    gap: 1.15rem;
  }

  .gift-hero h1 {
    font-size: clamp(1.7rem, 8vw, 2.25rem);
  }

  .gift-hero .lead {
    font-size: 0.98rem;
    margin-bottom: 1rem;
  }

  .gift-price {
    margin-bottom: 0.25rem;
  }

  .gift-price .amount {
    font-size: 2.1rem;
  }

  .gift-visual {
    position: relative;
    top: auto;
  }

  .gift-card-frame {
    transform: none;
    max-width: min(100%, 420px);
    margin: 0 auto;
    animation: none;
  }

  .gift-glow {
    inset: auto 5% -12% 5%;
    height: 28%;
  }

  .gift-buy-block .gift-cta,
  .gift-page a.gift-cta {
    width: 100%;
    min-height: 3.25rem;
    font-size: 1.05rem;
  }

  .gift-terms {
    font-size: 0.88rem;
  }

  .gift-compare {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
  }

  .gift-compare-table-wrap {
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
  }

  .gift-compare-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
    font-size: 0.84rem;
  }

  .gift-compare-table th,
  .gift-compare-table td {
    padding: 0.78rem 0.5rem;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
  }

  .gift-compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: #121814;
    box-shadow: 0 1px 0 rgba(125, 186, 140, 0.18);
  }

  .gift-compare-table thead th:first-child,
  .gift-compare-table tbody th {
    width: 44%;
    padding-left: 0.75rem;
    padding-right: 0.4rem;
    text-align: left;
  }

  .gift-compare-table thead th:nth-child(2),
  .gift-compare-table thead th:nth-child(3),
  .gift-compare-table tbody td {
    width: 28%;
    text-align: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .gift-compare-table tbody th {
    font-size: 0.86rem;
    font-weight: 500;
  }

  .gift-compare-table tbody td {
    font-size: 0.8rem;
  }

  .gift-compare-table tr.gift-compare-group th {
    padding: 0.75rem 0.75rem 0.45rem;
  }

  .gift-success h1 {
    font-size: clamp(1.65rem, 7vw, 2.1rem);
  }

  .gift-success .lead {
    font-size: 0.96rem;
  }

  .gift-success .card-wrap {
    max-width: 100%;
  }

  .gift-code {
    width: 100%;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    padding: 0.85rem 0.75rem;
  }

  .gift-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gift-actions .gift-cta,
  .gift-actions .gift-btn-secondary {
    width: 100%;
    min-height: 3.15rem;
  }

  .gift-email-box {
    width: 100%;
    padding: 1rem;
  }

  .gift-email-box input {
    font-size: 16px;
    min-height: 2.9rem;
  }

  .gift-howto {
    width: 100%;
    font-size: 0.94rem;
  }

  .gift-page .landing-site-footer {
    padding: clamp(2.5rem, 8vw, 4rem) 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
  }

  .gift-page .landing-footer-nav {
    gap: 0.65rem 1.15rem;
  }

  .gift-page .landing-footer-nav a,
  .gift-page .landing-footer-social a,
  .gift-page .landing-footer-social button {
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .gift-shell {
    width: calc(100% - 1rem);
  }

  .gift-price {
    flex-wrap: wrap;
    gap: 0.2rem 0.55rem;
  }

  .gift-compare-table {
    font-size: 0.8rem;
  }

  .gift-compare-table th,
  .gift-compare-table td {
    padding: 0.64rem 0.32rem;
  }

  .gift-compare-table thead th:first-child,
  .gift-compare-table tbody th {
    width: 44%;
    padding-left: 0.55rem;
  }

  .gift-compare-table thead th:nth-child(2),
  .gift-compare-table thead th:nth-child(3),
  .gift-compare-table tbody td {
    width: 28%;
  }
}
