:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #382f20;
  background: #f2eddf;
  color-scheme: light;
  font-synthesis: none;
  --gold: #f5c518;
  --paper: #fffdf0;
  --ink: #382f20;
  --muted: #82704c;
  --line: #e7dbb6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 40px 24px;
  display: grid;
  place-content: center;
}
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.18s;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible {
  outline: 3px solid #a27412;
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:disabled:active {
  transform: none;
}
[hidden] {
  display: none !important;
}
.scan-panel {
  width: min(880px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--paper);
  border: 1px solid #dfd2ad;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 64px #6650160d;
  animation: surface-in 0.3s ease-out;
}
.guide {
  background: var(--gold);
  padding: 42px 32px 30px;
  display: flex;
  flex-direction: column;
}
.site-name {
  font-size: 30px;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: -0.04em;
  margin: 0;
  overflow-wrap: anywhere;
}
h1 {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.guide-intro {
  margin: 28px 0 0;
  color: #665020;
  font-size: 14px;
  line-height: 1.9;
}
.steps {
  list-style: none;
  padding: 0;
  margin: 50px 0 60px;
  display: grid;
  gap: 28px;
}
.steps li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #725c25;
  transition: color 0.2s;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: calc(100% + 5px);
  width: 1px;
  height: 18px;
  background: #ad872950;
}
.steps b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid #98751e66;
  border-radius: 50%;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition:
    background 0.2s,
    color 0.2s;
}
.step-copy span {
  display: block;
  font-size: 16px;
  font-weight: 700;
}
.step-copy small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}
.steps .active {
  color: var(--ink);
}
.steps .active b {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.steps .done b {
  background: #fffdf080;
  border-color: transparent;
}
.guide-note {
  margin: auto 0 0;
  border-top: 1px solid #9a762e40;
  padding-top: 20px;
  color: #665020;
  font-size: 12px;
}
.guide-note span {
  padding: 0 6px;
}
.workspace {
  min-width: 0;
  min-height: 656px;
  padding: 36px 62px 28px;
}
.channel-label {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}
.channels {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.channels button {
  flex: 1;
  position: relative;
  min-height: 48px;
  padding: 10px 6px 14px;
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
}
.read-eyebrow {
  margin: 32px 0 8px;
  color: var(--muted);
  font-size: 12px;
}
#read-title {
  text-align: left;
  font-size: 25px;
  margin-bottom: 12px;
}
.read-intro,
.read-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}
.read-intro {
  margin: 0 0 28px;
}
#read-form label {
  display: block;
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 600;
}
#read-form input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffef8;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
#read-form input:focus-visible {
  outline: 2px solid #a27412;
  outline-offset: 2px;
}
#read-submit {
  margin-top: 28px;
}
.read-note {
  margin: 18px 0 0;
  font-size: 12px;
}
#read-panel {
  animation: surface-in 0.2s ease-out;
}
.channels button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.channels button.selected {
  color: var(--ink);
  font-weight: 750;
}
.channels button.selected::after {
  transform: scaleX(1);
}
.channels button:disabled.selected {
  opacity: 1;
}
.qr-frame {
  width: 252px;
  height: 252px;
  max-width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 5px 0 #eee4c7;
}
.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-frame.is-progress,
.qr-frame.is-terminal {
  height: 180px;
  border-color: transparent;
  background: #f6efd9;
  box-shadow: none;
}
#qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #eadfbf;
  border-top-color: #a27412;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.is-terminal .spinner {
  display: none;
}
h2 {
  font-size: 21px;
  line-height: 1.5;
  margin: 0 0 10px;
  text-align: center;
}
.description {
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
  text-align: center;
  margin: 0;
  overflow-wrap: anywhere;
}
.countdown {
  font-size: 13px;
  text-align: center;
  color: #896311;
  font-variant-numeric: tabular-nums;
  margin: 12px 0 0;
}
.caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  text-align: center;
  margin: 14px 0 0;
}
.progress-track {
  margin-top: 26px;
  background: #eee4c7;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}
.progress-track progress {
  display: block;
  width: 100%;
  height: 8px;
  accent-color: #b48719;
  border: 0;
}
.progress-track progress::-webkit-progress-bar {
  background: #eee4c7;
}
.progress-track progress::-webkit-progress-value {
  background: #b48719;
  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: 26px;
}
.primary,
.secondary {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
}
.primary {
  background: var(--ink);
  color: var(--paper);
}
.secondary {
  background: #f3ead1;
  color: #66532c;
}
@media (hover: hover) {
  .primary:hover:not(:disabled) {
    background: #55452c;
  }
  .secondary:hover:not(:disabled) {
    background: #eadeb9;
  }
  .channels button:hover:not(:disabled) {
    color: var(--ink);
  }
  .text-button:hover {
    color: var(--ink);
  }
}
.text-button {
  display: block;
  background: transparent;
  margin: 12px auto 0;
  min-height: 44px;
  padding: 8px 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.error {
  color: #913b25;
  background: #f9e7db;
  border-left: 3px solid #b35b38;
  border-radius: 4px 10px 10px 4px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin: 18px 0 0;
  overflow-wrap: anywhere;
}
#result {
  animation: surface-in 0.25s ease-out;
}
.complete-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  font-size: 28px;
}
.identity {
  margin: 24px 0 18px;
  text-align: center;
}
.identity strong {
  display: block;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.identity div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}
.read-access {
  background: #f6edce;
  border-radius: 12px;
  padding: 20px 16px 16px;
  text-align: center;
  margin-bottom: 16px;
}
.read-access p {
  font-size: 12px;
  color: #79602e;
  margin: 0 0 8px;
}
.read-access code {
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.6;
  letter-spacing: 0.12em;
}
.read-access span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.7;
}
.mini-instruction {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
  margin: 20px 0 0;
  text-align: center;
  overflow-wrap: anywhere;
}
#copy-result {
  margin-top: 17px;
}
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #382f20f5;
  color: var(--paper);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 3;
  text-align: center;
  max-width: 90vw;
}
noscript {
  padding: 16px;
  color: var(--ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 760px) {
  body {
    display: block;
    padding: 0;
    background: var(--gold);
  }
  .scan-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--gold);
  }
  .guide {
    padding: calc(24px + env(safe-area-inset-top)) 28px 24px;
  }
  .site-name {
    font-size: 26px;
  }
  h1 {
    font-size: 14px;
    letter-spacing: 0.08em;
    margin-top: 6px;
  }
  .guide-intro,
  .guide-note,
  .step-copy small {
    display: none;
  }
  .steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 24px 0 0;
  }
  .steps li {
    gap: 8px;
  }
  .steps b {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 13px;
  }
  .step-copy span {
    font-size: 14px;
  }
  .steps li:not(:last-child)::after {
    display: none;
  }
  .workspace {
    flex: 1 0 auto;
    min-height: auto;
    padding: 24px max(24px, calc((100vw - 440px) / 2))
      calc(24px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-radius: 26px 26px 0 0;
  }
  .channel-label {
    margin-bottom: 4px;
  }
  .channels {
    margin-bottom: 28px;
    gap: 8px;
  }
  .channels button {
    font-size: 14px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .qr-frame {
    width: 242px;
    height: 242px;
  }
  .actions {
    margin-top: 24px;
  }
}
@media (max-width: 360px) {
  .guide {
    padding-left: 22px;
    padding-right: 22px;
  }
  .site-name {
    font-size: 24px;
  }
  .workspace {
    padding-left: 22px;
    padding-right: 22px;
  }
  .qr-frame {
    width: 226px;
    height: 226px;
  }
  h2 {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
.code-policy {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
  margin: 18px 0 0;
}
#code-options {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
#code-options summary {
  cursor: pointer;
  text-align: center;
  padding: 10px 0;
}
#code-options label {
  display: block;
  margin: 14px 0 10px;
}
#custom-code {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dcd0ae;
  border-radius: 10px;
  background: #fffdf5;
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
}
#custom-code:focus-visible {
  outline: 2px solid #a27412;
  outline-offset: 2px;
}
.code-hint {
  margin: 10px 0 16px;
  font-size: 12px;
  line-height: 1.8;
}
.progress-track progress {
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--ink);
}
.progress-track progress::-webkit-progress-value {
  background: var(--ink);
}
.progress-track progress::-moz-progress-bar {
  background: var(--ink);
}
