/* ============================================================
   ChatGPT 订阅兑换 — 客户页
   中性色 + 黑色主按钮，细边框，不用渐变和彩色阴影
   ============================================================ */
:root {
  --ink: #0d0d0d;
  --ink-2: #5d5d66;
  --ink-3: #8e8e98;
  --line: #e3e3e8;
  --line-2: #efeff2;
  --bg-soft: #f7f7f8;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --ok-line: #bbf7d0;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --bad-line: #fecaca;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
.hidden { display: none !important; }

html, body {
  margin: 0; min-height: 100%; background: #fff; color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 480px; margin: 0 auto; padding: 28px 20px 40px;
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ---------------------------- 顶部 ---------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.wm-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); position: relative; flex: none; }
.wm-mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.step-count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

.progress { display: flex; gap: 6px; margin: 14px 0 34px; }
.pstep { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background .2s ease; }
.pstep.active, .pstep.done { background: var(--ink); }

/* ---------------------------- 文案 ---------------------------- */
h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.4px; line-height: 1.25; }
.lead { margin: 0 0 26px; color: var(--ink-2); font-size: 15px; }
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.hint:empty { display: none; }
.hint.bad { color: var(--bad); }
.hint.center { text-align: center; margin-top: 12px; }
code {
  font-family: var(--mono); font-size: 12.5px; background: var(--bg-soft);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px;
}
kbd {
  display: inline-block; padding: 0 6px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: #fff;
}

/* ---------------------------- 按钮 ---------------------------- */
.btn {
  appearance: none; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn.primary, .btn.dark { background: var(--ink); color: #fff; }
.btn.primary:hover, .btn.dark:hover { background: #2b2b2f; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.block { width: 100%; margin-top: 8px; }
.btn.sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn:disabled, .btn.primary:disabled { background: #ececf0; color: #a8a8b0; cursor: not-allowed; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #fff; border-top-color: transparent; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------- 兑换码 ---------------------------- */
.code-box { display: flex; flex-direction: column; gap: 12px; }
#codeInput {
  height: 52px; padding: 0 16px; font-family: var(--mono); font-size: 19px; letter-spacing: 3px;
  text-transform: uppercase; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#codeInput::placeholder { color: #c4c4cc; letter-spacing: 3px; }
#codeInput:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 13, 13, .08); }

.how { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.how h2 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how li {
  counter-increment: how; position: relative; padding: 0 0 14px 30px;
  display: flex; flex-direction: column; font-size: 14px;
}
.how li::before {
  content: counter(how); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 12px; color: var(--ink-2);
}
.how li b { font-weight: 500; }
.how li span { color: var(--ink-2); font-size: 13.5px; }

/* ---------------------------- 已匹配的卡 ---------------------------- */
.card-ready {
  display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft);
}
.card-icon {
  flex: none; width: 46px; height: 30px; border-radius: 6px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center;
}
.card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-text b { font-size: 14.5px; font-weight: 500; }
.card-text span { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.card-text em { font-style: normal; color: var(--ink); }
.tag { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.tag.ok { color: var(--ok); }
.tag.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 2px; }

/* 卡组织标识 */
.logo-visa { font: italic 800 13px/1 Arial, Helvetica, sans-serif; color: #1a1f71; letter-spacing: .3px; }
.logo-text { font: 700 10.5px/1 Arial, Helvetica, sans-serif; letter-spacing: .3px; }
.logo-amex { font: 800 9.5px/1 Arial, Helvetica, sans-serif; color: #fff; background: #1f72cd; padding: 4px 4px; border-radius: 3px; }

/* ---------------------------- 套餐 ---------------------------- */
.field { margin-bottom: 28px; }
.plans { display: flex; flex-direction: column; gap: 8px; }
.plan {
  appearance: none; font: inherit; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 20px 1fr; column-gap: 12px; align-items: center;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.plan::before {
  content: ""; grid-row: span 2; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid #c8c8d0; background: #fff; transition: all .15s ease;
}
.plan b { font-size: 15px; font-weight: 500; color: var(--ink); }
.plan span { font-size: 13px; color: var(--ink-3); }
.plan:hover { border-color: #c8c8d0; }
.plan.selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan.selected::before { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3.5px #fff; }

/* ---------------------------- 登录信息引导 ---------------------------- */
.guide { list-style: none; margin: 0; padding: 0; }
.guide-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.guide-step:last-child { padding-bottom: 0; }
.guide-step:not(:last-child)::before {
  content: ""; position: absolute; left: 11px; top: 28px; bottom: 4px; width: 1px; background: var(--line);
}
.guide-step > i {
  flex: none; width: 23px; height: 23px; border-radius: 50%; position: relative;
  display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.guide-step.done > i { background: var(--ink); border-color: var(--ink); color: transparent; }
.guide-step.done > i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 4.5px;
  border: solid #fff; border-width: 0 0 2px 2px; transform: translate(-50%, -70%) rotate(-45deg);
}
.guide-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 1px; }
.guide-body > b { font-size: 14.5px; font-weight: 500; }
.guide-body > span { font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }

#sessionInput {
  width: 100%; min-height: 96px; padding: 11px 13px; resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
#sessionInput:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(13, 13, 13, .08); }
#sessionInput::placeholder { font-family: var(--font); color: #b4b4bc; }
.paste-row { display: flex; gap: 10px; }

.session-status:empty { display: none; }
.session-status {
  width: 100%; padding: 11px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.6;
  display: flex; flex-direction: column;
}
.session-status.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #14532d; }
.session-status.ok b { font-weight: 500; }
.session-status.ok span { font-size: 13px; color: #3f6b4f; }
.session-status.ok em { font-style: normal; font-size: 12.5px; color: #3f6b4f; }
.session-status.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }

/* ---------------------------- 进度 ---------------------------- */
.timeline { list-style: none; margin: 4px 0 0; padding: 0; }
.timeline li {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-3);
}
.timeline li:last-child { border-bottom: none; }
.timeline li i {
  flex: none; width: 18px; height: 18px; border-radius: 50%; position: relative;
  border: 1.5px solid #d4d4da; background: #fff;
}
.timeline li span { flex: 1; }
.timeline li em { font-style: normal; font-size: 12.5px; }
.timeline li.done { color: var(--ink); }
.timeline li.done i { background: var(--ink); border-color: var(--ink); }
.timeline li.done i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 3.5px;
  border: solid #fff; border-width: 0 0 1.8px 1.8px; transform: translate(-50%, -70%) rotate(-45deg);
}
.timeline li.running { color: var(--ink); font-weight: 500; }
.timeline li.running i { border-color: var(--ink); border-top-color: transparent; animation: spin .8s linear infinite; }
.timeline li.error { color: var(--bad); }
.timeline li.error i { background: var(--bad); border-color: var(--bad); }

.result { margin-top: 22px; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.7; border: 1px solid var(--line); }
.result b { font-weight: 600; }
.result.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #14532d; }
.result.bad { background: var(--bad-bg); border-color: var(--bad-line); color: #7f1d1d; }

/* ---------------------------- 页脚 ---------------------------- */
.foot { margin-top: auto; padding-top: 40px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

@media (max-width: 480px) {
  .page { padding: 20px 16px 32px; }
  h1 { font-size: 23px; }
  .progress { margin-bottom: 26px; }
}
