// SASS变量定义，提高可维护性和编译性能

// 颜色系统
$order-bg-color: #fff;
$text-color-primary: #333;
$text-color-secondary: #666;
$text-color-accent: #ff5722;
$button-color: #00a6ff;
$button-hover-color: darken($button-color, 8%);
$button-disabled-color: #ccc;
$border-color: #ececec;
$shadow-color: rgba(0, 0, 0, 0.08);

// 尺寸和间距
$order-border-radius: 10px;
$order-padding: 16px 18px;
$spacing-small: 8px;
$spacing-medium: 10px;
$spacing-large: 20px;
$button-height: 42px;

// 字体系统
$font-size-small: 12px;
$font-size-medium: 14px;
$font-size-large: 18px;
$font-weight-normal: 400;
$font-weight-medium: 500;
$font-weight-semibold: 600;

// 过渡动画
$transition-fast: 0.2s ease;
$transition-normal: 0.3s ease;

// 动画关键帧
@keyframes loading-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.order-info {
  background-color: $order-bg-color;
  border-radius: $order-border-radius;
  padding: $order-padding;
  box-shadow: 0 2px 8px $shadow-color;
  transition: box-shadow $transition-normal;

  &:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }

  // 订单项样式，优化布局和视觉层次
  .order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: $spacing-small;
    padding: 4px 0;
    transition: background-color $transition-fast;

    .label {
      font-size: $font-size-small;
      color: $text-color-secondary;
      font-weight: $font-weight-normal;
      flex-shrink: 0;
      line-height: 1.4;
    }

    .value {
      font-size: $font-size-small;
      color: $text-color-primary;
      font-weight: $font-weight-normal;
      text-align: right;
      word-break: break-word;
      overflow-wrap: break-word;
      line-height: 1.4;
      max-width: 60%;
    }

    // 金额特殊样式，增强视觉重点
    &.amount {
      .label {
        color: $text-color-primary;
        font-weight: $font-weight-medium;
        font-size: $font-size-medium;
      }

      .value {
        color: $text-color-accent;
        font-size: $font-size-large;
        font-weight: $font-weight-semibold;
        max-width: none;

        // 货币符号样式
        &::before {
          content: "¥";
          margin-right: 2px;
          font-size: 11px;
        }
      }
    }
  }

  .line {
    border-bottom: 1px solid $border-color;
    margin: $spacing-medium 0;
    height: 0;
    opacity: 0.6;
    transition: opacity $transition-fast;

    &:hover {
      opacity: 1;
    }
  }

  .reserve-button {
    width: 100%;
    background: linear-gradient(179deg, #00a6ff 0%, #0256ff 100%);
    color: #fff;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    height: $button-height;
    font-size: $font-size-medium;
    font-weight: $font-weight-medium;
    margin-top: $spacing-large;
    position: relative;
    overflow: hidden;
    transition: all $transition-normal;
    letter-spacing: 0.5px;

    // 按钮波纹效果
    &::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 0;
      height: 0;
      background: rgba(255, 255, 255, 0.3);
      border-radius: 50%;
      transform: translate(-50%, -50%);
      transition: width 0.6s, height 0.6s;
    }

    &:hover {
      background: linear-gradient(
        135deg,
        $button-hover-color 0%,
        darken($button-hover-color, 5%) 100%
      );
      transform: translateY(-2px);
      box-shadow: 0 4px 16px rgba($button-color, 0.4);

      &::before {
        width: 300px;
        height: 300px;
      }
    }

    &:active {
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba($button-color, 0.3);
    }

    &:focus {
      outline: none;
      box-shadow: 0 0 0 3px rgba($button-color, 0.3);
    }

    &:disabled {
      background: $button-disabled-color;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;

      &::before {
        display: none;
      }
    }

    // 加载状态样式
    &.loading {
      background: $button-disabled-color;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
      position: relative;

      &::before {
        display: none;
      }

      // 加载动画
      &::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 16px;
        height: 16px;
        margin: -8px 0 0 -8px;
        border: 2px solid transparent;
        border-top: 2px solid #fff;
        border-radius: 50%;
        animation: loading-spin 1s linear infinite;
      }
    }
  }

  .feedback {
    text-align: center;
    font-size: $font-size-medium;
    color: $text-color-primary;
    font-weight: $font-weight-normal;
    margin-top: $spacing-medium;
  }
}
