* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #07060f; color: #e8e6ff;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
#cam { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#hud { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 0; right: 0; text-align: center; pointer-events: none; }
#brand { font-weight: 800; letter-spacing: .5em; font-size: 15px; opacity: .85; padding-left: .5em; }
#brand span { color: #7cf3ff; }
#hint { margin-top: 6px; font-size: 12px; opacity: .45; letter-spacing: .05em; }

#bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 6px; border-radius: 999px;
  background: rgba(20, 18, 40, .55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .08); }
#bar button { border: 0; border-radius: 999px; padding: 9px 15px; font-size: 13px; font-weight: 600;
  color: #e8e6ff; background: rgba(255, 255, 255, .06); cursor: pointer; white-space: nowrap; font-family: inherit; }
#bar button:hover { background: rgba(255, 255, 255, .14); }
#bar button.on { background: #7cf3ff; color: #07060f; }
#bar button.rec { background: #ff3b6b; color: #fff; }

#arTip { position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(16px, env(safe-area-inset-top)) + 34px);
  font-size: 12px; padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .1); white-space: nowrap; }
#recDot { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 18px; color: #ff3b6b; font-weight: 700; font-size: 13px;
  animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
#toast { position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 10px;
  background: rgba(0, 0, 0, .7); font-size: 14px; max-width: 86vw; text-align: center; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 13px; letter-spacing: .3em; opacity: .6;
  pointer-events: none; transition: opacity .6s; }
#intro { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: #050410; z-index: 10; transition: opacity .7s ease, visibility .7s; text-align: center; }
#intro.done { opacity: 0; visibility: hidden; }
#intro .ring { width: 86px; height: 86px; border-radius: 50%; border: 2px solid rgba(124, 243, 255, .25);
  border-top-color: #7cf3ff; animation: spin 1s linear infinite; margin-bottom: 12px;
  box-shadow: 0 0 40px rgba(124, 243, 255, .25); }
#intro .k { font-weight: 800; letter-spacing: .6em; font-size: 13px; opacity: .6; padding-left: .6em; }
#intro .t { font-size: 18px; letter-spacing: .1em; }
#intro .t b { color: #7cf3ff; font-size: 22px; text-shadow: 0 0 18px rgba(124, 243, 255, .6); }
#intro .s { font-size: 12px; letter-spacing: .25em; opacity: .5; font-family: ui-monospace, monospace; }
@keyframes spin { to { transform: rotate(360deg); } }

#owner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 60px);
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; font-size: 12px;
  color: #e8e6ff; text-decoration: none; white-space: nowrap;
  background: rgba(20, 18, 40, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 243, 255, .25); }
#owner b { color: #7cf3ff; }
#owner .cta { background: linear-gradient(90deg, #7cf3ff, #b36bff); color: #07060f; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; }
#owner:not([href]) .cta { display: none; }
#owner:not([href]) { padding-right: 14px; }

[hidden] { display: none !important; }
body.clean #hud, body.clean #bar, body.clean #arTip, body.clean #owner { display: none; }
body.ar #owner { display: none; }

/* AR 手势：手部光点、状态提示、首次引导 */
#handViz { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; display: none; }
body.ar #handViz { display: block; }
#arTip[data-s="hand"] { color: #ffd36b; }
#arTip[data-s="pinched"] { color: #7dff9a; }
#arTip[data-s="failed"] { color: #ff8a8a; }
#arGuide { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  width: min(88vw, 420px); padding: 22px 22px 18px; border-radius: 18px;
  background: rgba(14, 10, 30, 0.92); border: 1px solid rgba(124, 243, 255, 0.35);
  box-shadow: 0 0 40px rgba(124, 243, 255, 0.15); color: #e8e6ff; font-size: 14px; line-height: 1.65; }
#arGuide h3 { margin: 0 0 10px; font-size: 17px; color: #7cf3ff; letter-spacing: 1px; }
#arGuide ol { margin: 0; padding-left: 20px; }
#arGuide li { margin: 4px 0; }
#arGuide b { color: #ffd36b; font-weight: 600; }
#arGuide p { margin: 10px 0 14px; font-size: 12px; opacity: 0.7; }
#arGuide button { width: 100%; padding: 10px; border: 0; border-radius: 12px; font-size: 15px;
  background: linear-gradient(90deg, #7cf3ff, #b36bff); color: #0b0820; font-weight: 700; }

#bar button.hl { background: linear-gradient(90deg, #7cf3ff, #b36bff); color: #07060f; }
body.clean #share { display: none; }
#share { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 2, 8, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#share[hidden] { display: none; }
#share .panel { position: relative; width: min(88vw, 420px); text-align: center; }
#share img { display: block; margin: 0 auto; width: auto; height: auto; max-width: 100%; max-height: 72vh; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); -webkit-touch-callout: default; }
#share .tip { margin: 12px 0 10px; font-size: 13px; color: #c9c4e8; }
#share .row { display: flex; gap: 8px; justify-content: center; }
#share .row button { flex: 1; border: 0; border-radius: 999px; padding: 10px 0; font-size: 14px; font-weight: 600;
  color: #fff; background: rgba(255, 255, 255, .1); cursor: pointer; }
#share .row button:first-child { background: linear-gradient(90deg, #7cf3ff, #b36bff); color: #07060f; }
#share .x { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  font-size: 22px; line-height: 34px; color: #fff; background: rgba(255, 255, 255, .16); cursor: pointer; }

#introTap { margin-top: 18px; padding: 12px 30px; border: 1px solid rgba(124, 243, 255, .6); border-radius: 999px;
  background: rgba(124, 243, 255, .08); color: #e9fdff; font-size: 16px; letter-spacing: .3em; cursor: pointer;
  animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 28px rgba(124, 243, 255, .55); background: rgba(124, 243, 255, .18); } }
#btnMusic { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 6; width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; background: rgba(10, 8, 20, .5); color: #fff; font-size: 18px; cursor: pointer; }
#btnMusic.on { animation: spin 4s linear infinite; border-color: #7cf3ff; color: #7cf3ff; }
#btnMusic.off { opacity: .55; text-decoration: line-through; }
#credit { position: fixed; top: max(60px, calc(env(safe-area-inset-top) + 46px)); right: 14px; z-index: 6; max-width: 60vw;
  font-size: 11px; color: rgba(255, 255, 255, .55); text-align: right; pointer-events: none; }
body.clean #btnMusic, body.clean #credit { display: none; }
/* 沉浸模式：只留卡和展台，双击或按 Esc 退出 */
body.zen #hud, body.zen #bar, body.zen #owner, body.zen #credit, body.zen #rsvp, body.zen #btnMusic { opacity: 0; pointer-events: none; }
#hud, #bar, #owner, #credit, #btnMusic { transition: opacity .5s; }
#zenTip { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 7;
  font-size: 12px; color: rgba(255, 255, 255, .6); padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .35);
  pointer-events: none; animation: zenfade 3s forwards; }
@keyframes zenfade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }

#rsvp { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(max(18px, env(safe-area-inset-bottom)) + 110px); }
#rsvpOpen { white-space: nowrap; padding: 11px 26px; border: 0; border-radius: 999px; font-size: 15px; font-weight: 700; letter-spacing: .1em;
  color: #1a0f2e; background: linear-gradient(90deg, #ffd36b, #c9a8ff); box-shadow: 0 6px 30px rgba(201, 168, 255, .45);
  cursor: pointer; animation: breathe 2.2s ease-in-out infinite; }
#rsvpOpen.done { background: rgba(255, 255, 255, .12); color: #fff; animation: none; box-shadow: none; }
#rsvp .box { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100vw, 460px); padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: rgba(16, 10, 30, .96); border: 1px solid rgba(201, 168, 255, .35); color: #ece9ff; }
#rsvp .box[hidden] { display: none; }
#rsvp .h { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
#rsvp .h button { border: 0; background: none; color: #fff; font-size: 24px; cursor: pointer; }
#rsvp .info { margin: 6px 0 10px; font-size: 13px; line-height: 1.7; color: #b9b3d8; }
#rsvp .info a { color: #ffd36b; }
#rsvp .who { font-size: 14px; margin-bottom: 10px; } #rsvp .who b { color: #ffd36b; font-size: 16px; }
#rsvp .opts { display: flex; gap: 8px; }
#rsvp .opts button { flex: 1; padding: 11px 0; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .05);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
#rsvp .opts button.on { border-color: #ffd36b; background: rgba(255, 211, 107, .16); color: #ffd36b; }
#rsvp .plus { display: block; margin: 12px 0 8px; font-size: 13px; color: #c9c4e8; }
#rsvp select { margin: 0 4px; padding: 3px 6px; border-radius: 8px; background: #241a3a; color: #fff; border: 1px solid rgba(255,255,255,.2); }
#rsvp textarea { width: 100%; height: 64px; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; resize: none;
  background: rgba(255, 255, 255, .06); color: #fff; border: 1px solid rgba(255, 255, 255, .15); font: inherit; font-size: 14px; }
#rsvpSend { width: 100%; margin-top: 10px; padding: 12px 0; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700;
  color: #1a0f2e; background: linear-gradient(90deg, #ffd36b, #c9a8ff); cursor: pointer; }
#rsvpSend:disabled { opacity: .5; }
#rsvp .st { margin: 8px 0 0; min-height: 1em; font-size: 12px; color: #b9b3d8; text-align: center; }
body.clean #rsvp, body.ar #rsvp { display: none; }
