:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #27414e;
  background: #eef5f7;
  font-synthesis: none;
  --accent: #109e80;
  --muted: #728996;
  --line: #dce7eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  padding: 40px 18px;
  display: grid;
  place-content: center;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  transition:
    background 0.15s,
    transform 0.15s;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button:active {
  transform: scale(0.98);
}
button:focus-visible {
  outline: 3px solid #7fcdbb;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:disabled:active {
  transform: none;
}
[hidden] {
  display: none !important;
}
.scan-panel {
  width: min(460px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 50px #254a5910;
  overflow: hidden;
  animation: panel-in 0.25s ease-out;
}
header {
  padding: 30px 32px 28px;
  border-bottom: 1px solid #edf2f4;
}
.eyebrow {
  margin: 0 0 10px;
  color: #698492;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
h1 {
  font-size: 28px;
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.03em;
}
.workspace {
  padding: 26px 32px 30px;
}
.steps {
  padding: 0;
  margin: 0 0 28px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #92a4ad;
  font-size: 14px;
  font-weight: 650;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}
.steps b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f4f5;
  font-size: 13px;
  transition: background 0.2s;
}
.steps .active,
.steps .done {
  color: var(--accent);
}
.steps .active b,
.steps .done b {
  background: var(--accent);
  color: white;
}
.channels {
  display: flex;
  padding: 5px;
  border-radius: 14px;
  background: #f0f4f5;
  gap: 5px;
  margin-bottom: 24px;
}
.channels button {
  flex: 1;
  padding: 13px 5px;
  border-radius: 10px;
  background: transparent;
  color: #67828e;
  font-size: 15px;
  font-weight: 650;
}
.channels button.selected {
  background: var(--accent);
  color: white;
}
.channels button:disabled.selected {
  opacity: 1;
}
.qr-frame {
  width: 236px;
  height: 236px;
  max-width: 100%;
  padding: 20px;
  border: 1px solid #e0eaee;
  border-radius: 17px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  background: white;
}
.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-frame.is-progress {
  height: 132px;
  border-color: transparent;
  background: #f6faf9;
}
.qr-frame.is-terminal {
  height: 132px;
  background: #f6f8f9;
  border-color: transparent;
}
#qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.spinner {
  width: 31px;
  height: 31px;
  border: 3px solid #dceee9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.is-terminal .spinner {
  display: none;
}
h2 {
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 12px;
  text-align: center;
}
.description {
  font-size: 14px;
  line-height: 1.85;
  color: #6d8794;
  text-align: center;
  margin: 0;
  overflow-wrap: anywhere;
}
.countdown {
  font-size: 13px;
  text-align: center;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin: 12px 0 0;
}
.caption {
  color: #92a2aa;
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  margin: 16px 0 0;
}
.progress-track {
  margin-top: 24px;
  background: #eaf3f0;
  border-radius: 6px;
  height: 7px;
  overflow: hidden;
}
.progress-track progress {
  display: block;
  width: 100%;
  height: 7px;
  accent-color: var(--accent);
  border: 0;
}
.progress-track progress::-webkit-progress-bar {
  background: #eaf3f0;
}
.progress-track progress::-webkit-progress-value {
  background: var(--accent);
  transition: width 0.25s;
}
.progress-track progress:not([value]) {
  width: 100%;
  animation: pulse 1.1s ease-in-out infinite;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 25px;
}
.primary,
.secondary {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
}
.primary {
  background: var(--accent);
  color: white;
}
.primary:hover {
  background: #088c70;
}
.secondary {
  background: #f0f4f5;
  color: #68828f;
}
.secondary:hover {
  background: #e6eef0;
}
.text-button {
  display: block;
  background: transparent;
  margin: 17px auto 0;
  padding: 8px 0;
  font-size: 12px;
  color: #8a9ca4;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error {
  color: #9b4c37;
  background: #fff4ee;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin: 18px 0 0;
  overflow-wrap: anywhere;
}
.complete-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 3px auto 18px;
  border-radius: 50%;
  background: #e4f5ef;
  color: var(--accent);
  font-size: 31px;
  animation: panel-in 0.25s ease-out;
}
.identity {
  margin: 24px 0 18px;
  text-align: center;
}
.identity strong {
  display: block;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.identity div {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.read-access {
  background: #f2f8f6;
  border: 1px solid #dbebe5;
  border-radius: 12px;
  padding: 17px 12px;
  text-align: center;
  margin-bottom: 16px;
}
.read-access p {
  font-size: 12px;
  color: #638879;
  margin: 0 0 10px;
}
.read-access code {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #16735c;
  overflow-wrap: anywhere;
  line-height: 1.6;
  letter-spacing: 0.03em;
}
.read-access span {
  display: block;
  font-size: 11px;
  color: #7d978b;
  margin-top: 10px;
  line-height: 1.7;
}
.mini-instruction {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin: 20px 0 0;
  text-align: center;
}
#copy-result {
  margin-top: 17px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #27414eee;
  color: white;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 3;
  text-align: center;
  max-width: 90vw;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 480px) {
  body {
    padding: 24px 14px;
    align-content: start;
  }
  .scan-panel {
    width: calc(100vw - 28px);
    border-radius: 20px;
  }
  header {
    padding: 25px 24px 23px;
  }
  .workspace {
    padding: 23px 24px 26px;
  }
  .steps {
    margin-bottom: 24px;
  }
  .qr-frame {
    width: 226px;
    height: 226px;
  }
  .read-access code {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
