:root {
  /* --- 圖片隨機飄落參數 --- */
  --number: 30;
  --size: 20;
  --size-min: 12;
  --time: 6;
}

@media screen and (min-width: 960px) {
  :root {
    /* --- 圖片隨機飄落參數 --- */
    --number: 35;
    --size: 36;
    --size-min: 18;
    --time: 8;
  }
}

body {
  position: relative;
}

.home--icon {
  z-index: 1;
}

body:before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

body.bg-fixed:before {
  position: fixed;
  height: 100vh;
}

/* 有右電梯時，將小網背景下推電梯高度 */

.js-body-move-y:before{
  background-position-y: 39px;
}

@media screen and (min-width: 960px) {
  .js-body-move-y:before{
    background-position-y: 0px
  }
}

.go-top {
  display: none;
  position: fixed;
  z-index: 999;
  right: 10px;
  bottom: 90px;
  width: 48px;
  height: 48px;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border-width: 1px;
  border-style: solid;
  border-top-color: rgba(255, 255, 255, 0);
  border-right-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: rgba(255, 255, 255, 0.2);
  border-left-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: all 0.3s linear;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.go-top.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media screen and (min-width: 1213px) {
  .go-top.is-visible:hover {
    background-color: rgba(0, 0, 0, 1);
    border-top-color: rgba(255, 255, 255, 1);
    border-right-color: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(255, 255, 255, 0.8);
    border-left-color: rgba(255, 255, 255, 0.9);
  }
}

.go-top:focus,
.go-top i:focus {
  outline: 0;
}

/* style.css */
/* reset */
/* ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
*:before,
*:after {
  box-sizing: border-box;
}
a {
  display: block;
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  display: block;
  width: 100%;
  border: 0;
  vertical-align: middle;
}
article,
main,
nav,
section {
  display: block;
}
body {
  margin: 0;
  background-color: #f4d7d3;
  font-family: PingFangTC-regular, Roboto, "LiHei Pro", "Source Han Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft JhengHei", sans-serif;
}
.clearfix::after {
  content: '';
  display: block;
  clear: both;
}
.layout--main {
  position: relative;
  z-index: 0;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
/* 主視覺 */
/* ======================================== */
.logo a,
.sp__visual a {
  display: block;
}
.home--logo {
  z-index: 17;
}

.sp__wrap{
  position: relative;
  z-index: 0;
  overflow: hidden;
}

.logo {
  position: absolute;
  z-index: 17;
  top: 1vw;
  left: 1vw;
  width: 30%;
}

.sp__visual {
  position: relative;
  z-index: 0;
  width: 100%;
}
.visual--auto {
  display: flex;
  flex-wrap: wrap;
}

.visual__fragment {
  float: left;
  position: relative;
  z-index: 0;
  max-width: 100%;
  vertical-align: middle;
}

@media screen and (min-width: 960px) {
  .visual__fragment {
    width: auto;
  }

  .sp__wrap .animate__animated img{
    width: auto;
  }
}

.animate__wrap {
  position: relative;
  z-index: 1;
  transform: translateZ(0);
}

/* 自適應banner組 */
/* ======================================== */
.banner__title {
  height: 65px;
  background: center top no-repeat;
}
.banner__wrap {
  display: flex;
  flex-wrap: wrap;
}
.banner__item {
  transition: all 0.3s;
  padding-top: 1%;
}
.banner__item img {
  width: 100%;
}

@media screen and (min-width: 767px){
  .banner__item {
    padding: .3%;
  }
}

/* 設定一列2個(50%，3個就33.33%，4個就25%) */

.bn-w2m1 .banner__item {
  float: left;
  width: 100%;
  /* padding-top: 1%; */
  /* margin-bottom: 1%; */
}

@media screen and (min-width: 767px) {
  .bn-w2m1 .banner__item {
    width: 50%;
  }
}

/* 設定點下去與hover動畫 */
.banner__item:hover,
.banner__item:active {
  /* 變小(<1時變小) */
  transform: scale(0.98);
  /* 亮度調暗(<100%時變暗) */
  /*filter: brightness(95%);*/
}

/* 設定一列4個 */
.bn-w4m2 .banner__item {
  float: left;
  width: 50%;
  flex: 1 1 50%;
}
/* 設定點下去與hover動畫 */
.bn-w4m2 .banner__item:hover,
.bn-w4m2 .banner__item:active {
  /* 變大(>1時變大) */
  transform: scale(1.05);
  /* 亮度調亮(>100%時變亮) */
  filter: brightness(115%);
}
@media screen and (min-width: 767px) {
  /* 設定手機時一列2個 */
  .bn-w4m2 .banner__item {
    width: 25%;
    flex: 1 1 25%;
  }
}
/* 設定一列3個 */
.bn-w3m1 .banner__item {
  width: 33.33%;
  flex: 1 1 33.33%;
}
/* 設定點下去與hover動畫 */
.bn-w3m1 .banner__item:hover,
.bn-w3m1 .banner__item:active {
  /* 變大(>1時變大) */
  transform: scale(1.05);
  /* 亮度調亮(>100%時變亮) */
  filter: brightness(115%);
}

@media screen and (min-width: 767px) {
  /* 設定小網時一列1個 */
  .bn-w3m1 .banner__item {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* BN寬度只佔一半 */
@media screen and (min-width: 767px) {
  .banner__item--half{
    width: 50%;
  }
}

.decor__item{
  pointer-events: none;
}

/* 雙輪播用 */
.banner__slider {
  position: relative;
  z-index: 0;
}
.swiper-slide .slide__block {
  display: flex;
}

/* --- 背景飄落 start --- */

.bg__container{
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.bg__container.active{
  opacity: 1;
}

.bg__container .falling__block{
  position: fixed;
  z-index: 0;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

.bg__container .bg--first,
.bg__container .bg--second,
.bg__container .bg--third{
  z-index: 0;
}

.bg__container.falling .bg--first {
  animation: falling-down linear infinite;
  /* animation-duration調整飄落下來的時間 */
  animation-duration: 52s
}

.bg__container.falling .bg--second {
  transform: translate3d(0, -100%, 0);
  animation: falling-down-2 linear infinite;
  animation-duration: 28s
}

.bg__container.falling .bg--third {
  transform: translate3d(0, -100%, 0);
  animation: falling-down-3 linear infinite;
  animation-duration: 20s
}

.bg__container.falling-center .bg--first {
  animation: falling-center linear infinite;
  animation-duration: 52s;
}

.bg__container.snow .bg--first {
  background-size: 500%;
  filter: blur(0.5px);
  animation: snow-1 10s linear infinite both;
}

@media screen and (min-width: 768px) {
  .bg__container.snow .bg--first {
    background-size: 300%;
  }
}

@media screen and (min-width: 960px) {
  .bg__container.snow .bg--first {
    background-size: 120%;
  }
}

.bg__container.snow .bg--second {
  background-size: 160%;
  filter: blur(1px);
  transform: none;
  animation: snow-2 12s 3.2s linear infinite both;
}

@media screen and (min-width: 960px) {
  .bg__container.snow .bg--second {
    background-size: 90%;
  }
}

.bg__container.snow .bg--third {
  filter: blur(2px);
  transform: none;
  animation: snow-3 14s 4s linear infinite both;
}

.bg__container.rain .bg--third {
  background-image: none
}


.bg__container.rain .bg--first,
.bg__container.rain .bg--second {
  transform: none;
  animation: rain 1s linear infinite;
}

.bg__container.rain .bg--first {
  background-size: 100%;
  opacity: 0.6;
}

@media screen and (min-width: 960px) {
  .bg__container.rain .bg--first {
    background-size: 20%;
    opacity: 0.6;
  }
}

.bg__container.rain .bg--second {
  background-size: auto;
  opacity: 0.9;
  animation-duration: .45s;
}

@keyframes falling-down {
  0% {
    background-position: 0 0;
    opacity: 0
  }

  10%,
  90% {
    opacity: 1
  }

  100% {
    background-position: 100% 150vh;
    opacity: 0
  }
}

@keyframes falling-down-2 {
  0% {
    transform: translate3d(0, -100%, 0)
  }

  to {
    /* translate3d(x, y, z)調整飄落下來的位置 */
    transform: translate3d(15%, 100%, 0)
  }
}

@keyframes falling-down-3 {
  0% {
    transform: translate3d(0, -100%, 0)
  }

  50% {
    transform: translate3d(-10%, 0, 0)
  }

  to {
    transform: translate3d(15%, 100%, 0)
  }
}

@keyframes falling-center {
  0% {
    background-position: 0% 0%;
    opacity: 0;
  }

  10%,
  90% {
    opacity: 1;
  }

  100% {
    background-position: 0 150vh;
    opacity: 0;
  }
}

@keyframes snow-1 {
  0% {
    transform: translate3d(0%, -50%, 0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(0%, 50%, 0);
    opacity: 0;
  }
}

@keyframes snow-2 {
  0% {
    transform: translate3d(0%, -50%, 0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(10%, 50%, 0);
    opacity: 0;
  }
}

@keyframes snow-3 {
  0% {
    transform: translate3d(0%, -50%, 0);
    opacity: 0;
  }
  10%,
  90% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-3%, 50%, 0);
    opacity: 0;
  }
}

@keyframes rain {
  0% {
    transform: translate3d(0%, -50%, 0);
  }

  100% {
    transform: translate3d(0%, 50%, 0);
  }
}
/* --- 背景飄落 end --- */

/* --- 隨機背景飄落 start --- */

.bg__container.falling-random{
  position: fixed;
}

.random__layer{
  position: relative;
  width: 100%;
  height: 100%;
  transform: rotateZ(0);
}

.falling-random-image {
  display: inline-block;
  position: absolute;
  z-index: 0;
  top: -10vh;
  width: 3px;
  height: 2em;
  background-repeat: no-repeat;
  user-select: none;
  transform-style: preserve-3d;
  transform: translateY(-100px) rotate(0deg) perspective(100px, 0px, 0px);
  animation-name: falling-random;
  animation-timing-function: ease-in;
}

.random__layer .falling-random-image {
  background-size: 100%;
}

.falling-random-image.is-rotateX {
  animation-name: random-rotateX;
}
.falling-random-image.is-rotateY {
  animation-name: random-rotateY;
}

.falling-random-image.is-rotateZ {
  animation-name: random-rotateZ;
}

@keyframes falling-random {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
  }
}

@keyframes random-rotateX {
  0% {
    transform: translateY(0) rotateX(0deg);
  }
  100% {
    transform: translateY(110vh) rotateX(360deg);
  }
}

@keyframes random-rotateY {
  0% {
    transform: translateY(0) rotateY(0deg);
  }
  100% {
    transform: translateY(110vh) rotateY(360deg);
  }
} 

@keyframes random-rotateZ {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) rotate(-360deg);
  }
}
/* --- 隨機背景飄落 end --- */
