:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #101114;
  --surface-2: #15171b;
  --surface-3: #1b1d22;
  --line: #292c32;
  --line-soft: #202228;
  --text: #f4f4f2;
  --muted: #989ba3;
  --muted-2: #6f737c;
  --gold: #d6b168;
  --gold-bright: #efcf8b;
  --gold-deep: #8e6e38;
  --success: #72b79a;
  --danger: #d87575;
  --radius: 8px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 40px 40px;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-pro {
  margin-left: 2px;
  color: var(--gold-bright);
}

.account {
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-copy {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy span {
  color: var(--muted-2);
  font-size: 11px;
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #4d4433;
  border-radius: 50%;
  color: var(--gold-bright);
  background: #1a1711;
  font-size: 13px;
  font-weight: 800;
}

.guest-state {
  color: var(--muted);
  font-size: 11px;
}

.account .icon-button {
  margin-left: 2px;
}

main {
  flex: 1;
  padding: 44px 0 28px;
}

.claim-layout {
  display: grid;
  grid-template-columns: minmax(290px, 0.86fr) minmax(420px, 1.14fr);
  min-height: 522px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.34);
}

.pro-visual {
  position: relative;
  overflow: hidden;
  padding: 38px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #383229;
  background:
    linear-gradient(145deg, rgba(214, 177, 104, 0.09), transparent 48%),
    #0d0e10;
  text-align: center;
}

.pro-visual::before,
.pro-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.pro-visual::before {
  inset: 16px;
  border: 1px solid rgba(214, 177, 104, 0.16);
}

.pro-visual::after {
  width: 160px;
  height: 1px;
  top: 70px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

.edition-label {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.pro-emblem {
  position: relative;
  z-index: 1;
  width: min(245px, 78%);
  aspect-ratio: 1;
  margin: 18px 0 8px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55));
}

.trial-term {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.trial-term strong {
  color: var(--gold-bright);
  font-family: "Segoe UI", sans-serif;
  font-size: 40px;
  font-weight: 500;
}

.trial-term span {
  font-size: 16px;
  font-weight: 700;
}

.pro-visual p {
  position: relative;
  z-index: 1;
  max-width: 270px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.claim-panel {
  padding: 40px 44px 34px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.3;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  text-align: center;
}

.status-badge.status-ready {
  border-color: rgba(114, 183, 154, 0.35);
  color: #98d6bb;
  background: rgba(114, 183, 154, 0.08);
}

.status-badge.status-claimed {
  border-color: rgba(214, 177, 104, 0.38);
  color: var(--gold-bright);
  background: rgba(214, 177, 104, 0.08);
}

.auth-section {
  padding-top: 25px;
}

.auth-tabs {
  height: 38px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0d0f;
}

.auth-tab {
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--gold-bright);
  background: #252119;
  box-shadow: inset 0 0 0 1px rgba(214, 177, 104, 0.22);
}

.auth-form {
  padding-top: 19px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.input-shell {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #33363d;
  border-radius: 6px;
  background: #0c0d0f;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.input-shell:focus-within {
  border-color: var(--gold-deep);
  background: #0f1012;
}

.input-shell > svg {
  width: 16px;
  flex: 0 0 auto;
  color: var(--muted-2);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.input-shell input::placeholder {
  color: #575b64;
}

.password-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
}

.password-toggle svg {
  width: 16px;
}

.auth-message {
  min-height: 16px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.auth-message.error {
  color: #e09393;
}

.auth-message.success {
  color: #8cc8ad;
}

.account-status {
  padding: 12px 0;
}

.status-row {
  min-height: 59px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.status-row > div {
  display: grid;
  gap: 4px;
}

.status-row strong {
  font-size: 13px;
}

.status-row span:not(.status-icon, .row-state) {
  color: var(--muted-2);
  font-size: 11px;
}

.status-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-2);
  background: var(--surface-2);
}

.status-icon svg {
  width: 15px;
  height: 15px;
}

.status-icon.verified {
  border-color: rgba(114, 183, 154, 0.25);
  color: #8cc8ad;
}

.row-check {
  width: 16px;
  color: var(--success);
}

.row-state {
  color: var(--muted-2);
  font-size: 11px;
}

.row-state.pro {
  color: var(--gold-bright);
}

#eligibilityRow.eligible .status-icon {
  border-color: rgba(214, 177, 104, 0.35);
  color: var(--gold-bright);
}

#eligibilityRow.eligible .row-state {
  color: var(--gold-bright);
}

#eligibilityRow.ineligible .status-icon,
#eligibilityRow.ineligible .row-state {
  color: var(--danger);
}

.claim-actions,
.key-section {
  padding-top: 18px;
}

.rule-consent {
  min-height: 32px;
  margin-bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.rule-consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-mark {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid #40434b;
  border-radius: 4px;
  background: var(--surface-2);
}

.checkbox-mark svg {
  width: 12px;
  opacity: 0;
}

.rule-consent input:checked + .checkbox-mark {
  border-color: var(--gold-deep);
  color: #17120a;
  background: var(--gold);
}

.rule-consent input:checked + .checkbox-mark svg {
  opacity: 1;
}

.primary-button {
  width: 100%;
  min-height: 45px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #e2bf7b;
  border-radius: 6px;
  color: #15110a;
  background: var(--gold);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.primary-button:hover {
  border-color: #f1d59b;
  background: var(--gold-bright);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  border-color: #403a2e;
  color: #777168;
  background: #27241e;
  cursor: not-allowed;
}

.primary-button svg {
  width: 17px;
}

.action-note {
  margin: 11px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.action-note svg {
  width: 12px;
}

.success-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.success-line > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 177, 104, 0.34);
  border-radius: 6px;
  color: var(--gold-bright);
  background: rgba(214, 177, 104, 0.08);
}

.success-line svg {
  width: 18px;
}

.success-line strong {
  font-size: 13px;
}

.success-line p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.license-key {
  min-height: 52px;
  padding: 0 8px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #474033;
  border-radius: 6px;
  background: #0c0d0f;
}

.license-key code {
  overflow-wrap: anywhere;
  color: var(--gold-bright);
  font-family: Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
}

.license-key.receipt {
  min-height: 48px;
  padding-right: 16px;
}

.license-key.receipt > span {
  color: var(--muted-2);
  font-size: 10px;
}

.license-key.receipt code {
  font-size: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-2);
}

.icon-button svg {
  width: 17px;
}

.expiry {
  margin: 11px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.expiry span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.expiry svg {
  width: 13px;
}

.expiry strong {
  color: var(--text);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.success-note {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8cc8ad;
  font-size: 10px;
}

.success-note svg {
  width: 13px;
}

.rules-band {
  margin-top: 18px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rules-heading {
  display: flex;
  align-items: flex-start;
}

h2 {
  margin-bottom: 5px;
  font-size: 14px;
}

.rules-heading p {
  margin-bottom: 0;
  color: var(--muted-2);
  font-size: 10px;
}

.rules-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 28px;
  list-style: none;
}

.rules-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.rules-list span {
  color: var(--gold-deep);
  font-family: Consolas, monospace;
  font-size: 10px;
}

footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 10px;
}

.text-button {
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--text);
}

.text-button svg {
  width: 13px;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-state svg {
  width: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  min-width: 180px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid #484136;
  border-radius: 6px;
  color: var(--text);
  background: #191a1e;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spinning {
  animation: spin 700ms linear infinite;
}

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

@media (max-width: 820px) {
  .app-shell {
    width: min(680px, calc(100% - 28px));
  }

  main {
    padding-top: 24px;
  }

  .claim-layout {
    grid-template-columns: 1fr;
  }

  .pro-visual {
    min-height: 240px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid #383229;
  }

  .pro-visual::after {
    top: 48px;
  }

  .pro-emblem {
    width: 150px;
    margin: 6px 0 -4px;
  }

  .pro-visual p {
    display: none;
  }

  .trial-term strong {
    font-size: 29px;
  }

  .trial-term span {
    font-size: 14px;
  }

  .rules-band {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: calc(100% - 20px);
  }

  .topbar {
    height: 64px;
  }

  .account-copy {
    display: none;
  }

  .guest-state {
    font-size: 10px;
  }

  main {
    padding-top: 14px;
  }

  .pro-visual {
    min-height: 210px;
  }

  .pro-emblem {
    width: 132px;
  }

  .claim-panel {
    padding: 26px 20px 24px;
  }

  .panel-heading {
    gap: 12px;
    padding-bottom: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .panel-heading p {
    line-height: 1.7;
  }

  .rules-band {
    padding: 20px 10px;
  }

  .rules-list {
    grid-template-columns: 1fr;
  }

  .license-key code {
    font-size: 13px;
  }

  .license-key.receipt {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }

  .license-key.receipt code {
    font-size: 11px;
  }
}

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