:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fffefa;
  --ink: #1b2040;
  --muted: #555c73;
  --line: #dcdde5;
  --blue: #303bce;
  --blue-dark: #242da7;
  --blue-soft: #eeefff;
  --lime: #dfec90;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, p, h1, h2 { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.button-primary, .button-outline, .button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  transition: background-color .16s, border-color .16s;
}

.button-primary { color: white; background: var(--blue); }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.button-outline:hover:not(:disabled) { border-color: #aeb3eb; background: var(--blue-soft); }
.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover:not(:disabled) { color: var(--blue-dark); background: var(--blue-soft); }

.wordmark { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 760; line-height: 1.1; }
.wordmark small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.mark { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 12px; color: #fff; background: var(--blue); }
.mark .icon { width: 23px; height: 23px; }

.login { display: flex; flex-direction: column; width: min(100%, 1520px); min-height: 100svh; margin-inline: auto; padding-inline: clamp(24px, 4vw, 64px); }
.login-masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 82px; }
.edition, .login-footer { color: var(--muted); font: 11px/1.5 var(--mono); letter-spacing: .1em; }
.edition span { margin-inline: 9px; color: #777da2; }
.login-layout { display: grid; flex: 1; grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr); min-height: 630px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--surface); }
.studio {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4.15vw, 68px);
  padding-bottom: 24px;
  overflow: hidden;
  color: #fff9e8;
  background:
    linear-gradient(150deg, #3341d7 17%, transparent 80%),
    repeating-linear-gradient(0deg, #fff2 0 1px, transparent 1px 25px),
    repeating-linear-gradient(90deg, #fff2 0 1px, transparent 1px 25px),
    #2833b4;
}

.studio-copy { z-index: 1; }
.studio-index { display: flex; align-items: center; gap: 9px; color: #f0f2ff; font: 11px/1.4 var(--mono); letter-spacing: .15em; }
.studio-index span { width: 17px; height: 2px; background: var(--lime); }
.studio-title { margin-top: 17px; font-size: clamp(44px, 5.65vw, 86px); font-weight: 800; line-height: 1.06; letter-spacing: -.07em; }
.studio-caption { margin-top: 18px; color: #f0f1ff; font-size: 14px; line-height: 1.75; }
.studio-art { position: absolute; z-index: -1; right: -3.5%; bottom: 27px; width: min(88%, 645px); height: auto; }
.studio-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid #d0d5ff65; color: #f3f4ff; font: 10px/1.5 var(--mono); letter-spacing: .13em; }
.login-footer { display: flex; justify-content: space-between; gap: 12px; padding-block: 16px; }

.entry { display: grid; place-items: center; padding: 32px clamp(24px, 4.2vw, 66px); }
.entry-card { width: min(100%, 345px); }
.entry-label { display: flex; align-items: center; gap: 9px; color: var(--blue-dark); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.step-number { display: grid; width: 29px; height: 24px; place-items: center; border-radius: 5px; background: var(--lime); color: var(--ink); font: 700 12px var(--mono); }
.entry h1 { margin-top: 14px; font-size: clamp(30px, 3.35vw, 48px); font-weight: 780; line-height: 1.16; letter-spacing: -.06em; }
#instruction { margin-top: 11px; color: var(--muted); font-size: 14px; line-height: 1.65; }

.scan-stage {
  display: grid;
  min-height: 224px;
  margin-top: 23px;
  place-items: center;
  border: 1px solid #dbdef9;
  border-radius: 14px;
  background:
    radial-gradient(circle, #c9ccf0 1px, transparent 1.2px) center / 15px 15px,
    #f1f2ff;
}

.scan-placeholder, .code { display: grid; justify-items: center; gap: 10px; padding: 10px; color: var(--muted); font-size: 12px; }
.scan-corners { display: grid; width: 98px; height: 98px; place-items: center; border: 1px solid #d8dcf6; border-radius: 20px; color: var(--blue); background: var(--surface); }
.scan-corners .icon { width: 41px; height: 41px; stroke-width: 1.25; }
.scan-placeholder > span:last-child, .code-meta { padding: 4px 8px; border-radius: 5px; background: #f1f2ff; }
.code { gap: 3px; }
.code-frame { padding: 3px; border: 1px solid #dadcf0; border-radius: 12px; background: #fff; }
.code-frame img { display: block; }
.code-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: 9px; row-gap: 2px; }
.match strong { margin-left: 3px; color: var(--ink); font: 700 16px var(--mono); letter-spacing: .12em; }
.expiry { padding-left: 9px; border-left: 1px solid #b9bedb; font-variant-numeric: tabular-nums; }
.message { margin-top: 11px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.message:empty { display: none; }
.scan-stage:has(#code:not([hidden])) + .message { color: var(--blue-dark); }
.login-action { justify-content: space-between; width: 100%; min-height: 50px; margin-top: 16px; padding-inline: 16px; }
.entry-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.entry-note .icon { width: 14px; height: 14px; }

@media (min-width: 901px) {
  .studio { min-height: 655px; }
}

@media (max-width: 900px) {
  .studio-art { right: -12%; bottom: 46px; width: 113%; }
}

@media (max-width: 700px) {
  .login { padding-inline: 15px; }
  .login-masthead { min-height: 65px; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; border-radius: 17px; }
  .studio { min-height: 236px; padding: 24px 19px 18px; }
  .studio-title { margin-top: 11px; font-size: clamp(34px, 7.3vw, 52px); }
  .studio-caption { width: min(46%, 205px); margin-top: 10px; font-size: 12px; line-height: 1.55; }
  .studio-break, .studio-foot { display: none; }
  .studio-art { right: -10%; bottom: 2px; width: min(74%, 370px); }
  .entry { padding: 23px 17px; }
  .entry h1 { margin-top: 9px; }
  .scan-stage { min-height: 194px; margin-top: 17px; }
  .scan-corners { width: 82px; height: 82px; }
}

@media (max-width: 360px) {
  .edition { font-size: 10px; letter-spacing: 0; }
  .studio { min-height: 210px; }
  .studio-art { right: -14%; }
}

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