:root {
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.72);
  --text-dim: rgba(255, 255, 255, 0.5);
  --accent: #57c84d;
  --accent-strong: #46b03c;
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  touch-action: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
}

/* 背景图 + 遮罩 */
.bg {
  position: fixed;
  inset: 0;
  background: url("assets/bg.png") center / cover no-repeat;
  z-index: -2;
}
.bg-mask {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(8, 16, 34, 0.25), rgba(6, 12, 28, 0.72) 70%),
    linear-gradient(180deg, rgba(6, 12, 28, 0.35), rgba(6, 12, 28, 0.6));
  z-index: -1;
}

/* 卡片（磨砂玻璃，无阴影） */
.card {
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  text-align: center;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #d8ffce;
  background: rgba(87, 200, 77, 0.18);
  border: 1px solid rgba(87, 200, 77, 0.4);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

.title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 22px;
}

.qr-wrap {
  position: relative;
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
  margin-bottom: 14px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-wrap img {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.qr-wrap img.loaded { display: block; }

.placeholder {
  font-size: 14px;
  color: #9aa1ad;
}

.meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  min-height: 16px;
}

.scan-tip {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 20px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--accent-strong); }
.btn:active { background: #3c9a33; }
.btn:disabled { background: rgba(255,255,255,0.25); cursor: default; }

/* 社区信息浮层 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 28, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.overlay.show { display: flex; }

.sheet {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  background: rgba(20, 28, 48, 0.92);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex: none;
}
.sheet-title { font-size: 16px; font-weight: 600; color: #fff; }

.close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0 4px;
}
.close:hover { color: #fff; }

.sheet-body {
  padding: 16px;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.sheet-body img {
  display: none;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.sheet-body img.loaded { display: block; }
.sheet-body .placeholder { padding: 40px 0; color: var(--text-soft); }
