*,
::after,
::before {
  box-sizing: border-box;
}
body,
ul,
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 0;
  margin: 0;
}
body {
  font-family: Space Grotesk;
  font-size: 14px;
  color: #333;
}
img {
  vertical-align: bottom;
}
ul {
  list-style-type: none;
}
a {
  color: #333;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
header {
  background-color: aqua;
  height: 6.4rem;
  background-image: url("../images/bg-main-mobile.png");
  position: relative;
}
header img {
  width: 7.6rem;
}
header #card-back {
  position: absolute;
  top: 0.85333333rem;
  right: 0.42666667rem;
}
header #card-front {
  position: absolute;
  top: 3.36rem;
  left: 0.42666667rem;
}
header #card-front-details {
  height: 3.2rem;
  position: absolute;
  top: 3.84rem;
  left: 0.53333333rem;
}
header span {
  font-size: 0.24rem;
  color: white;
  position: absolute;
  top: 2.72rem;
  right: 1.49333333rem;
  z-index: 1;
  letter-spacing: 0.05333333rem;
}
form {
  width: 8.72rem;
  margin: 2.4rem auto 0.8rem;
  /* background-color: rgb(149, 248, 246);*/
  /*鼠标按下那一刻触发（不一定松开）*/
}
form label {
  display: block;
  text-transform: uppercase;
  font-size: 0.32rem;
  letter-spacing: 0.05333333rem;
  font-weight: 500;
  margin-top: 0.64rem;
}
form input::placeholder {
  opacity: 50%;
  color: #21092f;
}
form input {
  margin-top: 0.21333333rem;
  display: block;
  height: 1.2rem;
  width: 100%;
  border-style: solid;
  border-radius: 0.21333333rem;
  box-shadow: none;
  border-color: #dfdee0;
  border-width: 0.02666667rem;
  font-size: 0.48rem;
  padding-left: 0.42666667rem;
  font-weight: 500;
  color: #21092f;
}
form input:hover {
  cursor: pointer;
}
form input:focus {
  outline: none;
  /* 去掉点击时的轮廓（可选） */
  border: 1px solid transparent;
  /* 边框必须设置为 transparent */
  border-image: linear-gradient(to bottom right, #6348fe, #610595);
  border-image-slice: 1;
  border-radius: 0.21333333rem;
  cursor: pointer;
}
form input.inputerror {
  border-color: #ff5050;
}
form .exp-cvc {
  display: flex;
  justify-content: space-between;
  /* space-between两端对齐：第一个元素靠左边，最后一个元素靠右边。*/
  /*justify-content: space-around 所有元素左右都留有相等的空间。*/
  align-items: top;
}
form .exp-cvc .exp-inputs {
  display: inline-block;
}
form .exp-cvc .exp-inputs #exp-month {
  display: inline-block;
  width: 2.13333333rem;
}
form .exp-cvc .exp-inputs #exp-year {
  display: inline-block;
  width: 2.13333333rem;
}
form .exp-cvc .cvc {
  width: 3.6rem;
}
form .exp-cvc .cvc #cvc {
  display: inline-block;
  width: 3.6rem;
}
form span {
  display: block;
  margin-top: 0.21333333rem;
  color: #ff5050;
  font-size: 0.32rem;
}
form #exp-monthError {
  display: inline-block;
}
form button {
  margin-top: 0.53333333rem;
  color: white;
  line-height: 1.3;
  font-size: 0.48rem;
  background-color: #21092f;
  height: 1.41333333rem;
  width: 100%;
  border-radius: 0.21333333rem;
}
form .confirm-btn:active {
  background: #000000;
  transform: scale(1.05);
  box-shadow: 0 5px 5px rgba(31, 20, 91, 0.15);
}
#success {
  display: none;
  flex-direction: column;
  align-items: center;
}
#success img {
  margin-top: 2.4rem;
  width: 2.13333333rem;
}
#success #thank {
  margin-top: 0.85333333rem;
  font-size: 0.74666667rem;
  letter-spacing: 0.09333333rem;
}
#success #added {
  margin-top: 0.42666667rem;
  font-size: 0.48rem;
  color: #adb5be;
}
#success button {
  margin-top: 1.28rem;
  color: white;
  line-height: 1.3;
  font-size: 0.48rem;
  background-color: #21092f;
  height: 1.41333333rem;
  width: 8.72rem;
  border-radius: 0.21333333rem;
}
footer {
  display: none;
  font-size: 0.37333333rem;
  margin: 0 auto 0.53333333rem;
  text-align: center;
}
footer a {
  text-decoration: underline;
  color: #610595;
}
/*box-shadow: 0 4px 10px rgba(255, 0, 0, 0.5);*/
/*cursor: pointer;*/
/*大屏增强-平板*/
/*如果你们的设计稿只有“移动 + 桌面”两种 → 平板通常继承移动端逻辑（流动）。
如果设计稿有专门的“平板版” → 那么它通常就是介于移动和桌面之间的“固定字号 + 响应布局”。*/
@media (min-width: 768px) and (max-width: 1439px) {
  html {
    font-size: 37.5px !important;
    /* 或者 16px 等你希望的固定值*/
  }
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  header {
    width: 100%;
    height: 9.06666667rem;
    background-size: cover;
    /* 拉满整个元素，可能会裁剪 */
    background-repeat: no-repeat;
  }
  header div {
    max-width: 543px;
  }
  header img {
    width: 11.92rem;
  }
  header #card-back {
    top: 0.85333333rem;
    right: 2.98666667rem;
  }
  header #card-front {
    top: 4.64rem;
    left: 2.98666667rem;
  }
  header #card-front-details {
    height: 5.06666667rem;
    top: 5.33333333rem;
    left: 2.98666667rem;
  }
  header span {
    font-size: 0.37333333rem;
    color: white;
    position: absolute;
    top: 3.73333333rem;
    right: 4.53333333rem;
    z-index: 1;
    letter-spacing: 0.05333333rem;
  }
  form {
    padding: 0 5.12rem;
    margin-top: 3.86666667rem;
    width: 10.21333333rem;
    max-width: 500px;
    box-sizing: content-box;
  }
  #success {
    display: none;
    flex-direction: column;
    align-items: center;
  }
  #success img {
    margin-top: 4.66666667rem;
    width: 2.13333333rem;
  }
  footer {
    display: none;
  }
}
/*大屏增强-桌面1440px*/
/*字号：固定（16px/18px，不随屏幕变化）。
布局：响应式（flex/grid/media query 控制几列、间距、边距）。*/
@media (min-width: 1440px) {
  body {
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  html {
    font-size: 37.5px !important;
    /*在桌面端，不是「只有 @media 里面的样式固定」，而是 移动端写的所有 rem 样式都会继承过来，但它们都会变成固定像素（因为你强制把根字号固定了）。*/
  }
  header {
    background-image: url("../images/bg-main-desktop.png");
    background-repeat: no-repeat;
    background-size: cover;
    width: 33vw;
    max-width: 550px;
    height: 100vh;
  }
  header img {
    width: 447px;
  }
  header #card-back {
    top: 12.42666667rem;
    left: 6.88rem;
  }
  header #card-front {
    top: 5.04rem;
    left: 4.37333333rem;
  }
  header #card-front-details {
    height: 5.04rem;
    top: 5.78666667rem;
    left: 4.53333333rem;
  }
  header span {
    top: 15.46666667rem;
    left: 16rem;
    z-index: 1;
    letter-spacing: 0.05333333rem;
  }
  /*响应式宽度,最大宽度限制,水平居中对齐*/
  form {
    max-width: 450px;
    width: 27vw;
    margin: 0 auto;
    padding: 0;
    /*当你按下鼠标时，元素同时处于 hover 和 active 两个状态。
但是 浏览器会优先应用 :active 的样式，所以 :hover 的效果就“被覆盖”了，看起来就像没了。*/
  }
  form .confirm-btn:hover {
    box-shadow: 0 4px 5px rgba(77, 77, 77, 0.3);
    cursor: pointer;
  }
  form .confirm-btn:active {
    background: #000000;
    transform: scale(1.05);
    box-shadow: 0 5px 5px rgba(68, 45, 199, 0.5);
  }
  #success {
    margin: 0 auto;
  }
}
footer {
  display: block;
  position: absolute;
  font-size: 0.37333333rem;
  bottom: 2%;
  right: 30%;
  margin: 0 auto 0.53333333rem;
  text-align: center;
}
footer a {
  text-decoration: underline;
  color: #610595;
}
