:root {
  --theme: #07c160;
  --bg-top: #0f766e;
  --bg-bottom: #134e4a;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  background: #111827;
  color: var(--text);
}

/* ========== 非微信：拦截页 ========== */
#wechat-only-block {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(160deg, #111827 0%, #1f2937 100%);
  color: #f9fafb;
  text-align: center;
}

#wechat-only-block[aria-hidden="true"] {
  display: none;
}

.block-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 24px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

#block-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

#block-desc {
  font-size: 14px;
  line-height: 1.7;
  color: #9ca3af;
  max-width: 280px;
}

.block-hint {
  margin-top: 32px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  color: #d1d5db;
}

/* ========== 微信内：海报 ========== */
#poster[aria-hidden="true"] {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

body.in-wechat #poster {
  visibility: visible;
  height: auto;
  overflow: visible;
}

.poster-wrap {
  min-height: 100vh;
  padding: 0;
  background: #0f172a;
}

body[data-poster-mode="card"] .poster-wrap {
  padding: 20px 16px 32px;
  background: linear-gradient(
    165deg,
    var(--bg-top) 0%,
    var(--bg-bottom) 55%,
    #0f172a 100%
  );
}

/* ---------- 整图海报模式 ---------- */
.poster-bg-stage {
  --qr-bottom: 11%;
  --qr-width: 34%;
  --qr-left: 50%;
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
}

body[data-poster-mode="card"] .poster-bg-stage {
  display: none;
}

.poster-bg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100vh;
  object-fit: cover;
  object-position: center top;
}

.qr-overlay {
  position: absolute;
  left: var(--qr-left);
  bottom: var(--qr-bottom);
  transform: translateX(-50%);
  width: var(--qr-width);
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.qr-overlay #wework-qrcode {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: none;
  -webkit-user-select: none;
}

.qr-hint-float {
  position: absolute;
  left: 50%;
  bottom: calc(var(--qr-bottom) - 36px);
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  pointer-events: none;
}

body[data-poster-mode="card"] #poster-card {
  display: block;
}

body[data-poster-mode="background"] #poster-card {
  display: none !important;
}

.poster-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.poster-header {
  padding: 28px 24px 20px;
  text-align: center;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--theme) 12%, white) 0%,
    white 100%
  );
}

#poster-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 12px;
}

#poster-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

#poster-subtitle {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.poster-body {
  padding: 8px 24px 28px;
  text-align: center;
}

.qr-frame {
  display: inline-block;
  padding: 14px;
  border-radius: 16px;
  background: #f9fafb;
  border: 2px dashed color-mix(in srgb, var(--theme) 35%, #e5e7eb);
}

/* 关键：用 img 展示企业微信码，微信内可长按识别 */
#wework-qrcode {
  display: block;
  width: min(72vw, 260px);
  height: min(72vw, 260px);
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: none;
  -webkit-user-select: none;
}

.qr-tip {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--theme);
}

.qr-tip-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.poster-footer {
  padding: 14px 20px 18px;
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
}

/* 微信内隐藏系统菜单外的选中高亮 */
body.in-wechat {
  -webkit-tap-highlight-color: transparent;
}
