/**
 * PisellNumber 组件样式
 * 基于 Figma 设计规范，与 SingleLineText / PisellEmail 设计体系一致，覆盖时使用 pisell-lowcode-xxx
 */

.pisell-number {
  display: inline-block;
  width: 100%;

  &-edit {
    position: relative;
    width: 100%;

    // InputNumber 外层（Figma 设计规范）
    .pisell-lowcode-input-number {
      width: 100% !important;
      font-size: 16px !important;
      line-height: 24px !important;
      border-radius: 8px !important;
      border: 1px solid #d0d5dd !important; // Gray/300
      color: #101828 !important; // Gray/900
      background-color: #ffffff !important;

      // 内层 input
      .pisell-lowcode-input-number-input {
        height: 46px !important; // 48 - 2px border
        padding: 12px 16px !important;
        font-size: 16px !important;
        line-height: 24px !important;
        color: #101828 !important;
        background: transparent !important;
        border: none !important;

        &::placeholder {
          color: #667085 !important; // Gray/500
        }
      }

      // 聚焦态
      &.pisell-lowcode-input-number-focused,
      &:focus,
      &:focus-within {
        border-color: #d6bbfb !important; // Primary/300
        box-shadow: 0 0 0 4px #f4ebff !important; // Primary/100
        outline: none !important;
      }

      // Hover 态
      &:hover:not(.pisell-lowcode-input-number-disabled):not(.pisell-lowcode-input-number-focused) {
        border-color: #b692f6 !important; // Primary/400
      }

      // 禁用态
      &.pisell-lowcode-input-number-disabled {
        background-color: #f9fafb !important; // Gray/50
        border-color: #d0d5dd !important;
        cursor: not-allowed !important;

        .pisell-lowcode-input-number-input {
          color: #98a2b3 !important; // Gray/400
          cursor: not-allowed !important;
        }
      }

      // 前后缀
      .pisell-lowcode-input-number-prefix {
        margin-right: 8px;
        margin-left: 16px;
        color: #667085;
        font-size: 16px;
      }

      .pisell-lowcode-input-number-suffix {
        margin-left: 8px;
        margin-right: 16px;
        color: #667085;
        font-size: 16px;
      }

      // 步进器按钮（controls）
      .pisell-lowcode-input-number-handler-wrap {
        border-left: 1px solid #d0d5dd !important;
        background: #ffffff !important;

        .pisell-lowcode-input-number-handler {
          color: #667085;
          border-color: #d0d5dd;

          &:hover {
            color: #344054;
          }

          &.pisell-lowcode-input-number-handler-up-disabled,
          &.pisell-lowcode-input-number-handler-down-disabled {
            color: #98a2b3;
            cursor: not-allowed;
          }
        }
      }

      // 错误状态
      &.pisell-lowcode-input-number-status-error {
        border-color: #fda29b !important; // Error/300

        &.pisell-lowcode-input-number-focused,
        &:focus-within {
          border-color: #f97066 !important; // Error/400
          box-shadow: 0 0 0 4px #fee4e2 !important; // Error/100
        }

        &:hover:not(:focus-within) {
          border-color: #f97066 !important;
        }
      }
    }
  }

  // 错误提示（与设计体系一致）
  &-error {
    margin-top: 4px;
    font-size: 12px;
    color: #d92d20; // Error/600
    line-height: 1.5;
    animation: pisell-number-fadeIn 0.3s ease-in-out;
  }

  &-read {
    color: #101828; // Gray/900
    line-height: 1.5;
    font-size: 16px;
  }

  &-disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

@keyframes pisell-number-fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
