:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #07c160;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.card {
  width: 100%;
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 20px 16px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.page-head {
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
}

.title {
  margin: 0;
  padding: 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text);
}

.title[hidden] {
  display: none !important;
}

.staff-info {
  margin-top: 10px;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.staff-info:empty,
.staff-info:not(:has(:not([hidden]))) {
  display: none;
  margin: 0;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.subtitle {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
  color: #4b5563;
  word-break: break-word;
  max-width: 100%;
}

.name {
  margin: 0;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--accent);
  word-break: break-word;
  max-width: 100%;
}

.subtitle[hidden],
.name[hidden],
.avatar[hidden] {
  display: none !important;
}

.qr-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 12px;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.qr {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 280px);
  object-fit: contain;
  display: block;
  border-radius: 8px;
  -webkit-user-select: none;
  user-select: none;
}

.hint {
  margin: 0;
  padding: 16px 10px 0;
  font-size: 20px;
  font-weight: 500;
  color: #374151;
  line-height: 1.6;
  border-top: 1px solid #f0f0f0;
}

.hint::before {
  content: "👆 ";
}

.state {
  text-align: center;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.55;
  margin: auto;
  padding: 24px;
}

.state--loading p {
  margin: 16px 0 0;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.state--error {
  max-width: 320px;
}

.btn {
  margin-top: 16px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.btn:active {
  opacity: 0.85;
}

@media (min-width: 481px) {
  .page {
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
  }

  .card {
    flex: none;
    border-radius: var(--radius);
    padding: 28px 24px 32px;
  }

  .title {
    font-size: 28px;
  }

  .qr {
    max-height: 360px;
  }
}
