:root {
  --bg: #0a0c0b;
  --card: linear-gradient(168deg, #171c1a, #101413 62%);
  --line: #262d2a;
  --line-soft: rgba(255, 255, 255, 0.035);
  --ink: #e6e9e4;
  --ink-2: #939c95;
  --ink-3: #5f6763;
  --gold: #cf9f4a;
  --gold-hi: #ecc478;
  --gold-dim: rgba(207, 159, 74, 0.14);
  --ok: #74c08e;
  --err: #d9806f;
  /* 衬线优先选真正装了思源/Noto 的机器；Windows 上回退到宋体，同样是衬线骨架。 */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px 20px 28px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 极淡的网格，给深色底一点结构感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
}

.aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 72% 52% at 50% -18%, rgba(207, 159, 74, 0.14), transparent 64%),
    radial-gradient(ellipse 52% 46% at 12% 108%, rgba(116, 192, 142, 0.075), transparent 62%);
}

.stage { position: relative; width: min(452px, 100%); }

/* ------------------------------- 卡片 ------------------------------- */

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 40px 34px 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 50px 95px -44px rgba(0, 0, 0, 0.96),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  animation: cardIn 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.55;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.986); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------- 头部 ------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--gold);
  opacity: 0.78;
  margin-bottom: 15px;
}

.title {
  font-family: var(--serif);
  font-size: clamp(29px, 7.4vw, 35px);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: 0.012em;
}

.lede {
  margin-top: 11px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ------------------------------- 进度 ------------------------------- */

.track {
  display: flex;
  gap: 6px;
  margin: 27px 0 25px;
  list-style: none;
}

/* 卡密页时整条进度条要收起来。
   必须显式写这一条：`.track { display:flex }` 的优先级高于 UA 对
   [hidden] 的 display:none，只加 hidden 属性是收不掉的。 */
.track[hidden] { display: none; }

.track__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  transition: color 0.35s;
}

.track__item i {
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}

.track__item i::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background 0.35s;
}

.track__item.is-current { color: var(--ink); }
.track__item.is-current i {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(207, 159, 74, 0.09);
}
.track__item.is-current i::after { background: var(--gold); }

.track__item.is-done { color: var(--ink-2); }
.track__item.is-done i { border-color: rgba(116, 192, 142, 0.55); }
.track__item.is-done i::after { background: var(--ok); }

/* ------------------------------- 面板 ------------------------------- */

.pane { display: none; }
.pane.is-active {
  display: block;
  animation: rise 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(11px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------- 表单 ------------------------------- */

.field { display: block; }

.field__label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

input {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1110;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.1em;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: #444b48;
  letter-spacing: 0.04em;
  font-size: 14.5px;
}

input:focus {
  outline: none;
  border-color: rgba(207, 159, 74, 0.5);
  background: #101514;
  box-shadow: 0 0 0 3px var(--gold-dim);
}

input:disabled { opacity: 0.5; }

.note {
  min-height: 19px;
  margin: 11px 1px 15px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.note.is-err { color: var(--err); }
.note.is-ok { color: var(--ok); }

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #17120a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.045em;
  cursor: pointer;
  transition: filter 0.2s, transform 0.12s, opacity 0.2s;
}

.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.btn--ghost {
  margin-top: 9px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 500;
}
.btn--ghost:hover:not(:disabled) {
  filter: none;
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ink);
}

/* ------------------------------ 执行列表 ----------------------------- */

.runs { list-style: none; }

.runs li {
  display: grid;
  grid-template-columns: 17px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 1.5;
  animation: rise 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.runs li:last-child { border-bottom: none; }

.ico {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

.ico--run {
  border: 1.5px solid rgba(207, 159, 74, 0.28);
  border-top-color: var(--gold);
  animation: spin 0.85s linear infinite;
}

.ico--ok { background: rgba(116, 192, 142, 0.16); color: var(--ok); }
.ico--bad { background: rgba(217, 128, 111, 0.16); color: var(--err); }

@keyframes spin { to { transform: rotate(360deg); } }

.runs .name { color: var(--ink); }

.runs .detail {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  word-break: break-all;
}

.runs li.is-fail .name { color: var(--err); }

.hint {
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ------------------------------- 结果 ------------------------------- */

.verdict {
  position: relative;
  padding: 4px 0 22px;
  text-align: center;
}

.verdict::before {
  content: "";
  position: absolute;
  inset: -54px -40px -30px;
  background: radial-gradient(circle at 50% 24%, rgba(207, 159, 74, 0.16), transparent 66%);
  pointer-events: none;
  animation: bloom 1.5s ease-out both;
}

@keyframes bloom {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: none; }
}

.verdict__tag {
  position: relative;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  margin-bottom: 13px;
}

.verdict__big {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(26px, 6.6vw, 31px);
  font-weight: 600;
  line-height: 1.3;
}

.verdict__meta {
  position: relative;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
}

.verdict.is-ok .verdict__tag { color: var(--gold); }
.verdict.is-bad .verdict__tag { color: var(--err); }
.verdict.is-bad .verdict__big { color: var(--ink); font-size: 22px; }

/* 结果页的时间明细 */
.when {
  position: relative;
  margin: 24px 0 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}

.when__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.when dt {
  flex: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

.when dd {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}

.when__row--dim dd {
  font-size: 11.5px;
  color: var(--ink-3);
}

.verdict + .runs { margin-top: 4px; }

/* ------------------------------ 授权条 ------------------------------ */
/* 卡密兑换后的一行状态：卡号后段 + 剩余次数。刻意做得很轻，
   不抢三步流程的视觉重心。 */

.grant {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(207, 159, 74, 0.045);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.grant[hidden] { display: none; }

.grant__tag {
  flex: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.grant__code { color: var(--ink-2); }

.grant__uses {
  margin-left: auto;
  color: var(--gold-hi);
}

/* ------------------------------- 页脚 ------------------------------- */

.foot {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #3c4340;
}

@media (max-width: 420px) {
  .card { padding: 32px 24px 28px; border-radius: 18px; }
  .track__item { font-size: 10.5px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
