.star-rating {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;

  &.readonly {
    .star {
      cursor: default;
      
      &:hover {
        transform: none;
      }
    }
  }

  // 尺寸变体
  &.size-small {
    .star {
      font-size: 18px;
      width: 24px;
      height: 24px;
    }
    
    .rating-text {
      font-size: 12px;
    }
  }

  &.size-medium {
    .star {
      font-size: 24px;
      width: 32px;
      height: 32px;
    }
    
    .rating-text {
      font-size: 14px;
    }
  }

  &.size-large {
    .star {
      font-size: 32px;
      width: 40px;
      height: 40px;
    }
    
    .rating-text {
      font-size: 16px;
    }
  }

  .stars-container {
    display: flex;
    gap: 4px;
  }

  .star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border-radius: 3px;
    
    &:hover {
      transform: scale(1.1);
      color: #ffc53d !important;
    }

    &.filled {
      color: #ffc53d;
    }

    &.hovered {
      color: #ffc53d;
      opacity: 0.7;
    }
  }

  .rating-text {
    color: #595959;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
  }
}

// 暗色主题支持
@media (prefers-color-scheme: dark) {
  .star-rating {
    .star {
      color: #434343;
      
      &.filled {
        color: #ffc53d;
      }
      
      &.hovered {
        color: #ffc53d;
        opacity: 0.7;
      }
    }
    
    .rating-text {
      color: #bfbfbf;
    }
  }
}

// 响应式设计
@media (max-width: 480px) {
  .star-rating {
    &.size-medium {
      .star {
        font-size: 20px;
        width: 28px;
        height: 28px;
      }
    }
    
    &.size-large {
      .star {
        font-size: 24px;
        width: 32px;
        height: 32px;
      }
    }
  }
}