/* ------------------------------------------------------------------
   云端回声 Cloud Echo — 体验页样式（零依赖）
   与主站令牌一致：paper #f3f0e7 / ink #16150f / cobalt #2b3bff / coral #ff5a36
   待机页是半透明的：极光演示直接透出来，不再是纯色黑屏。
------------------------------------------------------------------ */

:root {
  --paper: #f3f0e7;
  --ink: #16150f;
  --cobalt: #2b3bff;
  --coral: #ff5a36;
  --gate-bg: #0b0e18;
  --mono: "Space Grotesk", "SFMono-Regular", ui-monospace, "Noto Sans SC", monospace;
  --sans: "Space Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --script: "Instrument Serif", "Noto Serif SC", Georgia, serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--gate-bg);
}

body {
  font-family: var(--sans);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
}

::selection {
  background: var(--cobalt);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- 画布 ---------------- */

#ce-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* ---------------- 待机态（半透明纱，露出演示） ---------------- */

.ce-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(130% 100% at 50% 22%, rgba(13, 16, 30, 0.24) 0%, rgba(10, 12, 22, 0.46) 55%, rgba(7, 9, 17, 0.66) 100%);
  transition: opacity 0.9s ease;
}

.ce-gate.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.ce-gate-inner {
  max-width: 560px;
  animation: ce-rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ce-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(46px, 9vw, 88px);
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--paper);
  text-shadow: 0 2px 26px rgba(7, 9, 17, 0.6);
}

.ce-en {
  display: block;
  margin-top: 8px;
  font-family: var(--script);
  font-style: italic;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.02em;
  color: var(--coral);
  text-shadow: 0 1px 14px rgba(7, 9, 17, 0.55);
}

.ce-sub {
  margin: 22px auto 0;
  max-width: 30em;
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.05em;
  color: rgba(243, 240, 231, 0.72);
  text-shadow: 0 1px 10px rgba(7, 9, 17, 0.6);
  text-wrap: balance;
}

/* 演示字幕：随待机演示每 6 秒轮换 */
.ce-demo-line {
  margin: 18px 0 0;
  min-height: 1.7em;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: rgba(243, 240, 231, 0.85);
  text-shadow: 0 1px 10px rgba(7, 9, 17, 0.75);
  transition: opacity 0.55s ease;
}

.ce-demo-line.is-swapping {
  opacity: 0;
}

.ce-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.ce-btn {
  height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    transform 0.35s ease,
    opacity 0.35s ease;
}

.ce-btn:active {
  transform: scale(0.97);
}

.ce-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ce-btn-primary {
  border: none;
  background: var(--paper);
  color: var(--ink);
}

.ce-btn-primary:hover {
  background: var(--coral);
  color: var(--paper);
}

.ce-btn-ghost {
  border: 1px solid rgba(243, 240, 231, 0.5);
  background: rgba(7, 9, 17, 0.35);
  color: rgba(243, 240, 231, 0.96);
}

.ce-btn-ghost:hover {
  border-color: rgba(243, 240, 231, 0.9);
  background: rgba(7, 9, 17, 0.55);
  color: var(--paper);
}

.ce-privacy {
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(243, 240, 231, 0.4);
}

.ce-noscript {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--coral);
}

/* ---------------- HUD ---------------- */

.ce-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: var(--mono);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.ce-hud.on {
  opacity: 1;
}

.ce-hud.on.idle {
  opacity: 0.35;
}

.ce-back {
  position: absolute;
  top: 18px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(243, 240, 231, 0.82);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-decoration: none;
  pointer-events: auto;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.ce-back:hover {
  background: rgba(12, 14, 24, 0.65);
  color: var(--paper);
}

/* 待机门是 z-index 30 的全屏层，HUD 在 20，门上也留一条回作品集的路 */
.ce-back-gate {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
}

.ce-status {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ce-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(243, 240, 231, 0.92);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.ce-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  animation: ce-pulse 2.4s ease-in-out infinite;
}

.ce-dwell {
  position: absolute;
  right: 20px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(243, 240, 231, 0.85);
  font-size: 10.5px;
  letter-spacing: 0.1em;
}

/* 回声统计：一行极小的诚实账本 */
.ce-stats {
  position: absolute;
  left: 20px;
  bottom: 46px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(243, 240, 231, 0.78);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.ce-credit {
  position: absolute;
  left: 20px;
  bottom: 20px;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(243, 240, 231, 0.48);
  text-shadow: 0 1px 8px rgba(7, 9, 17, 0.5);
}

.ce-hint {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  max-width: 88vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(12, 14, 24, 0.44);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(243, 240, 231, 0.88);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.ce-hint.is-on {
  opacity: 1;
}

.ce-hint.is-off {
  opacity: 0;
}

/* ---------------- 动画 ---------------- */

@keyframes ce-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ce-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.35);
  }
}

/* ---------------- 动效减弱 ---------------- */

@media (prefers-reduced-motion: reduce) {
  .ce-gate,
  .ce-hud,
  .ce-btn,
  .ce-back,
  .ce-hint,
  .ce-demo-line {
    transition-duration: 0.01ms;
  }
  .ce-gate-inner {
    animation: none;
  }
  .ce-dot {
    animation: none;
    opacity: 0.8;
  }
}
