@import url("https://fonts.googleapis.com/css?family=Roboto");

/* 缩放后动画关键帧 come-in */
@-webkit-keyframes come-in {
  0% {
    transform: translateY(70px);
    opacity: 1;
  }
  30% {
    transform: translateX(-35px) scale(0.4);
  }
  70% {
    transform: translateX(0px) scale(1.2);
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 1;
  }
}
@keyframes come-in {
  0% {
    transform: translateY(70px);
    opacity: 1;
  }
  30% {
    transform: translateX(-35px) scale(0.4);
  }
  70% {
    transform: translateX(0px) scale(1.2);
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 1;
  }
}

/* 未使用动画保留，不删除避免报错 */
@keyframes come-float1 {
  0% {
    transform: translateY(70px);
    opacity: 1;
  }
  30% {
    transform: translateX(-35px) scale(0.4);
    opacity: 0.8;
  }
  70% {
    transform: translateX(0px) scale(1.2);
    opacity: 0.2;
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0;
  }
}

/* 全局初始化 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  background: #111;
  font-family: "Roboto", sans-serif;
}

/* 子按钮容器 原500 → 350 */
.element-container {
  position: relative;
  width: 350px;
  height: 350px;
  margin-left: 56px;
}

/* 外层悬浮容器 修复position冲突，尺寸缩小30% */
.floating-container {
  position: fixed !important;
  width: 350px;
  height: 350px;
  bottom: 30%;
  right: 5%;
  margin: 24.5px 17.5px;
  cursor: move;
  transition: transform 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  z-index: 999999999999999999;
}

.floating-container:hover {
  height: 350px;
  width: 350px;
}

/* 拖拽按下效果 */
.floating-container:active {
  cursor: grabbing;
  transform: scale(1.02);
}

/* 主按钮上浮动画 */
.floating-container:hover .floating-button {
  transform: translateY(5px);
  transition: all 0.3s;
}

/* 5个子按钮依次弹出延迟动画 */
.floating-container:hover .element-container .float-element:nth-child(1) {
  -webkit-animation: come-in 0.4s forwards 0.2s;
  animation: come-in 0.4s forwards 0.2s;
}
.floating-container:hover .element-container .float-element:nth-child(2) {
  -webkit-animation: come-in 0.4s forwards 0.4s;
  animation: come-in 0.4s forwards 0.4s;
}
.floating-container:hover .element-container .float-element:nth-child(3) {
  -webkit-animation: come-in 0.4s forwards 0.6s;
  animation: come-in 0.4s forwards 0.6s;
}
.floating-container:hover .element-container .float-element:nth-child(4) {
  -webkit-animation: come-in 0.4s forwards 0.8s;
  animation: come-in 0.4s forwards 0.8s;
}
.floating-container:hover .element-container .float-element:nth-child(5) {
  -webkit-animation: come-in 0.4s forwards 1s;
  animation: come-in 0.4s forwards 1s;
}

/* 主悬浮按钮 原200 → 140 */
.floating-container .floating-button {
  width: 140px;
  height: 140px;
  line-height: 45.5px;
  text-align: center;
  font-size: 16.1px;
  cursor: pointer;
  transition: all 0.3s;
  float: right;
  margin-top: 105px;
  position: relative;
  z-index: 9999999999999;
}
.floating-container .floating-button img {
  width: 140px;
  height: 140px;
}

/* 子按钮基础样式 原50 → 35 */
.floating-container .float-element {
  position: relative;
  display: block;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  color: white;
  font-weight: 500;
  text-align: center;
  line-height: 35px;
  z-index: 0;
  opacity: 0;
  transform: translateY(70px);
  will-change: transform, opacity;
}

/* 子按钮环形定位坐标全部缩小70% */
.floating-container .float-element:nth-child(1) {
  position: absolute;
  left: 182px;
  top: 70px;
  cursor: pointer;
}
.floating-container .float-element:nth-child(2) {
  position: absolute;
  left: 119px;
  top: 101.5px;
  cursor: pointer;
}
.floating-container .float-element:nth-child(3) {
  position: absolute;
  left: 98px;
  top: 161px;
  cursor: pointer;
}
.floating-container .float-element:nth-child(4) {
  position: absolute;
  left: 126px;
  top: 224px;
  cursor: pointer;
}
.floating-container .float-element:nth-child(5) {
  position: absolute;
  left: 182px;
  top: 252px;
  cursor: pointer;
}

/* 统一子按钮背景与字号，合并冗余代码 */
.floating-container .float-element:nth-child(1),
.floating-container .float-element:nth-child(2),
.floating-container .float-element:nth-child(3),
.floating-container .float-element:nth-child(4),
.floating-container .float-element:nth-child(5) {
  background: #87c2f1;
  font-size: 7px;
}

/* 图标字体缩放 */
.floating-container .float-element .material-icons {
  vertical-align: middle;
  font-size: 11.2px;
}

.float-element img {
  width: 35px;
  height: 35px;
}

/* 备用悬浮类（保留兼容旧页面） */
.float1 {
  -webkit-animation: come-in 0.4s forwards 0.2s;
  animation: come-in 0.4s forwards 0.2s;
}
.float2 {
  -webkit-animation: come-in 0.4s forwards 0.4s;
  animation: come-in 0.4s forwards 0.4s;
}
.float3 {
  -webkit-animation: come-in 0.4s forwards 0.6s;
  animation: come-in 0.4s forwards 0.6s;
}
.float4 {
  -webkit-animation: come-in 0.4s forwards 0.8s;
  animation: come-in 0.4s forwards 0.8s;
}
.float5 {
  -webkit-animation: come-in 0.4s forwards 1s;
  animation: come-in 0.4s forwards 1s;
}

/* 按钮文字标签缩小 */
.title {
  margin-top: -21px;
  color: #333;
  font-weight: bold;
  font-size: 8.4px;
  text-shadow:
    -0.35px -0.35px 0 #fff,
    0.35px -0.35px 0 #fff,
    -0.35px 0.35px 0 #fff,
    0.35px 0.35px 0 #fff;
}

/* 移动端平板隐藏 */
@media only screen and (max-width: 1024px) {
  .floating-container {
    display: none;
  }
}