/* ==========================================================================
   愿宝周边 · 基础层
   设计令牌 / 重置 / 字体 / 卡通描边字 / 跨屏容器
   ========================================================================== */

/* -------- 设计令牌 -------- */

:root {
  --c-base: #e8762d;
  --c-ink: #7a3d0c;
  --c-ink-soft: #8a6a50;
  --c-gold: #ffe96b;
  --c-card: rgba(255, 255, 255, 0.92);
  --c-line: rgba(255, 255, 255, 0.9);

  --font-cartoon: "ZCOOL QingKe HuangYou", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;

  --ease-soft: cubic-bezier(0.16, 0.84, 0.44, 1);
  --ease-pop: cubic-bezier(0.22, 1.38, 0.36, 1);

  --dur-enter: 1.05s;
  --dur-bg-fade: 1.4s;
  --dur-screen: 0.56s;
  --loop-float: 3.8s;
  --loop-bg: 26s;

  --radius-card: 20px;
  --radius-pill: 28px;
  --pad-screen: 20px;
}


/* -------- 重置 -------- */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--c-base);
  color: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p,
ul,
li {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}


/* -------- 卡通描边字 -------- */

.outline-title {
  font-family: var(--font-cartoon);
  font-weight: 400;
  color: var(--c-gold);
  letter-spacing: 0.02em;
  text-shadow:
    -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff, 3px 3px 0 #fff,
    -3px 0 0 #fff, 3px 0 0 #fff, 0 -3px 0 #fff, 0 3px 0 #fff;
}

.outline-label {
  font-family: var(--font-cartoon);
  color: #fff;
  text-shadow:
    -2px -2px 0 var(--c-ink), 2px -2px 0 var(--c-ink),
    -2px 2px 0 var(--c-ink), 2px 2px 0 var(--c-ink),
    -2px 0 0 var(--c-ink), 2px 0 0 var(--c-ink),
    0 -2px 0 var(--c-ink), 0 2px 0 var(--c-ink);
}


/* -------- 应用容器（背景贯穿所有屏，切换时保持不动） -------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--c-base);
  container-type: size;
  isolation: isolate;
}

.stage__bg {
  position: absolute;
  inset: -2%;
  background: var(--c-base) url("../assets/bg.webp") center / cover no-repeat;
  animation: bg-fade var(--dur-bg-fade) ease-out both,
    bg-breathe var(--loop-bg) ease-in-out infinite;
}

.stage__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease-out 0.4s;
}

.is-ready .stage__dust {
  opacity: 1;
}


/* -------- 屏幕 -------- */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-screen) var(--ease-soft),
    visibility 0s linear var(--dur-screen);
}

.screen.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity var(--dur-screen) var(--ease-soft), visibility 0s;
}


/* -------- 通用按钮 -------- */

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: var(--radius-pill);
  background: #fff;
  /* 不再是 --c-base：白底上压品牌橙实测只有 2.97:1，差 0.03 没过 3.0 的大字门槛。
     主操作按钮可读性优先，字色往下压一档到 3.96:1，视觉上仍是同一个橙。 */
  color: #cf5f1a;
  font-family: var(--font-cartoon);
  font-size: 24px;
  box-shadow: 0 6px 16px rgba(158, 71, 5, 0.4);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pill:active {
  background: #ffe9d2;
}

.pill:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}


/* -------- 关键帧 -------- */

@keyframes bg-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes bg-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}


/* -------- 桌面预览 -------- */

/* 三个条件同时成立才算桌面：够宽、够高、有鼠标。
   手机横屏宽度会超过 640px，但高度撑不满 620px，因此不会被误判。 */
@media (min-width: 640px) and (min-height: 620px) and (hover: hover) and (pointer: fine) {
  body {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    background: #2a160a;
  }

  .stage {
    position: relative;
    inset: auto;
    height: min(844px, 88dvh);
    aspect-ratio: 390 / 844;
    border-radius: 26px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
}


/* -------- 降低动态 -------- */

@media (prefers-reduced-motion: reduce) {
  .stage__bg {
    animation: none;
  }

  .screen {
    transition: none;
  }
}
