.membership-shell {
  --membership-heading: #1f4e6e;
  --membership-copy: #2d526b;
  --membership-gold: #b68735;
  --membership-gold-dark: #886224;
  width: 100%;
  max-width: 780px;
  margin: clamp(28px, 4vw, 40px) auto 0;
  padding: clamp(24px, 3vw, 32px) 0 0;
  border-top: 1px solid rgba(166, 123, 47, 0.4);
  color: var(--membership-copy);
  text-align: left;
}
.membership-shell[aria-busy="true"] { cursor: progress; }
.membership-shell [hidden] { display: none !important; }
.membership-sales,
.membership-state { display: grid; gap: 18px; }
.membership-purchase-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.membership-purchase-option {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 9px;
}
.membership-shell .membership-purchase-option p {
  min-height: 1.5em;
  margin: 0;
  color: var(--membership-copy) !important;
  -webkit-text-fill-color: var(--membership-copy) !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-shadow: none !important;
}
.membership-shell .membership-action {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-width: 0;
  min-height: 52px;
  margin: 0 !important;
  padding: 12px 18px !important;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.membership-shell .membership-action:hover { transform: translateY(-1px); }
.membership-shell .membership-action:focus-visible,
.membership-signin-link:focus-visible,
.membership-email-label input:focus-visible {
  outline: 3px solid rgba(31, 78, 110, 0.24);
  outline-offset: 3px;
}
.membership-shell .membership-action:disabled { cursor: progress; opacity: .72; transform: none; }
.membership-action-primary {
  color: #102f46 !important;
  -webkit-text-fill-color: #102f46 !important;
  background: linear-gradient(135deg, #e5c570, #bd8b31);
  border-color: #ad7925;
  box-shadow: 0 8px 20px rgba(153, 104, 27, .2);
}
.membership-action-secondary {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #174866;
  border-color: #123b55;
  box-shadow: 0 8px 20px rgba(18, 59, 85, .16);
}
.membership-action-tertiary {
  color: var(--membership-heading) !important;
  -webkit-text-fill-color: var(--membership-heading) !important;
  background: #fffdf8;
  border-color: #8fa4b0;
}
.membership-signin-link {
  justify-self: center;
  padding: 6px 3px;
  border: 0;
  color: var(--membership-heading) !important;
  -webkit-text-fill-color: var(--membership-heading) !important;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.membership-email-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid rgba(31, 78, 110, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}
.membership-shell .membership-email-label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--membership-copy) !important;
  -webkit-text-fill-color: var(--membership-copy) !important;
  font-size: 14px;
  font-weight: 700;
}
.membership-email-label input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #879eaa;
  border-radius: 9px;
  box-sizing: border-box;
  color: #17384f;
  -webkit-text-fill-color: #17384f;
  background: #fff;
  font: inherit;
}
.membership-email-label input::placeholder { color: #647d8d; -webkit-text-fill-color: #647d8d; opacity: 1; }
.membership-email-step .membership-continue { width: auto !important; min-width: 190px; }
.membership-shell .membership-message {
  min-height: 0;
  margin: 2px 0 0;
  color: var(--membership-copy) !important;
  -webkit-text-fill-color: var(--membership-copy) !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}
.membership-state {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(31, 78, 110, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}
.membership-shell .membership-state-kicker {
  margin: 0;
  color: var(--membership-heading) !important;
  -webkit-text-fill-color: var(--membership-heading) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}
.membership-shell .membership-state h3 {
  margin: 0;
  color: var(--membership-heading) !important;
  -webkit-text-fill-color: var(--membership-heading) !important;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.25;
  text-align: center;
}
.membership-shell .membership-state-subtitle,
.membership-shell .membership-state-credit {
  margin: 0;
  color: var(--membership-copy) !important;
  -webkit-text-fill-color: var(--membership-copy) !important;
  font-size: 16px;
  line-height: 1.65;
  text-align: center;
}
.membership-shell .membership-state-credit { font-weight: 800; }
.membership-verifying-mark {
  width: 36px;
  height: 36px;
  margin: 2px auto;
  border: 3px solid rgba(182, 135, 53, .25);
  border-top-color: var(--membership-gold-dark);
  border-radius: 50%;
  animation: membership-spin .8s linear infinite;
}
@keyframes membership-spin { to { transform: rotate(360deg); } }
.membership-status-card {
  padding: 6px 0;
  border-top: 1px solid rgba(31, 78, 110, .2);
  border-bottom: 1px solid rgba(31, 78, 110, .2);
}
.membership-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.membership-status-item { display: grid; gap: 4px; padding: 15px 18px; border-bottom: 1px solid rgba(38, 70, 89, .1); }
.membership-status-item:nth-last-child(-n+2) { border-bottom: 0; }
.membership-status-item:nth-child(odd) { border-right: 1px solid rgba(38, 70, 89, .1); }
.membership-status-label { color: var(--membership-copy); font-size: 12px; font-weight: 750; letter-spacing: .04em; }
.membership-status-value { color: var(--membership-heading); font-size: 17px; font-weight: 800; }
.membership-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 11px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.membership-member-actions .membership-action { width: auto !important; min-width: 190px; }
.membership-member-rules { display: grid; gap: 4px; color: var(--membership-copy); font-size: 13px; line-height: 1.55; text-align: center; }
.membership-shell .membership-member-rules p { margin: 0; color: inherit !important; -webkit-text-fill-color: inherit !important; }
.membership-shell.is-member .membership-sales { display: none; }

@media (max-width: 640px) {
  .membership-shell { margin-top: 24px; padding-top: 22px; }
  .membership-purchase-options { grid-template-columns: 1fr; gap: 18px; }
  .membership-purchase-option p { min-height: 0; }
  .membership-email-step { grid-template-columns: 1fr; padding: 16px; }
  .membership-email-step .membership-continue,
  .membership-member-actions .membership-action { width: 100% !important; min-width: 0; }
  .membership-member-actions { display: grid; grid-template-columns: 1fr; max-width: none; }
  .membership-status-grid { grid-template-columns: 1fr; }
  .membership-status-item,
  .membership-status-item:nth-child(odd),
  .membership-status-item:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid rgba(38, 70, 89, .1); padding: 13px 10px; }
  .membership-status-item:last-child { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .membership-verifying-mark { animation: none; }
  .membership-shell .membership-action { transition: none; }
}


/* AM_PREPAY_PRICE_SUMMARY_V1 */

/*
  Purchase-section rule:
  prices are informational here.
  Actual checkout selection happens only after the question is completed.
*/
html[lang] body #purchaseSection .membership-purchase-options {
  display: none !important;
}

html[lang] body #purchaseSection .am-prepay-price-summary {
  width: min(100%, 620px);
  margin: 34px auto 0;
  text-align: center;
}

html[lang] body #purchaseSection .am-prepay-primary {
  margin: 0;
  color: #b8862c;
  -webkit-text-fill-color: #b8862c;
  font-size: clamp(28px, 2.35vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .02em;
}

html[lang] body #purchaseSection .am-prepay-secondary {
  margin-top: 12px;
  color: #315d76;
  -webkit-text-fill-color: #315d76;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
}

html[lang] body #purchaseSection .am-prepay-member {
  margin-top: 10px;
  color: #1f536f;
  -webkit-text-fill-color: #1f536f;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.6;
}

html[lang] body #purchaseSection .am-enter-question-btn {
  display: block !important;
  width: min(100%, 390px) !important;
  min-width: 0 !important;
  margin: 30px auto 0 !important;
}

html[lang] body #purchaseSection .membership-shell {
  border-top: 0 !important;
  padding-top: 0 !important;
  margin-top: 18px !important;
}

/* Returning-member access remains permanently visible. */
html[lang] body #purchaseSection .membership-login-link,
html[lang] body #purchaseSection [data-membership-link] {
  display: inline-flex;
}

@media (max-width: 640px) {
  html[lang] body #purchaseSection .am-prepay-price-summary {
    margin-top: 26px;
    padding-inline: 8px;
  }

  html[lang] body #purchaseSection .am-prepay-primary {
    font-size: 28px;
  }

  html[lang] body #purchaseSection .am-prepay-secondary {
    font-size: 15px;
  }

  html[lang] body #purchaseSection .am-prepay-member {
    font-size: 17px;
  }

  html[lang] body #purchaseSection .am-enter-question-btn {
    width: 100% !important;
    max-width: 390px !important;
  }
}


/* AM_MEMBER_20_VALUE_LOCK_V1 */

/* Keep membership elegant, but make its 20-question value unmistakable. */
html[lang] body #purchaseSection .am-prepay-member {
  margin-top: 12px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.65;
  color: #214f69;
  -webkit-text-fill-color: #214f69;
}

html[lang] body #purchaseSection .am-member-value {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-left: 3px;
  white-space: nowrap;
}

html[lang] body #purchaseSection .am-member-value strong {
  font-size: 29px;
  line-height: 1;
  font-weight: 800;
  color: #123b5d;
  -webkit-text-fill-color: #123b5d;
  letter-spacing: .01em;
}

html[lang] body #purchaseSection .am-member-value span {
  font-size: 21px;
  font-weight: 700;
  color: #1b4965;
  -webkit-text-fill-color: #1b4965;
}

@media (max-width: 640px) {
  html[lang] body #purchaseSection .am-prepay-member {
    font-size: 18px;
  }

  html[lang] body #purchaseSection .am-member-value strong {
    font-size: 26px;
  }

  html[lang] body #purchaseSection .am-member-value span {
    font-size: 18px;
  }
}


/* AM_INTRO_PRICE_GOLD_LOCK_V1 */
html[lang] body #purchaseSection .am-intro-price {
  font-size: 1.06em;
  font-weight: 700;
  color: #A86B12;
  -webkit-text-fill-color: #A86B12;
  letter-spacing: .01em;
}


/* AM_MEMBER_SIGNIN_AND_TC_BUTTON_LOCK_V1 */

/*
  Returning members are paying customers.
  Sign-in is a permanent secondary action — never tiny footer copy.
*/
html[lang] body #purchaseSection :is(
  .membership-login-link,
  [data-membership-link]
) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 22px;
  padding: 8px 14px;
  font-size: 19px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  color: #174B6A !important;
  -webkit-text-fill-color: #174B6A !important;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* English needs equal member friendliness, not footnote-sized text. */
html[lang="en"] body #purchaseSection :is(
  .membership-login-link,
  [data-membership-link]
) {
  font-size: 18px !important;
  font-weight: 700 !important;
}

/*
  Traditional Chinese CTA:
  force one TC-capable font family across every glyph,
  avoiding mixed-font fallback and uneven character height.
*/
html[lang="zh-Hant"] body #purchaseSection .am-enter-question-btn,
html[lang="zh-Hant"] body #formSection button[type="submit"] {
  font-family:
    "PingFang TC",
    "Noto Sans TC",
    "Microsoft JhengHei",
    "Heiti TC",
    sans-serif !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.08em !important;
  font-style: normal !important;
  font-variant: normal !important;
}

html[lang="zh-Hant"] body #purchaseSection .am-enter-question-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (max-width: 640px) {
  html[lang] body #purchaseSection :is(
    .membership-login-link,
    [data-membership-link]
  ) {
    min-height: 44px;
    font-size: 18px !important;
    padding: 8px 12px;
  }

  html[lang="en"] body #purchaseSection :is(
    .membership-login-link,
    [data-membership-link]
  ) {
    font-size: 17px !important;
  }

  html[lang="zh-Hant"] body #purchaseSection .am-enter-question-btn,
  html[lang="zh-Hant"] body #formSection button[type="submit"] {
    font-size: 20px !important;
  }
}


/* AM_YIWEN_FINAL_PAYMENT_GATE_V1 */

/*
  IMPORTANT:
  Everything below is scoped to the payment overlay.
  It must not alter the locked One Question page visual.
*/

html.am-payment-gate-open {
  overflow: hidden;
}

.am-yw-payment-gate[hidden] {
  display: none !important;
}

.am-yw-payment-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 24px;
}

.am-yw-payment-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 13, 22, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.am-yw-payment-card {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 38px 36px 30px;
  border-radius: 28px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 253, 246, 0.985),
      rgba(244, 239, 224, 0.985)
    );
  border: 1px solid rgba(203, 160, 75, 0.48);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.46) inset;
  color: #123f5c;
  text-align: center;
}

.am-yw-payment-card h2 {
  margin: 0;
  color: #123f5c;
  -webkit-text-fill-color: #123f5c;
  font-size: 29px;
  line-height: 1.3;
  font-weight: 800;
}

.am-yw-payment-subtitle {
  width: min(480px, 100%);
  margin: 13px auto 26px;
  color: #40647a;
  -webkit-text-fill-color: #40647a;
  font-size: 16px;
  line-height: 1.7;
}

.am-yw-payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.am-yw-payment-option {
  min-height: 132px;
  padding: 22px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.am-yw-payment-option:hover {
  transform: translateY(-2px);
}

.am-yw-payment-option strong {
  display: block;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 800;
}

.am-yw-payment-option span {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.am-yw-payment-intro {
  background: linear-gradient(145deg, #fff6d8, #efd08a);
  border: 1px solid rgba(184, 134, 44, 0.58);
  color: #8d5a0d;
  -webkit-text-fill-color: #8d5a0d;
  box-shadow: 0 12px 28px rgba(184, 134, 44, 0.13);
}

.am-yw-payment-membership {
  background: linear-gradient(
    145deg,
    rgba(231, 243, 249, 0.98),
    rgba(205, 229, 240, 0.98)
  );
  border: 1px solid rgba(31, 83, 111, 0.35);
  color: #123b5d;
  -webkit-text-fill-color: #123b5d;
  box-shadow: 0 12px 28px rgba(18, 59, 93, 0.10);
}

.am-yw-member-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 24px auto 0;
  padding: 8px 18px;
  border: 0;
  background: transparent;
  color: #174b6a;
  -webkit-text-fill-color: #174b6a;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  cursor: pointer;
}

.am-yw-payment-back {
  display: block;
  margin: 10px auto 0;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: #647986;
  -webkit-text-fill-color: #647986;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.am-yw-payment-x {
  position: absolute;
  top: 13px;
  right: 17px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #486577;
  -webkit-text-fill-color: #486577;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.am-yw-payment-auth[hidden] {
  display: none !important;
}

.am-yw-payment-auth {
  margin-top: 10px;
  padding: 8px 0 0;
}

.am-yw-payment-auth-host {
  width: 100%;
}

.am-yw-payment-auth .membership-email-step {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.am-yw-payment-auth .membership-message {
  width: min(500px, 100%);
  margin: 14px auto 0;
}

.am-yw-payment-status {
  margin: 15px auto 0;
  color: #8d4f32;
  -webkit-text-fill-color: #8d4f32;
  font-size: 14px;
  font-weight: 700;
}

html[lang="zh-Hant"] .am-yw-payment-card,
html[lang="zh-Hant"] .am-yw-payment-card button,
html[lang="zh-Hant"] .am-yw-payment-card input,
html[lang="zh-Hant"] .am-yw-payment-card label {
  font-family:
    "PingFang TC",
    "Noto Sans TC",
    "Microsoft JhengHei",
    "Heiti TC",
    sans-serif;
}

@media (max-width: 640px) {
  .am-yw-payment-gate {
    padding: 16px;
  }

  .am-yw-payment-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 24px);
    padding: 34px 20px 24px;
    border-radius: 23px;
  }

  .am-yw-payment-card h2 {
    font-size: 25px;
  }

  .am-yw-payment-subtitle {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .am-yw-payment-options {
    grid-template-columns: 1fr;
  }

  .am-yw-payment-option {
    min-height: 0;
    padding: 19px 16px;
  }

  .am-yw-member-signin {
    font-size: 18px;
    min-height: 48px;
  }
}


/* AM_PAYMENT_GATE_CLOSE_LOCK_V2 */
.am-yw-payment-card .am-yw-payment-x {
  position: absolute !important;
  top: 14px !important;
  right: 16px !important;
  z-index: 20 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 1px solid rgba(18, 63, 92, 0.18) !important;
  border-radius: 50% !important;

  background: rgba(255, 255, 255, 0.72) !important;

  color: #123F5C !important;
  -webkit-text-fill-color: #123F5C !important;

  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 24px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;

  opacity: 1 !important;
  visibility: visible !important;

  cursor: pointer !important;

  box-shadow: 0 4px 14px rgba(18, 63, 92, 0.10) !important;
}

.am-yw-payment-card .am-yw-payment-x:hover {
  background: rgba(255, 255, 255, 0.96) !important;
  transform: none !important;
}


/* AURA_MEMBERSHIP_PREMIUM_FINAL_V1 */

.membership-state-kicker {
  margin-bottom: 8px;
  color: rgba(173, 129, 46, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.membership-premium-title {
  margin: 0;
  color: #173f56;
  font-weight: 650;
}

.membership-premium-summary {
  width: min(100%, 620px);
  box-sizing: border-box;

  margin: 22px auto 20px;
  padding: 25px 26px 20px;

  border: 1px solid rgba(177, 132, 50, 0.24);
  border-radius: 20px;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.94),
      rgba(247,244,237,0.84)
    );

  box-shadow:
    0 14px 38px rgba(18, 52, 72, 0.08);

  text-align: center;
}

.membership-premium-balance {
  margin: 0;

  color: #173f56 !important;
  -webkit-text-fill-color: #173f56 !important;

  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.5;
  font-weight: 600;
}

.membership-premium-balance strong {
  display: inline-block;

  margin: 0 4px;

  color: #b18432 !important;
  -webkit-text-fill-color: #b18432 !important;

  font-size: 1.45em;
  font-weight: 750;
}

.membership-premium-cycle {
  margin: 8px 0 0;

  color: rgba(23,63,86,0.64) !important;
  -webkit-text-fill-color: rgba(23,63,86,0.64) !important;

  font-size: 14px;
}

.membership-premium-actions {
  justify-content: center;
  gap: 12px;
}

@media (max-width: 640px) {
  .membership-premium-summary {
    padding: 20px 15px 17px;
    border-radius: 16px;
  }

  .membership-premium-balance {
    font-size: 20px;
  }
}
