.qr-page {
  background:
    radial-gradient(900px 520px at 92% -8%, rgba(223, 161, 60, 0.15), transparent 62%),
    radial-gradient(800px 560px at -6% 2%, rgba(13, 92, 80, 0.1), transparent 58%),
    var(--wash);
}

.qr-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
}

.qr-back:hover {
  color: var(--primary);
}

.qr-back span {
  font-size: 16px;
  line-height: 1;
}

.qr-main {
  padding: clamp(30px, 5vw, 58px) 0 clamp(40px, 6vw, 70px);
}

.qr-sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  width: 100%;
  gap: clamp(32px, 5vw, 70px);
  padding: clamp(26px, 4.5vw, 54px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(520px 280px at 100% 0%, rgba(13, 92, 80, 0.055), transparent 68%),
    var(--paper);
  box-shadow: var(--shadow-md);
}

.qr-sheet::before {
  content: "";
  position: absolute;
  top: -110px;
  left: -110px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(223, 161, 60, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.qr-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.qr-mode {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin: 2px 0 12px;
  padding: 4px 9px;
  color: #8c621a;
  border: 1px solid rgba(223, 161, 60, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.qr-mode::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.qr-mode.is-online {
  color: var(--success);
  border-color: #cfe8dc;
  background: var(--success-soft);
}

.qr-mode.is-local {
  color: var(--muted);
  border-color: var(--line);
  background: #f5f8f5;
}

.qr-title {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.3vw, 56px);
  font-weight: 820;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.qr-title em {
  position: relative;
  color: var(--primary);
  font-style: normal;
  white-space: nowrap;
}

.qr-title em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  z-index: -1;
  height: 10px;
  border-radius: 999px;
  background: rgba(223, 161, 60, 0.28);
}

.qr-lead {
  max-width: 590px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.qr-steps {
  display: grid;
  gap: 13px;
  margin: 25px 0 22px;
  padding: 0;
  list-style: none;
}

.qr-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.qr-step-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--primary);
  border: 1px solid #cfe2db;
  border-radius: 8px;
  background: var(--primary-soft);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.qr-steps strong {
  display: block;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.55;
}

.qr-steps small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.qr-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfa;
}

.qr-address > div {
  min-width: 0;
}

.qr-address span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.qr-address code {
  display: block;
  max-width: 490px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-copy-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  color: var(--primary);
  border: 1px solid #cfe2db;
  border-radius: 7px;
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.qr-copy-btn:hover {
  background: #dceee8;
}

.qr-wifi {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.qr-wifi svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

.qr-wifi strong {
  color: var(--ink-soft);
  font-weight: 700;
}

#qr-network-desc {
  display: block;
  margin-top: 1px;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.qr-code-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  width: 100%;
  max-width: 380px;
  min-width: 0;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(240px 160px at 50% 0%, rgba(223, 161, 60, 0.16), transparent 70%),
    linear-gradient(165deg, #f8fbf8, #eef4ef);
  box-shadow: 0 16px 40px rgba(18, 38, 31, 0.08);
  text-align: center;
}

.qr-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 15px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 38, 31, 0.08), 0 0 0 1px rgba(13, 92, 80, 0.06);
}

.qr-frame::before,
.qr-frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--primary);
  border-style: solid;
  pointer-events: none;
}

.qr-frame::before {
  top: 6px;
  left: 6px;
  border-width: 2px 0 0 2px;
  border-radius: 7px 0 0;
}

.qr-frame::after {
  right: 6px;
  bottom: 6px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 7px;
}

.qr-code {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
}

.qr-code svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-loading {
  color: var(--muted);
  font-size: 12px;
}

.qr-caption {
  margin-top: 14px;
}

.qr-caption strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
}

.qr-caption span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.qr-switch {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  text-align: left;
}

.qr-switch label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.qr-switch select {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}

.qr-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.qr-help article {
  position: relative;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.qr-help-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 11px;
  color: var(--primary);
  border-radius: 7px;
  background: var(--primary-soft);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
}

.qr-help h2 {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 760;
}

.qr-help p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .qr-sheet {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .qr-code-panel {
    width: 100%;
    max-width: 380px;
    margin-inline: auto;
  }

  .qr-help {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .qr-main {
    padding-top: 20px;
  }

  .qr-sheet {
    padding: 22px 16px;
    border-radius: 22px;
  }

  .qr-title {
    font-size: 34px;
  }

  .qr-lead {
    font-size: 13px;
  }

  .qr-address {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .qr-address code {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .qr-copy-btn {
    width: 100%;
  }

  .qr-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .qr-actions .btn {
    width: 100%;
  }

  .qr-code-panel {
    padding: 14px;
  }

  .qr-frame {
    max-width: 100%;
    padding: 12px;
  }

  .qr-back {
    font-size: 11px;
  }

  .qr-back span {
    display: none;
  }

  .header-qr span {
    display: none;
  }

  .header-qr {
    padding: 9px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  body.qr-page {
    background: #fff;
  }

  body.qr-page::before {
    display: none;
  }

  .site-header,
  .site-footer,
  .qr-back,
  .qr-actions,
  .qr-help,
  .qr-switch,
  .qr-wifi svg,
  .qr-copy-btn,
  .toast {
    display: none !important;
  }

  .qr-main {
    padding: 0;
  }

  .shell {
    width: 100%;
  }

  .qr-sheet {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 34px;
    align-items: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .qr-sheet::before {
    display: none;
  }

  .qr-title {
    font-size: 42px;
  }

  .qr-lead {
    max-width: 470px;
  }

  .qr-address code {
    max-width: 100%;
    font-size: 10.5px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .qr-code-panel {
    padding: 14px;
    border: 1px solid #d9e2dd;
    box-shadow: none;
    background: #fff;
  }

  .qr-frame {
    width: 290px;
    padding: 10px;
    box-shadow: none;
  }

  .qr-wifi {
    max-width: 450px;
  }

  .qr-caption {
    margin-top: 10px;
  }

  .qr-caption strong {
    font-size: 14px;
  }
}
