:root {
  --bg: #0b7a75;
  --text: #ffffff;
  --primary: #f59e0b;
  --on-primary: #ffffff;
  --ink: #1f2528;
  --muted: #6b7378;
  --line: #e3e7e9;
  --card: #ffffff;
  --danger: #b42318;
  /* 竖版海报的设计单位：设计稿宽度的 1%，同时受高度约束，保证一体机整屏放得下 */
  --u: min(1vw, 0.5625dvh);
  /* 手机上的最小字号 / 按钮高度；屏幕键盘模式整页等比缩放时关闭 */
  --floor: 1;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); overflow-x: hidden; }
button, input { font: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, #fff); outline-offset: 2px; }
.backdrop { position: fixed; inset: 0; z-index: -1; background: var(--bg) center / cover no-repeat; }

/* ---------- 海报版式（竖屏：一体机 / iPad 竖放 / 手机） ---------- */
/* 海报字体：服务器矢量文字优先（.art），未启用或缺字时用各系统自带的圆体 */
.poster { font-family: "Yuanti SC", "YouYuan", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
.art svg { display: block; height: calc(var(--art-lines, 1) * var(--art-lh, 1.22) * 1em); width: auto; max-width: 100%; margin: 0 auto; overflow: visible; }
.submit.art svg { display: inline-block; vertical-align: middle; transform: translateY(calc(var(--u) * -0.55)); }
.identity h2.art svg { margin: 0; }
.poster { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; text-align: center; }
/* 以下尺寸按签到页设计稿（1124 × 2000，1u = 稿面 11.24px）1:1 还原 */
.poster-main { position: relative; z-index: 1; width: min(100%, calc(var(--u) * 100)); padding: calc(var(--u) * 7.12) calc(var(--u) * 2) 0; margin-bottom: calc(var(--u) * -0.6); display: flex; flex-direction: column; align-items: center; }
.logo { height: max(calc(52px * var(--floor)), calc(var(--u) * 15.12)); max-width: calc(var(--u) * 72); object-fit: contain; }
.hero h1 { margin: calc(var(--u) * 9.166) 0 0; font-size: max(calc(30px * var(--floor)), calc(var(--u) * var(--title-scale, 10))); line-height: 1.12; font-weight: 900; letter-spacing: .02em; white-space: pre-line; }
.slogan { margin: calc(var(--u) * 1.466) 0 0; font-size: max(calc(15px * var(--floor)), calc(var(--u) * 3.65)); font-weight: 500; letter-spacing: .04em; }
.slogan:empty, .details:empty, .event-info h2:empty, .footer:empty { display: none; }
/* 未填写活动名称与说明时整段不占位（设计稿：标语下方直接是签到区） */
.event-info:has(> h2:empty):has(> .details:empty) { display: none; }
.event-info { margin-top: calc(var(--u) * 12); }
.event-info h2 { margin: 0; font-size: max(calc(17px * var(--floor)), calc(var(--u) * 4.6)); font-weight: 800; }
.details { margin: calc(var(--u) * 2.4) 0 0; font-size: max(calc(12px * var(--floor)), calc(var(--u) * 2.6)); line-height: 1.75; white-space: pre-line; opacity: .95; }

.signin { width: 100%; margin-top: calc(var(--u) * 15.02); display: flex; flex-direction: column; align-items: center; }
form { width: min(100%, calc(var(--u) * 70.6)); display: flex; flex-direction: column; align-items: stretch; }
#formTitle { margin: 0; font-size: max(calc(30px * var(--floor)), calc(var(--u) * 8.98)); line-height: 1.15; font-weight: 800; }
.hint { margin: calc(var(--u) * 0.31) 0 calc(var(--u) * 5.377); font-size: max(calc(13px * var(--floor)), calc(var(--u) * 3.01)); }
/* 输入框与按钮：设计稿为通栏胶囊形 */
.code-input { height: max(calc(50px * var(--floor)), calc(var(--u) * 11.83)); border: 0; border-radius: 999px; background: #fff; color: var(--ink); text-align: center; font-size: max(calc(18px * var(--floor)), calc(var(--u) * 3.9)); letter-spacing: .3em; outline: none; }
.code-input::placeholder { color: #c1c1c1; letter-spacing: .05em; }
.code-wrap { position: relative; display: flex; flex-direction: column; }
.code-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: #c1c1c1;
  font-size: max(calc(18px * var(--floor)), calc(var(--u) * 3.9)); }
.code-art svg { display: block; height: 1.22em; width: auto; }
.code-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 45%, transparent); }
.code-input.long { letter-spacing: .1em; }
.error { margin: 0; font-size: max(calc(13px * var(--floor)), calc(var(--u) * 2.8)); font-weight: 600; }
.error:not(:empty) { margin-top: calc(var(--u) * 1.5); margin-bottom: calc(var(--u) * -1); padding: 6px 10px; border-radius: 6px; background: rgb(255 255 255 / 92%); color: var(--danger); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 1.8); margin: calc(var(--u) * 3) 0 0; }
.keypad button { height: max(calc(50px * var(--floor)), calc(var(--u) * 8.2)); border: 0; border-radius: 999px; background: rgb(255 255 255 / 92%); color: var(--ink); font-size: max(calc(22px * var(--floor)), calc(var(--u) * 4.6)); font-weight: 600; cursor: pointer; touch-action: manipulation; }
.keypad button.muted { font-size: max(calc(15px * var(--floor)), calc(var(--u) * 3)); color: var(--muted); }
.keypad button:active { background: #fff; transform: scale(.97); }
.submit { height: max(calc(50px * var(--floor)), calc(var(--u) * 12)); margin-top: calc(var(--u) * 5.16); border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: max(calc(17px * var(--floor)), calc(var(--u) * 3.85)); font-weight: 700; letter-spacing: .08em; cursor: pointer; width: 100%; }
.submit:disabled { opacity: .6; cursor: progress; }
.link { margin-top: calc(var(--u) * 2.4); border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font-size: max(calc(13px * var(--floor)), calc(var(--u) * 2.8)); }
.banner { margin: 0 0 calc(var(--u) * 3); padding: 6px 14px; border-radius: 999px; background: rgb(0 0 0 / 22%); font-size: max(calc(12px * var(--floor)), calc(var(--u) * 2.6)); }
.footer { margin: 0 0 calc(var(--u) * 3); padding: 0 16px; font-size: max(calc(12px * var(--floor)), calc(var(--u) * 2.4)); opacity: .85; }
.bottom-art { display: block; width: 100%; height: auto; max-height: 34dvh; margin-top: auto; object-fit: cover; object-position: center bottom; }

.panel { background: var(--card); color: var(--ink); border-radius: 16px; padding: 24px; box-shadow: 0 20px 50px rgb(0 0 0 / 18%); }
.help { width: min(100%, calc(var(--u) * 74)); display: grid; gap: 12px; text-align: center; }
.help-title { font-size: 19px; font-weight: 800; margin: 0; }
.help-sub { color: var(--muted); margin: 0; }
.qr { width: min(200px, 60%); margin: 4px auto; }
.qr svg { width: 100%; height: auto; display: block; }

/* 屏幕键盘模式（一体机 / iPad）：主视觉让出高度给键盘 */
.kiosk { --floor: 0; }
.kiosk .bottom-art { max-height: 24dvh; object-position: center 15%; }

/* ---------- 横屏（iPad 横放 / 横屏大屏）：同一张竖版海报按屏幕高度等比居中，两侧用背景色填充 ---------- */
@media (orientation: landscape) {
  .bottom-art { width: min(100%, calc(var(--u) * 100)); }
}

/* ---------- 签到成功：全屏专属页（样式见 guest-card.css） ---------- */
.result { position: fixed; inset: 0; z-index: 10; overflow: auto; background: var(--bg) center / cover no-repeat; display: flex; justify-content: center; align-items: flex-start; animation: fade .25s ease; }
/* 宽度按屏幕高度收窄，保证竖屏一体机、iPad、手机都一屏放下 */
#resultHost { width: min(100vw, 760px, calc(100dvh / 2.08)); margin: auto 0; }
/* 海报版按设计稿 1124 × 2000 铺满屏幕 */
#resultHost:has(.gc-poster) { width: min(100vw, calc(100dvh * .562)); }
@keyframes fade { from { opacity: 0; } }

/* ---------- 首页 / 现场登记等简单页面共用 ---------- */
.stage { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.stage h1 { font-size: clamp(28px, 6vw, 48px); margin: 0 0 12px; }
.subtitle { opacity: .85; margin: 6px 0; }
