/**
 * PisellLongText 组件样式
 * 基于 Figma 设计规范，与 SingleLineText 设计体系一致
 */

.pisell-long-text {
  &-edit {
    position: relative;
    width: 100%;

    // TextArea 样式（Figma 设计规范，覆盖时使用 pisell-lowcode-xxx）
    .pisell-lowcode-input {
      // 基础样式
      font-size: 16px !important;
      line-height: 24px !important;

      // 边框和圆角
      border-radius: 8px !important;
      border: 1px solid #d0d5dd !important; // Gray/300

      // 内边距（Figma: 垂直 12px，水平 14px）
      padding: 12px 14px !important;
      min-height: 80px !important; // 多行最小高度，由 rows 进一步控制

      // 颜色
      color: #101828 !important; // Gray/900
      background-color: #ffffff !important;

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

      // 聚焦态
      &: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(:focus):not(:focus-within):not([disabled]) {
        border-color: #b692f6 !important; // Primary/400
      }

      // 禁用态
      &[disabled],
      &.pisell-lowcode-input-disabled {
        background-color: #f9fafb !important; // Gray/50
        color: #98a2b3 !important; // Gray/400
        border-color: #d0d5dd !important;
        cursor: not-allowed !important;
      }
    }

    // 字数统计样式（TextArea showCount）
    .pisell-lowcode-input-data-count,
    .pisell-lowcode-input-show-count-suffix {
      color: #667085 !important; // Gray/500
      font-size: 14px !important;
    }

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

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

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

  &-error {
    margin-top: 4px;
    font-size: 12px;
    color: #d92d20; // Error/600
    line-height: 1.5;
    animation: fadeIn 0.3s ease-in-out;
  }

  &-read {
    .pisell-lowcode-typography {
      margin-bottom: 0;
    }
  }

  &-expand-btn {
    padding: 0;
    height: auto;
    font-size: 14px;
    margin-top: 8px;
    color: #6d48c4;

    &:hover {
      color: #6d48c4 !important;
    }
  }

  &-word-count {
    margin-top: 8px;
    font-size: 12px;
    color: #667085; // Gray/500
    text-align: right;
  }

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

// 错误提示淡入动画
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
