@use 'common/var' as *;
@use 'mixins/mixins' as *;
@use 'mixins/utils' as *;

@include b(gradient-card) {
  position: relative;
  width: 200px;
  height: 100px;
  border-radius: 10px;

  .default {
    --bg: linear-gradient(180deg, rgba(52, 101, 117, 0.1) 0%, #1a283b 100%);
    --border: linear-gradient(270deg, #455364, #aec9e9, #455364);
    border: 1px solid transparent;
    background-image: var(--bg), var(--border);
    background-origin: border-box;
    background-clip: content-box, border-box;
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
  }
  .a {
    background: #aec9e9;
    z-index: 1;

    &::after {
      content: '';
      position: absolute;
      /* 设置层级为-1，避免遮挡内容 */
      z-index: -1;
      width: calc(100% - 2px);
      height: calc(100% - 2px);
      left: 50%;
      top: 50%;
      border-radius: 10px;
      transform: translate(-50%, -50%);
      // background: linear-gradient(180deg, #27a6a7 0%, #054146 100%);
    }
  }

  .mask {
    --border-radius: 10px;
    --border-width: 1px;
    --border-color: linear-gradient(
      270deg,
      rgba(69, 83, 100, 1),
      rgba(126, 145, 169, 1),
      rgba(69, 83, 100, 1)
    );
    position: relative;
    color: #fff;
    border-radius: var(--border-radius);
    background: rgba(38, 70, 93, 0.2);
    backdrop-filter: blur(10px);
    // &::after {
    //   content: '';
    //   position: absolute;
    //   left: 0;
    //   top: 0;
    //   width: 100%;
    //   height: 100%;
    //   padding: var(--border-width);
    //   border-radius: var(--border-radius);
    //   background: var(--border-color);
    //   --mask-bg: linear-gradient(red, red);
    //   --mask-clip: content-box, padding-box;
    //   /* mask允许使用者通过遮罩或者裁切特定区域的图片的方式来隐藏一个元素的部分或者全部可见区域 */
    //   /* mask-image类似background-image 设置了用作元素蒙版层的图像，默认值为none，值为透明图片，或透明渐变 */
    //   -webkit-mask-image: var(--mask-bg), var(--mask-bg);
    //   /* 默认值为border-box，可选值与background-origin相同 */
    //   -webkit-mask-clip: var(--mask-clip);
    //   /* exclude排除，只显示不重合的地方,Firefox支持4个属性 */
    //   mask-composite: exclude;
    //   /* 只显示下方遮罩，重合的地方不显示 */
    //   -webkit-mask-composite: destination-out;
    // }
  }

  .semicircle {
    border-radius: 10px;
    box-shadow: 4px 2px 4px 0px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    // &:after {
    //   content: '';
    //   position: absolute;
    //   width: 100%;
    //   height: 100%;
    //   top: 50%;
    //   left: 50%;
    //   transform: translate(-50%, -50%);
    //   border: 4px solid;
    //   border-image: linear-gradient(
    //       115deg,
    //       #4fcf70,
    //       #fad648,
    //       #a767e5,
    //       #12bcfe,
    //       #44ce7b
    //     )
    //     2 2;
    // }
  }

  .clip-path {
    border: 4px solid;
    border-image: linear-gradient(270deg, #18f77f, #17ffff) 1 1;
    clip-path: inset(0 round 10px);
  }
  .ground-glass {
    box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
  }
  .conic-gradient {
    display: grid;
    // place-items: center;
    // z-index: 1;
    font-weight: 600;
    --conic-gradient-color1: #ff2770;
    --conic-gradient-color2: #45f3ff;

    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      background: repeating-conic-gradient(
        from var(--a),
        var(--conic-gradient-color1) 0%,
        var(--conic-gradient-color1) 5%,
        transparent 0%,
        transparent 40%,
        var(--conic-gradient-color1) 50%
      );
      animation: animateAngle 4s linear infinite;
      // background: repeating-conic-gradient(
      //   from var(--a),
      //   var(--conic-gradient-color2) 0%,
      //   var(--conic-gradient-color2) 5%,
      //   transparent 0%,
      //   transparent 40%,
      //   var(--conic-gradient-color2) 50%
      // );
      // animation: animateAngle 4s linear infinite;
      // animation-delay: -1s;
      border-radius: inherit;
      z-index: -1;
    }
    &::after {
      content: '';
      position: absolute;
      inset: 4px;
      background: rgba(126, 145, 169, 1);
      border-radius: 10px;
      border: 8px solid #455364;
      z-index: -1;
    }
  }
  @property --a {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
  }
  @keyframes animateAngle {
    0% {
      --a: 0deg;
    }
    100% {
      --a: 360deg;
    }
  }
}
