

:root {
  color-scheme: dark;

  --bg:        #0a0c0b;
  --card:      linear-gradient(168deg, #171c1a, #101413 62%);
  --surface:   #121716;   
  --surface-2: #171c1a;   
  --surface-3: #1d2320;   
  --line:      #262d2a;
  --line-2:    #5a6576;   
  --line-soft: rgba(255, 255, 255, .035);

  --ink:   #e6e9e4;   
  --ink-2: #a9b2ab;   
  --ink-3: #7d8581;   

  --gold:     #cf9f4a;
  --gold-hi:  #ecc478;
  --gold-dim: rgba(207, 159, 74, .14);
  --gold-line: rgba(207, 159, 74, .32);

  --ok:  #74c08e;
  --ok-dim: rgba(116, 192, 142, .14);
  --err: #d9806f;
  --err-dim: rgba(217, 128, 111, .14);
  --warn: #d9a95f;
  --warn-dim: rgba(217, 169, 95, .14);

  
  --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;

  --s1: 4px; --s2: 8px; --s3: 12px;
  --s4: 16px; --s5: 20px; --s6: 26px; --s8: 34px;

  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .014) 1px, transparent 1px);
  background-size: 46px 46px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 72% 52% at 50% -18%, rgba(207, 159, 74, .14), transparent 64%),
    radial-gradient(ellipse 52% 46% at 12% 108%, rgba(116, 192, 142, .07), transparent 62%);
}

h1, h2, h3, p { margin: 0; }
a { color: var(--gold); text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold-dim); }

* { scrollbar-width: thin; scrollbar-color: #2c3431 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: #2c3431;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #3a443f; background-clip: content-box; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.eyebrow, .field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--ink-3);
}

.logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--gold);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow:
    0 34px 64px -40px rgba(0, 0, 0, .9),
    inset 0 1px 0 rgba(255, 255, 255, .045);
}

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

button { font-family: inherit; font-size: 14px; cursor: pointer; }

.btn-primary, .btn-ghost, .btn-mini, .btn-code {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-md);
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1;
  white-space: nowrap;
  transition: filter .2s, transform .12s, opacity .2s,
              border-color .2s, color .2s, background .2s;
}

.btn-primary {
  height: 46px;
  padding: 0 20px;
  border: none;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #17120a;
  font-size: 15px;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }

.btn-ghost {
  height: 42px;
  padding: 0 18px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) { border-color: rgba(255, 255, 255, .3); color: var(--ink); }

.btn-mini {
  height: 30px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
}
.btn-mini:hover:not(:disabled) { border-color: var(--gold-line); color: var(--gold-hi); }

.btn-code {
  height: 40px;
  padding: 0 14px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-sm);
  color: var(--gold-hi);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
}
.btn-code:hover:not(:disabled) { filter: brightness(1.1); }

.btn-danger {
  color: var(--err);
  border-color: rgba(217, 128, 111, .55);
  background: var(--err-dim);
}
.btn-danger:hover:not(:disabled) {
  color: #2c1a16;                 
  background: var(--err);
  border-color: var(--err);
  filter: none;
}

.ops { display: flex; gap: 6px; }

button:disabled { opacity: .38; cursor: not-allowed; }

.btn-primary.loading .label,
.btn-ghost.loading .label { visibility: hidden; }

.spinner {
  position: absolute;
  width: 15px; height: 15px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0;
  animation: spin .85s linear infinite;
}
.loading .spinner { opacity: .9; }

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

input[type="text"], input[type="tel"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  background: #0d1110;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .06em;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

textarea {
  height: auto;
  padding: 12px 15px;
  font-size: 13px;
  letter-spacing: .02em;
  line-height: 1.7;
  resize: vertical;
}

input::placeholder, textarea::placeholder {
  color: #444b48;
  font-size: 13.5px;
  letter-spacing: .02em;
}

input:hover, select:hover, textarea:hover { border-color: #313a36; }

input:focus, select:focus, textarea:focus {
  outline: none;
  background: #101514;
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

select {
  appearance: none;
  padding-right: 34px;
  font-size: 13.5px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6763' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.field { display: block; margin-bottom: var(--s4); }

.field > label, .gen-field label, .field-grow label, .field-fix label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--ink-3);
}

.input-wrap { position: relative; display: flex; gap: var(--s2); }

.hint {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: .02em;
  line-height: 1.6;
}
.hint.ok  { color: var(--ok); }
.hint.err { color: var(--err); }

.alert {
  position: relative;
  margin-top: var(--s3);
  padding: 11px 40px 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .022);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.alert.ok   { border-color: rgba(116, 192, 142, .45); background: var(--ok-dim);   color: var(--ok); }
.alert.err  { border-color: rgba(217, 128, 111, .45); background: var(--err-dim);  color: var(--err); }
.alert.warn { border-color: var(--gold-line);         background: var(--gold-dim); color: var(--gold-hi); }
.alert.info { border-color: var(--gold-line);         background: var(--gold-dim); color: var(--gold-hi); }

.alert-close {
  position: absolute;
  top: 7px; right: 7px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: inherit;
  opacity: .6;
  font-size: 12px;
}
.alert-close:hover { opacity: 1; background: rgba(255, 255, 255, .07); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .06em;
  white-space: nowrap;
}
.badge.unused         { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold-hi); }
.badge.used,
.badge.success,
.badge.ok             { border-color: rgba(116, 192, 142, .4); background: var(--ok-dim); color: var(--ok); }
.badge.disabled,
.badge.fail,
.badge.cool           { border-color: rgba(217, 128, 111, .4); background: var(--err-dim); color: var(--err); }
.badge.already_member { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold-hi); }
.badge.pending        { background: rgba(255, 255, 255, .04); color: var(--ink-2); }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: auto;
  background: var(--surface);
}

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }

.tbl th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 13px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-align: left;
  white-space: nowrap;
}

.tbl td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  white-space: nowrap;
}

.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .018); }

.tbl .empty { padding: 36px 13px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.redeem-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px 20px 28px;
}

.redeem-stage { width: min(452px, 100%); }

.redeem-card {
  position: relative;
  overflow: hidden;
  padding: 40px 34px 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 50px 95px -44px rgba(0, 0, 0, .96),
    inset 0 1px 0 rgba(255, 255, 255, .055);
  animation: cardIn .72s var(--ease) both;
}

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

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

.redeem-head { margin-bottom: 24px; }

.redeem-head .eyebrow { display: block; margin-bottom: 14px; opacity: .8; color: var(--gold); }

.redeem-head h1 {
  font-family: var(--serif);
  font-size: clamp(24px, 7vw, 33px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .012em;
  white-space: nowrap;   
}

.redeem-head p {
  margin-top: 10px;
  font-size: 13.2px;
  line-height: 1.65;
  color: var(--ink-2);
}

.steps {
  display: flex;
  gap: 6px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

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

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

.step > span::after {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background .35s;
}

.step.active { color: var(--ink); }
.step.active > span {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(207, 159, 74, .09);
}
.step.active > span::after { background: var(--gold); }

.step.done { color: var(--ink-2); }
.step.done > span { border-color: rgba(116, 192, 142, .55); }
.step.done > span::after { background: var(--ok); }

.card-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--gold-dim);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  animation: rise .4s var(--ease) both;
}
.badge-label {
  flex: none;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(207, 159, 74, .2);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: .14em;
}
.badge-code { color: var(--ink-2); }

.mobile-echo {
  margin-bottom: 18px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .022);
  font-size: 12.5px;
  color: var(--ink-2);
}
.mobile-echo b { font-family: var(--mono); color: var(--ink); letter-spacing: .04em; }

.btn-row { display: flex; gap: var(--s2); }
.btn-row .btn-primary { flex: 1; }

.pane { animation: rise .42s var(--ease) both; }

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

.redeem-foot {
  margin-top: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: #3c4340;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 40px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 50px 95px -44px rgba(0, 0, 0, .96),
    inset 0 1px 0 rgba(255, 255, 255, .055);
  text-align: center;
  animation: cardIn .6s var(--ease) both;
}

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

.result-verdict { position: relative; padding-bottom: 20px; }

.result-verdict::before {
  content: "";
  position: absolute;
  inset: -50px -40px -26px;
  background: radial-gradient(circle at 50% 24%, rgba(207, 159, 74, .16), transparent 66%);
  pointer-events: none;
  animation: bloom 1.5s ease-out both;
}
.result-verdict.is-bad::before {
  background: radial-gradient(circle at 50% 24%, rgba(217, 128, 111, .13), transparent 66%);
}

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

.result-icon {
  position: relative;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 20px;
  font-weight: 600;
}
.result-icon.warn { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold); }
.result-icon.err  { border-color: rgba(217, 128, 111, .45); background: var(--err-dim); color: var(--err); }

.result-card h2 {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(25px, 6.4vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .012em;
}

.result-card > p {
  position: relative;
  margin-top: 11px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

.result-card > p.one-line { white-space: nowrap; }

.result-meta {
  position: relative;
  margin: 24px 0 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}

.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.meta-row:last-child { border-bottom: none; }
.meta-row .k {
  flex: none;
  font-size: 11.5px;
  letter-spacing: .05em;
  color: var(--ink-3);
}
.meta-row .v {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .01em;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}

.result-card .btn-row { margin-top: 22px; }

@media (max-width: 420px) {
  .redeem-card { padding: 32px 24px 26px; border-radius: 18px; }
  .result-card { padding: 32px 22px 26px; border-radius: 18px; }
  .step { font-size: 10.5px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
