:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: #082f77;
  --blue: #0758ec;
  --cyan: #00cbd5;
  --glass: rgba(255, 255, 255, .72);
  --stage-scale: 1;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(71, 192, 255, .28), transparent 42%),
    linear-gradient(155deg, #06255f 0%, #0a4da4 48%, #d6f8ff 100%);
}

body { min-height: 100dvh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.viewport {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
}

.stage-shell {
  position: relative;
  width: 941px;
  height: 1672px;
  filter: drop-shadow(0 26px 50px rgba(0, 38, 99, .28));
}

.stage {
  position: absolute;
  inset: 0;
  width: 941px;
  height: 1672px;
  overflow: hidden;
  isolation: isolate;
  transform: scale(var(--stage-scale));
  transform-origin: top left;
  background: #eaf9ff;
  color: var(--ink);
}

.venue-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.venue-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 1;
}

.particle-field {
  position: absolute;
  inset: 0;
}

.particle-field { z-index: 3; pointer-events: none; }
.default-character {
  position: absolute;
  z-index: 4;
  left: 292px;
  top: 432px;
  width: 399px;
  height: 554px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 72%, rgba(0, 0, 0, .55) 86%, rgba(0, 0, 0, .18) 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, rgba(0, 0, 0, .55) 86%, rgba(0, 0, 0, .18) 94%, transparent 100%);
  animation: character-float 4.8s ease-in-out infinite;
}
.default-character.is-hidden { visibility: hidden; }
.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 14px 4px rgba(43, 201, 255, .78);
  opacity: .3;
  animation: particle-float var(--duration, 8s) ease-in-out var(--delay, 0s) infinite alternate;
}

.hero-copy {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  height: 420px;
  text-align: center;
  pointer-events: none;
}

.eyebrow, .brand-line, .main-title, .subtitle, .english { margin: 0; }
.eyebrow,
.subtitle,
.default-character,
.custom-photo-wrap,
.event-lines .slogan,
.capability-ticker,
.particle-field,
.title-orbit,
.sparkle,
.holo-core,
.holo-ring {
  display: none !important;
}
.eyebrow {
  position: absolute;
  top: 39px;
  left: 50%;
  transform: translateX(-50%);
  color: #083a96;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .24em;
  white-space: nowrap;
}
.eyebrow::before, .eyebrow::after { content: ""; display: inline-block; width: 42px; height: 2px; margin: 0 22px 8px; background: #0c4cb7; }
.brand-line {
  position: absolute;
  top: 34px;
  right: 42px;
  color: #063c9a;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: .33em;
  text-align: left;
}
.brand-line::after { content: ""; display: block; width: 22px; height: 2px; margin: 10px 0 0 auto; background: currentColor; }

.title-wrap {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 600px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}
.title-banner {
  display: block;
  width: 100%;
  height: auto;
}
.title-orbit { position: absolute; inset: -10px 25px auto; width: 830px; height: 205px; overflow: visible; }
.title-orbit ellipse { fill: none; }
.orbit-track { stroke: rgba(29, 113, 231, .12); stroke-width: 1.25; }
.orbit-flow {
  stroke: url(#orbit-gradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 15 85;
  filter: drop-shadow(0 0 5px rgba(31, 180, 255, .28));
  animation: orbit-flow 10s linear infinite;
}
.main-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sparkle {
  position: absolute;
  z-index: 3;
  right: 26px;
  top: 57px;
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #0870ff, #04d0ce);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  filter: drop-shadow(0 0 12px rgba(24, 183, 255, .5));
  animation: sparkle-pulse 2.6s ease-in-out infinite;
}
.subtitle {
  position: absolute;
  top: 275px;
  left: 0;
  width: 100%;
  color: #092f78;
  font-size: 39px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: .08em;
}
.english {
  position: absolute;
  top: 340px;
  left: 50%;
  transform: translateX(-50%);
  color: #143f99;
  font-size: 22px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.english::before, .english::after { content: ""; display: inline-block; width: 42px; height: 2px; margin: 0 18px 7px; background: currentColor; opacity: .75; }

.portal {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 512px;
  width: 850px;
  height: 565px;
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
}
.custom-photo-wrap {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 100px;
  width: 335px;
  height: 430px;
  transform: translateX(-50%);
  border-radius: 160px 160px 40px 40px;
  overflow: hidden;
  opacity: 0;
  mask-image: linear-gradient(to bottom, black 76%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 76%, transparent 100%);
  animation: person-float 4.8s ease-in-out infinite;
}
.custom-photo-wrap.is-active { opacity: 1; }
.custom-photo { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.custom-photo-wrap.is-guest .custom-photo { object-position: center top; }
.holo-core {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 56px;
  width: 360px;
  height: 74px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,255,255,.72), rgba(78,235,255,.2) 34%, rgba(0,112,255,.07) 58%, transparent 72%);
  filter: blur(3px);
  animation: core-pulse 3.2s ease-in-out infinite;
}
.holo-ring {
  position: absolute;
  z-index: 4;
  left: 50%;
  transform: translateX(-50%);
  overflow: visible;
}
.holo-ring ellipse { fill: none; }
.ring-one { bottom: 19px; width: 720px; height: 150px; }
.ring-track { stroke: rgba(116, 222, 255, .2); stroke-width: 1.35; }
.ring-flow {
  stroke: url(#ring-gradient);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 11 89;
  filter: drop-shadow(0 0 5px rgba(50, 198, 255, .38));
  animation: ring-flow 8s linear infinite;
}

.actions {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 1380px;
  width: 650px;
  transform: translateX(-50%);
  display: grid;
  gap: 24px;
}
.primary-action, .secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  color: white;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: .02em;
  transition: transform .2s ease, filter .2s ease;
}
.primary-action {
  position: relative;
  min-height: 112px;
  padding: 0 105px 0 76px;
  border-radius: 58px;
  overflow: hidden;
  background: linear-gradient(100deg, #0065f7 0%, #003ddd 47%, #00d2a4 100%);
  box-shadow: 0 18px 36px rgba(0, 83, 214, .28), inset 0 2px 2px rgba(255,255,255,.55);
  font-size: 37px;
}
.primary-action::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 22%, rgba(255,255,255,.34), transparent 72%);
  animation: button-sheen 4.8s ease-in-out infinite;
}
.arrow-disc {
  position: absolute;
  right: 42px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #0a48bf;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 16px rgba(0,41,138,.2);
}
.secondary-action {
  justify-self: center;
  min-width: 490px;
  min-height: 71px;
  gap: 24px;
  padding: 0 42px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 38px;
  color: #0a3fab;
  background: rgba(255,255,255,.84);
  box-shadow: 0 12px 28px rgba(0, 78, 166, .18), inset 0 0 18px rgba(255,255,255,.7);
  backdrop-filter: blur(18px) saturate(150%);
  font-size: 26px;
}
.primary-action:active, .secondary-action:active { transform: scale(.975); filter: brightness(.98); }

.info-zone {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 58px;
  text-align: center;
}
.event-lines { color: #8fa9c4; }
.event-lines p { margin: 0; }
.event-lines > p:not(.slogan) { font-size: 22px; line-height: 1.6; font-weight: 600; letter-spacing: .12em; text-shadow: 0 1px 2px rgba(255, 255, 255, .55); }
.event-lines > p:not(.slogan)::before, .event-lines > p:not(.slogan)::after { content: ""; display: inline-block; width: 54px; height: 1px; margin: 0 20px 6px; background: currentColor; opacity: .38; }
.event-lines .slogan { margin-top: 7px; color: #86a1bf; font-size: 16px; font-weight: 600; letter-spacing: .08em; }

.capability-ticker {
  width: 884px;
  margin: 24px auto 0;
  display: grid;
  gap: 14px;
}
.ticker-row { overflow: visible; }
.ticker-track {
  display: flex;
  justify-content: center;
  width: 100%;
}
.ticker-group {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.capability-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 200px;
  height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: #2f71a9;
  background:
    linear-gradient(135deg, rgba(255,255,255,.82), rgba(230,248,255,.68)) padding-box,
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(103,181,219,.48)) border-box;
  box-shadow:
    0 8px 20px rgba(42, 121, 166, .09),
    inset 0 1px rgba(255,255,255,.96);
  backdrop-filter: blur(16px) saturate(135%);
  font-size: 16px;
  font-weight: 680;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: transform 100ms ease-out, background .18s ease, border-color .18s ease;
}
.ticker-row-reverse .capability-chip { flex-basis: 230px; }
.capability-chip:active, .capability-chip.is-lit {
  transform: scale(.96);
  color: #155f9f;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(211,242,255,.82)) padding-box,
    linear-gradient(135deg, rgba(255,255,255,1), rgba(61,157,207,.68)) border-box;
}

.editor-toggle {
  position: fixed;
  z-index: 30;
  top: max(18px, calc(env(safe-area-inset-top) + 10px));
  right: max(18px, calc(env(safe-area-inset-right) + 10px));
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 24px;
  color: #083c97;
  background: rgba(255,255,255,.74);
  box-shadow: 0 12px 30px rgba(0,47,114,.17);
  backdrop-filter: blur(18px) saturate(180%);
  font-weight: 750;
  cursor: pointer;
}
.editor-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.editor-panel {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(680px, calc(100vw - 24px));
  max-height: min(570px, calc(100dvh - 32px));
  overflow: auto;
  padding: 10px 20px 18px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 28px;
  color: #10244c;
  background: rgba(244,250,255,.82);
  box-shadow: 0 30px 80px rgba(0, 35, 97, .32), inset 0 1px rgba(255,255,255,.78);
  backdrop-filter: blur(28px) saturate(170%);
  transform: translate(-50%, calc(100% + 40px)) scale(.97);
  transform-origin: 50% 100%;
  opacity: 0;
  visibility: hidden;
  transition: transform .38s cubic-bezier(.2,.85,.25,1), opacity .25s ease, visibility .38s;
}
.editor-panel.is-open { transform: translate(-50%, 0) scale(1); opacity: 1; visibility: visible; }
.panel-grabber { width: 46px; height: 5px; margin: 2px auto 12px; border-radius: 4px; background: rgba(23,54,100,.22); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-header strong { display: block; font-size: 20px; }
.panel-header small { display: block; margin-top: 4px; color: #61708a; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(18,55,113,.08); color: #183b74; font-size: 25px; cursor: pointer; }
.template-switch { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 18px 0 14px; padding: 5px; border-radius: 14px; background: rgba(32,78,140,.07); }
.template-switch button, .upload-label { display: grid; place-items: center; min-height: 42px; margin: 0; border: 0; border-radius: 10px; color: #24466f; background: transparent; font-weight: 700; cursor: pointer; }
.template-switch button.is-active, .upload-label { color: #064dc2; background: rgba(255,255,255,.9); box-shadow: 0 4px 12px rgba(0,57,133,.08); }
.component-controls { display: grid; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.55); }
.component-controls label { display: grid; gap: 6px; color: #52647d; font-size: 12px; font-weight: 700; }
.component-controls input[type="text"], .component-controls select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid rgba(14,70,151,.14); border-radius: 10px; outline: none; color: #102e61; background: rgba(255,255,255,.88); }
.control-row { display: grid; grid-template-columns: 1fr 70px 82px 92px; gap: 10px; align-items: end; }
.control-row input[type="range"] { accent-color: #075bec; }
.control-row input[type="color"] { width: 100%; height: 42px; padding: 3px; border: 1px solid rgba(14,70,151,.14); border-radius: 10px; background: white; }
.control-row button { height: 42px; border: 0; border-radius: 10px; color: #28476d; background: rgba(15,66,139,.08); cursor: pointer; }
.panel-actions { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.panel-actions button { min-height: 44px; border: 1px solid rgba(9,65,141,.12); border-radius: 12px; color: #25446d; background: rgba(255,255,255,.78); font-weight: 750; cursor: pointer; }
.panel-actions .accent { border-color: transparent; color: white; background: linear-gradient(100deg, #0964ed, #05b9c7); }
.editor-tip { margin: 12px 0 0; color: #718097; font-size: 12px; text-align: center; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 24px;
  color: white;
  background: rgba(4, 28, 73, .88);
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
  backdrop-filter: blur(16px);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.share-sheet, .poster-preview {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.share-sheet[hidden], .poster-preview[hidden] { display: none !important; }
.share-sheet-mask, .poster-preview-mask {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 18, 48, .68);
}
.share-sheet-body, .poster-preview-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
}
.share-poster-preview, .poster-preview-panel {
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  text-align: center;
}
.share-poster-preview img, .poster-preview-panel img {
  display: block;
  max-width: min(78vw, 360px);
  max-height: min(62dvh, 640px);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.share-sheet-panel {
  margin-top: auto;
  padding: 18px 16px 8px;
  border-radius: 28px 28px 18px 18px;
  color: #12315f;
  background: rgba(255, 255, 255, .96);
}
.share-sheet-title { margin: 0 0 14px; font-size: 16px; font-weight: 750; text-align: center; }
.share-poster-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.share-poster-btn, .share-cancel, #poster-preview-close {
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  font-weight: 750;
  cursor: pointer;
}
.share-poster-btn.wechat { color: white; background: #07c160; }
.share-poster-btn.moments { color: white; background: #1677ff; }
.share-poster-btn:active, .share-cancel:active, #poster-preview-close:active { transform: scale(.98); }
.share-cancel, #poster-preview-close {
  width: 100%;
  margin-top: 10px;
  color: #33527a;
  background: #eef5fb;
}
.poster-preview { z-index: 90; }
.poster-preview-panel { pointer-events: none; }
.poster-preview-panel img, #poster-preview-tip, #poster-preview-close { pointer-events: auto; }
#poster-preview-close { width: min(240px, 70vw); }

.is-editing .editable-component { pointer-events: auto; cursor: grab; outline: 2px dashed rgba(1,100,235,.44); outline-offset: 5px; }
.is-editing .editable-component:hover, .is-editing .editable-component.is-selected { outline-style: solid; outline-color: #0267ef; filter: drop-shadow(0 0 8px rgba(0,132,255,.28)); }
.is-editing [contenteditable="true"] { cursor: text; user-select: text; }
.editable-component.is-hidden { display: none !important; }

:focus-visible { outline: 3px solid #ffb000 !important; outline-offset: 4px; }

@keyframes particle-float { from { transform: translate3d(0, 18px, 0) scale(.7); opacity: .12; } to { transform: translate3d(var(--drift, 14px), -28px, 0) scale(1.2); opacity: .7; } }
@keyframes orbit-flow { to { stroke-dashoffset: -100; } }
@keyframes sparkle-pulse { 0%,100% { transform: scale(.82) rotate(0deg); opacity: .7; } 50% { transform: scale(1.1) rotate(11deg); opacity: 1; } }
@keyframes character-float { 50% { transform: translateY(-6px); } }
@keyframes person-float { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
@keyframes core-pulse { 0%,100% { transform: translateX(-50%) scale(.92); opacity: .65; } 50% { transform: translateX(-50%) scale(1.06); opacity: 1; } }
@keyframes ring-flow { to { stroke-dashoffset: -100; } }
@keyframes button-sheen { 0%,35% { transform: translateX(-120%); } 65%,100% { transform: translateX(120%); } }

@media (max-width: 720px) {
  .editor-toggle span { display: none; }
  .editor-toggle { width: 44px; justify-content: center; padding: 0; }
  .editor-panel { padding-inline: 14px; }
  .control-row { grid-template-columns: 1fr 58px 70px; }
  .control-row > button { grid-column: 1 / -1; }
  .panel-actions { grid-template-columns: 1fr 1fr; }
  .panel-actions #reset-button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .editor-toggle, .editor-panel, .secondary-action, .capability-chip { background: #f5fbff; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  .editor-toggle, .editor-panel, .secondary-action, .capability-chip { border: 2px solid #002b76; background: #fff; }
}
