@mixin dao-card-media($offset-size: 0, $offset-size-selecor: '', $component-name: '.dao-card') {
  $array-length: length($media-size-array);
  @each $min, $max in $media-size-array {
    // 局部变量，表示媒体查询限制字段
    $media-range: '';
    $array-index: index($media-size-array, ($min, $max));
    $selector: #{$component-name}-layout#{$offset-size-selecor};
    // 屏幕最小的情况下
    @if $min == 0 {
      $max: $max + $offset-size;
      $media-range: '(min-width: 0) and (max-width: ' + $max + ')';
    } @else if $max == 'none' { // 屏幕大于最大的情况下
      $min: $min + $offset-size;
      $media-range: '(min-width: ' + $min + ')';
    } @else {
      $min: $min + $offset-size;
      $max: $max + $offset-size;
      $media-range: '(min-width: ' + $min + ') and (max-width: ' + $max + ')';
    }
    @media #{$media-range} {
      @include dao-card-size-limit($selector, $array-index, $array-length, $component-name);
    }
  }
}
@mixin card-size($amount, $component-name) {
  $card-size-blank-total-amount: ($amount - 1) * $card-side-blank * 2;
  $calc-exp: '(100% - #{$card-size-blank-total-amount}) / #{$amount}';
  #{$component-name}-col {
    min-width: calc(100% / #{$amount});
    max-width: calc(100% / #{$amount});
    width: calc(100% / #{$amount});
  }
  &.no-side-blank > #{$component-name}-col {
    min-width: calc(#{$calc-exp} + #{$card-side-blank * 2});
    max-width: calc(#{$calc-exp} + #{$card-side-blank * 2});
    width: calc(#{$calc-exp} + #{$card-side-blank * 2});
    padding-right: $card-side-blank * 2;
    padding-left: 0;
  }
  &.no-side-blank > #{$component-name}-col:nth-child(#{$amount}n) {
    min-width: calc(#{$calc-exp});
    max-width: calc(#{$calc-exp});
    width: calc(#{$calc-exp});
    padding-right: 0;
  }
}
// 不 not 样式会互相影响 主要是在 no-side-blank 的时候
@function getNotIncludeSelectorInSizeLimit($currentIndex, $length) {
  $not-include-selector: '';
  @for $i from 1 through $currentIndex {
    $not-include-selector: ':not(.max-#{$i})#{$not-include-selector}';
  }
  @for $i from $currentIndex through $length {
    $not-include-selector: ':not(.min-#{$i})#{$not-include-selector}';
  }
  @return $not-include-selector;
}
@mixin dao-card-size-limit($selector, $currentIndex, $length, $component-name) {
  $not-include-selector: getNotIncludeSelectorInSizeLimit($currentIndex, $length);
  #{$selector}#{$not-include-selector} {
    @include card-size($currentIndex, $component-name);
  }
  @for $i from 1 through $currentIndex {
    #{$selector}.max-#{$i} {
      @include card-size($i, $component-name);
    }
  }
  @for $i from $currentIndex through $length {
    #{$selector}.min-#{$i} {
      @include card-size($i, $component-name);
    }
  }
}
