:root {
  --bg: #f5f7fb;
  --card: rgba(255, 255, 255, 0.96);
  --line: #e4e8ef;
  --text: #13243a;
  --muted: #5a6b81;
  --brand: #1d4f91;
  --accent: #0f766e;
  --accent-2: #10b981;
  --accent-soft: #eafaf3;
  --danger: #b42318;
  --ok: #067647;
  --shadow: 0 14px 34px rgba(16, 29, 51, 0.09);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at 0% 10%, rgba(31, 96, 187, 0.08), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.08), transparent 28%),
    linear-gradient(165deg, #f9fbff 0%, #f3f6fb 100%);
}

.bg-halo {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.15;
  z-index: -1;
}

.halo-a {
  left: -120px;
  top: 28%;
  background: #6ea8f3;
}

.halo-b {
  right: -130px;
  top: -90px;
  background: #7fd7a8;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 22px auto 30px;
  display: grid;
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0b56a6;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
}

h1 {
  margin-top: 6px;
  font-size: clamp(32px, 3vw, 42px);
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 2.4vw, 32px);
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.top-lead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.wechat-pill {
  color: #0f5132;
  background: #dcfce7;
}

.trust-inline {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-inline span {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #31557f;
  background: #eaf0f7;
}

.warning-banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #f5d48f;
  background: #fff6df;
  color: #8a5b03;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 14px;
  align-items: stretch;
}

.intro-col,
.checkout-col {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.checkout-col {
  position: relative;
}

.hero-image-wrap {
  margin-bottom: 14px;
}

.hero-image {
  width: 100%;
  min-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.hero-placeholder {
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius-md);
  border: 1px dashed #d4dde9;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  padding: 14px;
}

.hero-placeholder code {
  background: #e8f0fb;
  border-radius: 6px;
  padding: 0 6px;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
}

.feature-list li {
  color: var(--muted);
  line-height: 1.9;
}

.checkout-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
}

.checkout-subtitle strong {
  color: var(--brand);
}

.plan-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.plan-option {
  position: relative;
  min-height: 102px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid #cfd9e7;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.plan-option:hover {
  transform: translateY(-1px);
  border-color: #95b4db;
}

.plan-name {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.plan-option strong {
  display: block;
  margin-top: 2px;
  font-size: 23px;
  color: var(--brand);
}

.plan-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.plan-stock {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0f5132;
  background: #e8f8ef;
}

.plan-option em,
.plan-option i {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-style: normal;
}

.plan-option em {
  color: #0f5132;
  background: #dcfce7;
}

.plan-option i {
  color: var(--danger);
  background: #feeceb;
}

.plan-option-featured {
  border-color: #86d9b0;
  background: linear-gradient(180deg, #f4fdf8 0%, #ffffff 100%);
}

.plan-option-selected {
  border-color: #4d8ed4;
  box-shadow: 0 8px 16px rgba(50, 98, 161, 0.16);
}

.plan-option-disabled {
  opacity: 0.55;
}

label {
  display: block;
  margin: 8px 0;
  font-weight: 700;
}

input[type="email"] {
  width: 100%;
  border: 1px solid #d2dbe8;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  font-size: 15px;
}

input[type="email"]:focus {
  outline: 2px solid rgba(77, 142, 212, 0.2);
  border-color: #4d8ed4;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(130deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.25);
}

.btn-secondary {
  width: 100%;
  padding: 12px 16px;
  font-size: 17px;
  text-decoration: none;
  text-align: center;
  color: #18457a;
  background: #eef3fa;
  border-color: #c9d7e9;
  box-shadow: 0 6px 14px rgba(24, 69, 122, 0.09);
}

.action-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-ghost {
  padding: 10px 14px;
  color: var(--text);
  background: #f8fafc;
  border-color: #d9e1ec;
}

.status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--muted);
}

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

.status.success {
  color: var(--ok);
}

.hidden {
  display: none !important;
}

.pay-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7dfeb;
}

.pay-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
}

.qr-box {
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #d5deea;
  background: #fff;
}

#qrcode-image {
  width: 100%;
  display: block;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.pay-meta p {
  margin: 0;
  line-height: 1.85;
}

.countdown strong {
  font-size: 22px;
  color: #0f5132;
}

.hint {
  color: var(--muted);
}

.done-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7dfeb;
}

.history-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #d7dfeb;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #d8e1ed;
  border-radius: 10px;
  background: #fbfdff;
  padding: 8px 10px;
}

.history-main {
  display: grid;
  gap: 2px;
}

.history-title {
  font-weight: 700;
  color: #173a66;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.history-btn {
  border: 1px solid #c8d7ea;
  background: #eef4fc;
  color: #18457a;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.history-empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-key-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#card-key {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #bfe7d3;
  background: var(--accent-soft);
  word-break: break-all;
}

.notes details + details {
  margin-top: 8px;
}

.notes summary {
  padding: 8px 0;
  font-weight: 700;
  cursor: pointer;
}

.notes p,
.notes li {
  color: var(--muted);
  line-height: 1.85;
}

.notes ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

a {
  color: var(--brand);
}

body.embed-mode {
  background: #f7f9fc;
}

body.embed-mode .bg-halo,
body.embed-mode #intro-panel,
body.embed-mode #notes-panel {
  display: none !important;
}

body.embed-mode .page {
  width: min(100%, calc(100% - 24px));
  margin: 12px auto;
  gap: 12px;
}

body.embed-mode .card {
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(16, 29, 51, 0.06);
}

body.embed-mode .topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 12px;
  width: min(920px, 100%);
  margin: 0 auto;
}

body.embed-mode .topbar h1 {
  grid-column: 1 / -1;
  margin-top: 0;
  font-size: 28px;
  line-height: 1.2;
}

body.embed-mode .brand {
  font-size: 22px;
}

body.embed-mode .top-lead,
body.embed-mode .trust-inline {
  display: none;
}

body.embed-mode .layout {
  grid-template-columns: 1fr;
  width: min(920px, 100%);
  margin: 0 auto;
}

body.embed-mode .checkout-col {
  position: static;
  width: 100%;
}

body.embed-mode .plan-picker {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

body.embed-mode .plan-option {
  min-height: 92px;
  padding: 10px;
}

body.embed-mode .plan-name {
  font-size: 18px;
}

body.embed-mode .plan-option strong {
  font-size: 20px;
}

body.embed-mode .action-row {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.embed-mode .btn-primary {
  font-size: 17px;
  padding: 10px 12px;
}

body.embed-mode .btn-secondary {
  font-size: 15px;
  padding: 10px 12px;
}

body.embed-mode .pay-grid {
  grid-template-columns: 180px 1fr;
  gap: 10px;
  align-items: start;
}

body.embed-mode .countdown strong {
  font-size: 18px;
}

@media (max-width: 920px) {
  body.embed-mode .page {
    width: min(100%, calc(100% - 20px));
    margin: 10px auto;
  }

  body.embed-mode .plan-picker,
  body.embed-mode .pay-grid,
  body.embed-mode .action-row {
    grid-template-columns: 1fr;
  }

  body.embed-mode .topbar h1 {
    font-size: 24px;
  }
}

@media (max-width: 980px) {
  .layout,
  .plan-picker,
  .pay-grid {
    grid-template-columns: 1fr;
  }

  .checkout-col {
    position: static;
  }

  .intro-col {
    display: none;
  }

  .notes {
    margin-top: 2px;
  }
}

@media (max-width: 560px) {
  .page {
    width: min(100%, calc(100% - 14px));
    margin: 10px auto 18px;
  }

  .card {
    padding: 14px;
    border-radius: 18px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  h2 {
    font-size: 24px;
  }

  .plan-option {
    min-height: 90px;
    padding: 11px;
  }

  .plan-name {
    font-size: 18px;
  }

  .plan-option strong {
    font-size: 20px;
  }

  .btn-primary {
    font-size: 18px;
    padding: 11px 14px;
  }

  .btn-secondary {
    font-size: 16px;
    padding: 11px 14px;
  }

  .pay-grid {
    gap: 10px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-actions {
    justify-content: flex-start;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  #card-key {
    width: 100%;
  }
}
