/* ==========================================================================
   開場信封 · Opening gate
   基礎版面 → 5 種開啟物件（信封／對摺卡／雜誌書腰／雙開門／入場券）→ 10 個範本主題
   ========================================================================== */
html.gate-lock, html.gate-lock body { overflow: hidden; }

.inv-gate {
  position: fixed; inset: 0; z-index: 64; overflow: hidden; isolation: isolate;
  display: grid; place-items: center; text-align: center; color: #fff;
  padding: calc(var(--topbar-h, 0px) + 20px) 20px calc(24px + env(safe-area-inset-bottom));
  font-family: var(--font-body);
  --gate-shade: radial-gradient(ellipse at 50% 45%, rgba(20, 14, 10, .25), rgba(20, 14, 10, .68));
  --fx: rgba(255, 255, 255, .9);
  transition: opacity .9s ease, transform .9s ease, filter .9s ease;
}
.inv-gate.is-leaving { opacity: 0; transform: scale(1.05); filter: blur(6px); pointer-events: none; }
.gate-bg { position: absolute; inset: 0; z-index: -3; background: var(--surface); }
.gate-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(2px) saturate(.9); transform: scale(1.08); animation: gateZoom 24s ease-out both; }
@keyframes gateZoom { from { transform: scale(1.16); } to { transform: scale(1.04); } }
.gate-shade { position: absolute; inset: 0; z-index: -2; background: var(--gate-shade); }

.gate-inner { position: relative; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate-inner > * { animation: gateIn 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.gate-inner > :nth-child(2) { animation-delay: .15s; }
.gate-inner > :nth-child(3) { animation-delay: .3s; }
.gate-inner > :nth-child(n + 4) { animation-delay: .55s; }
@keyframes gateIn { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
.gate-eyebrow { font: 500 11px/1.6 var(--font-ui, var(--font-body)); letter-spacing: .28em; text-transform: uppercase; opacity: .85; max-width: 30em; }
.gate-names { margin: 0; font-family: var(--font-script); font-weight: 400; font-size: clamp(34px, 10vw, 64px); line-height: 1.12; text-shadow: 0 2px 18px rgba(0, 0, 0, .3); }
.gate-names em { font-style: normal; color: var(--gate-amp, var(--accent2)); margin: 0 .1em; }
.gate-stage { width: min(80vw, 340px); margin: 12px 0 8px; perspective: 1400px; }
.gate-hint { font: 500 14px/1.5 var(--font-ui, var(--font-body)); letter-spacing: .18em; }
.gate-sorry { font-size: 12px; opacity: .75; margin-top: -6px; }
.gate-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 30px; margin-top: 8px; cursor: pointer;
  font: 500 14px/1 var(--font-ui, var(--font-body)); letter-spacing: .22em; color: inherit;
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent); border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .3s, transform .3s;
}
.gate-btn svg { width: 18px; height: 18px; }
.gate-btn:hover { background: color-mix(in srgb, currentColor 22%, transparent); transform: translateY(-2px); }
.inv-gate.is-opening .gate-hint, .inv-gate.is-opening .gate-sorry, .inv-gate.is-opening .gate-btn { animation: none; opacity: 0; transition: opacity .4s; pointer-events: none; }
.gate-to { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.2; pointer-events: none; }
.gate-to small { font: 500 10px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .2em; opacity: .7; }
.gate-to b { font: italic 400 clamp(18px, 5.4vw, 24px)/1.25 var(--font-display); max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-gate-open] { cursor: pointer; }

/* ---------- 漂浮粒子 ---------- */
.gate-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.gate-fx i { position: absolute; top: -8%; width: calc(10px * var(--s)); height: calc(14px * var(--s)); background: var(--fx); animation: gateFall linear infinite; }
.fx-petals i { border-radius: 80% 0 80% 0; opacity: .85; }
.fx-sparkle i, .fx-gold i { width: calc(4px * var(--s)); height: calc(4px * var(--s)); border-radius: 50%; box-shadow: 0 0 8px 2px var(--fx); animation-name: gateDrift; }
.fx-bubbles i { top: auto; bottom: -10%; width: calc(26px * var(--s)); height: calc(26px * var(--s)); border-radius: 50%; background: radial-gradient(circle at 32% 30%, #fff, rgba(255, 255, 255, .25) 40%, rgba(255, 255, 255, .05) 70%); border: 1px solid rgba(255, 255, 255, .7); animation-name: gateRise; }
@keyframes gateFall { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(60px, 115vh) rotate(600deg); } }
@keyframes gateDrift { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: .8; } 100% { transform: translate(-30px, 110vh); opacity: 0; } }
@keyframes gateRise { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(24px, -115vh); opacity: 0; } }

/* ==========================================================================
   1) 信封 Envelope
   ========================================================================== */
.env { --paper: #f3ebdd; --paper2: #e6d9c2; --liner: #d9c39b; --wax: #a8844f; --wax-ink: #fff6e2; --to-ink: #5a4a38; --decor: #6f7f63;
  position: relative; width: 100%; aspect-ratio: 1.42; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .35)); }
.env > span { position: absolute; display: block; }
.env-back { inset: 0; background: var(--paper2); border-radius: 6px; }
.env-letter { left: 6%; right: 6%; top: 5%; height: 88%; z-index: 1; background: #fffdf7; border-radius: 4px; display: flex; justify-content: center; align-items: flex-start; padding-top: 9%; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); transition: transform 1s cubic-bezier(.3, .7, .2, 1) .95s; }
.env-letter__in { display: flex; flex-direction: column; gap: 4px; color: #3a3029; }
.env-letter__in small { font: 500 10px/1 var(--font-ui, var(--font-body)); letter-spacing: .26em; text-transform: uppercase; opacity: .6; }
.env-letter__in b { font: 400 22px/1.2 var(--font-display); letter-spacing: .08em; }
.env-front { inset: 0; z-index: 2; background: var(--paper); clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); border-radius: 6px; }
.env-front::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, .06)); clip-path: polygon(0 100%, 50% 50%, 100% 100%); }
.env-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .05), transparent 30%, transparent 70%, rgba(0, 0, 0, .05)); }
.env-flap { left: 0; right: 0; top: 0; height: 54%; z-index: 3; background: var(--paper); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; filter: brightness(.96);
  transition: transform .8s cubic-bezier(.5, 0, .3, 1) .3s, z-index 0s linear .7s; }
.env-flap__liner { position: absolute; inset: 5% 7% 12%; clip-path: polygon(0 0, 100% 0, 50% 100%); background: var(--liner); opacity: 0; transition: opacity .2s .7s; }
.env-seal { left: 50%; top: 52%; width: 23%; aspect-ratio: 1; z-index: 5; translate: -50% -50%;
  border-radius: 48% 52% 50% 50% / 52% 47% 53% 48%; display: grid; place-items: center; color: var(--wax-ink);
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--wax) 55%, #fff), var(--wax) 48%, color-mix(in srgb, var(--wax) 70%, #000) 100%);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .28), inset 0 3px 6px rgba(255, 255, 255, .25), 0 5px 12px rgba(0, 0, 0, .3);
  transition: transform .45s cubic-bezier(.5, 0, .3, 1), opacity .45s; animation: sealPulse 2.6s ease-in-out infinite; }
.env-seal::before { content: ''; position: absolute; inset: 13%; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--wax-ink) 35%, transparent); }
.env-seal span { font: 500 clamp(14px, 4.4vw, 20px)/1 var(--font-display); letter-spacing: .02em; text-shadow: 0 -1px 0 rgba(0, 0, 0, .25); }
.env-seal i { font-style: italic; font-size: .75em; margin: 0 .04em; }
@keyframes sealPulse { 50% { transform: scale(1.06); } }
.env .gate-to { display: flex; left: 0; right: 0; bottom: 6%; z-index: 4; color: var(--to-ink); transition: opacity .3s; }
.env-ribbon { left: -2%; right: -2%; top: 46%; height: 12%; z-index: 4; background: linear-gradient(180deg, color-mix(in srgb, var(--ribbon) 80%, #fff), var(--ribbon) 45%, color-mix(in srgb, var(--ribbon) 75%, #000)); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .6s cubic-bezier(.5, 0, .3, 1), opacity .6s; }
.env-ribbon i { position: absolute; left: 50%; top: 50%; width: 46%; height: 260%; translate: -50% -50%; }
.env-ribbon i::before, .env-ribbon i::after { content: ''; position: absolute; top: 18%; width: 46%; height: 64%; background: inherit; border: 6px solid var(--ribbon); border-radius: 50% 10% 10% 50%; background: transparent; }
.env-ribbon i::before { left: 0; }
.env-ribbon i::after { right: 0; transform: scaleX(-1); }
.env-decor { left: 24%; top: 34%; width: 52%; z-index: 4; color: var(--decor); transform: rotate(-14deg); transition: opacity .3s; }
.env-decor svg { width: 100%; height: auto; display: block; }

/* 開啟動畫 */
.is-opening .env-ribbon { transform: translateX(120%) rotate(8deg); opacity: 0; }
.is-opening .env-seal { animation: none; transform: scale(1.35); opacity: 0; }
.is-opening .env-decor, .is-opening .env .gate-to { opacity: 0; }
.is-opening .env-flap { transform: rotateX(180deg); z-index: 0; }
.is-opening .env-flap__liner { opacity: 1; }
.is-opening .env-letter { transform: translateY(-62%); }

/* ==========================================================================
   2) 對摺卡 Card（現代極簡）
   ========================================================================== */
.gcard { position: relative; width: 86%; margin: 0 auto; aspect-ratio: 1.2; }
.gcard > span { position: absolute; display: flex; }
.gcard-inside { inset: 0; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); padding: 12%; }
.gcard-inside b { font: 300 18px/1.4 var(--font-display); letter-spacing: .3em; text-transform: uppercase; }
.gcard-half { left: 0; right: 0; height: 50%; background: #fff; border: 1px solid var(--ink); flex-direction: column; align-items: center; justify-content: center; color: var(--ink); z-index: 2; transition: transform 1s cubic-bezier(.6, 0, .2, 1) .35s, opacity 1s .35s; }
.gcard-top { top: 0; border-bottom: 0; padding-bottom: 18px; }
.gcard-bottom { bottom: 0; border-top: 1px dashed color-mix(in srgb, var(--ink) 40%, transparent); gap: 6px; justify-content: flex-end; padding-bottom: 12%; }
.gcard-mono { font: 200 clamp(32px, 10vw, 44px)/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; }
.gcard-mono i { font-style: normal; margin: 0 .25em; color: var(--muted); }
.gcard-date { font: 400 11px/1 var(--font-ui); letter-spacing: .3em; color: var(--muted); }
.gcard .gate-to b { font-style: normal; font-weight: 300; text-transform: uppercase; letter-spacing: .14em; font-size: 17px; }
.gcard-seal { left: 50%; top: 50%; translate: -50% -50%; z-index: 3; width: 52px; aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: var(--bg); align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .25); transition: transform .4s, opacity .4s; }
.gcard-seal span { font: 400 11px/1 var(--font-ui); letter-spacing: .08em; }
.gcard-seal i { font-style: normal; }
.is-opening .gcard-seal { transform: scale(0); opacity: 0; }
.is-opening .gcard-top { transform: translateY(-70%); opacity: 0; }
.is-opening .gcard-bottom { transform: translateY(70%); opacity: 0; }

/* ==========================================================================
   3) 雜誌書腰 Band（精品雜誌）
   ========================================================================== */
.gmag { position: relative; width: 72%; margin: 0 auto; aspect-ratio: 3 / 4; perspective: 1400px; }
.gmag > span { position: absolute; display: block; }
.gmag-page { inset: 0; background: #f4f1ec; color: #141414; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12%; box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .6); }
.gmag-page b { font: italic 400 26px/1.15 var(--font-display); }
.gmag-page small { font: 500 10px/1.5 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: #6e6a64; }
.gmag-cover { inset: 0; z-index: 2; transform-origin: left center; backface-visibility: hidden; overflow: hidden; background: #222; box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .7); transition: transform 1.2s cubic-bezier(.6, 0, .2, 1) .55s; }
.gmag-cover img { width: 100%; height: 100%; object-fit: cover; }
.gmag-mast { position: absolute; left: 0; right: 0; top: 4%; font: 900 clamp(46px, 15vw, 64px)/1 var(--font-display); letter-spacing: -.03em; color: #fff; }
.gmag-issue { position: absolute; left: 8%; right: 8%; top: 2%; display: flex; justify-content: center; font: 500 8px/1 var(--font-ui); letter-spacing: .3em; color: #fff; opacity: .85; }
.gmag-band { left: -6%; right: -6%; top: 60%; z-index: 3; padding: 12px 10px 14px; background: var(--accent2); color: #141414; display: flex !important; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 8px 18px rgba(0, 0, 0, .35); transition: transform .7s cubic-bezier(.5, 0, .3, 1), opacity .7s; }
.gmag-band > small { font: 600 9px/1 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; }
.gmag-band .gate-to small { display: none; }
.gmag-band .gate-to b { font-size: 22px; }
.gmag-seal { position: absolute; right: 10%; top: -16px; width: 40px; height: 40px; border-radius: 50%; background: #141414; color: #f4f1ec; display: grid; place-items: center; font: italic 400 12px/1 var(--font-display); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.gmag-seal i { font-size: .8em; }
.is-opening .gmag-band { transform: translateY(160%) rotate(5deg); opacity: 0; }
.is-opening .gmag-cover { transform: rotateY(-118deg); }

/* ==========================================================================
   4) 雙開門 Doors（東方雅緻 / 黑金晚宴）
   ========================================================================== */
.gdoors { position: relative; width: 78%; margin: 0 auto; aspect-ratio: 3 / 4; perspective: 1500px; }
.gdoors > span { position: absolute; display: block; }
.gdoors-inside { inset: 0; display: grid !important; place-items: center; padding: 14%; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--door-glow) 90%, #fff), var(--door-glow) 40%, color-mix(in srgb, var(--door-glow) 40%, #000)); }
.gdoors-inside b { font: 600 22px/1.4 var(--font-display); letter-spacing: .2em; color: var(--door-ink); }
.gdoor { top: 0; bottom: 0; width: 50%; z-index: 2; transition: transform 1.3s cubic-bezier(.6, 0, .2, 1) .35s; transform-style: preserve-3d; }
.gdoor-l { left: 0; transform-origin: left center; }
.gdoor-r { right: 0; transform-origin: right center; }
.gdoor-panel { position: absolute; inset: 0; background: var(--door); border: 3px solid var(--door-trim); box-shadow: inset 0 0 0 6px var(--door), inset 0 0 0 7px var(--door-trim), 0 20px 40px -12px rgba(0, 0, 0, .6); }
.gdoor-panel::before { content: ''; position: absolute; inset: 14% 16%; border: 1px solid var(--door-trim); background: var(--door-lattice); opacity: .9; }
.gdoors-knob { left: 50%; top: 46%; z-index: 4; translate: -50% -50%; width: 26%; aspect-ratio: 1; border-radius: 50%; display: grid !important; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff3c9, #d6b25f 40%, #8c6a2c 100%); box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(255, 255, 255, .25), inset 0 -3px 6px rgba(0, 0, 0, .3); transition: transform .45s, opacity .45s; animation: sealPulse 2.6s ease-in-out infinite; }
.gdoors-knob span { font: 700 clamp(20px, 6.6vw, 28px)/1 var(--font-display); color: var(--knob-ink); letter-spacing: .04em; }
.gdoors .gate-to { display: flex; left: 0; right: 0; bottom: 6%; z-index: 4; color: var(--door-trim); transition: opacity .3s; }
.is-opening .gdoors-knob { animation: none; transform: scale(1.4); opacity: 0; }
.is-opening .gdoors .gate-to { opacity: 0; }
.is-opening .gdoor-l { transform: rotateY(-108deg); }
.is-opening .gdoor-r { transform: rotateY(108deg); }

/* ==========================================================================
   5) 入場券 Ticket（現代活潑）
   ========================================================================== */
.gticket { position: relative; width: 100%; aspect-ratio: 2.05; display: grid; grid-template-columns: 1fr 32%; filter: drop-shadow(6px 6px 0 #14161f); text-align: left; color: #14161f; }
.gticket > span { display: flex; position: relative; }
.gticket-main { flex-direction: column; justify-content: center; gap: 2px; padding: 8% 7%; background: var(--pop); border: 3px solid #14161f; border-right: 0; border-radius: 16px 0 0 16px; transition: transform .9s cubic-bezier(.5, 0, .3, 1) .5s, opacity .9s .5s; }
.gticket-main small { font: 700 10px/1 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; }
.gticket-main b { font: 800 clamp(34px, 11vw, 52px)/.95 var(--font-display); text-transform: uppercase; letter-spacing: -.03em; }
.gticket-main em { font: 600 11px/1.4 var(--font-ui); font-style: normal; }
.gticket-age { position: absolute; right: 8%; top: 12%; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent2); color: #fff; font: 800 18px/1 var(--font-display); border: 2px solid #14161f; transform: rotate(10deg); }
.gticket-stub { flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 6%; background: #fff; border: 3px solid #14161f; border-left: 3px dashed #14161f; border-radius: 0 16px 16px 0; transition: transform .8s cubic-bezier(.5, 0, .3, 1), opacity .8s; transform-origin: bottom left; }
.gticket-stub .gate-to small { opacity: .6; }
.gticket-stub .gate-to b { font: 700 15px/1.2 var(--font-ui); font-style: normal; white-space: normal; text-align: center; }
.gticket-no { font: 700 10px/1 var(--font-ui); letter-spacing: .14em; opacity: .6; }
.gticket-seal { position: absolute !important; left: 68%; bottom: -16px; translate: -50% 0; width: 46px; height: 46px; border-radius: 50%; display: grid !important; place-items: center; background: var(--accent); color: #fff; border: 2px solid #14161f; font: 800 10px/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; animation: wobble 3s ease-in-out infinite; transition: opacity .3s; }
.is-opening .gticket-seal { opacity: 0; }
.is-opening .gticket-stub { transform: translate(30%, 130%) rotate(28deg); opacity: 0; }
.is-opening .gticket-main { transform: translateY(-40%) scale(1.15); opacity: 0; }
.gate-confetti { position: absolute; left: 50%; top: 48%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.gate-confetti i { position: absolute; width: 10px; height: 14px; opacity: 0; background: var(--pop); }
.gate-confetti i:nth-child(3n) { background: var(--accent2); }
.gate-confetti i:nth-child(3n + 1) { background: #fff; }
.gate-confetti i:nth-child(4n) { border-radius: 50%; width: 10px; height: 10px; }
.is-opening .gate-confetti i { animation: burst 1.6s cubic-bezier(.1, .7, .3, 1) .35s forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(720deg); } }
.gate-confetti i:nth-child(1) { --dx: -160px; --dy: -220px; } .gate-confetti i:nth-child(2) { --dx: 140px; --dy: -240px; }
.gate-confetti i:nth-child(3) { --dx: -220px; --dy: -60px; } .gate-confetti i:nth-child(4) { --dx: 200px; --dy: -90px; }
.gate-confetti i:nth-child(5) { --dx: -90px; --dy: -300px; } .gate-confetti i:nth-child(6) { --dx: 80px; --dy: -320px; }
.gate-confetti i:nth-child(7) { --dx: -260px; --dy: 80px; } .gate-confetti i:nth-child(8) { --dx: 250px; --dy: 60px; }
.gate-confetti i:nth-child(9) { --dx: -30px; --dy: -360px; } .gate-confetti i:nth-child(10) { --dx: 30px; --dy: 260px; }
.gate-confetti i:nth-child(11) { --dx: -180px; --dy: 200px; } .gate-confetti i:nth-child(12) { --dx: 170px; --dy: 220px; }
.gate-confetti i:nth-child(13) { --dx: -120px; --dy: -150px; } .gate-confetti i:nth-child(14) { --dx: 120px; --dy: -160px; }
.gate-confetti i:nth-child(15) { --dx: -300px; --dy: -160px; } .gate-confetti i:nth-child(16) { --dx: 300px; --dy: -180px; }
.gate-confetti i:nth-child(17) { --dx: -60px; --dy: 300px; } .gate-confetti i:nth-child(18) { --dx: 60px; --dy: -260px; }
.gate-confetti i:nth-child(19) { --dx: -240px; --dy: -280px; } .gate-confetti i:nth-child(20) { --dx: 230px; --dy: -300px; }
.gate-confetti i:nth-child(21) { --dx: -140px; --dy: 120px; } .gate-confetti i:nth-child(22) { --dx: 140px; --dy: 130px; }
.gate-confetti i:nth-child(23) { --dx: -320px; --dy: 20px; } .gate-confetti i:nth-child(24) { --dx: 320px; --dy: 0; }
.gate-confetti i:nth-child(25) { --dx: -200px; --dy: 300px; } .gate-confetti i:nth-child(26) { --dx: 210px; --dy: 320px; }
.gate-confetti i:nth-child(27) { --dx: 0; --dy: -380px; } .gate-confetti i:nth-child(28) { --dx: 0; --dy: 340px; }

/* ==========================================================================
   範本主題 · Per-template themes
   ========================================================================== */
/* W01 經典浪漫：象牙信封、金色封蠟、金粉 */
.tpl-classic-romance .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 45%, rgba(60, 42, 20, .25), rgba(40, 28, 14, .7)); --fx: #f3d9a0; --gate-amp: #e9cf98; }
.tpl-classic-romance .env { --paper: #f6efe1; --paper2: #eadcc2; --liner: repeating-radial-gradient(circle at 50% 0, #e6d3ad 0 6px, #d4b984 6px 7px); --wax: #a8844f; --wax-ink: #fff4dc; --to-ink: #6a5640; }
.tpl-classic-romance .env-seal span { font-family: 'Great Vibes', var(--font-display); font-size: clamp(18px, 5.4vw, 24px); }

/* W02 現代極簡：黑白、淺色霧面、對摺卡 */
.tpl-modern-minimal .inv-gate { color: var(--ink); --gate-shade: linear-gradient(180deg, rgba(247, 245, 240, .82), rgba(247, 245, 240, .92)); }
.tpl-modern-minimal .gate-bg img { filter: grayscale(1) blur(1px); }
.tpl-modern-minimal .gate-names { font-family: var(--font-display); font-weight: 300; text-transform: uppercase; letter-spacing: .08em; text-shadow: none; font-size: clamp(30px, 9vw, 54px); }
.tpl-modern-minimal .gate-names em { color: var(--muted); }
.tpl-modern-minimal .gate-btn { border-radius: 0; backdrop-filter: none; }

/* W03 花園婚禮：森林綠、橄欖綠封蠟、尤加利枝、白色花瓣 */
.tpl-garden-wedding .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 45%, rgba(25, 40, 25, .25), rgba(18, 32, 20, .72)); --fx: rgba(255, 255, 255, .9); --gate-amp: #c8d4bc; }
.tpl-garden-wedding .env { --paper: #ece9db; --paper2: #dfdbc8; --liner: repeating-linear-gradient(45deg, #c8d4bc 0 8px, #b5c4a6 8px 9px); --wax: #6a7f58; --wax-ink: #eef2e4; --to-ink: #3f4a3a; --decor: #6f8463; }

/* W04 精品雜誌：深色、雜誌書腰 */
.tpl-editorial-vogue .inv-gate { --gate-shade: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .8)); }
.tpl-editorial-vogue .gate-names { font: italic 400 clamp(34px, 10vw, 60px)/1.1 var(--font-display); }
.tpl-editorial-vogue .gate-btn { border-radius: 0; background: #fff; color: #111; border-color: #fff; }

/* W05 東方雅緻：朱漆格扇門、金色門環「囍」、金箔 */
.tpl-oriental-grace .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 40%, rgba(120, 30, 22, .55), rgba(40, 10, 8, .92)); --fx: #e8c77a; --gate-amp: #e8c77a; }
.tpl-oriental-grace .gate-names { font-family: var(--font-display); font-weight: 700; letter-spacing: .16em; font-size: clamp(28px, 8vw, 46px); }
.tpl-oriental-grace .gdoors { --door: #9b2f25; --door-trim: #d9b25f; --door-glow: #f3dfae; --door-ink: #8e2a22; --knob-ink: #9b2f25;
  --door-lattice: repeating-linear-gradient(0deg, transparent 0 16px, rgba(217, 178, 95, .7) 16px 17.5px), repeating-linear-gradient(90deg, transparent 0 16px, rgba(217, 178, 95, .7) 16px 17.5px); }
.tpl-oriental-grace .gdoors .gate-to b { font-style: normal; font-weight: 600; letter-spacing: .2em; }
.tpl-oriental-grace .gate-btn { border-radius: 2px; }

/* B01 優雅成人生日：莫蘭迪信封、緞帶蝴蝶結、酒紅封蠟 */
.tpl-elegant-soiree .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 45%, rgba(60, 35, 42, .3), rgba(40, 22, 28, .75)); --gate-amp: #e2c6cb; }
.tpl-elegant-soiree .gate-names { font: italic 400 clamp(40px, 12vw, 70px)/1.05 'Bodoni Moda', var(--cjk-serif), serif; }
.tpl-elegant-soiree .env { --paper: #e9dcda; --paper2: #dccac8; --liner: repeating-linear-gradient(90deg, #d9bfc2 0 10px, #cfb0b4 10px 20px); --wax: #6e2f3c; --wax-ink: #f6e3e6; --to-ink: #5a3d43; --ribbon: #b88a94; }
.tpl-elegant-soiree .env-flap { transition-delay: .55s, .95s; }
.tpl-elegant-soiree .env-letter { transition-delay: 1.15s; }

/* B02 粉彩夢幻派對：虹彩信封、愛心貼紙、泡泡 */
.tpl-pastel-dream .inv-gate { color: var(--ink); --gate-shade: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent2) 60%, transparent) 55%, rgba(191, 233, 224, .7)); --gate-amp: var(--accent); }
.tpl-pastel-dream .gate-bg img { filter: blur(6px) saturate(1.1); }
.tpl-pastel-dream .gate-names { font: italic 600 clamp(44px, 13vw, 76px)/1 'Fraunces', var(--cjk-sans), serif; text-shadow: 0 4px 24px rgba(255, 255, 255, .6); }
.tpl-pastel-dream .gate-btn { background: #fff; border-color: #fff; font-weight: 700; box-shadow: 0 14px 30px -14px var(--accent); }
.tpl-pastel-dream .env { --paper: linear-gradient(135deg, #fde7f1, #efe3fb 50%, #dff5ef); --paper2: #eadff3; --liner: repeating-linear-gradient(45deg, #f7c9da 0 8px, #fff 8px 16px); --wax: #f08fb3; --wax-ink: #fff; --to-ink: #6b5a80; }
.tpl-pastel-dream .env-front, .tpl-pastel-dream .env-flap { background: var(--paper); }
.tpl-pastel-dream .env-seal { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd3e3, #f08fb3 60%); box-shadow: 0 6px 14px rgba(240, 143, 179, .5), inset 0 0 0 3px rgba(255, 255, 255, .7); }
.tpl-pastel-dream .env-seal::before { border: 2px dotted #fff; }
.tpl-pastel-dream .env-seal span { font-family: 'Fraunces', serif; font-style: italic; font-weight: 600; }

/* B03 現代活潑派對：鈷藍點點背景、入場券、彩紙 */
.tpl-pop-party .inv-gate { --gate-shade: var(--accent-base); --gate-amp: var(--pop); }
.tpl-pop-party .gate-bg { display: none; }
.tpl-pop-party .gate-shade { background-image: radial-gradient(rgba(255, 255, 255, .22) 1.4px, transparent 1.6px); background-size: 18px 18px; }
.tpl-pop-party .gate-names { font: 800 clamp(48px, 15vw, 90px)/.9 'Syne', var(--cjk-sans), sans-serif; text-transform: uppercase; letter-spacing: -.03em; text-shadow: 4px 4px 0 #14161f; }
.tpl-pop-party .gate-btn { background: var(--pop); color: #14161f; border: 2px solid #14161f; box-shadow: 4px 4px 0 #14161f; border-radius: 14px; font-weight: 700; backdrop-filter: none; }

/* B04 花卉慶典：腮紅信封、花朵裝飾、玫瑰花瓣 */
.tpl-floral-fete .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 45%, rgba(90, 40, 50, .2), rgba(70, 28, 38, .7)); --fx: #f4b6c0; --gate-amp: #f3c9c4; }
.tpl-floral-fete .env { --paper: #f7e9e5; --paper2: #ecd5ce; --liner: radial-gradient(circle at 25% 30%, #e9b9b3 0 6px, transparent 7px) 0 0 / 22px 22px, #f3dbd6; --wax: #9b3f4f; --wax-ink: #fde9ec; --to-ink: #7a4a52; --decor: #9b3f4f; }
.tpl-floral-fete .env-decor { left: 18%; top: 30%; width: 64%; transform: none; }
.tpl-floral-fete .env-seal { border-radius: 50%; box-shadow: 0 0 0 4px #f7e9e5, 0 0 0 5px #e9b9b3, 0 6px 14px rgba(0, 0, 0, .3); }
.tpl-floral-fete .env-seal span { font-family: 'Allura', var(--font-display); font-size: clamp(20px, 6vw, 26px); }

/* B05 黑金高級晚宴：Art Deco 黑金門、羅馬數字門環、金粉 */
.tpl-noir-gala .inv-gate { --gate-shade: radial-gradient(ellipse at 50% 42%, rgba(60, 46, 20, .5), rgba(5, 5, 4, .95)); --fx: #d6b56e; --gate-amp: #d6b56e; }
.tpl-noir-gala .gate-bg img { filter: blur(3px) grayscale(.4); }
.tpl-noir-gala .gate-names { font: 500 clamp(32px, 10vw, 58px)/1.1 'Cinzel', var(--cjk-serif), serif; letter-spacing: .12em; text-transform: uppercase; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.tpl-noir-gala .gdoors { --door: #0e0d0b; --door-trim: #c9a45c; --door-glow: #3a2c12; --door-ink: #e9cf8e; --knob-ink: #1b150a;
  --door-lattice: repeating-linear-gradient(45deg, transparent 0 13px, rgba(201, 164, 92, .45) 13px 14px), repeating-linear-gradient(-45deg, transparent 0 13px, rgba(201, 164, 92, .45) 13px 14px); }
.tpl-noir-gala .gdoors-inside b { font-family: 'Cinzel', serif; }
.tpl-noir-gala .gdoors-knob span { font-family: 'Cinzel', serif; letter-spacing: .1em; }
.tpl-noir-gala .gdoors .gate-to b { font-style: normal; font-family: 'Cinzel', var(--cjk-serif), serif; letter-spacing: .12em; }
.tpl-noir-gala .gate-btn { border-radius: 0; color: #e9cf8e; }

@media (max-height: 700px) {
  .gate-stage { width: min(68vw, 280px); margin: 4px 0; }
  .gate-names { font-size: clamp(28px, 8vw, 44px); }
  .gate-inner { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-gate *, .inv-gate { animation: none !important; transition: none !important; }
}
