/* 纸感改造版：来自 Magic UI 的 ShineBorder / Meteors / Dock / ScrollProgress
   配色改成砖红-琥珀，圆角与描边对齐站点设计令牌。 */

/* ---------- 顶部滚动进度 ---------- */
.scrollbar-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #c8161e, #f35737 45%, #ffd65a);
  box-shadow: 0 1px 0 rgba(43, 33, 27, .12);
  pointer-events: none;
  will-change: transform;
}

/* ---------- 边框流光（ShineBorder） ----------
   Magic UI 的 mask-composite: exclude 技巧：两层 mask 相减，只留下边框那一圈，
   然后让径向渐变在这圈里缓慢移动。 */
.has-shine { position: relative; }
.has-shine::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background-image: radial-gradient(transparent, transparent, #ffd65a, #f35737, transparent, transparent);
  background-size: 300% 300%;
  background-position: 0% 0%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  animation: shine-slide var(--shine-duration, 14s) linear infinite;
  animation-play-state: paused;
}
.has-shine:hover::after,
.has-shine:focus-visible::after { opacity: .9; animation-play-state: running; }

@keyframes shine-slide {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

/* ---------- 流星（Meteors） ---------- */
.hero > .meteors {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.meteor {
  position: absolute;
  top: -8%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 246, 220, .9);
  box-shadow: 0 0 6px 1px rgba(255, 246, 220, .55);
  transform: rotate(35deg);
  animation-name: meteor-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.meteor::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 84px;
  height: 1.5px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(255, 246, 220, .75), transparent);
}
.meteor--gold { background: #ffd65a; box-shadow: 0 0 8px 2px rgba(255, 214, 90, .5); }
.meteor--gold::before { background: linear-gradient(90deg, rgba(255, 214, 90, .8), transparent); }

@keyframes meteor-fall {
  0% { transform: rotate(35deg) translate3d(0, -10vh, 0); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: rotate(35deg) translate3d(60vw, 120vh, 0); opacity: 0; }
}

/* ---------- 底部 Dock ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border: 2.5px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 251, 245, .88);
  backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 6px 8px 0 rgba(43, 33, 27, .12), 0 16px 40px rgba(43, 33, 27, .14);
}
.dock__item {
  --dock-scale: 1;
  --dock-lift: 0px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--paper-4);
  transform: translateY(var(--dock-lift)) scale(var(--dock-scale));
  transform-origin: 50% 100%;
  transition: transform .08s linear, background .15s;
  cursor: pointer;
}
.dock__item:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.dock__item svg { width: 22px; height: 22px; }
.dock__label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
  padding: 3px 7px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s;
}
.dock__item:hover .dock__label { opacity: 1; }

@media (min-width: 761px) {
  /* 桌面端顶栏已经够用，Dock 只在窄屏出现 */
  .dock { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 84px; }
}

@media (max-width: 620px) {
  .dock { gap: 6px; padding: 7px 8px; }
  .dock__item { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .has-shine::after { animation: none; opacity: 0 !important; }
  .meteor { animation: none; opacity: 0 !important; }
  .scrollbar-progress { transition: none; }
}
